Differences between revisions 4 and 5
Revision 4 as of 2021-03-01 16:01:31
Size: 1519
Editor: jbjohnston
Comment:
Revision 5 as of 2021-03-01 16:07:17
Size: 1542
Editor: jbjohnston
Comment:
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
{{{#!/bin/bash #SBATCH --job-name=mySerialjob #SBATCH --nodes=1 #SBATCH --ntasks-per-node=1 #SBATCH --cpus-per-task=1 #SBATCH --time=0-00:20:00 #SBATCH --mem=3102 {{{
&
#35;!/bin/bash

#SBATCH --job-name=mySerialjob #SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=1
#SBATCH --time=0-00:20:00
#SBATCH --mem=3102
Line 11: Line 18:
}}}
{{{
module load someApp
Line 12: Line 22:
module load someApp someApp }}}
someApp
}}}

Job Scripts

Serial Single Threaded

This example illustrates a job script designed to run a simple single-threaded processes on a single compute node:

#!/bin/bash

#SBATCH --job-name=mySerialjob #SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=1
#SBATCH --time=0-00:20:00
#SBATCH --mem=3102

cd ${SLURM_SUBMIT_DIR}

module load someApp

someApp

Explanation

A single process run only requires 1 node, as well as 1 cpu and a single task. These are reflected in the example script. We change to the same directory from where we submitted the job ( ${SLURM_SUBMIT_DIR} to produce our output. Then we load the module "someApp" and execute it.

Multi-Threaded Single Node

In this example we are running an application capable of utilizing multiple process threads on a single node (BLAST):

{{{#!/bin/bash

#SBATCH --job-name=myBLASTjob

#SBATCH --nodes=1

#SBATCH --ntasks-per-node=1

#SBATCH --cpus-per-task=8

#SBATCH --time=0-01:00:00

#SBATCH --mem=3102

cd ${SLURM_SUBMIT_DIR}

module load BLAST

blastn --num_threads 8 <...> }}}

Explanation

In this case we still have a single task (our blastn run) but we require 8 cpu cores to accommodate the 8 threads we've specified on the command line. The ellipses between the angle brackets represents the balance of our command line arguments.

command


CategoryHPC