-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathSingularity.def
39 lines (29 loc) · 1023 Bytes
/
Singularity.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Bootstrap: docker
From: andreweiner/of_pytorch:of2106-py1.9.0-cpu
%runscript
CMD="${1:?[Please specify a command; singularity run-help of2106-py1.9.0-cpu.sif]}"
# openFOAM environment variables
. /usr/lib/openfoam/openfoam2106/etc/bashrc
if [ "$#" -eq "1" ]; then
$CMD
elif [ "$#" -eq "2" ]; then
cd $2
$CMD
elif [ "$#" -eq "3" ]; then
cd $2
$CMD $3
else
echo "Error: expected exactly one, two, or three arguments."
fi
%help
Simple Singularity image containing OpenFOAM-v2106
and libtorch (PyTorch 1.9.0). The generic syntax to execute
a command with arguments is
singularity run image_name.sif command [path] [argument]
Examples:
- compile the application tensorCreation using wmake
singularity run of2106-py1.9.0-cpu.sif wmake test/tensorCreation/
- clean tensorCreation build
singularity run of2106-py1.9.0-cpu.sif wclean test/tensorCreation/
- run tensorCreation
singularity run of2106-py1.9.0-cpu.sif ./tensorCreation test/tensorCreation/