Source

pythongrid / test / test_drmaa.py

Diff from to

File test/test_drmaa.py

 from drmaa import *
 
 s = Session()
+s.initialize()
 print('DRMAA library v%s'%str(s.version))
 print('DRM system used: '+s.drmsInfo)
 
 jt.remoteCommand = '/bin/sleep'
 jt.args = ['10']
 jt.nativeSpecification = ''
-jname = s.runJob(jt)
-
-jinfo = s.wait(jname, Session.TIMEOUT_WAIT_FOREVER)
+jname1 = s.runJob(jt)
 
 jt2 = JobTemplate()
 jt2.remoteCommand = '/bin/sleep'
 jt2.args = ['20']
 jt2.nativeSpecification = ''
-jname = s.runJob(jt2)
+jname2 = s.runJob(jt2)
 
-jinfo2 = s.wait(jname, Session.TIMEOUT_WAIT_FOREVER)
+jinfo = s.wait(jname1, Session.TIMEOUT_WAIT_FOREVER)
+jinfo2 = s.wait(jname2, Session.TIMEOUT_WAIT_FOREVER)
 
 # Show all the returned information
 # print jinfo
     print jinfo.resourceUsage
 if (jinfo.hasSignal):
     print('Job was signalled with '+jinfo.terminatedSignal)
+if (jinfo2.wasAborted):
+    print('Job never ran')
+if (jinfo2.hasExited):
+    print('Job exited using the following resources:')
+    print jinfo.resourceUsage
+if (jinfo2.hasSignal):
+    print('Job was signalled with '+jinfo2.terminatedSignal)
 s.exit()