natefoo / slurm-drmaa

DRMAA for Slurm: Implementation of the DRMAA C bindings for Slurm
GNU General Public License v3.0
48 stars 22 forks source link

Support `maxnodes` in `--nodes` option #4

Closed natefoo closed 6 years ago

natefoo commented 6 years ago

As per the sbatch documentation, it is possible to request both a minimum and a maximum number of nodes with --nodes:

-N, --nodes=<minnodes[-maxnodes]> Request that a minimum of minnodes nodes be allocated to this job. A maximum node count may also be specified with maxnodes.

However, slurm-drmaa doesn't support this:

Traceback (most recent call last):
  File "/home/ndc/drmaa-venv/bin/sbatch-drmaa", line 20, in <module>
    jobid = s.runJob(jt)
  File "/home/ndc/drmaa-venv/lib/python2.7/site-packages/drmaa/session.py", line 314, in runJob
    c(drmaa_run_job, jid, sizeof(jid), jobTemplate)
  File "/home/ndc/drmaa-venv/lib/python2.7/site-packages/drmaa/helpers.py", line 303, in c
    return f(*(args + (error_buffer, sizeof(error_buffer))))
  File "/home/ndc/drmaa-venv/lib/python2.7/site-packages/drmaa/errors.py", line 151, in error_check
    raise _ERRORS[code - 1](error_string)
drmaa.errors.InvalidArgumentException: code 4: not an number: 1-1
natefoo commented 6 years ago

Turns out it is supported but the syntax is -N <min>=<max>. I think this was probably a typo, even the slurm-drmaa documentation says it should be <min>-<max>. So I think the correct thing to do here would be to support the correct syntax.

natefoo commented 6 years ago

The delimiter has been corrected as of 09a90b62b1dce6d741b2dba3688a747e3e564bb9

BrunoGrandePhD commented 6 years ago

Thanks, @natefoo! I will let you know if I run into issues with the latest version once I have jobs to test it with.