### specjbb is executed with one JVM running per-NUMA node in the system
### and a total heap size configured to be 80% of memory.
DIRNAME=`dirname $0`
SCRIPTDIR=`cd "$DIRNAME" && pwd`

# MM Test Parameters
export MMTESTS="specjbb"
export RUN_WARMUP=

# Profiling parameters
export RUN_NOPROFILE=yes
export RUN_FINEPROFILE=no
export RUN_COARSEPROFILE=no
export OPROFILE_REPORT_ANNOTATE=no
export OPROFILE_REPORT_CALLGRAPH=

# Fixups
if [ "`which check-confidence.pl 2> /dev/null`" = "" ]; then
	export PATH=$SCRIPTDIR/bin:$PATH
fi
if [ "`which record-extfrag 2> /dev/null`" = "" ]; then
	export PATH=$SCRIPTDIR/fraganalysis:$PATH
fi
if [ "`which oprofile_report.sh 2> /dev/null`" = "" ]; then
	export PATH=$SCRIPTDIR/vmr/bin:$PATH
fi

# Machine configuration
# Swap configuration can be one of default, partitions, swapfile, NFS
#export RUN_TUNINGS="$RUN_TUNINGS sysctl"
#export VM_DIRTY_RATIO=20
export VM_TRANSPARENT_HUGEPAGES_DEFAULT=default
export SWAP_CONFIGURATION=default
export SWAP_PARTITIONS=
export SWAP_SWAPFILE_SIZEMB=$((MEMTOTAL_BYTES/1048576))
export SWAP_NFS_MOUNT=192.168.10.7:/exports/`hostname`-swapfile
export SWAP_NBD_DEVICE=/dev/nbd0
export SWAP_NBD_HOST=mcp
export SWAP_NBD_PORT=10001

# List of monitors
export RUN_MONITOR=yes
export MONITORS_ALWAYS=
export MONITORS_PLAIN=
export MONITORS_GZIP="proc-vmstat top numa-numastat numa-meminfo numa-convergence"
export MONITORS_WITH_LATENCY="vmstat iostat"
export MONITOR_UPDATE_FREQUENCY=10

# SPECjbb - max heap 80% of memory.
# Total heap is divided between number of instances
export SPECJBB_JRE=/opt/java/jre/bin
export SPECJBB_STARTING_WAREHOUSES=1
export SPECJBB_INCREMENT_WAREHOUSES=1
export SPECJBB_ENDING_WAREHOUSES=$((NUMCPUS/NUMNODES))
export SPECJBB_JVM_INSTANCES=$NUMNODES
export SPECJBB_MAXHEAP_TOTAL_MB=$((MEMTOTAL_BYTES*8/10/1048576))
export SPECJBB_MAXHEAP=-Xmx$(($SPECJBB_MAXHEAP_TOTAL_MB/$SPECJBB_JVM_INSTANCES))m
export SPECJBB_PAGESIZES="default"
#export SPECJBB_PAGESIZES="base huge"
export SPECJBB_HUGESWITCH=-Xlp

if [ $NUMNODES -eq 1 ]; then
	echo Skipping multi-JVM test configuration on single node machine
	exit $SHELLPACK_SUCCESS
fi
