-
Notifications
You must be signed in to change notification settings - Fork 3
/
run_docker.sh
48 lines (38 loc) · 1.11 KB
/
run_docker.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -e
# Process configuration a bit
INPUTFILE=$1
WORKDIR=`dirname "$1"`
# Adopt naming convention from input file
if [[ $INPUTFILE =~ \.[A-Z]+$ ]]
then
OUTPUTFILE="${INPUTFILE%.*}.PRT"
else
OUTPUTFILE="${INPUTFILE%.*}.prt"
fi
echo ----------------------------------------------------------------------
echo $SWANEXE
echo with OpenMP on linux cluster, Nerdalize mod.
#echo SGE_O_WORKDIR : $SWANDIR
echo INPUT FILE : $INPUTFILE
echo WORKING DIRECTORY : $WORKDIR
echo OUTPUT FILE : $OUTPUTFILE
echo ----------------------------------------------------------------------
# Switch to base working directory
cd $WORKDIR
# Rename input file for SWAN
cp $INPUTFILE INPUT
# Run SWAN
starttime=`date +%s`
$SWANEXE
endtime=`date +%s`
runtime=$((endtime-starttime))
echo ----------------------------------------------------------------------
echo "The run was completed after $((runtime / 60)) minutes"
echo ----------------------------------------------------------------------
# Process generated files into output and delete temporary files
mv PRINT $OUTPUTFILE
rm INPUT
rm -f swaninit
rm -f norm_end
cp -r . /output/