#!/bin/bash # # Usage: run_benchmarks [--fork] # # --fork: Fork the runs such that each benchmarks may use one CPU available. # # # Environment variables: # # VM - VMs to use # BENCHMARKS - Benchmarks to use # NB_RUNS - Number of runs # ADD_OPTIONS - additional SableVM options # ADD_JIT_OPTIONS - additional SableVM-jit options # DEFAULT_VM="switch switch-jit direct direct-jit inlined inlined-jit" DEFAULT_BENCHMARKS="check compress db jack javac jess mpegaudio mtrt raytrace sablecc soot" export ROOT_DIR=`pwd` export TIME_CMD="/usr/bin/time -p" export RESULTS_DIR=`pwd`/results/`date +%F_%T` export VM_BASE_NAME=$SABLEVM_WITH_JIT_LOCATION/bin/sablevm export SABLECC_JAR=./sablecc.jar export SPEC_DIR=benchmarks/package_benchmarks/SPECjvm98_no_harness if test "x$VM" = x ; then VM=$DEFAULT_VM fi export VM if test "x$BENCHMARKS" = x ; then BENCHMARKS=$DEFAULT_BENCHMARKS fi export BENCHMARKS if test x$NB_RUNS = x ; then NB_RUNS=3 fi export NB_RUNS if test x$1 = x--fork ; then FORK=yes else FORK=no fi mkdir -p $RESULTS_DIR rm -f `dirname $RESULTS_DIR`/recent ln -s $RESULTS_DIR `dirname $RESULTS_DIR`/recent for f in $BENCHMARKS; do if test $FORK = yes ; then echo Forking $f... ./run_benchmark $f & else ./run_benchmark $f fi done