-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_spec.sh
executable file
·90 lines (71 loc) · 2.42 KB
/
run_spec.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
#!/bin/bash
# $1 - app name
# $2 - execno
#BENCHMARK_DIR=/home/mejbah/benchmark/SPEC/spec2000
#BIN_DIR=$BENCHMARK_DIR/bin
BIN_DIR=/home/mejbah/benchmark/SPEC/scripts/bin
PIN_HOME=/home/mejbah/pintool/pin-2.10-45467-gcc.3.4.6-ia32_intel64-linux
i=$2
#EXPERIMENT_HOME=/home/muzahid/projects/code/performance_bug/bugs/experiments
#TYPE=spec
DATA_DIR=./data
PROGRAM_DATA_DIR=${DATA_DIR}/${1}
#LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/muzahid/projects/code/all_pin/pin/intel64/lib-ext
#export LD_LIBRARY_PATH
#PIN=/home/muzahid/projects/code/all_pin/pin/intel64/bin/pinbin
export LD_LIBRARY_PATH=/home/mejbah/opencv-libs/lib:${LD_LIBRARY_PATH}
echo execution no $2
if [ -d "${PROGRAM_DATA_DIR}" ]; then
echo ${PROGRAM_DATA_DIR} already exists
else
echo creating new ${PROGRAM_DATA_DIR} directory ...
mkdir ${PROGRAM_DATA_DIR}
fi
mkdir ${PROGRAM_DATA_DIR}/run$2
SPECAPP="$1"
if [ "$SPECAPP" = "gzip.spec" ]
then
ARGS="${BIN_DIR}/input.compressed 1"
fi
#if [ "$SPECAPP" = "vpr.spec" ]
#then
# ARGS="${BIN_DIR}/net.in ${BIN_DIR}/arch.in ${PROGRAM_DATA_DIR}/place.${HOSTNAME}.$$.out ${PROGRAM_DATA_DIR}/dum.${HOSTNAME}.$$.out -nodisp -place_only -init_t 5 -exit_t 0.005 -alpha_t 0.9412 -inner_num 2"
#fi
if [ "$SPECAPP" = "gcc.spec" ]
then
ARGS="${BIN_DIR}/cccp.i -o ${PROGRAM_DATA_DIR}/gcc1.${HOSTNAME}.$$.s"
fi
if [ "$SPECAPP" = "mcf.spec" ]
then
ARGS="${BIN_DIR}/inp.in"
fi
if [ "$SPECAPP" = "perlbmk.spec" ]
then
# cd ${BIN_DIR}
ARGS="${BIN_DIR}/scrabbl.pl"
PIN_ARGS="-stdin ${BIN_DIR}/scrabbl.in"
fi
if [ "$SPECAPP" = "bzip2.spec" ]
then
ARGS="${BIN_DIR}/input.random 58"
fi
if [ "$SPECAPP" = "twolf.spec" ]
then
cd ${BIN_DIR}
ARGS="test"
fi
APP_NAME=$1
OUTPUT_PATH=./data
DATA_PATH=/home/mejbah/pintool/mem_access_LR/data
MODE=0
CONF_DIR=./data/spec.conf
PINTOOL_ARGS="-mode $MODE -datadir $DATA_PATH/$APP_NAME -mlp $OUTPUT_PATH/$APP_NAME/run$i"
mkdir -p ${OUTPUT_PATH}/${APP_NAME}/run$i
START_TIME=$(($(date +%s%N)/1000000))
${BIN_DIR}/${SPECAPP} ${ARGS}
END_TIME=$(($(date +%s%N)/1000000))
TOTAL_TIME=$(($END_TIME -$START_TIME))
echo "Original elapsed time: $TOTAL_TIME milliseconds" > ${OUTPUT_PATH}/$APP_NAME/run$i/original.out
echo ${PIN_HOME}/pin -t ./mentalist.so -c ./data/spec.conf -o ${OUTPUT_PATH}/$APP_NAME/run$i/report.out $PINTOOL_ARGS -- ${BIN_DIR}/${SPECAPP} ${ARGS}
${PIN_HOME}/pin -t ./mentalist.so -c ./data/spec.conf -o ${OUTPUT_PATH}/$APP_NAME/run$i/report.out $PINTOOL_ARGS -- ${BIN_DIR}/${SPECAPP} ${ARGS}
echo done