User Tools

Site Tools


torque_slurm_scripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
torque_slurm_scripts [2020/01/31 20:27]
root
torque_slurm_scripts [2022/02/02 17:36]
jpummil
Line 1: Line 1:
-====PBS and Slurm Commands and Scripts====+====Slurm Commands and Scripts====
 Basic torque/slurm commands are: Basic torque/slurm commands are:
 <csv> <csv>
-torque,                     slurm, use +slurm, use 
-qsub,                       sbatch         ,       submit <job file> +sbatch         ,       submit <job file> 
-qsub -I   ,                  srun            ,      submit interactive job +srun            ,      submit interactive job 
-qstat  ,                     squeue           ,     list all queued jobs +squeue           ,     list all queued jobs 
-qstat -u rfeynman  ,         squeue -u rfeynman  ,  list queued jobs for user rfeynman +squeue -u rfeynman  ,  list queued jobs for user rfeynman 
-qdel        ,                scancel       ,        cancel <job#> +scancel       ,        cancel <job#> 
-shownodes -l -n;qstat -q ,   sinfo         ,        node status;list of queues+sinfo         ,        node status;list of queues
 </csv> </csv>
  
-A basic script in ''torque'' and ''slurm'' looks like: +A basic script in ''slurm'' looks like:
-<code> +
-#PBS -N mpi +
-#PBS -j oe +
-#PBS -o zzz.$PBS_JOBID +
-#PBS -l nodes=2:ppn=32,walltime=06:00:00 +
-#PBS -q q06h32c +
-cd $PBS_O_WORKDIR +
-NP=$(wc<$PBS_NODEFILE) +
-module purge +
-module load intel/18.0.1 impi/18.0.1 mkl/18.0.1 +
-mpirun -np $NP -machinefile $PBS_NODEFILE ./mympiexe -inputfile MA4um.mph -outputfile MA4um-output.mph +
-</code>+
  
 <code> <code>
Line 38: Line 26:
 mpirun -np $SLURM_NTASKS -machinefile /scratch/${SLURM_JOB_ID}/machinefile_${SLURM_JOB_ID} ./mympiexe -inputfile MA4um.mph -outputfile MA4um-output.mph mpirun -np $SLURM_NTASKS -machinefile /scratch/${SLURM_JOB_ID}/machinefile_${SLURM_JOB_ID} ./mympiexe -inputfile MA4um.mph -outputfile MA4um-output.mph
 </code> </code>
 +
 and a more complex script with file moving looks like: and a more complex script with file moving looks like:
-<code> + 
-#PBS -N espresso +
-#PBS -j oe +
-#PBS -o zzz.$PBS_JOBID +
-#PBS -l nodes=4:ppn=32,walltime=00:00:10 +
-#PBS -q q06h32c +
-module purge +
-module load intel/14.0.3 mkl/14.0.3 fftw/3.3.6 impi/5.1.2 +
-cd $PBS_O_WORKDIR +
-cp *.in *UPF /scratch/$PBS_JOBID +
-cd /scratch/$PBS_JOBID +
-sort -u $PBS_NODEFILE >hostfile +
-mpirun -ppn 16 -hostfile hostfile -genv OMP_NUM_THREADS 4 -genv MKL_NUM_THREADS 4 /share/apps/espresso/qe-6.1-intel-mkl-impi/bin/pw.x -npools 1 <ausurf.in +
-mv ausurf.log *mix* *wfc* *igk* $PBS_O_WORKDIR/ +
-</code>+
 <code> <code>
 #!/bin/bash #!/bin/bash
Line 74: Line 50:
 See also [ https://hprc.tamu.edu/wiki/TAMU_Supercomputing_Facility:HPRC:Batch_Translation ] [ https://slurm.schedmd.com/rosetta.pdf ] [ https://www.sdsc.edu/~hocks/FG/PBS.slurm.html ] See also [ https://hprc.tamu.edu/wiki/TAMU_Supercomputing_Facility:HPRC:Batch_Translation ] [ https://slurm.schedmd.com/rosetta.pdf ] [ https://www.sdsc.edu/~hocks/FG/PBS.slurm.html ]
  
-We have a conversion script **/share/apps/bin/pbs2slurm.sh** which should do 95% of the script conversion. Please report errors by the script so we can improve it. Normally it should be in your path and+We have a conversion script **/share/apps/bin/pbs2slurm.sh** which should do 95% of the script conversion from old PBS scripts to SLURM scripts. Please report errors by the script so we can improve it. Normally it should be in your path and
 <code> <code>
 pbs2slurm.sh <pbs-script-name> pbs2slurm.sh <pbs-script-name>
torque_slurm_scripts.txt · Last modified: 2022/02/02 20:36 by jpummil