Singularity

Singularity

Singularity is a free and open-source computer program that performs operating-system-level virtualization also known as containerization. A Singularity container is used to encapsulate all required software and dependencies for a workflow. This is extremely useful when trying to execute a particular workflow on different systems. Containers make compiling software on different compute platforms easy and effortless.

Slurm script

#!/bin/bash
#SBATCH --job-name="McontainerJob"
#SBATCH --output="Mycontaineroutput.%j.out"
#SBATCH --error="Mycontainererror.%j.err"
#SBATCH --ntasks=16

# Everything below here is linux commands
mkdir singularity_scratch/%j
ulimit -s unlimited
module load singularity/3.7.1
CONTAINER=/home/<user name>/<your container name>.sif

srun singularity exec -B $PWD/singularity_scratch:/tmp ${CONTAINER} <binary application> -n $SLURM_NTASKS <your_input_file_if_any>

rm -rf singularity_scratch/%j
exit 0

Submit the job to the scheduler as

sbatch mycontainer.slurm

For managing your “job” , refer to this guide.

 

For more on singularity, refer to their official documentation
Singularity documenation