/
Singularityg16.sh
27 lines (27 loc) · 986 Bytes
/
Singularityg16.sh
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
if [ "$#" -eq 0 ]; then
echo ""
echo "Please provide the complete path to your sif file. Example:"
echo ""
echo "$(basename $0) $HOME/automekin2020_872.sif"
echo ""
exit 1
fi
siffile=$1
if [ $(singularity instance list | awk 'END{print NR-1}') -ge 1 ];then
in=$(singularity instance list | awk '{n=$1};END{print n}' | sed 's/automekin//' | awk '{print $1+1}')
else
in=1
fi
if G09DIR=$(dirname $(which g16 2> /dev/null) 2> /dev/null)
then
if [ -d $GAUSS_SCRDIR ]
then
SINGULARITYENV_GAUSS_SCRDIR=/scratch SINGULARITYENV_PREPEND_PATH=/opt/g16 singularity instance start --bind $G09DIR:/opt/g16 --bind $GAUSS_SCRDIR:/scratch $siffile automekin$in
else
SINGULARITYENV_PREPEND_PATH=/opt/g16 singularity instance start --bind $G09DIR:/opt/g16 $siffile automekin$in
fi
else
echo "Gaussian 09 not available, only low-level calculations available"
singularity instance start $siffile automekin$in
fi
singularity run instance://automekin$in