Difference between revisions of "LSF to Slurm quick reference"

From ScientificComputing
Jump to: navigation, search
Line 3: Line 3:
  
 
==Submitting a job==
 
==Submitting a job==
{| class="wikitable" border="1" style="width:50%;text-align:left;"
+
{| class="wikitable" border="1" style="width:80%;text-align:left;"
 
! LSF !! Slurm
 
! LSF !! Slurm
 
|-
 
|-
Line 35: Line 35:
  
 
==Interactive job==
 
==Interactive job==
{| class="wikitable" border="1" style="width:50%;text-align:left;"
+
{| class="wikitable" border="1" style="width:80%;text-align:left;"
 
! LSF !! Slurm
 
! LSF !! Slurm
 
|-
 
|-
Line 42: Line 42:
  
 
==Monitoring a job==
 
==Monitoring a job==
{| class="wikitable" border="1" style="width:50%;text-align:left;"
+
{| class="wikitable" border="1" style="width:80%;text-align:left;"
 
! LSF !! Slurm
 
! LSF !! Slurm
 
|-
 
|-
Line 49: Line 49:
  
 
==Killing a job==
 
==Killing a job==
{| class="wikitable" border="1" style="width:50%;text-align:left;"
+
{| class="wikitable" border="1" style="width:80%;text-align:left;"
 
! LSF !! Slurm
 
! LSF !! Slurm
 
|-
 
|-
Line 56: Line 56:
  
 
==Environment variables==
 
==Environment variables==
{| class="wikitable" border="1" style="width:50%;text-align:left;"
+
{| class="wikitable" border="1" style="width:80%;text-align:left;"
 
! LSF !! Slurm  
 
! LSF !! Slurm  
 
|-
 
|-
Line 65: Line 65:
  
 
==Check resource usage of a job==
 
==Check resource usage of a job==
{| class="wikitable" border="1" style="width:50%;text-align:left;"
+
{| class="wikitable" border="1" style="width:80%;text-align:left;"
 
! LSF !! Slurm
 
! LSF !! Slurm
 
|-
 
|-
 
| style="width:50%;" | <tt>bbjobs [JOBID]</tt> || <tt>sacct -j JOBID</tt>  
 
| style="width:50%;" | <tt>bbjobs [JOBID]</tt> || <tt>sacct -j JOBID</tt>  
 
|}
 
|}

Revision as of 13:14, 31 March 2022

Introduction

The commands for slurm are similar to the ones used in LSF. You can find a mapping of the relevant commands below.

Submitting a job

LSF Slurm
bsub < jobscript.sh sbatch jobscript.sh
jobscript.sh:
#!/bin/bash

#BSUB -n 4
#BSUB -W 08:00
#BSUB -R "rusage[mem=2000]"
#BSUB -J analysis1
#BSUB -o analysis1.out
#BSUB -e analysis1.err

# load modules
# run command
jobscript.sh:
#!/bin/bash

#SBATCH -n 4
#SBATCH --time=8:00
#SBATCH --mem-per-cpu=2000
#SBATCH --job-name=analysis1
#SBATCH --output=analysis1.out
#SBATCH --error=analysis1.err

# load modules
# run command

Interactive job

LSF Slurm
bsub -Is [LSF options] bash srun --pty bash

Monitoring a job

LSF Slurm
bjobs [JOBID] squeue [-j JOBID]

Killing a job

LSF Slurm
bkill [JOBID] scancel [JOBID]

Environment variables

LSF Slurm
$LSB_JOBID $SLURM_JOB_ID
$LSB_SUBCWD $SLURM_SUBMIT_DIR

Check resource usage of a job

LSF Slurm
bbjobs [JOBID] sacct -j JOBID