Source

pythongrid / test / test_drmaa.py

Cheng Soon Ong 5399d7d 

co...@brutus3.et… da128db 
Cheng Soon Ong ec3176e 
Cheng Soon Ong 5399d7d 

co...@brutus3.et… da128db 




Cheng Soon Ong ec3176e 
co...@brutus3.et… da128db 




Cheng Soon Ong ec3176e 
co...@brutus3.et… da128db 
Cheng Soon Ong ec3176e 

Cheng Soon Ong 5399d7d 









Cheng Soon Ong ec3176e 






Cheng Soon Ong 5399d7d 

from drmaa import *

s = Session()
s.initialize()
print('DRMAA library v%s'%str(s.version))
print('DRM system used: '+s.drmsInfo)

jt = JobTemplate()
jt.remoteCommand = '/bin/sleep'
jt.args = ['10']
jt.nativeSpecification = ''
jname1 = s.runJob(jt)

jt2 = JobTemplate()
jt2.remoteCommand = '/bin/sleep'
jt2.args = ['20']
jt2.nativeSpecification = ''
jname2 = s.runJob(jt2)

jinfo = s.wait(jname1, Session.TIMEOUT_WAIT_FOREVER)
jinfo2 = s.wait(jname2, 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)
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()