-
Notifications
You must be signed in to change notification settings - Fork 2
/
init.sh
58 lines (51 loc) · 1.23 KB
/
init.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
#!/bin/bash
if [ -f "${MAIN_DIR}/common-functions.sh" ] ; then
source "${MAIN_DIR}/common-functions.sh"
else
echo "Missing library: ${MAIN_DIR}/common-functions.sh"
exit 1
fi
FRAMEWORK_NAME=$(basename -- "${BASE_DIR}")
RESULTS_DIR="${BASE_DIR}/results-$FRAMEWORK_NAME"
RAWFN="${RESULTS_DIR}/raw"
# Initialize all unset parameters
if [ -z $SLEEP_TIME ]; then
SLEEP_TIME=30 ## 30
fi
if [ -z $NUM_OF_LOOPS ]; then
NUM_OF_LOOPS=10 ## 10
fi
if [ -z $THREADS ]; then
THREADS=1 ## 1
fi
if [ -z $RECURSION_DEPTH ]; then
RECURSION_DEPTH=10 ## 10
fi
if [ -z $TOTAL_NUM_OF_CALLS ]; then
TOTAL_NUM_OF_CALLS=2000000 ## 2000000
fi
if [ -z $METHOD_TIME ]; then
METHOD_TIME=0 ## 500000
fi
if [ -z $DEBUG ]; then
DEBUG=false ## false
fi
# load configuration and common functions
if [ -f "${BASE_DIR}/config.rc" ] ; then
source "${BASE_DIR}/config.rc"
else
echo "Missing configuration: ${BASE_DIR}/config.rc"
exit 1
fi
if [ -f "${BASE_DIR}/functions.sh" ] ; then
source "${BASE_DIR}/functions.sh"
else
echo "Missing: ${BASE_DIR}/functions.sh"
exit 1
fi
if [ -f "${BASE_DIR}/labels.sh" ] ; then
source "${BASE_DIR}/labels.sh"
else
echo "Missing file: ${BASE_DIR}/labels.sh"
exit 1
fi