DIRNAME=`dirname $0`
SCRIPTDIR=`cd "$DIRNAME" && pwd`
MEMTOTAL_BYTES=`free -b | grep Mem: | awk '{print $2}'`
NUM_CPU=$(grep -c '^processor' /proc/cpuinfo)

# MM Test Parameters
export MMTESTS="specjbb"
export SKIP_WARMUP=yes

# Profiling parameters
export SKIP_NOPROFILE=no
export SKIP_FINEPROFILE=yes
export SKIP_COARSEPROFILE=yes
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 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 slabinfo"
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=$NUM_CPU
export SPECJBB_JVM_INSTANCES=1
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
