This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
slurm_scripts [2020/01/29 18:59] root |
slurm_scripts [2022/05/02 17:03] (current) root created |
||
---|---|---|---|
Line 1: | Line 1: | ||
====Slurm Commands and Scripts==== | ====Slurm Commands and Scripts==== | ||
- | Basic torque/slurm commands are: | + | Basic slurm commands are: |
<csv> | <csv> | ||
- | torque, | + | slurm, use |
- | qsub, sbatch | + | sbatch |
- | qsub -I , | + | srun , submit interactive job |
- | qstat , squeue | + | squeue |
- | qstat -u rfeynman | + | squeue -u rfeynman |
- | qdel , | + | scancel |
- | shownodes -l -n;qstat -q , sinfo , | + | sinfo , |
</ | </ | ||
- | A basic slurm script looks like: | + | A Torque compatibility layer also offers some torque commands such as '' |
< | < | ||
#!/bin/bash | #!/bin/bash | ||
Line 25: | Line 26: | ||
mpirun -np $SLURM_NTASKS -machinefile / | mpirun -np $SLURM_NTASKS -machinefile / | ||
</ | </ | ||
- | and a little | + | |
+ | and a more complex script | ||
+ | |||
< | < | ||
- | pinnacle-l1: | ||
#!/bin/bash | #!/bin/bash | ||
#SBATCH --job-name=espresso | #SBATCH --job-name=espresso | ||
Line 40: | Line 43: | ||
cp *.in *UPF / | cp *.in *UPF / | ||
cd / | cd / | ||
- | mpirun -ppn 16 -hostfile / | + | mpirun -ppn 16 -hostfile / |
mv ausurf.log *mix* *wfc* *igk* $SLURM_SUBMIT_DIR/ | mv ausurf.log *mix* *wfc* *igk* $SLURM_SUBMIT_DIR/ | ||
pinnacle-l1: | pinnacle-l1: | ||
</ | </ | ||
+ | |||
+ | See also [ https:// | ||
+ | ] | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | We have a conversion script **/ | ||
+ | < | ||
+ | pbs2slurm.sh < | ||
+ | </ | ||
+ | will generate the conversion to stdout, thus save with | ||
+ | < | ||
+ | pbs2slurm.sh demoscriptpbs.sh > demoscriptslurm.sh | ||
+ | </ | ||
+ | |||
+ | ==Notes:== | ||
+ | |||
+ | Leading hash-bang /bin/sh or /bin/bash or /bin/tcsh is optional in torque, required in slurm, pbs2slurm.sh inserts it if not present\\ | ||
+ | |||
+ | Slurm date formats with days are " | ||
+ | |||
+ | Slurm unlike Torque does not autogenerate an MPI machinefile/ | ||
+ | < | ||
+ | The generated machinefile differs from torque machinefile in that it has 1 entry per host instead of '' | ||
+ | Slurm does define a variable with the total number of cores '' |