Excerpt |
---|
Singularity is a container platform: it lets you create and run containers that package up pieces of software in a way that is portable and reproducible. With a few basic commands, you can set up a workflow to run on Pawsey systems using Singularity. This page introduces how to get or build a Singularity container image and run that image on HPC systems. |
...
$ module load singularity/3.8.6
...
-mpi
for applications that need mpi.
Or, for applications that do not need mpi (like for many of the bioinformatics containers):
...
To avoid errors when downloading and running containers, run the sequence of commands in the following terminal 1display:
Column |
---|
|
Code Block |
---|
language | bash |
---|
theme | DJango |
---|
title | Terminal 1. Setting ownership and permission for the Singularity cache directory |
---|
| $ mkdir -p /software/projects/<project-id>/<user-name>/.singularity
$ chown -hR $USER:$PAWSEY_PROJECT /software/projects/<project-id>/<user-name>/.singularity
$ find /software/projects/<project-id>/<user-name>/.singularity -type d -exec chmod g+s {} \; |
|
...
Column |
---|
$ sbatch --account=<your-pawsey-project> singularity_job_script.sh
Tip |
---|
title | Use the combination of --export=NONE and --export=all |
---|
| Note the usage of the combination #SBATCH --export=NONE and srun --export=all . The first setting is needed to start the script with a clean environment, which guarantees the correct behaviour of the script. The second one is needed for the job to use all the environmental settings defined within the script. |
|
Bind mounting host directories
...
Bind mounting host directories
The Singularity configuration at Pawsey takes care of always bind mounting the scratch filesystem for you. You can mount additional host directories to the container with the following syntax:
...
Column |
---|
|
Code Block |
---|
language | bash |
---|
theme | Emacs |
---|
title | Listing 3. Enabling a container to use GPUs |
---|
collapse | true |
---|
| #!/bin/bash -l
#SBATCH --job-name=gpu
#SBATCH --gres=gpu:1
#SBATCH --ntasks=1
#SBATCH --time=01:00:00
#SBATCH
--export=NONE
# Load Singularity
module load singularity/3.8.6
# Define the container to use
export myRepository=$MYSCRATCH/singularity/myRepository
export containerImage=$myRepository/gromacs_2018.2.sif
# Run Gromacs preliminary step with container
srun --export=ALL singularity exec --nv $containerImage gmx grompp -f pme.mdp
# Run Gromacs MD with container
srun --export=ALL singularity exec --nv $containerImage \
gmx mdrun -ntmpi 1 -nb gpu -pin on -v \
-noconfout -nsteps 5000 -s topol.tpr -ntomp 1 |
|
...