Grid Engine to Slurm Helper Program
To run, change into the directory that contains your grid engine script and type
$ convert-sge-to-slurm scriptToConvert
where, scriptToConvert is your grid engine script. As output, you will see a new script scriptToConvert.sbatch which puts the equivalent slurm command on the line below each grid engine command. Edit this sbatch script to customize the parameters such as memory, run time, email, etc.
Slurm Command References
Slurm Quick reference guide – pdf of the most common slurm commands
Slurm Man Pages – A full reference of Slurm commands
Some Equivalent Grid Engine and Slurm Commands
The directives are slightly different between systems, but the concept and functionality are mostly the same.
Grid engine directives begin with: #$
Slurm directives begin with: #SBATCH
Resource or Specification | Grid Engine | Slurm |
12gb Memory | #$ -l h_vmem=12g | #SBATCH --mem=12g |
2hrs Run time | #$ -l h_cpu=2:00:00 1 | #SBATCH --time=2:00:002 |
Job name | #$ -N MyJob | #SBATCH --job-name=ZZ |
Email trigger | #$ -m ea | #SBATCH --mail-type=END,FAIL |
Email Address | #$ -M email@system | #SBATCH --mail-user=email@system |
Job log | #$ -cwd | #SBATCH --output=slurm_%j.out |
1 – CPU time
2 – Wall time
Example Slurm Script
#!/bin/bash # myProgName.sbatch #SBATCH --mem=12g #SBATCH --time-1:00:00 #SBATCH --job-name=myJobName #SBATCH --mail-type=END,FAIL #SBATCH --mail-user=YourEmail@stern.nyu.edu #SBATCH --output=myJobName_%j.out module purge module load matlab/2019a matlab -nosplash -nodesktop -nojvm -nodisplay < mymatjob.m
To Submit Your Slurm Job
$ sbatch myProgName.sbatch
To See Your Job in the Queue or Running
$ squeue