From 6919edd49aabaf28ede0da10179dc2f27d51475f Mon Sep 17 00:00:00 2001
From: katherine-hough <32645020+katherine-hough@users.noreply.github.com>
Date: Sun, 26 Nov 2023 16:05:14 -0500
Subject: [PATCH] * Finished driver
---
integration-tests/pom.xml | 19 +++-----
integration-tests/runDacapo.sh | 46 +++++++++----------
.../phosphor/driver/PhosphorInstrumenter.java | 1 +
3 files changed, 30 insertions(+), 36 deletions(-)
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index f6eaacb4e..9d68e5ba8 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -18,7 +18,7 @@
${project.build.directory}/phosphor/data/cache
false
${edu.gmu.swe.phosphor:Phosphor:jar}
- false
+ ${edu.gmu.swe.phosphor:phosphor-driver:jar}
@@ -26,6 +26,11 @@
Phosphor
${project.version}
+
+ edu.gmu.swe.phosphor
+ phosphor-driver
+ ${project.version}
+
edu.gmu.swe.phosphor
phosphor-jigsaw-javaagent
@@ -107,15 +112,6 @@
-
- java8
-
- 1.8
-
-
- true
-
-
dacapo
@@ -145,9 +141,8 @@
${project.build.directory}
${phosphor.jar}
- ${phosphor.jar}
+ ${phosphor.driver.jar}
${data.flow.java}/bin/java
- ${isJava8}
diff --git a/integration-tests/runDacapo.sh b/integration-tests/runDacapo.sh
index d39923466..e267acce1 100755
--- a/integration-tests/runDacapo.sh
+++ b/integration-tests/runDacapo.sh
@@ -1,13 +1,12 @@
#!/bin/bash
set -x
-BUILD_DIR=$1
-PHOSPHOR_JAR=$2
-PHOSPHOR_JAVA_AGENT=$3
-INST_JVM=$4
-IS_JAVA_8=$5
-DACAPO_DIR=$BUILD_DIR/dacapo
-INST_DACAPO_DIR=$BUILD_DIR/dacapo-inst
-BENCHMARKS=(avrora fop h2 jython luindex pmd sunflow xalan)
+readonly BUILD_DIR=$1
+readonly PHOSPHOR_JAR=$2
+readonly DRIVER_JAR=$3
+readonly INST_JVM=$4
+readonly DACAPO_DIR=$BUILD_DIR/dacapo
+readonly INST_DACAPO_DIR=$BUILD_DIR/dacapo-inst
+readonly BENCHMARKS=(avrora fop h2 jython luindex pmd sunflow xalan)
#tradebeans tradesoap are disabled in this script because of the difficulty with distributing the openjdk jce.jar file with everything, then switching it in...
#we don't run batik anymore because it's an enormous pain to automatically set up oracle java...
#tomcat started crashing on travis
@@ -15,39 +14,38 @@ BENCHMARKS=(avrora fop h2 jython luindex pmd sunflow xalan)
# (export controls are annoying)
# eclipse doesn't work without big hacks on travis
# ..also disable lusearch because travis seems unhappy when we run it there
-HAD_ERROR=0
if [ ! -d "$DACAPO_DIR" ]; then
echo "Downloading dacapo jar"
- mkdir -p $DACAPO_DIR
- cd $DACAPO_DIR
+ mkdir -p "$DACAPO_DIR"
+ cd "$DACAPO_DIR"
wget --quiet https://www.jonbell.net/dacapo-9.12-MR1-bach.jar
unzip -qq dacapo-9.12-MR1-bach.jar
fi
-cd $BUILD_DIR
+cd "$BUILD_DIR"
if [ ! -d "$INST_DACAPO_DIR" ]; then
echo "Creating data flow instrumented dacapo"
- java -Xmx6g -XX:MaxPermSize=512m -jar "$PHOSPHOR_JAR" -q -forceUnboxAcmpEq -withEnumsByValue "$DACAPO_DIR" "$INST_DACAPO_DIR"
+ java -Xmx6g -jar "$DRIVER_JAR" -q -forceUnboxAcmpEq -withEnumsByValue "$DACAPO_DIR" "$INST_DACAPO_DIR"
else
echo "Not regenerating data flow instrumented dacapo"
fi
-
+errors=0
echo "Trying data flow benchmarks, one iteration only"
for bm in "${BENCHMARKS[@]}"; do
-# echo "$JAVA_HOME/bin/java -cp $DACAPO_DIR Harness $bm"
-
- if [ "$IS_JAVA_8" == "true" ]; then
- $INST_JVM -Xmx1g -Xbootclasspath/a:"$PHOSPHOR_JAR" -javaagent:"$PHOSPHOR_JAVA_AGENT" -cp "$INST_DACAPO_DIR" -Declipse.java.home="$JAVA_HOME" -Djava.awt.headless=true Harness "$bm"
- else
- $INST_JVM -Xmx4g -javaagent:"$PHOSPHOR_JAVA_AGENT" -cp "$INST_DACAPO_DIR" -Declipse.java.home="$JAVA_HOME" -Djava.awt.headless=true Harness "$bm"
- fi
+ $INST_JVM -Xmx4g \
+ -Xbootclasspath/a:"$PHOSPHOR_JAR" \
+ -javaagent:"$PHOSPHOR_JAR" \
+ -cp "$INST_DACAPO_DIR" \
+ -Declipse.java.home="$JAVA_HOME" \
+ -Djava.awt.headless=true \
+ Harness "$bm"
if [ $? -ne 0 ]; then
- HAD_ERROR=$(expr $HAD_ERROR + 1)
+ errors=var=$((errors + 1))
echo "ERROR!!!"
fi
done
-echo "Total errors: $HAD_ERROR"
-if [ $HAD_ERROR -ne 0 ]; then
+echo "Total errors: $errors"
+if [ $errors -ne 0 ]; then
exit 255
fi
diff --git a/phosphor-driver/src/main/java/edu/columbia/cs/psl/phosphor/driver/PhosphorInstrumenter.java b/phosphor-driver/src/main/java/edu/columbia/cs/psl/phosphor/driver/PhosphorInstrumenter.java
index f445b1401..d07713f17 100644
--- a/phosphor-driver/src/main/java/edu/columbia/cs/psl/phosphor/driver/PhosphorInstrumenter.java
+++ b/phosphor-driver/src/main/java/edu/columbia/cs/psl/phosphor/driver/PhosphorInstrumenter.java
@@ -19,6 +19,7 @@ public static void main(String[] args) throws IOException {
// The "help" option was specified
return;
}
+ args = line.getArgs();
File source = new File(args[0]);
File destination = new File(args[1]);
instrumentation.initialize(line);