Skip to content

Commit 83416d1

Browse files
committed
Provide a guide on how to run the images on Expanse.
1 parent c4871f3 commit 83416d1

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,57 @@ If you need to get a file out of your docker container, use:
2020
docker cp test:<filename> .
2121
```
2222

23+
# Running on HPC such as Expanse or NERSC
24+
25+
SDSC and NERSC uses singularity. You will first need to build a singularity image from the docker images.
26+
27+
## Building the SIF
28+
29+
SSH to the cluster and start an interactive session with enough memory, e.g.:
30+
31+
```shell
32+
srun -N 1 -n 1 -c 4 --mem 50G -p condo -q condo -A <allocation> -t 4:00:00 --pty /bin/bash
33+
```
34+
35+
or if you are using the `hotel` queue:
36+
37+
```shell
38+
srun -N 1 -n 1 -c 4 --mem 50G -p hotel -q hotel -A <allocation> -t 4:00:00 --pty /bin/bash
39+
```
40+
41+
Next pull the docker container.
42+
43+
```shell
44+
module load singularitypro
45+
singularity pull --disable-cache docker://materialsvirtuallab/matml
46+
```
47+
48+
You should see a `matml_latest.sif` file in your directory. Exit the interactive shell.
49+
50+
## Running jobs using the SIF container
51+
52+
You can now run a job using the SIF container. An example script is given below:
53+
54+
```bash
55+
#!/bin/bash
56+
#SBATCH --job-name="singularity"
57+
#SBATCH -t 00:05:00
58+
#SBATCH --nodes=1
59+
#SBATCH --tasks-per-node=1
60+
#SBATCH -o sing.out
61+
#SBATCH -e sing.err
62+
##SBATCH -p hotel
63+
#SBATCH --qos hotel
64+
#SBATCH -A <allocation>
65+
#SBATCH --export=ALL
66+
67+
export OMP_NUM_THREADS=1
68+
69+
module load singularitypro
70+
71+
IMAGE=/tscc/nfs/home/shyuep/test_singularity/matml_latest.sif
72+
73+
singularity exec $IMAGE python script.py
74+
```
75+
2376
[Materials Virtual Lab Docker Repository]: https://hub.docker.com/orgs/materialsvirtuallab/repositories

0 commit comments

Comments
 (0)