forked from parzonka/prm4j-eval
-
Notifications
You must be signed in to change notification settings - Fork 0
/
baseline
executable file
·77 lines (66 loc) · 2.96 KB
/
baseline
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
#!/usr/bin/env bash
#
# Compiles, runs and measures a runtime baseline for the test system using the DaCapo-9.12-bach benchmark.
#
#
# usage: ./baseline <list of benchmarks>
# Measures runtime for each benchmark in the given list of DacCapo benchmarks.
# examples: ./baseline avrora
# ./baseline "avrora h2 tradebeans"
#
# usage: ./baseline (parameterless)
# Measures runtime for each benchmark in {avrora batik eclipse fop h2 jython luindex pmd
# sunflow tomcat tradebeans tradesoap xalan}.
#
# notes: A list of all monitored properties can be found in target/jars/mop; each jar is a property
# A list of all benchmarks can be found at http://dacapobench.org/benchmarks.html
# Benchmark "lusearch" is not used because of random crashes in lucine on the evaluation hardware.
#
#
# CONFIGURATION:
invocations=16 # sets the number of JVM invocations
######################################################################################################################
if [ -z "$1" ]; then
benchmarks="avrora batik eclipse fop h2 jython luindex pmd sunflow tomcat tradebeans tradesoap xalan"
else
benchmarks=$1
fi
# remember directory where this script is called (some benchmarks need absolute paths)
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "Resolving maven dependencies... (may take a while)"
mvn -q dependency:resolve --update-snapshots
# get and process classpath from maven pom
mvn -q dependency:build-classpath -Dmdep.outputFile=dependency-outputfile
tr ':' '\n' < dependency-outputfile > dependency-list
DACAPO=$(grep "dacapo" dependency-list)
GUAVA=$(grep "guava" dependency-list)
APACHEMATH=$(grep "math3" dependency-list)
# cleanup tempfiles
rm dependency-outputfile dependency-list
# create working and target directories
rm -rf target
mkdir -p target/classes/META-INF target/jars
# create jar with callback
javac src/main/java/prm4jeval/*.java -d target/classes -cp "$DACAPO:$APACHEMATH:$GUAVA"
jar cf target/jars/Callback.jar -C target/classes .
# create dir for logs
mkdir -p logs
# create jar with callback
javac src/main/java/prm4jeval/EvalCallback.java src/main/java/prm4jeval/SteadyStateInvocation.java -d target/classes -cp "$DACAPO:$APACHEMATH:$GUAVA"
jar cf target/jars/Callback.jar -C target/classes .
echo "Will perform ${invocations} JVM invocations for all benchmarks in (${benchmarks}) until reaching static state (max. 25 iterations)."
for invocation in $(jot $invocations 1) ; do
for benchmark in $benchmarks ; do
STATUS=0
while [ $STATUS -eq 0 ]; do
echo "Starting benchmark [baseline:$benchmark] measurement $invocation..."
java -Xms256M -Xmx2048M \
-Dprm4jeval.outputfile=logs/baseline.log \
-Dprm4jeval.invocation=$invocation \
-Dprm4jeval.benchmark=$benchmark -Dprm4jeval.parametricProperty=- \
-cp "$DACAPO:$GUAVA:$APACHEMATH:${DIR}/target/jars/Callback.jar" \
Harness --no-validation -c prm4jeval.EvalCallback $benchmark
STATUS=$?
done
done
done