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