On 28/01/17 09:04, Bill Broadley wrote:
> I have a very simple script:
> #!/bin/bash -l
> #SBATCH --mem=350000
> #SBATCH --time=96:00:00
> #SBATCH --nodes=1
> #SBATCH --cpus-per-task=4
>
> srun date
>
> It acts exactly like I expect with srun:
[...]
> So 4 CPUs are allocated, but the binary is run once. If I used -n 4 I'd
> expect the binary to be run 4 times.
But the srun you are using to launch the script doesn't ask for any
resources, so it'll get the default which I would expect to be 1 core
and so the srun inside the script will just use that 1 core.
> But now with sbatch:
That's more peculiar, I would expect it to get 1 task with 4 CPUs
associated and then just run date once, with access to the 4 cores.
Before your script does "srun date" add:
env | fgrep SLURM
echo '------------------------------------'
scontrol show job -dd ${SLURM_JOB_ID}
echo '------------------------------------'
In my Slurm environment it does just what I expect, runs date once with
4 cores allocated, to whit the environment has:
SLURM_JOB_CPUS_PER_NODE=4
and scontrol shows:
[...]
NumNodes=1 NumCPUs=4 NumTasks=1 CPUs/Task=4 ReqB:S:C:T=0:0:*:*
[...]
Best of luck,
Chris
--
Christopher Samuel Senior Systems Administrator
VLSCI - Victorian Life Sciences Computation Initiative
Email: [email protected] Phone: +61 (0)3 903 55545
http://www.vlsci.org.au/ http://twitter.com/vlsci