diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/README.txt ./README.txt
--- /usr/share/benchmarks/SPECjbb2005/README.txt 2006-12-18 14:26:39.000000000 +1100
+++ ./README.txt 2007-12-19 12:25:46.000000000 +1100
@@ -1,3 +1,21 @@
+This is pseudojbb2005.
+Below is the original README for SPECjbb2005.
+It has been modified in a number of ways:
+ - to run for a fixed number of transactions
+
+Additionally modified by Robin Garner, A.N.U.
+ - to run a number of iterations of the benchmark (specified using
+ the "-n" flag)
+ - To call a user-defined callback method at the start end end of
+ each iteration (look for example at MMTkCallback), specified
+ by the "-c" flag.
+
+The following will run pseudojbb2005 for two iterations with 8 ware houses and 50000 transactions per warehouse:
+
+$JAVA_HOME/bin/java -cp jbb.jar:check.jbb spec.jbb.JBBmain -propfile SPECjbb-8x50000.props -n 2
+
+---
+
SPECjbb2005 (Java Server Benchmark)
Release 1.07 03/15/2006
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/SPECjbb-4x100.props ./SPECjbb-4x100.props
--- /usr/share/benchmarks/SPECjbb2005/SPECjbb-4x100.props 1970-01-01 10:00:00.000000000 +1000
+++ ./SPECjbb-4x100.props 2007-11-09 16:27:48.000000000 +1100
@@ -0,0 +1,24 @@
+# pseudojbb05 options
+
+# modify these
+input.starting_number_warehouses=4
+input.increment_number_warehouses=1
+input.ending_number_warehouses=4
+input.pseudojbb_transactions=100
+
+# keep these as is
+input.jvm_instances=1
+input.show_warehouse_detail=false
+input.include_file=SPECjbb_config.props
+input.output_directory=results
+input.suite=SPECjbb
+input.log_level=INFO
+input.deterministic_random_seed=false
+
+# these apply for multi-jvm mode only (seconds)
+input.per_jvm_warehouse_rampup=3
+input.per_jvm_warehouse_rampdown=20
+
+# ramp_up_seconds must be zero, measurement_seconds gets ignored
+input.ramp_up_seconds=0
+input.measurement_seconds=20
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/SPECjbb-4x2000.props ./SPECjbb-4x2000.props
--- /usr/share/benchmarks/SPECjbb2005/SPECjbb-4x2000.props 1970-01-01 10:00:00.000000000 +1000
+++ ./SPECjbb-4x2000.props 2007-11-09 16:27:48.000000000 +1100
@@ -0,0 +1,24 @@
+# pseudojbb05 options
+
+# modify these
+input.starting_number_warehouses=4
+input.increment_number_warehouses=1
+input.ending_number_warehouses=4
+input.pseudojbb_transactions=2000
+
+# keep these as is
+input.jvm_instances=1
+input.show_warehouse_detail=false
+input.include_file=SPECjbb_config.props
+input.output_directory=results
+input.suite=SPECjbb
+input.log_level=INFO
+input.deterministic_random_seed=false
+
+# these apply for multi-jvm mode only (seconds)
+input.per_jvm_warehouse_rampup=3
+input.per_jvm_warehouse_rampdown=20
+
+# ramp_up_seconds must be zero, measurement_seconds gets ignored
+input.ramp_up_seconds=0
+input.measurement_seconds=20
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/SPECjbb-4x50000.props ./SPECjbb-4x50000.props
--- /usr/share/benchmarks/SPECjbb2005/SPECjbb-4x50000.props 1970-01-01 10:00:00.000000000 +1000
+++ ./SPECjbb-4x50000.props 2007-11-09 16:27:48.000000000 +1100
@@ -0,0 +1,24 @@
+# pseudojbb05 options
+
+# modify these
+input.starting_number_warehouses=4
+input.increment_number_warehouses=1
+input.ending_number_warehouses=4
+input.pseudojbb_transactions=50000
+
+# keep these as is
+input.jvm_instances=1
+input.show_warehouse_detail=false
+input.include_file=SPECjbb_config.props
+input.output_directory=results
+input.suite=SPECjbb
+input.log_level=INFO
+input.deterministic_random_seed=false
+
+# these apply for multi-jvm mode only (seconds)
+input.per_jvm_warehouse_rampup=3
+input.per_jvm_warehouse_rampdown=20
+
+# ramp_up_seconds must be zero, measurement_seconds gets ignored
+input.ramp_up_seconds=0
+input.measurement_seconds=20
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/SPECjbb-8x100.props ./SPECjbb-8x100.props
--- /usr/share/benchmarks/SPECjbb2005/SPECjbb-8x100.props 1970-01-01 10:00:00.000000000 +1000
+++ ./SPECjbb-8x100.props 2007-11-09 16:27:48.000000000 +1100
@@ -0,0 +1,24 @@
+# pseudojbb05 options
+
+# modify these
+input.starting_number_warehouses=8
+input.increment_number_warehouses=1
+input.ending_number_warehouses=8
+input.pseudojbb_transactions=100
+
+# keep these as is
+input.jvm_instances=1
+input.show_warehouse_detail=false
+input.include_file=SPECjbb_config.props
+input.output_directory=results
+input.suite=SPECjbb
+input.log_level=INFO
+input.deterministic_random_seed=false
+
+# these apply for multi-jvm mode only (seconds)
+input.per_jvm_warehouse_rampup=3
+input.per_jvm_warehouse_rampdown=20
+
+# ramp_up_seconds must be zero, measurement_seconds gets ignored
+input.ramp_up_seconds=0
+input.measurement_seconds=20
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/SPECjbb-8x10000.props ./SPECjbb-8x10000.props
--- /usr/share/benchmarks/SPECjbb2005/SPECjbb-8x10000.props 1970-01-01 10:00:00.000000000 +1000
+++ ./SPECjbb-8x10000.props 2007-11-09 12:50:33.000000000 +1100
@@ -0,0 +1,24 @@
+# pseudojbb05 options
+
+# modify these
+input.starting_number_warehouses=8
+input.increment_number_warehouses=1
+input.ending_number_warehouses=8
+input.pseudojbb_transactions=10000
+
+# keep these as is
+input.jvm_instances=1
+input.show_warehouse_detail=false
+input.include_file=SPECjbb_config.props
+input.output_directory=results
+input.suite=SPECjbb
+input.log_level=INFO
+input.deterministic_random_seed=false
+
+# these apply for multi-jvm mode only (seconds)
+input.per_jvm_warehouse_rampup=3
+input.per_jvm_warehouse_rampdown=20
+
+# ramp_up_seconds must be zero, measurement_seconds gets ignored
+input.ramp_up_seconds=0
+input.measurement_seconds=20
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/SPECjbb-8x50000.props ./SPECjbb-8x50000.props
--- /usr/share/benchmarks/SPECjbb2005/SPECjbb-8x50000.props 1970-01-01 10:00:00.000000000 +1000
+++ ./SPECjbb-8x50000.props 2007-11-09 16:27:48.000000000 +1100
@@ -0,0 +1,24 @@
+# pseudojbb05 options
+
+# modify these
+input.starting_number_warehouses=8
+input.increment_number_warehouses=1
+input.ending_number_warehouses=8
+input.pseudojbb_transactions=50000
+
+# keep these as is
+input.jvm_instances=1
+input.show_warehouse_detail=false
+input.include_file=SPECjbb_config.props
+input.output_directory=results
+input.suite=SPECjbb
+input.log_level=INFO
+input.deterministic_random_seed=false
+
+# these apply for multi-jvm mode only (seconds)
+input.per_jvm_warehouse_rampup=3
+input.per_jvm_warehouse_rampdown=20
+
+# ramp_up_seconds must be zero, measurement_seconds gets ignored
+input.ramp_up_seconds=0
+input.measurement_seconds=20
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/build.xml ./build.xml
--- /usr/share/benchmarks/SPECjbb2005/build.xml 2006-12-18 14:26:39.000000000 +1100
+++ ./build.xml 2007-11-08 13:45:13.000000000 +1100
@@ -20,6 +20,9 @@
+
+
+
@@ -42,7 +45,7 @@
Binary files /usr/share/benchmarks/SPECjbb2005/check.jar and ./check.jar differ
Binary files /usr/share/benchmarks/SPECjbb2005/jbb.jar and ./jbb.jar differ
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/runjbb ./runjbb
--- /usr/share/benchmarks/SPECjbb2005/runjbb 1970-01-01 10:00:00.000000000 +1000
+++ ./runjbb 2007-11-08 16:43:45.000000000 +1100
@@ -0,0 +1,33 @@
+BMS=build/dist
+VM=$1
+HEAP=${2:-256}
+SIZE=${3:-4x50000}
+PROCS=${4:-all}
+INTERVAL=32m
+shift 4
+OPTS=$*
+
+JIKESRVM=$HOME/jikesrvm/trunk/dist/production_ia32-linux/rvm
+XML=-X:gc:xmlStats=true
+COMPILER="-X:aos:initial_compiler=base -X:aos:enable_recompilation=false"
+RVMEXTRA=-X:processors=$PROCS
+RVMCALLBACK="-c MMTkCallback"
+
+case $VM in
+ measure) JAVA="$JIKESRVM -X:gc:stressFactor=$INTERVAL -X:gc:cohortSize=$INTERVAL $XML $COMPILER $RVMEXTRA $OPTS" ;;
+ markcons) JAVA="$JIKESRVM -X:gc:fixedNursery=4m $XML $COMPILER $RVMEXTRA $OPTS" ;;
+ rvm) JAVA="$JIKESRVM $COMPILER $RVMEXTRA $OPTS" ;;
+ jdk15) JAVA=/opt/jdk1.5.0_07/bin/java ;;
+ jdk16) JAVA=/opt/jdk1.6.0/bin/java ;;
+ j9) JAVA=/opt/ibm-java2-i386-50/bin/java ;;
+ *) echo "unrecognised java vm \"$1\""
+ exit 1;;
+esac
+
+PROPS=SPECjbb-${SIZE}.props
+
+export DISPLAY=:0.0
+( cd $BMS
+ echo $JAVA >> /dev/stderr
+ $JAVA -Xms${HEAP}m -Xmx${HEAP}m -cp jbb.jar:check.jar spec.jbb.JBBmain -propfile $PROPS -n 2 $RVMCALLBACK
+)
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/src/MMTkCallback.java ./src/MMTkCallback.java
--- /usr/share/benchmarks/SPECjbb2005/src/MMTkCallback.java 1970-01-01 10:00:00.000000000 +1000
+++ ./src/MMTkCallback.java 2007-11-09 16:08:07.000000000 +1100
@@ -0,0 +1,63 @@
+
+
+
+/*
+ * (C) Copyright Department of Computer Science,
+ * Australian National University. 2005
+ */
+
+import harness.Callback;
+
+import java.lang.reflect.Method;
+
+public class MMTkCallback extends Callback {
+ private final String callbackClass = "org.mmtk.plan.Plan";
+
+ private Method beginMethod, endMethod;
+ private boolean found = false;
+
+ /**
+ * Locate the class where the harness resides in various versions
+ * of JikesRVM, and then retain Method references to the correct one.
+ */
+ public MMTkCallback() {
+ try {
+ Class> harnessClass = Class.forName(callbackClass);
+ beginMethod = harnessClass.getMethod("harnessBegin", (Class[])null);
+ endMethod = harnessClass.getMethod("harnessEnd", (Class[])null);
+ found = true;
+ } catch (ClassNotFoundException c) {
+ System.err.println("Could not locate "+callbackClass);
+ } catch (SecurityException e) {
+ System.err.println("harness method of "+callbackClass+" is not accessible");
+ } catch (NoSuchMethodException e) {
+ System.err.println("harness method of "+callbackClass+" not found");
+ }
+ if (!found)
+ System.err.println("WARNING: MMTk harness not found.");
+ }
+
+ @Override
+ public void start() {
+ super.start();
+ if (!found) return;
+ try {
+ beginMethod.invoke(null, (Object[])null);
+ } catch (Exception e) {
+ throw new RuntimeException("Error running MMTk harnessBegin",e);
+ }
+ }
+
+ @Override
+ public void stop() {
+ if (found) {
+ try {
+ endMethod.invoke(null, (Object[])null);
+ } catch (Exception e) {
+ throw new RuntimeException("Error running MMTk harnessEnd",e);
+ }
+ }
+ super.stop();
+ }
+}
+
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/src/harness/Callback.java ./src/harness/Callback.java
--- /usr/share/benchmarks/SPECjbb2005/src/harness/Callback.java 1970-01-01 10:00:00.000000000 +1000
+++ ./src/harness/Callback.java 2007-11-09 16:11:36.000000000 +1100
@@ -0,0 +1,42 @@
+package harness;
+
+public class Callback {
+ private static final long MS = 1000000;
+ long startTime = 0;
+
+ public void startWarmup() {
+ salutation(false);
+ startTime = System.nanoTime();
+ }
+ public void stopWarmup() {
+ long duration = System.nanoTime() - startTime;
+ message(true,true,duration/MS);
+ }
+ public void start() {
+ salutation(false);
+ startTime = System.nanoTime();
+ }
+ public void stop() {
+ long duration = System.nanoTime() - startTime;
+ message(true,false,duration/MS);
+ }
+
+ private void salutation(boolean warmup) {
+ System.err.print("===== pseudojbb 2005 starting ");
+ System.err.println((warmup ? "warmup " : "") + "=====");
+ System.err.flush();
+ }
+
+ private void message(boolean valid, boolean warmup, long elapsed) {
+ System.err.print("===== pseudojbb 2005");
+ if (valid) {
+ System.err.print(warmup ? " completed warmup " : " PASSED ");
+ System.err.print("in " + elapsed + " msec ");
+ } else {
+ System.err.print(" FAILED " + (warmup ? "warmup " : ""));
+ }
+ System.err.println("=====");
+ System.err.flush();
+
+ }
+}
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/src/spec/jbb/Company.java ./src/spec/jbb/Company.java
--- /usr/share/benchmarks/SPECjbb2005/src/spec/jbb/Company.java 2006-12-18 14:26:39.000000000 +1100
+++ ./src/spec/jbb/Company.java 2006-12-10 09:39:08.000000000 +1100
@@ -45,7 +45,7 @@
// timing variables:
private long rampup_time;
- private long measurement_time;
+ private long pseudojbbTransactions;
private TimerData companyTimerData;
@@ -222,14 +222,14 @@
}
public synchronized void startAutomated(short inWarehouseId,
- int rampup_time, int measurement_time) {
+ int rampup_time, int pseudojbbTransactions) {
companyTimerData.zeroTimerData();
this.rampup_time = rampup_time;
- this.measurement_time = measurement_time;
+ this.pseudojbbTransactions = pseudojbbTransactions;
TimerData warehouseTimerData = getTimerDataPtr(inWarehouseId);
warehouseTimerData.zeroTimerData();
warehouseTimerData.setRampUpTime(rampup_time);
- warehouseTimerData.setMeasurementTime(measurement_time);
+ warehouseTimerData.setPseudojbbTransactions(pseudojbbTransactions);
}
public synchronized void startValidation(short inWarehouseId) {
@@ -443,15 +443,24 @@
System.out.println(msg); // display rampup start time
JBButil.SecondsToSleep((int) rampup_time);
}
- if (measurement_time > 0) {
+ if (pseudojbbTransactions > 0) {
msg = "Timing Measurement began " + new Date().toString() + " for "
- + df.format(measurement_time / 60.) + " minutes";
+ + pseudojbbTransactions + " transactions per thread";
setrunMode(runModes.RECORDING);
start_time = System.currentTimeMillis();
JBButil.getLog().info(msg);
System.out.println(msg); // display start time
// Wait while user threads do the recorded run
- JBButil.SecondsToSleep((int) measurement_time);
+ System.out.println("pseudojbb waiting for threads");
+ synchronized (threadsDoneCountMonitor) {
+ while (threadsDoneCount != MaxWarehouses) {
+ try {
+ threadsDoneCountMonitor.wait();
+ }
+ catch (InterruptedException e) {
+ }
+ }
+ }
}
end_time = System.currentTimeMillis();
msg = "Timing Measurement ended " + new Date().toString();
@@ -471,15 +480,7 @@
setrunMode(runModes.RAMP_DOWN);
elapsed_time = end_time - start_time;
System.out.println("");
- synchronized (threadsDoneCountMonitor) {
- while (threadsDoneCount != MaxWarehouses) {
- try {
- threadsDoneCountMonitor.wait();
- }
- catch (InterruptedException e) {
- }
- }
- }
+ System.out.println("pseudojbb ramped down");
setrunMode(runModes.STOP);
synchronized (stopThreadsCountMonitor) {
while (stopThreadsCount != MaxWarehouses) {
@@ -490,6 +491,7 @@
}
}
}
+ System.out.println("pseudojbb stopped");
// print results
outPropFile.println(propPrefix + "warehouses=" + MaxWarehouses);
if (JBBmain.multiJVMMode) {
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/src/spec/jbb/JBBProperties.java ./src/spec/jbb/JBBProperties.java
--- /usr/share/benchmarks/SPECjbb2005/src/spec/jbb/JBBProperties.java 2006-12-18 14:26:39.000000000 +1100
+++ ./src/spec/jbb/JBBProperties.java 2007-11-08 16:45:31.000000000 +1100
@@ -46,6 +46,8 @@
public boolean showWarehouseDetail = false;
+ public int pseudojbbTransactions;
+
public int startingNumberWarehouses;
public int incrementNumberWarehouses;
@@ -263,38 +265,25 @@
if (val != null) {
tmpValue = Integer.parseInt(val);
if (tmpValue == 0) {
- tmpValue = Runtime.getRuntime().availableProcessors();
+ expectedPeakWarehouse = Runtime.getRuntime().availableProcessors();
if (jvm_instances > 1 && tmpValue > 1)
- expectedPeakWarehouse = Runtime.getRuntime()
- .availableProcessors()
+ expectedPeakWarehouse = Runtime.getRuntime().availableProcessors()
/ jvm_instances;
else
- expectedPeakWarehouse = Runtime.getRuntime()
- .availableProcessors();
+ expectedPeakWarehouse = Runtime.getRuntime().availableProcessors();
}
else{
- if(tmpValue == Runtime.getRuntime().availableProcessors()){
- System.out.println("Warning: Explicitly setting " + prefix + "expected_peak_warehouse");
- System.out.println("requires submission and review by SPEC in order to publish the result.");
- }
expectedPeakWarehouse = tmpValue;
}
}
else {
- tmpValue = Runtime.getRuntime().availableProcessors();
- if (jvm_instances > 1 && tmpValue > 1)
- expectedPeakWarehouse = Runtime.getRuntime()
- .availableProcessors()
- / jvm_instances;
- else
- expectedPeakWarehouse = Runtime.getRuntime()
- .availableProcessors();
+ expectedPeakWarehouse = 4;
}
PropertiesForBatch.put(prefix + "expected_peak_warehouse", String
.valueOf(expectedPeakWarehouse));
val = getRequiredProperty(prefix + "deterministic_random_seed");
if (val != null) {
- deterministicRandomSeed = Boolean.parseBoolean(val);
+ deterministicRandomSeed = val.equals("true");
}
else {
retval = false;
@@ -362,6 +351,10 @@
retval = false;
}
}
+ val = getOptionalProperty(prefix + "pseudojbb_transactions");
+ if (val != null) {
+ pseudojbbTransactions = Integer.parseInt(val);
+ }
val = getOptionalProperty(prefix + "starting_number_warehouses");
if (val != null) {
startingNumberWarehouses = Integer.parseInt(val);
@@ -456,6 +449,8 @@
// System.out.println(" forcegc = " + forceGC);
// System.out.println("steady_state = " + steadyStateFlag);
// System.out.println("screen_write = " + screenWriteFlag);
+ System.out.println(" pseudojbb_transactions = "
+ + pseudojbbTransactions);
if (sequenceOfWarehouses == null) {
System.out.println(" starting_number_warehouses = "
+ startingNumberWarehouses);
@@ -495,7 +490,8 @@
"suite", "log_level", "warehouse_population",
"orderlines_per_order", "ramp_up_seconds",
"measurement_seconds", "wait_time_percent", "screen_write",
- "steady_state", "starting_number_warehouses",
+ "steady_state", "pseudojbb_transactions",
+ "starting_number_warehouses",
"increment_number_warehouses", "ending_number_warehouses",
"sequence_of_number_of_warehouses", "include_file",
"override_itemtable_size", "uniform_random_items",
@@ -562,10 +558,7 @@
String svalue = PropertiesForBatch.getProperty(propsKey);
outRawFile.println(propsKey + "=" + svalue);
}
- Integer procsAvail = new Integer(Runtime.getRuntime()
- .availableProcessors());
- outRawFile.println("config.sw.procsAvailtoJava" + "="
- + procsAvail.toString());
+ outRawFile.println("config.sw.procsAvailtoJava" + "=" + 4);
}
return retval;
}
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/src/spec/jbb/JBBmain.java ./src/spec/jbb/JBBmain.java
--- /usr/share/benchmarks/SPECjbb2005/src/spec/jbb/JBBmain.java 2006-12-18 14:26:39.000000000 +1100
+++ ./src/spec/jbb/JBBmain.java 2007-11-08 13:02:15.000000000 +1100
@@ -10,6 +10,8 @@
import spec.jbb.validity.Check;
import spec.jbb.validity.digest;
+import harness.Callback;
+
import java.io.*;
import java.util.*;
import java.util.logging.ConsoleHandler;
@@ -21,6 +23,7 @@
import spec.reporter.*;
import java.net.Socket;
+
public class JBBmain implements Runnable {
// This goes right after each class/interface statement
static final String COPYRIGHT = "SPECjbb2005,"
@@ -114,6 +117,10 @@
JBBProperties prop;
+ /* pseudojbb2005 mods */
+ static private int harnessIteration = 1;
+ static private Callback harness = new Callback();
+
public void run() {
TransactionManager transMgr = null;
// Vector.remove(n) method returns n-element and deletes it
@@ -165,7 +172,7 @@
}
public void DoARun(Company myCompany, short number_of_warehouses,
- int rampup_time, int measurement_time) {
+ int rampup_time, int pseudojbbTransactions) {
JBButil.getLog().entering("spec.jbb.JBBmain", "DoARun");
short whID;
testnum++;
@@ -175,7 +182,8 @@
myCompany.prepareForStart();
try {
for (whID = 1; whID <= number_of_warehouses; whID++) {
- myCompany.startAutomated(whID, rampup_time, measurement_time);
+ myCompany.startAutomated(whID, rampup_time,
+ pseudojbbTransactions);
startJBBthread(whID);
String msg = " started user thread for Warehouse " + whID;
System.out.println(msg);
@@ -269,6 +277,7 @@
cur_warehouses = num_wh;
}
}
+ myCompany = null; // RJG
JBButil.getLog().exiting("spec.jbb.JBBmain", "DOIT");
}
@@ -310,7 +319,7 @@
}
else {
DoARun(myCompany, (short) myCompany.getMaxWarehouses(), 0,
- prop.measurementSeconds);
+ prop.pseudojbbTransactions);
}
if (prop.checkThroughput) {
TimerData companyTimerDataPtr = myCompany
@@ -326,7 +335,56 @@
return true;
}
- public String commandLineParser(String args[]) {
+ public String newImprovedCommandLineParser(String args[]) {
+ String propsFileName = defaultPropsFileName;
+ for (int i=0; i < args.length; i++) {
+ if (args[i].charAt(0) == '-') {
+ if (args[i].equals("-id")) {
+ i++;
+ if (i == args.length) {
+ System.out.println("Missing instance ID");
+ return null;
+ }
+ JBBmain.instanceId = Integer.parseInt(args[i]);
+ } else if (args[i].equals("-propfile")) {
+ i++;
+ if (i == args.length) {
+ System.out.println("Missing iproperties file name");
+ return null;
+ }
+ propsFileName = args[i];
+ } else if (args[i].equals("-n")) {
+ i++;
+ if (i == args.length) {
+ System.out.println("Missing number of iterations after \"-n\" flag");
+ return null;
+ }
+ JBBmain.harnessIteration = Integer.valueOf(args[i]);
+ } else if (args[i].equals("-c")) {
+ i++;
+ if (i == args.length) {
+ System.out.println("Missing callback class name after \"-c\" flag");
+ return null;
+ }
+ try {
+ Class harnessClass = (Class)Class.forName(args[i]);
+ JBBmain.harness = harnessClass.newInstance();
+ } catch (Exception e) {
+ throw new RuntimeException("Exception thrown while creating harness class "+args[i],e);
+ }
+ } else {
+ System.out.println("Unrecognized parameter "+args[i]);
+ return null;
+ }
+ } else {
+ System.out.println("Unrecognized parameter "+args[i]);
+ return null;
+ }
+ }
+ return propsFileName;
+ }
+
+ private String commandLineParser(String args[]) {
String s = null;
if (args.length == 0) {
s = defaultPropsFileName;
@@ -532,7 +590,8 @@
tfile = new File("JBB.temp.scratch2");
tfile.delete();
main = new JBBmain();
- main.prop = new JBBProperties(main.commandLineParser(args));
+ //main.prop = new JBBProperties(main.commandLineParser(args));
+ main.prop = new JBBProperties(main.newImprovedCommandLineParser(args));
if (!main.prop.getProps()) {
System.out
.println("ERROR: Properties File error; please start again");
@@ -701,7 +760,15 @@
return;
}
}
+ for (int i=1; i < harnessIteration; i++) {
+ harness.startWarmup();
+ main.doIt();
+ harness.stopWarmup();
+ main.flushLog();
+ }
+ harness.start();
main.doIt();
+ harness.stop();
// And again right after we are finished
main.flushLog();
if (JBBProperties.printPropertiesAndArgs) {
@@ -722,8 +789,8 @@
}
outRawFile.println();
}
- main.callReporter(output_directory, outRawFile_name, outRawPrefix,
- sequenceNumber);
+ //main.callReporter(output_directory, outRawFile_name, outRawPrefix,
+ // sequenceNumber);
outDeliveriesFile.close();
outRawFile.close();
// elian: sending FINISHED state
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/src/spec/jbb/TimerData.java ./src/spec/jbb/TimerData.java
--- /usr/share/benchmarks/SPECjbb2005/src/spec/jbb/TimerData.java 2006-12-18 14:26:39.000000000 +1100
+++ ./src/spec/jbb/TimerData.java 2006-12-10 09:39:08.000000000 +1100
@@ -73,7 +73,7 @@
private long rampup_time; // time
// to run before measuring
- private long measurement_time; // time
+ private long pseudojbbTransactions; // time
// to run while measuring
private double tpmc; // transactions
@@ -102,7 +102,7 @@
standardDeviationTime = new double[Transaction.maxTxnTypes];
coefficientOfVariationTime = new double[Transaction.maxTxnTypes];
rampup_time = 0;
- measurement_time = 0;
+ pseudojbbTransactions = 0;
useWaits = false;
tpmc = 0;
btps = 0;
@@ -138,7 +138,7 @@
standardDeviationTime = new double[Transaction.maxTxnTypes];
coefficientOfVariationTime = new double[Transaction.maxTxnTypes];
rampup_time = 0;
- measurement_time = 0;
+ pseudojbbTransactions = 0;
useWaits = false;
tpmc = 0;
btps = 0;
@@ -200,9 +200,9 @@
rampup_time = in_rampup_time;
}
- public synchronized void setMeasurementTime(long in_measurement_time) {
+ public synchronized void setPseudojbbTransactions(long in_pseudojbbTransactions) {
// convert seconds to milliseconds
- measurement_time = in_measurement_time;
+ pseudojbbTransactions = in_pseudojbbTransactions;
}
public synchronized long getRampUpTime() {
@@ -210,8 +210,8 @@
return temp;
}
- public synchronized long getMeasurementTime() {
- long temp = measurement_time;
+ public synchronized long getPseudojbbTransactions() {
+ long temp = pseudojbbTransactions;
return temp;
}
diff -uNr --exclude build --exclude bin --exclude .classpath --exclude .project --exclude .swp --exclude='*.orig' --exclude results /usr/share/benchmarks/SPECjbb2005/src/spec/jbb/TransactionManager.java ./src/spec/jbb/TransactionManager.java
--- /usr/share/benchmarks/SPECjbb2005/src/spec/jbb/TransactionManager.java 2006-12-18 14:26:39.000000000 +1100
+++ ./src/spec/jbb/TransactionManager.java 2006-12-10 09:39:08.000000000 +1100
@@ -186,7 +186,7 @@
int i = 0;
TimerData warehouseTimerDataPtr = company.getTimerDataPtr(warehouseId);
long rampup_time = warehouseTimerDataPtr.getRampUpTime();
- long measurement_time = warehouseTimerDataPtr.getMeasurementTime();
+ long pseudojbbTransactions = warehouseTimerDataPtr.getPseudojbbTransactions();
// create object to store timer data for this process
TimerData myTimerData = new TimerData();
// copy wait times from warehouseTimerData to myTimerData
@@ -206,7 +206,7 @@
catch (InterruptedException e) {
}
}
- if ((rampup_time > 0) || (measurement_time > 0)) {
+ if ((rampup_time > 0) || (pseudojbbTransactions > 0)) {
timed = true;
}
if (JBButil.getLog().isLoggable(Level.FINEST)) {
@@ -214,7 +214,7 @@
"Benchmark " + JBBmain.Version + ": warehouse "
+ warehouseId);
}
- while (this.getrunMode() != Company.runModes.STOP) {
+ for (int iTrans=0; iTrans