pythongrid / test / test_drmaa.py

from drmaa import *

s=Session()
print('DRMAA library v%s'%str(s.version))
# On LSF, it seems that session already initialized.
#s.initialize()
print('DRM system used: '+s.drmsInfo)
jt=JobTemplate()
jt.remoteCommand='/bin/sleep'
jt.args=['10']
jt.nativeSpecification=''
jname=s.runJob(jt)
# Explicitly kill the job
#s.control(jname, JobControlAction.TERMINATE)
jinfo=s.wait(jname, Session.TIMEOUT_WAIT_FOREVER)

# Show all the returned information
# print jinfo
if (jinfo.wasAborted):
    print('Job never ran')
if (jinfo.hasExited):
    print('Job exited using the following resources:')
    print jinfo.resourceUsage
if (jinfo.hasSignal):
    print('Job was signalled with '+jinfo.terminatedSignal)
s.exit()
                         
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.