Stern School of Business, New York University

Moving from Grid Engine to Slurm

As the Center transitions from Grid Engine HPC scheduling to SLURM scheduling, here are a few tips on how to convert a grid engine batch job to a slurm batch job.

In grid engine, special comments in a shell script are used to pass parameters to grid engine. Slurm uses the same convention of a shell with “special comments” to tell slurm about the job, and the parameters have slightly different names.

In slurm, the comments start with #SBATCH .

For instance, in Grid Engine,

#$ -l h_vmem=12g

requests 12gb of ram

#$ -l h_cpu=2:00:00 

requests 2 hours of cpu.

In SLURM, the special comments are #SBATCH


#SBATCH  --mem=12g

Requests 12gb of ram

$SBATCH --time=2:00:200

request 2 hours of WALL time (note, not cpu)

To submit a job script, use the “sbatch” command.

For instance, here is a sample sbatch script “mysbatch.sbatch

#SBATCH --mem=12g
#SBATCH --time-1:00:00
module purge
module load matlab/2019a
matlab  -nosplash -nodesktop -nojvm -nodisplay < mymatjob.m

To submit it, just type:

sbatch mysbatch.sbatch

The “squeue” command will show you what is running (like the qstat command in SGE).