How to specific odd total cpu counts for a job?


If there is a job that needs 13 cpu cores in total, how do I write job submit script? Assume there are 12 cores per node.

Can I do this using followng 2 lines?

#PBS    select=1:ppn=12
#PBS    select=1:ppn=1

mpirun -np 13 xxxx

Please try this

#PBS -l select=1:ncpus=12:mpiprocs=12+1:ncpus=1:mpiprocs=1
#PBS -l place=scatter
mpirun -np 13 xxxx

Thank you

You saved my life!!!

Thank you! You saved my life!

Or, if it’s a small job, i.e. you mention only 13 cores (if the job gets large it does take longer to schedule more chunks, for example 576:ncpus=1 takes longer than 48:ncpus=12), and since it doesn’t seem to matter if the job consumes an entire node (you’re grabbing 1 core from a separate node anyway thus assuming one core per MPI process), though by default PBS will try to get as many cores as possible from each node, you could do something like:

#PBS -l select=13:ncpus=1
#PBS -l place=free
mpirun -np 13 xxxx

Note that PBS defaults to 1 mpiproc/“chunk with ncpus” if there is no specific mpiproc value specified for the chunk, so including :mpiprocs=1 is optional in this case

1 Like