Sample script
OpenMP (multi-threaded) job sample script – sample.sub
#!/bin/bash # # Job name #SBATCH --job-name=ompi_lws # STDOUT file; "N" is node number and "j" job id number #SBATCH --output=ompi-lws_%N_%j.out # STDERR file; "N" is node number and "j" job id number #SBATCH --error=ompi-lws_%N_%j.err # # Set partition [change] #SBATCH --partition=devel # # Number of tasks per node #SBATCH --ntasks=1 # Number of CPUs required for the process #SBATCH --cpus-per-task=32 # # Memory requirement #SBATCH --mem=1000 # # Total wall-time #SBATCH --time=00:05:00 # # To get email alert [Optional] # NOTE: Remove one "#" and "write your email ID" (ex: #SBATCH --mail-user=hemanta.kumar@icts.res.in) ##SBATCH --mail-user= email id ##SBATCH --mail-type=ALL # export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK # date ./openmp_loopwork_share date
Submit job:
sbatch sample.sub
The job’s status in the queue can be monitored with squeue; (add -u username to focus on a particular user’s jobs).
The job can be deleted with scancel <job_id> .
When the job finishes (in error or correctly) there will normally be one file created in the submission directory with the name of the form slurm-NNNN.out (where NNNN is the job id).