-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
44 lines (35 loc) · 866 Bytes
/
run.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
#!/bin/bash
OMP_NUM_THREADS=8 # <- change this to available cores
output="./out" # <- change this to your desired output folder
#output="/mnt/c/Users/nico/Desktop/PolymorphOutput"
move_files() {
echo "moving output files to folder ..."
local timestamp=$(date +%Y-%m-%d_%H-%M)
mkdir $output/$timestamp
mv *.vtp *.vts *.cfg log.txt "$output/$timestamp/"
}
cleanup_files() {
echo "cleaning up leftover output files ..."
rm *.vtp *.vts *.cfg log.txt *.off
make clean
}
run() {
echo "compiling src/$1.cpp ..."
make clean
make $1
export OMP_NUM_THREADS
echo "running $1 with $OMP_NUM_THREADS threads... "
./polymorph
}
if [ "$1" = "c" ]; then
cleanup_files
elif [ "$1" = "m" ]; then
move_files
elif [ -n "$1" ]; then
run "$1"
move_files
else
run "main"
move_files
fi
echo "all done."