Does PySlurm currently support jobs submission via sbatch?

592 views
Skip to first unread message

Maiky Nata

unread,
Nov 7, 2018, 9:36:38 AM11/7/18
to pyslurm
Hi everyone,
Does PySlurm currently support jobs submission via sbatch?

In https://pyslurm.github.io/ I found the Job Class (pyslurm.job) with the following methods bellow, but there is no explanation or examples of use.

slurm_job_batch_script(jobid)
submit_batch_job(self, job_opts)

Someone can post an exemple of python script for this?

Giovanni

unread,
Nov 11, 2018, 11:34:02 PM11/11/18
to pyslurm
 The first function will print the batch script for a given jobid: https://github.com/SchedMD/slurm/blob/master/slurm/slurm.h.in#L3284.  I also updated the function's signature, docstring, and handling of string and integer jobids: https://github.com/PySlurm/pyslurm/commit/2c0bc634569278de5b67cc9c28528304605aac48

The second was my incomplete attempt at wrapping sbatch.  The function will return the jobid of the job it creates. Here are some examples:

>>> pyslurm.job().submit_batch_job({'script': 'batch.sh'})
3
>>> pyslurm.job().submit_batch_job({'wrap': 'sleep 700'})
4

I'll have to check again, but I think at the moment, it won't process #SBATCH directives in a shell script, but in the same job_opts dictionary, you can pass it the same options you would in #SBATCH.

Giovanni
Reply all
Reply to author
Forward
0 new messages