Debian Codegraph @

examples/example3.1.py

raw
1 #!/usr/bin/env python
2
3 from __future__ import print_function
4 import drmaa
5 import os
6
7 def main():
8 """Submit an array job, and wait for all of them to finish.
9 Note, need file called sleeper.sh in home directory.
10 """
11 s = drmaa.Session()
12 s.initialize()
13 print('Creating job template')
14 jt = s.createJobTemplate()
15 jt.remoteCommand = os.getcwd() + '/sleeper.sh'
16 jt.args = ['42','Simon says:']
17 jt.joinFiles=True
18
19 joblist = s.runBulkJobs(jt,1,30,2)
20 print('Your job has been submitted with id ' + str(joblist))
21
22 s.synchronize(joblist, drmaa.Session.TIMEOUT_WAIT_FOREVER, True)
23
24 print('Cleaning up')
25 s.deleteJobTemplate(jt)
26 s.exit()
27
28 if __name__=='__main__':
29 main()