5 echo -singleTM single machine committing transactions
6 echo -stmdebug STM debug
7 echo "-stmstats prints single machine commit (stm) statistics for the benchmark"
8 echo -fastmemcpy use fast memcpy
9 echo -sandbox sandbox transactions
10 echo -dcopts conflict optimizations for transactional memory
11 echo -transstats generates transaction stats on commits and aborts
12 echo -inlineatomic depth inline methods inside of transactions to specified depth
13 echo "-stmarray partial array treatment"
14 echo "-dualview dual view of arrays"
15 echo "-hybrid use fission only when it looks like a good choice"
16 echo "-numa numa aware"
17 echo "-eventmonitor turn on transaction event trace recording"
20 echo -coreprof, turn on profiling API
21 echo -coreprof-eventwords NUM, space in words/thread for coreprof events
22 echo -coreprof-checkoverflow, ONLY use for debugging event overflow
23 echo -coreprof-enable EVENTNAME, only enable desired events to reduce overhead
24 echo EVENTNAME can be: cpe_main, cpe_runmalloc, cpe_runfree, cpe_poolalloc, cpe_count_poolalloc, cpe_count_poolreuse, cpe_workschedgrab, cpe_taskdispatch, cpe_preparememq, cpe_taskexecute, cpe_taskretire, cpe_taskstallvar, cpe_taskstallmem
25 echo "-ooojava <numberofcores> <maxseseage>"
26 echo -ooodebug general OOOJava debugging messages
27 echo -ooodebug-disable-task-mem-pool this is a tricky module, disable for simpler runtime
28 echo -mempool-detect-misuse turn on to find code misusing pool-allocated records
29 echo -rcr turn on runtime conflict resolver
30 echo -squeue use single queue
31 echo -corepin use core pinning
32 echo -nostalltr turn off RCR traversers that only handle conflicts between task and stallsite
34 echo Disjoint Reachability Analysis options
35 echo -disjoint enable analysis
36 echo -disjoint-k set k-limit for heap nodes per allocation site
37 echo "-disjoint-write-dots <all/final> write reach graphs for all method sols. or only final sols."
38 echo -disjoint-write-initial-contexts write reach graphs for callee initial contexts from all call sites
39 echo -disjoint-write-ihms write reach graphs for each call site\'s Initial Heap Model
40 echo "-disjoint-alias-file <filename> <normal/tabbed> write sharing for normal human reading or LaTeX tabbed"
41 echo "-disjoint-debug-callsite <callee> <caller> <visit to start> <num caps> <T/F stop after>"
42 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"
43 echo "-disjoint-debug-snap-method <method> <visit to start> <num caps> <T/F stop after>"
44 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"
45 echo "-disjoint-dvisit-stack use stack strat to visit descriptors (tasks or methods)"
46 echo -disjoint-dvisit-stack-callees-on-top alternate stack strat
47 echo -disjoint-dvisit-pqueue use prio. q strat to visit descriptors
48 echo -disjoint-desire-determinism set above interproc for determinism
49 echo -disjoint-debug-scheduling debug when methods are scheduled for analysis
51 echo "-mlp <num cores> <max sese age> build mlp code"
52 echo -mlpdebug if mlp, report progress and interim results
55 echo -dsm distributed shared memory
56 echo -abortreaders abort readers immediately
57 echo -trueprob double - probabiltiy of true branch
58 echo -dsmcaching -enable caching in dsm runtime
60 echo BAMBOO Multicore options
61 echo -scheduling do task scheduling
62 echo "-distributioninfo execute to collect distribution info for simulated annealing in multi-core version"
63 echo "-disall execute to collect whole distribution"
64 echo "-disstart specify the start number of distribution information collection"
65 echo -multicore generate multi-core version binary
66 echo "-numcore set the number of cores (should be used together with -multicore), defaultly set as 1"
67 echo "-cacheflush enable cache flush in raw version binary (should be used togethere with -raw)"
68 echo "-interrupt generate raw version binary with interruption (should be used togethere with -raw)"
69 echo "-rawpath print out execute path information for raw version (should be used together with -raw)"
70 echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
71 echo -printscheduling print out scheduling graphs
72 echo -printschedulesim print out scheduling simulator result graphs
73 echo "-tilera_bme generate tilera version binary for Bare Mental Environment (should be used together with -multicore"
74 echo "-tilera_zlinux generate tilera version binary for Zero-Overhead Linux with multi-process mode (should be used together with -multicore"
75 echo "-tileraconfig config tilera simulator/pci as nxm (should be used together with -tilera)"
76 echo "-raw generate raw version binary (should be used together with -multicore)"
77 echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
78 echo "-tilera_memprof build the memprof version (should be used together with -tilera_xx) "
79 echo -accurateprofile build with accurate profile information including pre/post task processing info
80 echo -profile_interrupt build with profile information of interrupts
81 echo "-useio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
83 echo Multicore GC options
84 echo -multicoregc generate multi-core binary with garbage collection
85 echo "-numcore4gc set the number of cores for gc (should be used together with -multicoregc), defaultly set as 0"
86 echo "-gcmem_local set the gc shared memory allocation strategy as local (should be used together with -multicoregc)"
87 echo "-gcmem_fixed set the gc shared memory allocation strategy as fixed (should be used together with -multicoregc)"
88 echo "-gcmem_mixed set the gc shared memory allocation strategy as mixed (should be used together with -multicoregc)"
89 echo "-gcmem_global set the gc shared memory allocation strategy as global (should be used together with -multicoregc)"
90 echo "-gccache_local set the gc shared memory cache strategy as local (should be used together with -multicoregc)"
91 echo "-gccache_ran set the gc shared memory cache strategy as random (should be used together with -multicoregc)"
92 echo "-gccontroller_near set the gc shared memory to use the nearest controller for each core (should be used together with -multicoregc)"
93 echo "-gccontroller_remote set the gc shared memory to use a remote controller for each core (should be used together with -multicoregc)"
94 echo "-gcsmallpagesize(2) set the gc shared memory to use small page size (should be used together with -multicoregc)"
95 echo "-gclargepagesize set the gc shared memory to use large page size (should be used together with -multicoregc)"
96 echo "-gclargesharedheap(2) set the gc shared memory as large (should be used together with -multicoregc)"
97 echo "-gccacheadapt setup as cacheadaptable mode (should be used together with -multicoregc)"
98 echo -gcprofile build with gcprofile options
99 echo -mgc generate Multicore GC binary without task stuff
102 echo -abcclose turnoff array boundary checks
103 echo -builddir setup different build directory
104 echo -robustroot set up the ROBUSTROOT to directory other than default one
105 echo -readset turn on readset
106 echo -mac distributed shared memory mac support
107 echo -check generate check code
108 echo -dmalloc link in dmalloc
109 echo -64bit compile for 64 bit machine
110 echo -32bit compile for 32 bit machine
111 echo -joptimize java compiler optimizations
112 echo -noloop turnoff loop optimizations
113 echo -recover compile task code
114 echo -fastcheck fast checkpointing for Bristlecone
115 echo -specdir directory
116 echo -printflat print out flat representation
117 echo -selfloop task - this task cannot self loop forever
118 echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
119 echo -taskstate do task state analysis
120 echo -tagstate do tag state analysis
121 echo -optional enable optional
122 echo -debug generate debug symbols
123 echo -prefetch do prefetch analysis
124 echo -heapsize-mb NUM set initial heap size in MB, default is 256
125 echo -garbagestats Print garbage collection statistics
126 echo -webinterface enable web interface
127 echo -runtimedebug printout runtime debug messages
128 echo "-thread use support for multiple threads"
129 echo "-optimize call gcc with -O9 (optimize)"
130 echo "-nooptimize call gcc with -O0 (do not optimize)"
131 echo -curdir directory
132 echo -mainclass class with main method
134 echo -nojava do not run bristlecone compiler
135 echo -instructionfailures inject code for instructionfailures
136 echo -profile build with profile options
137 echo "-enable-assertions execute assert statements during compilation"
138 echo -justanalyze exit after compiler analyses complete
139 echo -assembly generate assembly
140 echo -recovery compile recovery code
141 echo -dsmtask support work and task class library
142 echo -recoverystats print out recovery record
143 echo -src-after-pp prints source code after preprocessor to tmp.c
147 tmpbuilddirectory="tmpbuilddirectory"
153 ROBUSTROOT=~/research/Robust/src
154 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
155 STMRUNTIME=$ROBUSTROOT/Runtime/STM/
156 DSMRECOVERYRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface_recovery/
157 REPAIRROOT=~/research/Repair/RepairCompiler/
177 TILERAZLINUXFLAG=false
178 TILERAMEMPROFFLAG=false
187 ACCURATEPROFILEFLAG=false
188 PROFILEINTERRUPTFLAG=false
191 THREADSIMULATEFLAG=false;
192 MULTICOREGCFLAG=false;
193 GCMEMLOCALFLAG=false;
194 GCMEMFIXEDFLAG=false;
195 GCMEMMIXEDFLAG=false;
196 GCMEMGLOBALFLAG=false;
197 GCCACHELOCALFLAG=false;
198 GCCACHERANFLAG=false;
199 GCCONTROLLERNEARFLAG=false;
200 GCCONTROLLERREMOTEFLAG=false;
201 GCSMALLPAGESIZEFLAG=false;
202 GCLARGEPAGESIZEFLAG=false;
203 GCLARGEPAGESIZE2FLAG=false;
204 GCLARGESHAREDHEAPFLAG=false;
205 GCSMALLPAGESIZEFLAG2=false;
206 GCLARGESHAREDHEAPFLAG2=false;
207 GCCACHEADAPTFLAG=false
208 GCCACHEADAPTPOLICYFLAG=false
209 GCCACHEADAPTPOLICY=''
210 GCCACHESAMPLINGFLAG=false
222 EXITAFTERANALYSIS=false
225 TILERAN1COREFLAG=false
226 TILERA56COREFLAG=false
236 if [[ $1 = '-help' ]]
241 elif [[ $1 = '-justanalyze' ]]
243 EXITAFTERANALYSIS=true
245 elif [[ $1 = '-src-after-pp' ]]
249 elif [[ $1 = '-assembly' ]]
252 elif [[ $1 = '-abortreaders' ]]
255 EXTRAOPTIONS="$EXTRAOPTIONS -DABORTREADERS"
256 JAVAOPTS="$JAVAOPTS -abortreaders"
257 elif [[ $1 = '-sandbox' ]]
260 EXTRAOPTIONS="$EXTRAOPTIONS -DSANDBOX"
261 JAVAOPTS="$JAVAOPTS -sandbox"
262 elif [[ $1 = '-numa' ]]
264 EXTRAOPTIONS="$EXTRAOPTIONS -DAFFINITY -D_GNU_SOURCE"
266 elif [[ $1 = '-robustroot' ]]
270 elif [[ $1 = '-builddir' ]]
272 tmpbuilddirectory="$2"
274 elif [[ $1 = '-nojava' ]]
277 elif [[ $1 = '-eventmonitor' ]]
279 JAVAOPTS="$JAVAOPTS -eventmonitor"
281 EXTRAOPTIONS="$EXTRAOPTIONS -DEVENTMONITOR"
282 elif [[ $1 = '-garbagestats' ]]
284 EXTRAOPTIONS="$EXTRAOPTIONS -DGARBAGESTATS"
285 elif [[ $1 = '-64bit' ]]
287 EXTRAOPTIONS="$EXTRAOPTIONS -DBIT64 -m64"
288 elif [[ $1 = '-32bit' ]]
290 EXTRAOPTIONS="$EXTRAOPTIONS -m32"
291 elif [[ $1 = '-fastcheck' ]]
293 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTCHECK"
294 JAVAOPTS="$JAVAOPTS -fastcheck"
300 elif [[ $1 = '-mainclass' ]]
302 JAVAOPTS="$JAVAOPTS -mainclass $2"
304 elif [[ $1 = '-selfloop' ]]
306 JAVAOPTS="$JAVAOPTS -selfloop $2"
308 elif [[ $1 = '-excprefetch' ]]
310 JAVAOPTS="$JAVAOPTS -excprefetch $2"
312 elif [[ $1 = '-arraypad' ]]
314 JAVAOPTS="$JAVAOPTS -arraypad"
315 elif [[ $1 = '-dsm' ]]
317 JAVAOPTS="$JAVAOPTS -dsm"
319 elif [[ $1 = '-fastmemcpy' ]]
322 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTMEMCPY"
323 elif [[ $1 = '-singleTM' ]]
325 JAVAOPTS="$JAVAOPTS -singleTM"
326 EXTRAOPTIONS="$EXTRAOPTIONS -DSTM"
328 elif [[ $1 = '-stmarray' ]]
330 JAVAOPTS="$JAVAOPTS -stmarray"
331 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMARRAY"
333 elif [[ $1 = '-dualview' ]]
335 JAVAOPTS="$JAVAOPTS -dualview"
336 EXTRAOPTIONS="$EXTRAOPTIONS -DDUALVIEW"
338 elif [[ $1 = '-readset' ]]
340 JAVAOPTS="$JAVAOPTS -readset"
341 EXTRAOPTIONS="$EXTRAOPTIONS -DREADSET"
342 elif [[ $1 = '-stmdebug' ]]
344 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMDEBUG"
345 elif [[ $1 = '-stmstats' ]]
347 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMSTATS"
348 elif [[ $1 = '-stmlog' ]]
350 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMLOG"
351 elif [[ $1 = '-prefetch' ]]
353 JAVAOPTS="$JAVAOPTS -prefetch"
354 elif [[ $1 = '-transstats' ]]
356 EXTRAOPTIONS="$EXTRAOPTIONS -DTRANSSTATS"
357 elif [[ $1 = '-printflat' ]]
359 JAVAOPTS="$JAVAOPTS -printflat"
360 elif [[ $1 = '-trueprob' ]]
362 JAVAOPTS="$JAVAOPTS -trueprob $2"
364 elif [[ $1 = '-inlineatomic' ]]
366 JAVAOPTS="$JAVAOPTS -inlineatomic $2"
368 elif [[ $1 = '-mac' ]]
370 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
371 elif [[ $1 = '-squeue' ]]
373 EXTRAOPTIONS="$EXTRAOPTIONS -DSQUEUE"
374 elif [[ $1 = '-corepin' ]]
376 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPIN"
378 elif [[ $1 = '-profile' ]]
381 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
382 elif [[ $1 = '-gcprofile' ]]
385 elif [[ $1 = '-gcprofile_s' ]]
388 elif [[ $1 = '-accurateprofile' ]]
390 ACCURATEPROFILEFLAG=true
391 elif [[ $1 = '-profile_interrupt' ]]
393 PROFILEINTERRUPTFLAG=true
394 elif [[ $1 = '-useio' ]]
397 elif [[ $1 = '-taskstate' ]]
399 JAVAOPTS="$JAVAOPTS -taskstate"
400 elif [[ $1 = '-tagstate' ]]
402 JAVAOPTS="$JAVAOPTS -tagstate"
403 elif [[ $1 = '-scheduling' ]]
405 JAVAOPTS="$JAVAOPTS -scheduling"
406 elif [[ $1 = '-multicore' ]]
409 JAVAOPTS="$JAVAOPTS -multicore"
410 elif [[ $1 = '-numcore' ]]
412 JAVAOPTS="$JAVAOPTS -numcore $2"
413 if [[ "$2" -gt "1" ]]
415 TILERAN1COREFLAG=true
416 if [[ "$2" -eq "56" ]]
418 TILERA56COREFLAG=true
422 elif [[ $1 = '-numcore4gc' ]]
424 JAVAOPTS="$JAVAOPTS -numcore4gc $2"
427 elif [[ $1 = '-raw' ]]
430 JAVAOPTS="$JAVAOPTS -raw"
431 elif [[ $1 = '-tilera_bme' ]]
435 elif [[ $1 = '-tilera_zlinux' ]]
438 TILERAZLINUXFLAG=true
439 elif [[ $1 = '-tilera_memprof' ]]
441 TILERAMEMPROFFLAG=true
442 elif [[ $1 = '-tileraconfig' ]]
446 elif [[ $1 = '-cacheflush' ]]
449 elif [[ $1 = '-rawconfig' ]]
453 elif [[ $1 = '-interrupt' ]]
456 elif [[ $1 = '-abcclose' ]]
458 JAVAOPTS="$JAVAOPTS -abcclose"
459 elif [[ $1 = '-optional' ]]
461 JAVAOPTS="$JAVAOPTS -optional"
463 elif [[ $1 = '-multicoregc' ]]
466 JAVAOPTS="$JAVAOPTS -multicoregc"
467 elif [[ $1 = '-gcmem_local' ]]
470 elif [[ $1 = '-gcmem_fixed' ]]
473 elif [[ $1 = '-gcmem_mixed' ]]
476 elif [[ $1 = '-gcmem_global' ]]
479 elif [[ $1 = '-gccache_local' ]]
481 GCCACHELOCALFLAG=true
482 elif [[ $1 = '-gccache_ran' ]]
485 elif [[ $1 = '-gccontroller_near' ]]
487 GCCONTROLLERNEARFLAG=true
488 elif [[ $1 = '-gccontroller_remote' ]]
490 GCCONTROLLERREMOTEFLAG=true
491 elif [[ $1 = '-gcsmallpagesize' ]]
493 GCSMALLPAGESIZEFLAG=true
494 elif [[ $1 = '-gcsmallpagesize2' ]]
496 GCSMALLPAGESIZEFLAG2=true
497 elif [[ $1 = '-gclargepagesize' ]]
499 GCLARGEPAGESIZEFLAG=true
500 elif [[ $1 = '-gclargepagesize2' ]]
502 GCLARGEPAGESIZE2FLAG=true
503 elif [[ $1 = '-gclargesharedheap' ]]
505 GCLARGESHAREDHEAPFLAG=true
506 elif [[ $1 = '-gclargesharedheap2' ]]
508 GCLARGESHAREDHEAPFLAG2=true
509 elif [[ $1 = '-gccacheadapt' ]]
511 GCCACHEADAPTFLAG=true
512 elif [[ $1 = '-gccacheadaptpolicy' ]]
514 GCCACHEADAPTPOLICYFLAG=true
515 GCCACHEADAPTPOLICY="$2"
517 elif [[ $1 = '-gccachesampling' ]]
519 GCCACHESAMPLINGFLAG=true
520 elif [[ $1 = '-mgc' ]]
523 JAVAOPTS="$JAVAOPTS -mgc"
524 elif [[ $1 = '-dmalloc' ]]
527 elif [[ $1 = '-recover' ]]
530 JAVAOPTS="$JAVAOPTS -task"
531 elif [[ $1 = '-useprofile' ]]
533 JAVAOPTS="$JAVAOPTS -useprofile $2"
535 elif [[ $1 = '-webinterface' ]]
537 JAVAOPTS="$JAVAOPTS -webinterface"
538 elif [[ $1 = '-instructionfailures' ]]
540 JAVAOPTS="$JAVAOPTS -instructionfailures"
541 elif [[ $1 = '-joptimize' ]]
543 JAVAOPTS="$JAVAOPTS -optimize"
544 elif [[ $1 = '-noloop' ]]
546 JAVAOPTS="$JAVAOPTS -noloop"
547 elif [[ $1 = '-dcopts' ]]
549 JAVAOPTS="$JAVAOPTS -dcopts"
550 elif [[ $1 = '-delaycomp' ]]
552 JAVAOPTS="$JAVAOPTS -delaycomp"
553 EXTRAOPTIONS="$EXTRAOPTIONS -DDELAYCOMP"
554 elif [[ $1 = '-hybrid' ]]
556 JAVAOPTS="$JAVAOPTS -hybrid"
557 EXTRAOPTIONS="$EXTRAOPTIONS -DHYBRID"
558 elif [[ $1 = '-minimize' ]]
560 JAVAOPTS="$JAVAOPTS -minimize"
562 elif [[ $1 = '-ooojava' ]]
565 JAVAOPTS="$JAVAOPTS -ooojava $2 $3"
566 EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
570 elif [[ $1 = '-ooodebug-disable-task-mem-pool' ]]
572 EXTRAOPTIONS="$EXTRAOPTIONS -DOOO_DISABLE_TASKMEMPOOL"
574 elif [[ $1 = '-mempool-detect-misuse' ]]
576 EXTRAOPTIONS="$EXTRAOPTIONS -DMEMPOOL_DETECT_MISUSE"
578 elif [[ $1 = '-heapsize-mb' ]]
580 EXTRAOPTIONS="$EXTRAOPTIONS -DINITIALHEAPSIZE_MB=($2)"
583 elif [[ $1 = '-nostalltr' ]]
585 JAVAOPTS="$JAVAOPTS -nostalltr"
587 elif [[ $1 = '-rcr' ]]
589 JAVAOPTS="$JAVAOPTS -rcr"
591 EXTRAOPTIONS="$EXTRAOPTIONS -DRCR -I$ROBUSTROOT/Runtime/oooJava"
593 elif [[ $1 = '-debug-deque' ]]
595 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG_DEQUE"
597 elif [[ $1 = '-coreprof' ]]
600 JAVAOPTS="$JAVAOPTS -coreprof"
601 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF -I$ROBUSTROOT/Runtime/coreprof"
603 elif [[ $1 = '-coreprof-eventwords' ]]
605 EXTRAOPTIONS="$EXTRAOPTIONS -DCP_MAXEVENTWORDS=($2)"
608 elif [[ $1 = '-coreprof-checkoverflow' ]]
610 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF_CHECKOVERFLOW"
612 elif [[ $1 = '-coreprof-enable' ]]
614 EXTRAOPTIONS="$EXTRAOPTIONS -D$2"
617 elif [[ $1 = '-mlp' ]]
620 EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
621 JAVAOPTS="$JAVAOPTS -mlp $2 $3"
625 elif [[ $1 = '-mlpdebug' ]]
627 JAVAOPTS="$JAVAOPTS -mlpdebug"
629 elif [[ $1 = '-check' ]]
632 JAVAOPTS="$JAVAOPTS -conscheck"
633 elif [[ $1 = '-enable-assertions' ]]
635 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
636 elif [[ $1 = '-specdir' ]]
642 elif [[ $1 = '-debug' ]]
645 EXTRAOPTIONS="$EXTRAOPTIONS -g -rdynamic"
646 elif [[ $1 = '-rawpath' ]]
649 elif [[ $1 = '-runtimedebug' ]]
651 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
652 elif [[ $1 = '-dsmcaching' ]]
654 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
655 elif [[ $1 = '-rangeprefetch' ]]
657 EXTRAOPTIONS="$EXTRAOPTIONS -DRANGEPREFETCH"
658 elif [[ $1 = '-nooptimize' ]]
660 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
661 elif [[ $1 = '-optimize' ]]
663 EXTRAOPTIONS="$EXTRAOPTIONS -O3"
664 elif [[ $1 = '-thread' ]]
666 JAVAOPTS="$JAVAOPTS -thread"
667 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
669 elif [[ $1 = '-recovery' ]]
671 EXTRAOPTIONS="$EXTRAOPTIONS -DRECOVERY"
673 elif [[ $1 = '-recoverystats' ]]
675 JAVAOPTS="$JAVAOPTS -recoverystats"
676 EXTRAOPTIONS="$EXTRAOPTIONS -DRECOVERYSTATS"
677 elif [[ $1 = '-distributioninfo' ]]
679 JAVAOPTS="$JAVAOPTS -distributioninfo"
680 elif [[ $1 = '-disall' ]]
682 JAVAOPTS="$JAVAOPTS -disall"
683 elif [[ $1 = '-disstart' ]]
685 JAVAOPTS="$JAVAOPTS -disstart $2"
687 elif [[ $1 = '-noc' ]]
690 elif [[ $1 = '-curdir' ]]
694 elif [[ $1 = '-outputdir' ]]
696 JAVAOPTS="$JAVAOPTS -outputdir $2"
699 SRCFILES="$SRCFILES $1"
704 BUILDDIR="$CURDIR/$tmpbuilddirectory"
706 BAMBOORUNTIME=$ROBUSTROOT/Runtime/bamboo
714 if $CHECKFLAG #Generate structure files for repair tool
716 JAVAOPTS="$JAVAOPTS -struct structfile"
726 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
728 #base bristlecone files
729 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
735 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
738 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaSTM"
741 #threading java stuff
742 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
745 #base multicore gc files
746 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/MGC"
749 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
752 # Build bristlecone/java sources
756 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
757 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ \
758 -dir $BUILDDIR $JAVAOPTS $SRCFILES
762 #if ! ${ROBUSTROOT}/ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
765 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
766 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ -dir $BUILDDIR -precise \
773 if $EXITAFTERANALYSIS
778 # Build all of the consistency specs
780 if $CHECKFLAG # CHECKFLAG
783 mkdir $BUILDDIR/specdir
784 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
786 echo > $BUILDDIR/specs
788 # compile specs into C code
789 for i in * # iterate over all directories
791 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
794 cat $BUILDDIR/structfile.struct $i.label > $i.struct
795 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
796 cp size.[c,h] $BUILDDIR/specdir
797 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
798 echo $i >> $BUILDDIR/specs
800 done # iterate over all directories
806 echo > $BUILDDIR/checkers.h
807 for i in `cat $BUILDDIR/specs`
809 gcc -O0 -g -fbounds-check -c $i\_aux.c
810 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
814 #build and link everything
819 MAKEFILE="Makefile.raw"
825 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
829 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DCACHEFLUSH"
834 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
839 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DDEBUG"
843 then # profile version
844 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DPROFILE"
847 if $ACCURATEPROFILEFLAG
848 then # accurateprofile version
849 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DACCURATEPROFILE"
854 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DUSEIO"
858 then #INTERRUPT version
859 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
860 fi #INTERRUPT version
864 MAKEFILE="$MAKEFILE.io"
865 echo "+++++++++++use Makefile.raw.io++++++++++++++++"
867 MAKEFILE="$MAKEFILE.$RAWCONFIG"
870 cp $BAMBOORUNTIME/RAW/$MAKEFILE ./Makefile
876 cp ../Runtime/coreprof/*.c ./coreprof/
877 cp ../Runtime/coreprof/*.h ./coreprof/
878 cp $BAMBOORUNTIME/*.c ./
879 cp $BAMBOORUNTIME/*.h ./
880 cp $BAMBOORUNTIME/RAW/*.c ./
881 cp $BAMBOORUNTIME/RAW/*.h ./
882 cp $BAMBOORUNTIME/RAW/*.S ./
883 cp $BAMBOORUNTIME/RAW/*.s ./
884 cp ../$tmpbuilddirectory/*.c ./
885 cp ../$tmpbuilddirectory/*.h ./
891 TILERADIR="$CURDIR/tilera"
895 MAKEFILE="Makefile.tilera.$TILERACONFIG"
896 SIMHVC="sim.hvc.$TILERACONFIG"
897 PCIHVC="pci.hvc.$TILERACONFIG"
902 elif $TILERAZLINUXFLAG
903 then # TILERAZLINUXFLAG
904 TILERA_INDIR="ZLinux"
905 MAKEFILE="Makefile.tilera.$TILERACONFIG"
915 export TILERACFLAGS="-DMULTICORE -DCLOSE_PRINT -DTILERA"
917 export TILERACFLAGS="-DTASK -DMULTICORE -DCLOSE_PRINT -DTILERA"
920 if $TILERAMEMPROFFLAG
921 then # not only with 1 core
922 PCIHVC="$PCIHVC.memprof"
923 TILERACFLAGS="${TILERACFLAGS} -DBAMBOO_MEMPROF"
928 TILERACFLAGS="${TILERACFLAGS} -DTILERA_BME"
929 elif $TILERAZLINUXFLAG
930 then # TILERAZLINUXFLAG
931 TILERACFLAGS="${TILERACFLAGS} -DTILERA_ZLINUX"
936 TILERACFLAGS="${TILERACFLAGS} -DCACHEFLUSH"
941 TILERACFLAGS="${TILERACFLAGS} -DRAWPATH"
946 TILERACFLAGS="${TILERACFLAGS} -DDEBUG"
950 then # profile version
951 TILERACFLAGS="${TILERACFLAGS} -DPROFILE"
954 if $ACCURATEPROFILEFLAG
955 then # accurateprofile version
956 TILERACFLAGS="${TILERACFLAGS} -DACCURATEPROFILE"
959 if $PROFILEINTERRUPTFLAG
960 then # profile_interrupt version
961 TILERACFLAGS="${TILERACFLAGS} -DPROFILE_INTERRUPT"
966 TILERACFLAGS="${TILERACFLAGS} -DUSEIO"
970 then #INTERRUPT version
971 TILERACFLAGS="${TILERACFLAGS} -DINTERRUPT"
972 fi #INTERRUPT version
976 TILERACFLAGS="${TILERACFLAGS} -DMGC"
980 then #MULTICOREGC version
981 TILERACFLAGS="${TILERACFLAGS} -DMULTICORE_GC -D${GCCORES}"
985 then # GC_PROFILE version
986 TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE"
990 then # GC_PROFILE_S version
991 TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE_S"
995 then # SMEMLOCAL version
996 TILERACFLAGS="${TILERACFLAGS} -DSMEML"
1000 then # SMEMFIXED version
1001 TILERACFLAGS="${TILERACFLAGS} -DSMEMF"
1005 then # SMEMMIXED version
1006 TILERACFLAGS="${TILERACFLAGS} -DSMEMM"
1010 then # SMEMGLOBAL version
1011 TILERACFLAGS="${TILERACFLAGS} -DSMEMG"
1014 if $GCCACHELOCALFLAG
1015 then # CACHE_LOCAL version
1016 TILERACFLAGS="${TILERACFLAGS} -DCACHE_LOCAL"
1020 then # CACHE_RAN version
1021 TILERACFLAGS="${TILERACFLAGS} -DCACHE_RAN"
1024 if $GCCONTROLLERNEARFLAG
1025 then # CONTROLLER_NEAR version
1026 TILERACFLAGS="${TILERACFLAGS} -DCONTROLLER_NEAR"
1029 if $GCCONTROLLERREMOTEFLAG
1030 then # CONTROLLER_REMOTE version
1031 TILERACFLAGS="${TILERACFLAGS} -DCONTROLLER_REMOTE"
1034 if $GCSMALLPAGESIZEFLAG
1035 then # GC_SMALLPAGESIZE version
1036 TILERACFLAGS="${TILERACFLAGS} -DGC_SMALLPAGESIZE"
1039 if $GCLARGEPAGESIZEFLAG
1040 then # GC_LARGEPAGESIZE version
1041 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE"
1044 if $GCLARGEPAGESIZE2FLAG
1045 then # GC_LARGEPAGESIZE2 version
1046 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE2"
1049 if $GCLARGESHAREDHEAPFLAG
1050 then # GC_LARGESHAREDHEAP version
1051 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP"
1054 if $GCSMALLPAGESIZEFLAG2
1055 then # GC_SMALLPAGESIZE2 version
1056 TILERACFLAGS="${TILERACFLAGS} -DGC_SMALLPAGESIZE2"
1059 if $GCLARGESHAREDHEAPFLAG2
1060 then # GC_LARGESHAREDHEAP2 version
1061 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP2"
1064 if $GCCACHEADAPTFLAG
1065 then # GC_CACHE_ADAPT version
1066 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_ADAPT"
1069 if $GCCACHEADAPTPOLICYFLAG
1070 then # GC_CACHE_ADAPT version
1071 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_ADAPT_POLICY${GCCACHEADAPTPOLICY}"
1074 if $GCCACHESAMPLINGFLAG
1075 then # GC_CACHE_ADAPT version
1076 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_SAMPLING"
1081 cp $ROBUSTROOT/Tilera/Runtime/MGC/$MAKEFILE ./Makefile
1083 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$MAKEFILE ./Makefile
1086 then # TILERABMEFLAG
1087 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$SIMHVC ./sim.hvc
1088 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$PCIHVC ./pci.hvc
1089 if $TILERA56COREFLAG
1091 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc.56 ./bamboo-vmlinux-pci.hvc.56
1093 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc ./bamboo-vmlinux-pci.hvc
1096 cp ../Runtime/Queue.c ./
1097 cp ../Runtime/file.c ./
1098 cp ../Runtime/math.c ./
1101 cp ../Runtime/object.c ./
1103 cp ../Runtime/GenericHashtable.c ./
1104 cp ../Runtime/SimpleHash.c ./
1105 cp ../Runtime/ObjectHash.c ./
1106 cp ../Runtime/socket.c ./
1107 cp ../Runtime/mem.c ./
1108 cp ../Runtime/GenericHashtable.h ./
1109 cp ../Runtime/mem.h ./
1112 cp ../Runtime/object.h ./
1114 cp ../Runtime/ObjectHash.h ./
1115 cp ../Runtime/Queue.h ./
1116 cp ../Runtime/runtime.h ./
1117 cp ../Runtime/SimpleHash.h ./
1119 cp ../Runtime/coreprof/coreprof.c ./coreprof/
1120 cp ../Runtime/coreprof/coreprof.h ./coreprof/
1121 cp $BAMBOORUNTIME/multicoretask.c ./
1122 cp $BAMBOORUNTIME/multicoreruntime.c ./
1123 cp $BAMBOORUNTIME/multicoremem.c ./
1124 cp $BAMBOORUNTIME/multicoregarbage.c ./
1125 cp $BAMBOORUNTIME/GCSharedHash.c ./
1126 cp $BAMBOORUNTIME/MGCHash.c ./
1127 cp $BAMBOORUNTIME/multicoreruntime.h ./
1128 cp $BAMBOORUNTIME/multicoremem.h ./
1129 cp $BAMBOORUNTIME/multicoregarbage.h ./
1130 cp $BAMBOORUNTIME/multicorecache.h ./
1131 cp $BAMBOORUNTIME/multicoregc.h ./
1132 cp $BAMBOORUNTIME/multicorehelper.h ./
1133 cp $BAMBOORUNTIME/GCSharedHash.h ./
1134 cp $BAMBOORUNTIME/MGCHash.h ./
1135 cp ../Tilera/Runtime/*.c ./
1136 cp ../Tilera/Runtime/*.h ./
1137 cp ../Tilera/Runtime/$TILERA_INDIR/*.c ./
1138 cp ../Tilera/Runtime/$TILERA_INDIR/*.h ./
1139 if $TILERAZLINUXFLAG
1140 then # TILERAZLINUXFLAG
1141 cp ../Tilera/Runtime/$TILERA_INDIR/*.S ./
1143 #if $TILERAMEMPROFFLAG
1144 #then # TILERAMEMPROFFLAG
1145 cp ../Tilera/Runtime/$TILERA_INDIR/linux_client.c ./
1149 cp ../Tilera/Runtime/MGC/*.c ./
1150 cp ../Tilera/Runtime/MGC/*.h ./
1152 cp ../Tilera/lib/* ./
1153 cp ../$tmpbuilddirectory/*.c ./
1154 cp ../$tmpbuilddirectory/*.h ./
1158 else #!RAWFLAG && !TILERABMEFLAG && ! TILERAZLINUXFLAG
1161 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
1166 RUNTIMEFILE="$BAMBOORUNTIME/multicoreruntime.c $BAMBOORUNTIME/multicoretask.c"
1167 INCLUDES="$INCLUDES -I$BAMBOORUNTIME"
1169 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
1172 FILES="$RUNTIMEFILE \
1173 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
1174 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
1175 $ROBUSTROOT/Runtime/ObjectHash.c \
1176 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
1177 $ROBUSTROOT/Runtime/math.c \
1178 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
1182 FILES="$FILES $ROBUSTROOT/Runtime/affinity.c"
1187 FILES="$FILES $ROBUSTROOT/Runtime/STM/monitor.c"
1192 FILES="$FILES $ROBUSTROOT/Runtime/memcpy32.o $ROBUSTROOT/Runtime/instrset32.o"
1199 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRECOVERYRUNTIME"
1200 FILES="$FILES $DSMRECOVERYRUNTIME/trans.c $DSMRECOVERYRUNTIME/mcpileq.c $DSMRECOVERYRUNTIME/objstr.c $DSMRECOVERYRUNTIME/dstm.c $DSMRECOVERYRUNTIME/altmlookup.c $DSMRECOVERYRUNTIME/clookup.c $DSMRECOVERYRUNTIME/llookup.c $DSMRECOVERYRUNTIME/tlookup.c $DSMRECOVERYRUNTIME/threadnotify.c $DSMRECOVERYRUNTIME/dstmserver.c $DSMRECOVERYRUNTIME/plookup.c $DSMRECOVERYRUNTIME/ip.c $DSMRECOVERYRUNTIME/queue.c $DSMRECOVERYRUNTIME/altprelookup.c $DSMRECOVERYRUNTIME/machinepile.c $ROBUSTROOT/Runtime/localobjects.c $ROBUSTROOT/Runtime/thread.c $DSMRECOVERYRUNTIME/sockpool.c $DSMRECOVERYRUNTIME/addUdpEnhance.c $DSMRECOVERYRUNTIME/signal.c $DSMRECOVERYRUNTIME/gCollect.c $DSMRECOVERYRUNTIME/addPrefetchEnhance.c $DSMRECOVERYRUNTIME/dsmlock.c $DSMRECOVERYRUNTIME/translist.c $DSMRECOVERYRUNTIME/paxos.c"
1202 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
1203 FILES="$FILES $DSMRUNTIME/trans.c $DSMRUNTIME/mcpileq.c $DSMRUNTIME/objstr.c $DSMRUNTIME/dstm.c $DSMRUNTIME/clookup.c $DSMRUNTIME/llookup.c $DSMRUNTIME/threadnotify.c $DSMRUNTIME/dstmserver.c $DSMRUNTIME/plookup.c $DSMRUNTIME/ip.c $DSMRUNTIME/queue.c $DSMRUNTIME/altprelookup.c $DSMRUNTIME/machinepile.c $ROBUSTROOT/Runtime/localobjects.c $ROBUSTROOT/Runtime/thread.c $DSMRUNTIME/sockpool.c $DSMRUNTIME/addUdpEnhance.c $DSMRUNTIME/signal.c $DSMRUNTIME/gCollect.c $DSMRUNTIME/addPrefetchEnhance.c $DSMRUNTIME/dsmlock.c $DSMRUNTIME/prefetch.c $DSMRUNTIME/altmlookup.c"
1209 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$STMRUNTIME"
1210 FILES="$FILES $STMRUNTIME/stmlock.c $STMRUNTIME/stm.c $STMRUNTIME/stmlookup.c $ROBUSTROOT/Runtime/thread.c $STMRUNTIME/stats.c $STMRUNTIME/commit.c $STMRUNTIME/objstr.c"
1217 FILES="$FILES $DSMRUNTIME/sandbox.c"
1219 FILES="$FILES $STMRUNTIME/sandbox.c"
1225 FILES="$FILES $DSMRUNTIME/abortreaders.c"
1230 FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
1235 FILES="$FILES $ROBUSTROOT/Runtime/coreprof/coreprof.c"
1240 FILES="$FILES $tmpbuilddirectory/RuntimeConflictResolver.c $ROBUSTROOT/Runtime/oooJava/hashRCR.c $ROBUSTROOT/Runtime/oooJava/Queue_RCR.c $ROBUSTROOT/Runtime/oooJava/hashStructure.c $ROBUSTROOT/Runtime/oooJava/trqueue.c $ROBUSTROOT/Runtime/oooJava/rcr_runtime.c"
1245 FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"
1246 FILES="$FILES $ROBUSTROOT/Runtime/psemaphore.c"
1247 FILES="$FILES $ROBUSTROOT/Runtime/workschedule.c"
1250 FILES="$FILES $ROBUSTROOT/Runtime/deque.c"
1256 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
1259 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
1261 FILES="$FILES $tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
1264 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
1266 if $THREADSIMULATEFLAG
1268 # -lpthread for pthread functions, -lrt for message queue functions
1269 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
1275 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
1276 FILES="$FILES $tmpbuilddirectory/optionalarrays.c"
1281 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
1286 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
1287 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
1292 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
1296 echo EXTRAOPTIONS=$EXTRAOPTIONS
1300 gcc -S $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
1301 -c $tmpbuilddirectory/methods.c -lm
1308 NONMULTICOREOPTS=-DPRECISE_GC
1313 gcc -E $INCLUDES $EXTRAOPTIONS $NONMULTICOREOPTS \
1314 $tmpbuilddirectory/methods.c $FILES > tmp.c
1317 gcc $INCLUDES $EXTRAOPTIONS $NONMULTICOREOPTS \
1318 $tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin