Ask.Cyberinfrastructure

I am a Sun Grid Engine user moving to SLURM. What are a few of the basic commands that I can use to get started?

scripting
sge
slurm
scheduler
programming-for-hpc

#1

I am an expert user of a cluster with a Sun Grid Engine Scheduler and need to use a cluster with a SLURM Scheduler. Can someone help me get started by translating the following simple examples from SGE to SLURM?

What Jobs are currently running?
qstat

What Jobs am I currently running?
qstat -u username

Launch an interactive session on one node with 16 cores:
qrsh -pe omp 16

Launch a batch job one node with 16 cores:
qsub -pe omp 16 script.sh

Cancel a batch job
qdel -j jobID

Cancel all my jobs
qdel -u username

CURATOR: John Goodhue


#2

ANSWER:
Here are equivalents to the commands you listed.

What Jobs are currently running?
squeue -a

What Jobs am I currently running?
squeue -u <username>

Launch an interactive session on one node in the default queue, with 16 cores and exclusive use of the node:
salloc -N 1 -n 16 -p defq --time=1:00:00 --exclusive

Launch a batch job:
sbatch <scriptname>.slurm

Example batch file with directives that reserve one node in the default queue, with 16 cores and exclusive use of the node:
#!/bin/bash
#SBATCH -N 1
#SBATCH -n 16
#SBATCH --time=1:00:00
#SBATCH --exclusive
<<shell commands that set up and run the job>>

Cancel a batch job
scancel <jobid>

For a more comprehensive look, here are links to three SGE->SLURM translation tables:
https://srcc.stanford.edu/sge-slurm-conversion
http://www.mpcdf.mpg.de/services/computing/linux/migration-from-sge-to-slurm


#4

COMMENT-JG: content from this answer was folded into the answer above.


#3

COMMENT-JG: content from this comment was folded into the answer above.