working on task mem pool, there is a crash bug, use -ooodebug-disable-task-mem-pool...
[IRC.git] / Robust / src / buildscript
index 76d63517315c578ad46377c974973ae2b9ea74c3..cfebc7aedcaf30403549c447f1df1e05eef96ba3 100755 (executable)
@@ -16,6 +16,35 @@ echo "-hybrid use fission only when it looks like a good choice"
 echo "-numa numa aware"
 echo "-eventmonitor turn on transaction event trace recording"
 echo
+echo OOOJava options
+echo -coreprof turn on profiling API
+echo -coreprof-eventwords NUM  space in words/thread for coreprof events
+echo -coreprof-checkoverflow ONLY use for debugging event overflow
+echo "-ooojava <numberofcores> <maxseseage>"
+echo -ooodebug general OOOJava debugging messages
+echo -ooodebug-disable-task-mem-pool this is a tricky module, disable for simpler runtime
+echo -rcr turn on runtime conflict resolver
+echo
+echo Disjoint Reachability Analysis options
+echo -disjoint enable analysis
+echo -disjoint-k set k-limit for heap nodes per allocation site
+echo "-disjoint-write-dots <all/final> write reach graphs for all method sols. or only final sols."
+echo -disjoint-write-initial-contexts write reach graphs for callee initial contexts from all call sites
+echo -disjoint-write-ihms write reach graphs for each call site\'s Initial Heap Model
+echo "-disjoint-alias-file <filename> <normal/tabbed> write sharing for normal human reading or LaTeX tabbed"
+echo "-disjoint-debug-callsite <callee> <caller> <visit to start> <num caps> <T/F stop after>"
+echo "  To debug call site, give callee caller symbols (ie foo) the analysis visit to start capturing, num captures to take, and whether to halt analysis after capturing"
+echo "-disjoint-debug-snap-method <method> <visit to start> <num caps> <T/F stop after>"
+echo "  To take snapshots at statements, give method symbol, the analysis visit to start capturing, num captures to take, and whether to halt analsyis after capturing"
+echo "-disjoint-dvisit-stack use stack strat to visit descriptors (tasks or methods)"
+echo -disjoint-dvisit-stack-callees-on-top alternate stack strat
+echo -disjoint-dvisit-pqueue use prio. q strat to visit descriptors
+echo -disjoint-desire-determinism set above interproc for determinism
+echo -disjoint-debug-scheduling debug when methods are scheduled for analysis
+echo 
+echo "-mlp <num cores> <max sese age> build mlp code"
+echo -mlpdebug if mlp, report progress and interim results
+echo
 echo DSM options
 echo -dsm distributed shared memory
 echo -abortreaders abort readers immediately
@@ -32,7 +61,6 @@ echo "-rawpath print out execute path information for raw version (should be use
 echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
 echo -printscheduling print out scheduling graphs
 echo -printschedulesim print out scheduling simulator result graphs
-echo -abcclose close the array boundary check
 echo "-tilera_bme generate tilera version binary for Bare Mental Environment (should be used together with -multicore"
 echo "-tilera_zlinux generate tilera version binary for Zero-Overhead Linux with multi-process mode (should be used together with -multicore"
 echo "-tileraconfig config tilera simulator/pci as nxm (should be used together with -tilera)"
@@ -48,12 +76,18 @@ echo "-gccache_local set the gc shared memory cache strategy as local (should be
 echo "-gccache_ran set the gc shared memory cache strategy as random (should be used together with -multicoregc)"
 echo "-gccontroller_near set the gc shared memory to use the nearest controller for each core (should be used together with -multicoregc)"
 echo "-gccontroller_remote set the gc shared memory to use a remote controller for each core (should be used together with -multicoregc)"
+echo "-gcsmallpagesize(2) set the gc shared memory to use small page size (should be used together with -multicoregc)"
+echo "-gclargepagesize set the gc shared memory to use large page size (should be used together with -multicoregc)"
+echo "-gclargesharedheap(2) set the gc shared memory as large (should be used together with -multicoregc)"
+echo "-gccacheadapt setup as cacheadaptable mode (should be used together with -multicoregc)"
 echo -gcprofile build with gcprofile options
-echo -gcprofile_s build with gcprofile_s options
+echo "-tilera_memprof build the memprof version (should be used together with -tilera_xx) "
 echo -accurateprofile build with accurate profile information including pre/post task processing info
+echo -profile_interrupt build with profile information of interrupts
 echo "-useio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
 echo
 echo Other options
+echo -abcclose turnoff array boundary checks
 echo -builddir setup different build directory
 echo -robustroot set up the ROBUSTROOT to directory other than default one
 echo -readset turn on readset
@@ -63,6 +97,7 @@ echo -dmalloc link in dmalloc
 echo -64bit compile for 64 bit machine
 echo -32bit compile for 32 bit machine
 echo -joptimize java compiler optimizations
+echo -noloop turnoff loop optimizations
 echo -recover compile task code
 echo -fastcheck fast checkpointing for Bristlecone
 echo -specdir directory
@@ -74,6 +109,7 @@ echo -tagstate do tag state analysis
 echo -optional enable optional
 echo -debug generate debug symbols
 echo -prefetch do prefetch analysis
+echo -heapsize-mb NUM  set initial heap size in MB, default is 256
 echo -garbagestats Print garbage collection statistics
 echo -webinterface enable web interface
 echo -runtimedebug printout runtime debug messages
@@ -99,6 +135,7 @@ echo -help help
 }
 
 tmpbuilddirectory="tmpbuilddirectory"
+COREPROF=false;
 NUMA=false;
 SANDBOX=false;
 ABORTREADERS=false;
@@ -119,12 +156,14 @@ NOJAVA=false
 CHECKFLAG=false
 RECOVERFLAG=false
 MLP_ON=false
+RCR=false
 MLPDEBUG=false
 MULTICOREFLAG=false
 RAWFLAG=false
 TILERAFLAG=false
 TILERABMEFLAG=false
 TILERAZLINUXFLAG=false
+TILERAMEMPROFFLAG=false
 TILERACONFIG=''
 CACHEFLUSHFLAG=false
 RAWCONFIG=''
@@ -134,6 +173,7 @@ PROFILEFLAG=false
 GCPROFILEFLAG=false
 GCPROFILESFLAG=false
 ACCURATEPROFILEFLAG=false
+PROFILEINTERRUPTFLAG=false
 USEIOFLAG=false
 INTERRUPTFLAG=false
 THREADSIMULATEFLAG=false;
@@ -146,6 +186,16 @@ GCCACHELOCALFLAG=false;
 GCCACHERANFLAG=false;
 GCCONTROLLERNEARFLAG=false;
 GCCONTROLLERREMOTEFLAG=false;
+GCSMALLPAGESIZEFLAG=false;
+GCLARGEPAGESIZEFLAG=false;
+GCLARGEPAGESIZE2FLAG=false;
+GCLARGESHAREDHEAPFLAG=false;
+GCSMALLPAGESIZEFLAG2=false;
+GCLARGESHAREDHEAPFLAG2=false;
+GCCACHEADAPTFLAG=false
+GCCACHEADAPTPOLICYFLAG=false
+GCCACHEADAPTPOLICY=''
+GCCACHESAMPLINGFLAG=false
 USEDMALLOC=false
 THREADFLAG=false
 FASTCHECK=false
@@ -159,8 +209,8 @@ OPTIONALFLAG=false
 EXITAFTERANALYSIS=false
 ASSEMBLY=false
 GCCORES=''
-GC1COREFLAG=false
 TILERAN1COREFLAG=false
+TILERA56COREFLAG=false
 
 if [[ -z $1 ]]
 then
@@ -312,6 +362,9 @@ GCPROFILESFLAG=true
 elif [[ $1 = '-accurateprofile' ]]
 then
 ACCURATEPROFILEFLAG=true
+elif [[ $1 = '-profile_interrupt' ]]
+then
+PROFILEINTERRUPTFLAG=true
 elif [[ $1 = '-useio' ]]
 then
 USEIOFLAG=true
@@ -334,16 +387,16 @@ JAVAOPTS="$JAVAOPTS -numcore $2"
 if [[ "$2" -gt "1" ]]
 then
 TILERAN1COREFLAG=true
+if [[ "$2" -eq "56" ]]
+then
+TILERA56COREFLAG=true
+fi
 fi
 shift
 elif [[ $1 = '-numcore4gc' ]]
 then
 JAVAOPTS="$JAVAOPTS -numcore4gc $2"
 GCCORES="GC_$2"
-if [[ "$2" -eq "1" ]]
-then
-GC1COREFLAG=true
-fi
 shift
 elif [[ $1 = '-raw' ]]
 then
@@ -357,6 +410,9 @@ elif [[ $1 = '-tilera_zlinux' ]]
 then
 TILERAFLAG=true
 TILERAZLINUXFLAG=true
+elif [[ $1 = '-tilera_memprof' ]]
+then
+TILERAMEMPROFFLAG=true
 elif [[ $1 = '-tileraconfig' ]]
 then
 TILERACONFIG="$2"
@@ -406,6 +462,35 @@ GCCONTROLLERNEARFLAG=true
 elif [[ $1 = '-gccontroller_remote' ]]
 then
 GCCONTROLLERREMOTEFLAG=true
+elif [[ $1 = '-gcsmallpagesize' ]]
+then
+GCSMALLPAGESIZEFLAG=true
+elif [[ $1 = '-gcsmallpagesize2' ]]
+then
+GCSMALLPAGESIZEFLAG2=true
+elif [[ $1 = '-gclargepagesize' ]]
+then
+GCLARGEPAGESIZEFLAG=true
+elif [[ $1 = '-gclargepagesize2' ]]
+then
+GCLARGEPAGESIZE2FLAG=true
+elif [[ $1 = '-gclargesharedheap' ]]
+then
+GCLARGESHAREDHEAPFLAG=true
+elif [[ $1 = '-gclargesharedheap2' ]]
+then
+GCLARGESHAREDHEAPFLAG2=true
+elif [[ $1 = '-gccacheadapt' ]]
+then
+GCCACHEADAPTFLAG=true
+elif [[ $1 = '-gccacheadaptpolicy' ]]
+then
+GCCACHEADAPTPOLICYFLAG=true
+GCCACHEADAPTPOLICY="$2"
+shift
+elif [[ $1 = '-gccachesampling' ]]
+then
+GCCACHESAMPLINGFLAG=true
 elif [[ $1 = '-dmalloc' ]]
 then
 USEDMALLOC=true
@@ -426,6 +511,9 @@ JAVAOPTS="$JAVAOPTS -instructionfailures"
 elif [[ $1 = '-joptimize' ]]
 then
 JAVAOPTS="$JAVAOPTS -optimize"
+elif [[ $1 = '-noloop' ]]
+then
+JAVAOPTS="$JAVAOPTS -noloop"
 elif [[ $1 = '-dcopts' ]]
 then
 JAVAOPTS="$JAVAOPTS -dcopts"
@@ -449,6 +537,37 @@ EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
 shift
 shift
 
+elif [[ $1 = '-ooodebug-disable-task-mem-pool' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DOOO_DISABLE_TASKMEMPOOL"
+
+elif [[ $1 = '-heapsize-mb' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DINITIALHEAPSIZE_MB=($2)"
+shift
+
+elif [[ $1 = '-rcr' ]]
+then
+JAVAOPTS="$JAVAOPTS -rcr"
+RCR=true
+EXTRAOPTIONS="$EXTRAOPTIONS -I$ROBUSTROOT/Runtime/oooJava"
+
+
+elif [[ $1 = '-coreprof' ]]
+then
+COREPROF=true
+JAVAOPTS="$JAVAOPTS -coreprof"
+EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF -I$ROBUSTROOT/Runtime/coreprof"
+
+elif [[ $1 = '-coreprof-eventwords' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DCP_MAXEVENTWORDS=($2)"
+shift
+
+elif [[ $1 = '-coreprof-checkoverflow' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF_CHECKOVERFLOW"
+
 elif [[ $1 = '-mlp' ]]
 then
 MLP_ON=true
@@ -538,6 +657,8 @@ done
 
 BUILDDIR="$CURDIR/$tmpbuilddirectory"
 
+BAMBOORUNTIME=$ROBUSTROOT/Runtime/bamboo
+
 cd $1
 cd $CURDIR
 shift
@@ -696,15 +817,18 @@ else
 MAKEFILE="$MAKEFILE.$RAWCONFIG"
 fi #useio version
 
-cp $ROBUSTROOT/Runtime/RAW/$MAKEFILE ./Makefile
+cp $BAMBOORUNTIME/RAW/$MAKEFILE ./Makefile
 cp ../Runtime/*.c ./
 cp ../Runtime/*.h ./
 cp ../Runtime/*.S ./
 cp ../Runtime/*.s ./
-cp ../Runtime/RAW/*.c ./
-cp ../Runtime/RAW/*.h ./
-cp ../Runtime/RAW/*.S ./
-cp ../Runtime/RAW/*.s ./
+mkdir ./coreprof
+cp ../Runtime/coreprof/*.c ./coreprof/
+cp ../Runtime/coreprof/*.h ./coreprof/
+cp $BAMBOORUNTIME/RAW/*.c ./
+cp $BAMBOORUNTIME/RAW/*.h ./
+cp $BAMBOORUNTIME/RAW/*.S ./
+cp $BAMBOORUNTIME/RAW/*.s ./
 cp ../$tmpbuilddirectory/*.c ./
 cp ../$tmpbuilddirectory/*.h ./
 
@@ -719,18 +843,16 @@ TILERA_INDIR="BME"
 MAKEFILE="Makefile.tilera.$TILERACONFIG"
 SIMHVC="sim.hvc.$TILERACONFIG"
 PCIHVC="pci.hvc.$TILERACONFIG"
-if $GC1COREFLAG 
-then # 1-core gc
-  if $TILERAN1COREFLAG
-  then # not only with 1 core
-       PCIHVC="$PCIHVC.1gc"
-  fi
+if $TILERA56COREFLAG
+then
+  PCIHVC="$PCIHVC.56"
 fi
 elif $TILERAZLINUXFLAG
 then # TILERAZLINUXFLAG
 TILERA_INDIR="ZLinux"
 MAKEFILE="Makefile.tilera.$TILERACONFIG"
 fi
+
 mkdir $TILERADIR
 cd $TILERADIR
 make clean
@@ -738,6 +860,12 @@ rm ./*
 
 export TILERACFLAGS="-DTASK -DMULTICORE -DCLOSE_PRINT -DTILERA"
 
+if $TILERAMEMPROFFLAG
+then # not only with 1 core
+  PCIHVC="$PCIHVC.memprof"
+  TILERACFLAGS="${TILERACFLAGS} -DBAMBOO_MEMPROF"
+fi
+
 if $TILERABMEFLAG
 then # TILERABMEFLAG
 TILERACFLAGS="${TILERACFLAGS} -DTILERA_BME"
@@ -771,6 +899,11 @@ then # accurateprofile version
 TILERACFLAGS="${TILERACFLAGS} -DACCURATEPROFILE"
 fi
 
+if $PROFILEINTERRUPTFLAG
+then # profile_interrupt version
+TILERACFLAGS="${TILERACFLAGS} -DPROFILE_INTERRUPT"
+fi
+
 if $USEIOFLAG
 then # useio version
 TILERACFLAGS="${TILERACFLAGS} -DUSEIO"
@@ -836,40 +969,94 @@ then # CONTROLLER_REMOTE version
 TILERACFLAGS="${TILERACFLAGS} -DCONTROLLER_REMOTE"
 fi
 
+if $GCSMALLPAGESIZEFLAG
+then # GC_SMALLPAGESIZE version
+TILERACFLAGS="${TILERACFLAGS} -DGC_SMALLPAGESIZE"
+fi
+
+if $GCLARGEPAGESIZEFLAG
+then # GC_LARGEPAGESIZE version
+TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE"
+fi
+
+if $GCLARGEPAGESIZE2FLAG
+then # GC_LARGEPAGESIZE2 version
+TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE2"
+fi
+
+if $GCLARGESHAREDHEAPFLAG
+then # GC_LARGESHAREDHEAP version
+TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP"
+fi
+
+if $GCSMALLPAGESIZEFLAG2
+then # GC_SMALLPAGESIZE2 version
+TILERACFLAGS="${TILERACFLAGS} -DGC_SMALLPAGESIZE2"
+fi
+
+if $GCLARGESHAREDHEAPFLAG2
+then # GC_LARGESHAREDHEAP2 version
+TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP2"
+fi
+
+if $GCCACHEADAPTFLAG
+then # GC_CACHE_ADAPT version
+TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_ADAPT"
+fi
+
+if $GCCACHEADAPTPOLICYFLAG
+then # GC_CACHE_ADAPT version
+TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_ADAPT_POLICY${GCCACHEADAPTPOLICY}"
+fi
+
+if $GCCACHESAMPLINGFLAG
+then # GC_CACHE_ADAPT version
+TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_SAMPLING"
+fi
+
 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$MAKEFILE ./Makefile
 if $TILERABMEFLAG
 then # TILERABMEFLAG
 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$SIMHVC ./sim.hvc
 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$PCIHVC ./pci.hvc
+if $TILERA56COREFLAG
+then
+cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc.56 ./bamboo-vmlinux-pci.hvc.56
+else
 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc ./bamboo-vmlinux-pci.hvc
 fi
-cp ../Runtime/multicoretask.c ./
-cp ../Runtime/multicoreruntime.c ./
+fi
 cp ../Runtime/Queue.c ./
 cp ../Runtime/file.c ./
 cp ../Runtime/math.c ./
 cp ../Runtime/object.c ./
 cp ../Runtime/GenericHashtable.c ./
 cp ../Runtime/SimpleHash.c ./
-cp ../Runtime/GCSharedHash.c ./
 cp ../Runtime/ObjectHash.c ./
 cp ../Runtime/socket.c ./
 cp ../Runtime/mem.c ./
-cp ../Runtime/multicoregarbage.c ./
-cp ../Runtime/MGCHash.c ./
 cp ../Runtime/GenericHashtable.h ./
 cp ../Runtime/mem.h ./
-cp ../Runtime/multicoreruntime.h ./
 cp ../Runtime/object.h ./
 cp ../Runtime/ObjectHash.h ./
 cp ../Runtime/Queue.h ./
 cp ../Runtime/runtime.h ./
 cp ../Runtime/SimpleHash.h ./
-cp ../Runtime/GCSharedHash.h ./
-cp ../Runtime/multicoregc.h ./
-cp ../Runtime/multicoregarbage.h ./
-cp ../Runtime/multicorehelper.h ./
-cp ../Runtime/MGCHash.h ./
+mkdir ./coreprof
+cp ../Runtime/coreprof/coreprof.c ./coreprof/
+cp ../Runtime/coreprof/coreprof.h ./coreprof/
+cp $BAMBOORUNTIME/multicoretask.c ./
+cp $BAMBOORUNTIME/multicoreruntime.c ./
+cp $BAMBOORUNTIME/GCSharedHash.c ./
+cp $BAMBOORUNTIME/multicoregarbage.c ./
+cp $BAMBOORUNTIME/MGCHash.c ./
+cp $BAMBOORUNTIME/multicoreruntime.h ./
+cp $BAMBOORUNTIME/GCSharedHash.h ./
+cp $BAMBOORUNTIME/multicoregc.h ./
+cp $BAMBOORUNTIME/multicoregarbage.h ./
+cp $BAMBOORUNTIME/multicorehelper.h ./
+cp $BAMBOORUNTIME/MGCHash.h ./
+cp $BAMBOORUNTIME/multicorecache.h ./
 cp ../Tilera/Runtime/*.c ./
 cp ../Tilera/Runtime/*.h ./
 cp ../Tilera/Runtime/$TILERA_INDIR/*.c ./
@@ -878,6 +1065,10 @@ if $TILERAZLINUXFLAG
 then # TILERAZLINUXFLAG
 cp ../Tilera/Runtime/$TILERA_INDIR/*.S ./
 fi
+#if $TILERAMEMPROFFLAG
+#then # TILERAMEMPROFFLAG
+cp ../Tilera/Runtime/$TILERA_INDIR/linux_client.c ./
+#fi
 cp ../Tilera/lib/* ./
 cp ../$tmpbuilddirectory/*.c ./
 cp ../$tmpbuilddirectory/*.h ./
@@ -892,7 +1083,8 @@ INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
 
 if $MULTICOREFLAG
 then
-RUNTIMEFILE="$ROBUSTROOT/Runtime/multicoreruntime.c $ROBUSTROOT/Runtime/multicoretask.c"
+RUNTIMEFILE="$BAMBOORUNTIME/multicoreruntime.c $BAMBOORUNTIME/multicoretask.c"
+INCLUDES="$INCLUDES -I$BAMBOORUNTIME"
 else
 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
 fi
@@ -958,6 +1150,16 @@ then
 FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
 fi
 
+if $COREPROF
+then
+FILES="$FILES $ROBUSTROOT/Runtime/coreprof/coreprof.c"
+fi
+
+if $RCR
+then
+FILES="$FILES $tmpbuilddirectory/RuntimeConflictResolver.c $ROBUSTROOT/Runtime/oooJava/hashRCR.c $ROBUSTROOT/Runtime/oooJava/Queue_RCR.c" 
+fi
+
 if $MLP_ON
 then
 FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"