forked from neboat/cilkbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configureTests.sh
106 lines (91 loc) · 3.16 KB
/
configureTests.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
COMPILERS="gcc tapir ref stapir sref serial"
WORKERS="1 18"
# NUMTRIALS=3
TAPIR_CC=clang
TAPIR_CXX=clang++
if [ -z $REF_BASE ]; then
if [ -z $TAPIR_BASE ]; then
REF_BASE="/unknown/path/to/src-ref"
else
REF_BASE=$TAPIR_BASE-ref
fi
fi
if [ ! -z $TAPIR_BASE ]; then
if [ -z $DEBUG ]; then
TAPIR_ROOT=$TAPIR_BASE/build
REF_ROOT=$REF_BASE/build
else
echo "Using Debug build"
TAPIR_ROOT=$TAPIR_BASE/build-debug
REF_ROOT=$REF_BASE/build-debug
fi
fi
if [ ! -z $TAPIR_ROOT ]; then
TAPIR_PATH=$TAPIR_ROOT/bin
REF_PATH=$REF_ROOT/bin
TAPIR_CC=$TAPIR_PATH/clang
TAPIR_CXX=$TAPIR_PATH/clang++
TAPIR_LIB=$TAPIR_ROOT/lib/clang/`$TAPIR_CC --version | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/'`/lib/linux
else
TAPIR_LIB=/usr/lib/clang/`$TAPIR_CC --version | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/'`/lib/linux
fi
echo $TAPIR_LIB
echo $REF_PATH
#TAPIR_CILK_FLAG=-fcilkplus
TAPIR_CILK_FLAG=-fopencilk
REF_CILK_FLAG=-fcilkplus #-fdetach
GCC_CILK_FLAG=-fcilkplus
SERIAL_CFLAGS="-Dcilk_for=for -Dcilk_spawn= -Dcilk_sync= -D_Cilk_for=for -D_Cilk_spawn= -D_Cilk_sync= "
REPORT_CFLAGS="-Rpass=.* -Rpass-analysis=.*"
# REPORT_CFLAGS="-Rpass=loop-spawning"
CILKSAN_LIB=$TAPIR_LIB
CILKSAN_CFLAGS="-g -fsanitize=cilk"
# CILKSAN_LDFLAGS="-lcilksan -L$CILKSAN_LIB"
CILKSAN_LDFLAGS="-fsanitize=cilk"
CILKSCALE_CFLAGS="-flto -fcsi"
CILKSCALE_LDFLAGS="-flto -fuse-ld=gold -L$TAPIR_LIB"
CILKSCALE_LDLIBS="-lclang_rt.cilkscale-x86_64"
JEMALLOC_LDLIBS="-L`jemalloc-config --libdir` -Wl,-rpath,`jemalloc-config --libdir` -ljemalloc `jemalloc-config --libs`"
C_COMPILER() {
case $1 in
"tapir") echo "$TAPIR_CC $TAPIR_CILK_FLAG";;
"ref") echo "$REF_PATH/clang $REF_CILK_FLAG";;
"stapir") echo "$TAPIR_CC $TAPIR_CILK_FLAG $SERIAL_CFLAGS";;
"sref") echo "$REF_PATH/clang $REF_CILK_FLAG $SERIAL_CFLAGS";;
"serial") echo "$TAPIR_CC $SERIAL_CFLAGS";;
"gcc") echo "gcc $GCC_CILK_FLAG";;
"sgcc") echo "gcc $GCC_CILK_FLAG $SERIAL_CFLAGS";;
*) echo "Unknown compiler $1"; exit 1;;
esac
}
CXX_COMPILER() {
case $1 in
"tapir") echo "$TAPIR_CXX $TAPIR_CILK_FLAG";;
"ref") echo "$REF_PATH/clang++ $REF_CILK_FLAG";;
"stapir") echo "$TAPIR_CXX $TAPIR_CILK_FLAG $SERIAL_CFLAGS";;
"sref") echo "$REF_PATH/clang++ $REF_CILK_FLAG $SERIAL_CFLAGS";;
"serial") echo "$TAPIR_CXX $SERIAL_CFLAGS";;
"gcc") echo "g++ $GCC_CILK_FLAG";;
"sgcc") echo "g++ $GCC_CILK_FLAG $SERIAL_CFLAGS";;
*) echo "Unknown compiler $1"; exit 1;;
esac
}
CILKFLAG() {
case $1 in
"tapir") echo "$TAPIR_CILK_FLAG";;
"ref") echo "$REF_CILK_FLAG";;
"stapir") echo "$TAPIR_CILK_FLAG $SERIAL_CFLAGS";;
"sref") echo "$REF_CILK_FLAG $SERIAL_CFLAGS";;
"serial") echo "$SERIAL_CFLAGS";;
"gcc") echo "$GCC_CILK_FLAG";;
"sgcc") echo "$GCC_CILK_FLAG $SERIAL_CFLAGS";;
*) echo "Unknown compiler $1"; exit 1;;
esac
}
RUN_ON_P_WORKERS() {
P=$1
# echo "CILK_NWORKERS=$P setarch x86_64 -R taskset -c 1-$P numactl -i all ionice -c 2 -n 0 $2"
# CILK_NWORKERS=$P setarch x86_64 -R taskset -c 1-$P numactl -i all ionice -c 2 -n 0 $2
echo "CILK_NWORKERS=$P setarch x86_64 -R taskset -c 1-$P numactl -i all ionice -c 2 -n 0 $2"
CILK_NWORKERS=$P setarch x86_64 -R taskset -c 1-$P numactl -i all ionice -c 2 -n 0 $2
}