-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·80 lines (69 loc) · 1.72 KB
/
run
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
ARCH=`uname -s`
EASYPAPDIR=${EASYPAPDIR:-.}
# source common vars
. ${EASYPAPDIR}/script/easypap-common.bash
TRACE=no
THUMBS=no
DEBUG=no
for ((i = 1; i <= $#; i++ )); do
case ${!i} in
-t|--trace|-ti|--trace-iter)
TRACE=yes
;;
-tn|--thumbs)
THUMBS=yes
;;
-lk|--list-kernels)
shift
exec $EASYPAPDIR/script/easypap-list-kernels "$@"
;;
-lv|--list-variants)
shift
exec $EASYPAPDIR/script/easypap-list-variants "$@"
;;
-mpi|--mpirun)
if ((i == $#)); then
echo "Error: option --mpi must be followed by a string"
${SIMU} --help
exit 1
fi
j=$((i + 1))
MPIRUNARGS="${!j}"
;;
--gdb|--lldb)
DEBUG=${!i#--}
;;
*)
;;
esac
done
# build easypap if needed
if [[ ! -f ${SIMU} ]]; then
make -j
fi
# if thumbnails generation is requested, clean the old files
if [[ $THUMBS == "yes" ]]; then
${EASYPAPDIR}/script/clean-thumbs
fi
# if trace generation is requested, we back up the previous trace file
if [[ $TRACE = "yes" ]]; then
if [[ -f ${TRACEFILE} ]] ; then
mv ${TRACEFILE} ${OLDTRACEFILE}
fi
fi
# if no thread binding is specified, use OMP_PLACES=cores on Linux systems
if [[ -z $OMP_PLACES ]]; then
if [[ $ARCH == "Linux" ]]; then
export OMP_PLACES="cores"
fi
fi
if [[ $DEBUG != no ]]; then
exec ${DEBUG} ${SIMU} -- "$@"
fi
# check if program should be launched by mpirun
if [[ -n $MPIRUNARGS ]]; then
mpirun ${MPIRUNARGS} ${SIMU} "$@"
else
exec ${SIMU} "$@"
fi