Difference: SlurmScheduler (17 vs. 18)

Revision 182020-05-19 - MartinMarinus

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Slurm

Line: 25 to 25
 

srun

Changed:
<
<
srun will execute the command given, and wait for it to finish. Some examples:
>
>
srun is mostly useful for testing, and for interactive use. It will execute the command given, and wait for it to finish. Some examples:
 
  • srun sleep 60
Changed:
<
<
  • srun -n 4 bash -c "hostname; stress -c 10". This will start 4 seperate "tasks", each getting 1 CPU (2 cores on each). Eight threads in total.
>
>
  • srun -c 4 bash -c "hostname; stress -c 10". This will start 1 task, getting 4 cores (2 CPU's, 2 cores on each).
  This is different from:
Changed:
<
<
  • srun -c 4 bash -c "hostname; stress -c 10". This will start 1 task, getting 4 cores (2 CPU's, 2 cores on each).
>
>
  • srun -n 4 bash -c "hostname; stress -c 10". This will start 4 seperate "tasks", each getting 1 CPU (2 cores on each). Eight threads in total.

The previous form (-c) is usually what you want. Just one "job" with 4 CPU cores.

  To me, the number of tasks, CPU's and cores is sometimes slightly surprising. I guess it will make sense after a while...

You can also use srun to get an interactive shell on a compute node (like qlogin):

Changed:
<
<
  • srun -n 2 --mem 5G --time 01:00:00 --pty bash
>
>
  • srun -c 2 --mem 5G --time 01:00:00 --pty bash
  Or on a specific node:
Changed:
<
<
  • srun -n 2 --mem 5G --time 01:00:00 --nodelist n0014 --pty bash
>
>
  • srun -c 2 --mem 5G --time 01:00:00 --nodelist n0014 --pty bash
 

sbatch

Line: 107 to 109
  srun --gres=tmpspace:250M --pty bash
Changed:
<
<
Of course, this works for all the commands. The scratch disk space will be made available in $TMPDIR (/scratch/$SLURM_JOB_ID) and will be erased automatically when your job is finished.
>
>
Of course, this works for all the commands. The scratch disk space will be made available in $TMPDIR (/scratch/$SLURM_JOB_ID) and will be erased automatically when your job is finished. Note: the "--tmp" option to srun/sbatch sounds like it will do the same, but it won't. Please use the "--gres" method.
 

Using a GPU

Something like:

Changed:
<
<
srun -p gpu -n 2 --gres=tmpspace:10G --gpus-per-node=1 --time 24:00:00 --mem 100G --pty bash
>
>
srun -p gpu -c 2 --gres=tmpspace:10G --gpus-per-node=1 --time 24:00:00 --mem 100G --pty bash
  will give you an interactive session with 1 GPU.
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback