This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
torque_slurm_scripts [2020/01/29 19:13] root |
torque_slurm_scripts [2022/02/02 20:36] (current) jpummil |
||
---|---|---|---|
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 script in '' | + | A basic script in '' |
- | < | + | |
- | #PBS -N mpi | + | |
- | #PBS -j oe | + | |
- | #PBS -o zzz.$PBS_JOBID | + | |
- | #PBS -l nodes=2: | + | |
- | #PBS -q q06h32c | + | |
- | cd $PBS_O_WORKDIR | + | |
- | NP=$(wc< | + | |
- | module purge | + | |
- | module load intel/ | + | |
- | mpirun -np $NP -machinefile $PBS_NODEFILE ./mympiexe -inputfile MA4um.mph -outputfile MA4um-output.mph | + | |
- | </ | + | |
< | < | ||
Line 38: | Line 26: | ||
mpirun -np $SLURM_NTASKS -machinefile / | mpirun -np $SLURM_NTASKS -machinefile / | ||
</ | </ | ||
+ | |||
and a more complex script with file moving looks like: | and a more complex script with file moving looks like: | ||
- | < | + | |
- | #PBS -N espresso | + | |
- | #PBS -j oe | + | |
- | #PBS -o zzz.$PBS_JOBID | + | |
- | #PBS -l nodes=4: | + | |
- | #PBS -q q06h32c | + | |
- | module purge | + | |
- | module load intel/ | + | |
- | cd $PBS_O_WORKDIR | + | |
- | cp *.in *UPF / | + | |
- | cd / | + | |
- | sort -u $PBS_NODEFILE > | + | |
- | mpirun -ppn 16 -hostfile hostfile -genv OMP_NUM_THREADS 4 -genv MKL_NUM_THREADS 4 / | + | |
- | mv ausurf.log *mix* *wfc* *igk* $PBS_O_WORKDIR/ | + | |
- | </ | + | |
< | < | ||
#!/bin/bash | #!/bin/bash | ||
Line 74: | Line 50: | ||
See also [ https:// | See also [ https:// | ||
- | We have a conversion script **/ | + | We have a conversion script **/ |
< | < | ||
pbs2slurm.sh < | pbs2slurm.sh < | ||
Line 83: | Line 59: | ||
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\\ | 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 does not autogenerate an MPI machinefile/ | + | Slurm does not autogenerate an MPI machinefile/ |
< | < | ||
The generated machinefile differs from torque machinefile in that it has 1 entry per host instead of '' | 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 '' | + | Slurm does define a variable with the total number of cores '' |