Reputation: 57281
Using the DRMAA interface to Son of Grid Engine I would like to get the name of a host running a particular job. I would like something like the following (using the drmaa-python
interface)
>>> import drmaa
>>> s = drmaa.Session()
>>> s.initialize()
>>> jt = s.createJobTemplate()
>>> jt.remoteCommand = 'sleep'
>>> jt.args = ['100']
>>> jobid = s.runJob(jt)
>>> jobid
'1'
>>> s.jobStatus(jobid)
'running'
>>> s.the_function_I_want(jobid)
'worker-host-123'
Upvotes: 0
Views: 164
Reputation: 312
Short answer: You are right, this is not possible.
Long answer:
The drmaa-python
library acts as wrapper for an underlying C implementation of the DRMAAv1 API (see https://www.ogf.org/documents/GFD.130.pdf). Such a C library usually comes together with your cluster framework. DRMAAv1 does not support a standardized monitoring of jobs, and therefore both the DRMAAv1 C and Python library can't get this information.
If you wonder about that lack of functionality, please note that the original API design is from 2004.
The second version of DRMAA (https://www.ogf.org/documents/GFD.231.pdf) does support monitoring. At the time of writing, the only known implementation comes with Univa GridEngine, and there is no existing Python wrapper implementation for it.
You could try to parse the job log file by yourself to extract the execution host name. If you need to pass special options to qsub
for getting such a file, you can use the nativeSpecification
field in the job template.
Upvotes: 0