BioMonth - CSC supercomputing and data management for bioscientists

Batch job tutorial

Serial jobs

#!/bin/bash
#SBATCH --account=myprojectname
#SBATCH --partition=test
#SBATCH --ntasks=1
#SBATCH --time=00:02:00

srun hostname
srun sleep 60

Parallel jobs

A simple OpenMP job

#!/bin/bash
#SBATCH --account=myprojectname
#SBATCH --partition=test
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --time=00:00:10
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
srun hello_omp.x
cat slurm-5118404.out
Hello from thread: 0
Hello from thread: 3
Hello from thread: 2
Hello from thread: 1

A simple MPI job

#!/bin/bash
#SBATCH --account=myprojectname
#SBATCH --partition=test
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=4
#SBATCH --time=00:00:10

srun hello_mpi.x

Interactive jobs

A simple interactive job

Gathering information

Additional material FAQ on CSC batch jobs in Docs CSC