Skip to content

Commit

Permalink
* Finished driver
Browse files Browse the repository at this point in the history
  • Loading branch information
katherine-hough committed Nov 26, 2023
1 parent d380406 commit 6919edd
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 36 deletions.
19 changes: 7 additions & 12 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@
<data.flow.cache>${project.build.directory}/phosphor/data/cache</data.flow.cache>
<data.flow.skip>false</data.flow.skip>
<phosphor.jar>${edu.gmu.swe.phosphor:Phosphor:jar}</phosphor.jar>
<isJava8>false</isJava8>
<phosphor.driver.jar>${edu.gmu.swe.phosphor:phosphor-driver:jar}</phosphor.driver.jar>
</properties>
<dependencies>
<dependency>
<groupId>edu.gmu.swe.phosphor</groupId>
<artifactId>Phosphor</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>edu.gmu.swe.phosphor</groupId>
<artifactId>phosphor-driver</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>edu.gmu.swe.phosphor</groupId>
<artifactId>phosphor-jigsaw-javaagent</artifactId>
Expand Down Expand Up @@ -107,15 +112,6 @@
</plugins>
</build>
<profiles>
<profile>
<id>java8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<properties>
<isJava8>true</isJava8>
</properties>
</profile>
<profile>
<id>dacapo</id>
<build>
Expand Down Expand Up @@ -145,9 +141,8 @@
<arguments>
<argument>${project.build.directory}</argument>
<argument>${phosphor.jar}</argument>
<argument>${phosphor.jar}</argument>
<argument>${phosphor.driver.jar}</argument>
<argument>${data.flow.java}/bin/java</argument>
<argument>${isJava8}</argument>
</arguments>
</configuration>
</execution>
Expand Down
46 changes: 22 additions & 24 deletions integration-tests/runDacapo.sh
Original file line number Diff line number Diff line change
@@ -1,53 +1,51 @@
#!/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
#if you want to run them, copy the jce.jar file from an openjdk distribution of the same version into your hotspot jvm that you are going to instrument before instrumenting it.
# (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
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6919edd

Please sign in to comment.