-
Notifications
You must be signed in to change notification settings - Fork 3
/
memtest.sh
executable file
·69 lines (58 loc) · 1.2 KB
/
memtest.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
help() {
cat << __EOF
Usage: memtest.sh [-p path] [-m|-c] [-h] [MOD] [MODEL]
-p path Run an alternative binary (build/release-qt)
-m Run massif
-c Run memcheck
--steps n Run n steps
-h Show this help
MOD The mod (testexample)
MODEL The config (baseline)
__EOF
}
SRC=`pwd`
MYPATH=`pwd`/build/release-qt5/
MOD=testexample
MODEL=baseline
SIMU=simu2
STEPS=8762
while [ "$1" != "" ] ; do
case "$1" in
-m)
RUN="valgrind --tool=massif --massif-out-file=${SRC}/massif.out"
shift
;;
-c)
RUN="valgrind --tool=memcheck --log-file=${SRC}/memcheck.out"
shift
;;
-p)
shift
MYPATH=`realpath $1`
shift
;;
--steps)
shift
STEPS=$1
shift
;;
-h)
help
exit 1
;;
*)
break
;;
esac
done
if [ "$1" != "" ] ; then
MOD=$1
fi
if [ "$2" != "" ] ; then
MODEL=$2
fi
export LD_LIBRARY_PATH=${MYPATH}
SIM=/home/happycactus/Documents/Progetti/displace/Applications/DISPLACE_input_${MOD}
cd $SIM
${RUN} ${MYPATH}/displace -f ${MOD} -f2 ${MODEL} -s ${SIMU} -i ${STEPS} -p 1 -o 1 -e 1 -v 0 --without-gnuplot -V 1 --num_threads 1