# 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?

**URL:** <https://ask.cyberinfrastructure.org/t/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/209>\
**Category:** Q&A\
**Tags:** sge, programming-for-hpc, slurm, scripting, scheduler, researcher\
**Created:** [May 11, 2018, 3:52pm UTC](https://ask.cyberinfrastructure.org/t/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/209 "2018-05-11T15:52:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jtgoodhue](https://ask.cyberinfrastructure.org/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@jtgoodhue](https://ask.cyberinfrastructure.org/u/jtgoodhue)\
**Post date:** [May 11, 2018, 3:52pm UTC](https://ask.cyberinfrastructure.org/t/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/209/1 "2018-05-11T15:52:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jtgoodhue](https://ask.cyberinfrastructure.org/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@jtgoodhue](https://ask.cyberinfrastructure.org/u/jtgoodhue)\
**Post date:** [May 11, 2018, 4:56pm UTC](https://ask.cyberinfrastructure.org/t/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/209/2 "2018-05-11T16:56:25Z")

</div>

**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](https://srcc.stanford.edu/sge-slurm-conversion)  
[http://www.mpcdf.mpg.de/services/computing/linux/migration-from-sge-to-slurm](http://www.mpcdf.mpg.de/services/computing/linux/migration-from-sge-to-slurm)

> **[rosetta.pdf](https://slurm.schedmd.com/rosetta.pdf)**
>
> 148.17 KB

---

<div class="post-metadata">

**Author:** ![ktrn](https://ask.cyberinfrastructure.org/user_avatar/ask.cyberinfrastructure.org/ktrn/32/554_2.png) [@ktrn](https://ask.cyberinfrastructure.org/u/ktrn)\
**Post date:** [May 31, 2018, 7:30pm UTC](https://ask.cyberinfrastructure.org/t/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/209/3 "2018-05-31T19:30:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ktrn](https://ask.cyberinfrastructure.org/user_avatar/ask.cyberinfrastructure.org/ktrn/32/554_2.png) [@ktrn](https://ask.cyberinfrastructure.org/u/ktrn)\
**Post date:** [May 31, 2018, 7:32pm UTC](https://ask.cyberinfrastructure.org/t/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/209/4 "2018-05-31T19:32:29Z")

</div>

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