wormulon is a Python library aimed at programmatically controlling SLURM jobs remotely. Wormulon uses Paramiko to connect to a remote machine via SSH and then wrap SLURM's terminal commands (sbatch, squeue, sacct, etc.).
You can install wormulon using pip:
$ pip install -u wormulon
Connect to a remote cluster via SSH:
import wormulon
slurm = wormulon.Slurm.ssh(host="example.org", username="me")
# submits a job using the file `jobscript.sh` in your home directory as the
# slurm jobscript.
# Returns an object representing the submitted job
job = slurm.submit_job("~/jobscript.sh")
print(job)
# returns all jobs currently in SLURM's queue by the user 'me'
my_jobs = slurm.queue.find(user_id="me")
print(my_jobs)
- Talking to Slurm on a remote cluster via SSH.
- Submitting simple jobs with jobscripts and additional specifications (see the
jobspec.Jobspec
class). - Looking up simple and heterogeneous jobs, currently in Slurm's queue.
- Actual documentation and more examples.
- Talking to a local Slurm on the local machine.
- Submitting more complex job workflows with job dependencies.
- Submitting and looking up array jobs.
- Submitting heterogeneous jobs.