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 -rcr_debug Shows weakly connected heaproots and which allocation sites were considered for traversal
31 echo -rcr_debug_verbose in addition to above, also prints out effects passed in, internal representation of effects, and internal representation of reach graph
32 echo -squeue use single queue
33 echo -corepin use core pinning
34 echo -nostalltr turn off RCR traversers that only handle conflicts between task and stallsite
36 echo Disjoint Reachability Analysis options
37 echo -disjoint enable analysis
38 echo -disjoint-k set k-limit for heap nodes per allocation site
39 echo "-disjoint-write-dots <all/final> write reach graphs for all method sols. or only final sols."
40 echo -disjoint-write-initial-contexts write reach graphs for callee initial contexts from all call sites
41 echo -disjoint-write-ihms write reach graphs for each call site\'s Initial Heap Model
42 echo "-disjoint-alias-file <filename> <normal/tabbed> write sharing for normal human reading or LaTeX tabbed"
43 echo "-disjoint-debug-callsite <callee> <caller> <visit to start> <num caps> <T/F stop after>"
44 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"
45 echo "-disjoint-debug-snap-method <method> <visit to start> <num caps> <T/F stop after>"
46 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"
47 echo "-disjoint-dvisit-stack use stack strat to visit descriptors (tasks or methods)"
48 echo -disjoint-dvisit-stack-callees-on-top alternate stack strat
49 echo -disjoint-dvisit-pqueue use prio. q strat to visit descriptors
50 echo -disjoint-desire-determinism set above interproc for determinism
51 echo -disjoint-debug-scheduling debug when methods are scheduled for analysis
53 echo "-mlp <num cores> <max sese age> build mlp code"
54 echo -mlpdebug if mlp, report progress and interim results
57 echo -dsm distributed shared memory
58 echo -abortreaders abort readers immediately
59 echo -trueprob double - probabiltiy of true branch
60 echo -dsmcaching -enable caching in dsm runtime
62 echo BAMBOO Multicore options
63 echo -scheduling do task scheduling
64 echo "-distributioninfo execute to collect distribution info for simulated annealing in multi-core version"
65 echo "-disall execute to collect whole distribution"
66 echo "-disstart specify the start number of distribution information collection"
67 echo -multicore generate multi-core version binary
68 echo "-numcore set the number of cores (should be used together with -multicore), defaultly set as 1"
69 echo "-cacheflush enable cache flush in raw version binary (should be used togethere with -raw)"
70 echo "-interrupt generate raw version binary with interruption (should be used togethere with -raw)"
71 echo "-rawpath print out execute path information for raw version (should be used together with -raw)"
72 echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
73 echo -printscheduling print out scheduling graphs
74 echo -printschedulesim print out scheduling simulator result graphs
75 echo "-tilera_bme generate tilera version binary for Bare Mental Environment (should be used together with -multicore"
76 echo "-tilera_zlinux generate tilera version binary for Zero-Overhead Linux with multi-process mode (should be used together with -multicore"
77 echo "-tileraconfig config tilera simulator/pci as nxm (should be used together with -tilera)"
78 echo "-raw generate raw version binary (should be used together with -multicore)"
79 echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
80 echo "-tilera_memprof build the memprof version (should be used together with -tilera_xx) "
81 echo -accurateprofile build with accurate profile information including pre/post task processing info
82 echo -profile_interrupt build with profile information of interrupts
83 echo "-useio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
85 echo Multicore GC options
86 echo -multicoregc generate multi-core binary with garbage collection
87 echo "-numcore4gc set the number of cores for gc (should be used together with -multicoregc), defaultly set as 0"
88 echo "-gcmem_local set the gc shared memory allocation strategy as local (should be used together with -multicoregc)"
89 echo "-gcmem_fixed set the gc shared memory allocation strategy as fixed (should be used together with -multicoregc)"
90 echo "-gcmem_mixed set the gc shared memory allocation strategy as mixed (should be used together with -multicoregc)"
91 echo "-gcmem_global set the gc shared memory allocation strategy as global (should be used together with -multicoregc)"
92 echo "-gccache_local set the gc shared memory cache strategy as local (should be used together with -multicoregc)"
93 echo "-gccache_ran set the gc shared memory cache strategy as random (should be used together with -multicoregc)"
94 echo "-gccontroller_near set the gc shared memory to use the nearest controller for each core (should be used together with -multicoregc)"
95 echo "-gccontroller_remote set the gc shared memory to use a remote controller for each core (should be used together with -multicoregc)"
96 echo "-gcsmallpagesize(2) set the gc shared memory to use small page size (should be used together with -multicoregc)"
97 echo "-gclargepagesize set the gc shared memory to use large page size (should be used together with -multicoregc)"
98 echo "-gclargesharedheap(2) set the gc shared memory as large (should be used together with -multicoregc)"
99 echo "-gccacheadapt setup as cacheadaptable mode (should be used together with -multicoregc)"
100 echo -gcprofile build with gcprofile options
101 echo -mgc generate Multicore GC binary without task stuff
104 echo -ssjava enables SSJava
107 echo -abcclose turnoff array boundary checks
108 echo -builddir setup different build directory
109 echo -robustroot set up the ROBUSTROOT to directory other than default one
110 echo -readset turn on readset
111 echo -mac distributed shared memory mac support
112 echo -check generate check code
113 echo -dmalloc link in dmalloc
114 echo -64bit compile for 64 bit machine
115 echo -32bit compile for 32 bit machine
116 echo -joptimize java compiler optimizations
117 echo -noloop turnoff loop optimizations
118 echo -recover compile task code
119 echo -fastcheck fast checkpointing for Bristlecone
120 echo -specdir directory
121 echo -printflat print out flat representation
122 echo -selfloop task - this task cannot self loop forever
123 echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
124 echo -taskstate do task state analysis
125 echo -tagstate do tag state analysis
126 echo -optional enable optional
127 echo -debug generate debug symbols
128 echo -prefetch do prefetch analysis
129 echo -heapsize-mb NUM set initial heap size in MB, default is 256
130 echo -garbagestats Print garbage collection statistics
131 echo -webinterface enable web interface
132 echo -runtimedebug printout runtime debug messages
133 echo "-thread use support for multiple threads"
134 echo "-optimize call gcc with -O9 (optimize)"
135 echo "-nooptimize call gcc with -O0 (do not optimize)"
136 echo -curdir directory
137 echo -mainclass class with main method
139 echo -nojava do not run bristlecone compiler
140 echo -instructionfailures inject code for instructionfailures
141 echo -profile build with profile options
142 echo "-enable-assertions execute assert statements during compilation"
143 echo -justanalyze exit after compiler analyses complete
144 echo -assembly generate assembly
145 echo -recovery compile recovery code
146 echo -dsmtask support work and task class library
147 echo -recoverystats print out recovery record
148 echo -src-after-pp prints source code after preprocessor to tmp.c
149 echo -printlinenum print out line numbers in generated C codes
153 tmpbuilddirectory="tmpbuilddirectory"
159 ROBUSTROOT=~/research/Robust/src
160 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
161 STMRUNTIME=$ROBUSTROOT/Runtime/STM/
162 DSMRECOVERYRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface_recovery/
163 REPAIRROOT=~/research/Repair/RepairCompiler/
179 RCR_DEBUG_VERBOSE=false
185 TILERAZLINUXFLAG=false
186 TILERAMEMPROFFLAG=false
195 ACCURATEPROFILEFLAG=false
196 PROFILEINTERRUPTFLAG=false
199 THREADSIMULATEFLAG=false;
200 MULTICOREGCFLAG=false;
201 GCMEMLOCALFLAG=false;
202 GCMEMFIXEDFLAG=false;
203 GCMEMMIXEDFLAG=false;
204 GCMEMGLOBALFLAG=false;
205 GCCACHELOCALFLAG=false;
206 GCCACHERANFLAG=false;
207 GCCONTROLLERNEARFLAG=false;
208 GCCONTROLLERREMOTEFLAG=false;
209 GCSMALLPAGESIZEFLAG=false;
210 GCLARGEPAGESIZEFLAG=false;
211 GCLARGEPAGESIZE2FLAG=false;
212 GCLARGESHAREDHEAPFLAG=false;
213 GCSMALLPAGESIZEFLAG2=false;
214 GCLARGESHAREDHEAPFLAG2=false;
215 GCCACHEADAPTFLAG=false
216 GCCACHEADAPTPOLICYFLAG=false
217 GCCACHEADAPTPOLICY=''
218 GCCACHESAMPLINGFLAG=false
230 EXITAFTERANALYSIS=false
233 TILERAN1COREFLAG=false
234 TILERA56COREFLAG=false
244 if [[ $1 = '-help' ]]
249 elif [[ $1 = '-justanalyze' ]]
251 EXITAFTERANALYSIS=true
253 elif [[ $1 = '-src-after-pp' ]]
257 elif [[ $1 = '-assembly' ]]
260 elif [[ $1 = '-abortreaders' ]]
263 EXTRAOPTIONS="$EXTRAOPTIONS -DABORTREADERS"
264 JAVAOPTS="$JAVAOPTS -abortreaders"
265 elif [[ $1 = '-sandbox' ]]
268 EXTRAOPTIONS="$EXTRAOPTIONS -DSANDBOX"
269 JAVAOPTS="$JAVAOPTS -sandbox"
270 elif [[ $1 = '-numa' ]]
272 EXTRAOPTIONS="$EXTRAOPTIONS -DAFFINITY -D_GNU_SOURCE"
274 elif [[ $1 = '-robustroot' ]]
278 elif [[ $1 = '-builddir' ]]
280 tmpbuilddirectory="$2"
282 elif [[ $1 = '-nojava' ]]
285 elif [[ $1 = '-eventmonitor' ]]
287 JAVAOPTS="$JAVAOPTS -eventmonitor"
289 EXTRAOPTIONS="$EXTRAOPTIONS -DEVENTMONITOR"
290 elif [[ $1 = '-garbagestats' ]]
292 EXTRAOPTIONS="$EXTRAOPTIONS -DGARBAGESTATS"
293 elif [[ $1 = '-64bit' ]]
295 EXTRAOPTIONS="$EXTRAOPTIONS -DBIT64 -m64"
296 elif [[ $1 = '-32bit' ]]
298 EXTRAOPTIONS="$EXTRAOPTIONS -m32"
299 elif [[ $1 = '-fastcheck' ]]
301 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTCHECK"
302 JAVAOPTS="$JAVAOPTS -fastcheck"
308 elif [[ $1 = '-mainclass' ]]
310 JAVAOPTS="$JAVAOPTS -mainclass $2"
312 elif [[ $1 = '-selfloop' ]]
314 JAVAOPTS="$JAVAOPTS -selfloop $2"
316 elif [[ $1 = '-excprefetch' ]]
318 JAVAOPTS="$JAVAOPTS -excprefetch $2"
320 elif [[ $1 = '-arraypad' ]]
322 JAVAOPTS="$JAVAOPTS -arraypad"
323 elif [[ $1 = '-dsm' ]]
325 JAVAOPTS="$JAVAOPTS -dsm"
327 elif [[ $1 = '-fastmemcpy' ]]
330 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTMEMCPY"
331 elif [[ $1 = '-singleTM' ]]
333 JAVAOPTS="$JAVAOPTS -singleTM"
334 EXTRAOPTIONS="$EXTRAOPTIONS -DSTM"
336 elif [[ $1 = '-stmarray' ]]
338 JAVAOPTS="$JAVAOPTS -stmarray"
339 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMARRAY"
341 elif [[ $1 = '-dualview' ]]
343 JAVAOPTS="$JAVAOPTS -dualview"
344 EXTRAOPTIONS="$EXTRAOPTIONS -DDUALVIEW"
346 elif [[ $1 = '-readset' ]]
348 JAVAOPTS="$JAVAOPTS -readset"
349 EXTRAOPTIONS="$EXTRAOPTIONS -DREADSET"
350 elif [[ $1 = '-stmdebug' ]]
352 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMDEBUG"
353 elif [[ $1 = '-stmstats' ]]
355 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMSTATS"
356 elif [[ $1 = '-stmlog' ]]
358 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMLOG"
359 elif [[ $1 = '-prefetch' ]]
361 JAVAOPTS="$JAVAOPTS -prefetch"
362 elif [[ $1 = '-transstats' ]]
364 EXTRAOPTIONS="$EXTRAOPTIONS -DTRANSSTATS"
365 elif [[ $1 = '-printflat' ]]
367 JAVAOPTS="$JAVAOPTS -printflat"
368 elif [[ $1 = '-trueprob' ]]
370 JAVAOPTS="$JAVAOPTS -trueprob $2"
372 elif [[ $1 = '-inlineatomic' ]]
374 JAVAOPTS="$JAVAOPTS -inlineatomic $2"
376 elif [[ $1 = '-mac' ]]
378 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
379 elif [[ $1 = '-squeue' ]]
381 EXTRAOPTIONS="$EXTRAOPTIONS -DSQUEUE"
382 elif [[ $1 = '-corepin' ]]
384 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPIN"
386 elif [[ $1 = '-profile' ]]
389 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
390 elif [[ $1 = '-gcprofile' ]]
393 elif [[ $1 = '-gcprofile_s' ]]
396 elif [[ $1 = '-accurateprofile' ]]
398 ACCURATEPROFILEFLAG=true
399 elif [[ $1 = '-profile_interrupt' ]]
401 PROFILEINTERRUPTFLAG=true
402 elif [[ $1 = '-useio' ]]
405 elif [[ $1 = '-taskstate' ]]
407 JAVAOPTS="$JAVAOPTS -taskstate"
408 elif [[ $1 = '-tagstate' ]]
410 JAVAOPTS="$JAVAOPTS -tagstate"
411 elif [[ $1 = '-scheduling' ]]
413 JAVAOPTS="$JAVAOPTS -scheduling"
414 elif [[ $1 = '-multicore' ]]
417 JAVAOPTS="$JAVAOPTS -multicore"
418 elif [[ $1 = '-numcore' ]]
420 JAVAOPTS="$JAVAOPTS -numcore $2"
421 if [[ "$2" -gt "1" ]]
423 TILERAN1COREFLAG=true
424 if [[ "$2" -eq "56" ]]
426 TILERA56COREFLAG=true
430 elif [[ $1 = '-numcore4gc' ]]
432 JAVAOPTS="$JAVAOPTS -numcore4gc $2"
435 elif [[ $1 = '-raw' ]]
438 JAVAOPTS="$JAVAOPTS -raw"
439 elif [[ $1 = '-tilera_bme' ]]
443 elif [[ $1 = '-tilera_zlinux' ]]
446 TILERAZLINUXFLAG=true
447 elif [[ $1 = '-tilera_memprof' ]]
449 TILERAMEMPROFFLAG=true
450 elif [[ $1 = '-tileraconfig' ]]
454 elif [[ $1 = '-cacheflush' ]]
457 elif [[ $1 = '-rawconfig' ]]
461 elif [[ $1 = '-interrupt' ]]
464 elif [[ $1 = '-abcclose' ]]
466 JAVAOPTS="$JAVAOPTS -abcclose"
467 elif [[ $1 = '-optional' ]]
469 JAVAOPTS="$JAVAOPTS -optional"
471 elif [[ $1 = '-multicoregc' ]]
474 JAVAOPTS="$JAVAOPTS -multicoregc"
475 elif [[ $1 = '-gcmem_local' ]]
478 elif [[ $1 = '-gcmem_fixed' ]]
481 elif [[ $1 = '-gcmem_mixed' ]]
484 elif [[ $1 = '-gcmem_global' ]]
487 elif [[ $1 = '-gccache_local' ]]
489 GCCACHELOCALFLAG=true
490 elif [[ $1 = '-gccache_ran' ]]
493 elif [[ $1 = '-gccontroller_near' ]]
495 GCCONTROLLERNEARFLAG=true
496 elif [[ $1 = '-gccontroller_remote' ]]
498 GCCONTROLLERREMOTEFLAG=true
499 elif [[ $1 = '-gcsmallpagesize' ]]
501 GCSMALLPAGESIZEFLAG=true
502 elif [[ $1 = '-gcsmallpagesize2' ]]
504 GCSMALLPAGESIZEFLAG2=true
505 elif [[ $1 = '-gclargepagesize' ]]
507 GCLARGEPAGESIZEFLAG=true
508 elif [[ $1 = '-gclargepagesize2' ]]
510 GCLARGEPAGESIZE2FLAG=true
511 elif [[ $1 = '-gclargesharedheap' ]]
513 GCLARGESHAREDHEAPFLAG=true
514 elif [[ $1 = '-gclargesharedheap2' ]]
516 GCLARGESHAREDHEAPFLAG2=true
517 elif [[ $1 = '-gccacheadapt' ]]
519 GCCACHEADAPTFLAG=true
520 elif [[ $1 = '-gccacheadaptpolicy' ]]
522 GCCACHEADAPTPOLICYFLAG=true
523 GCCACHEADAPTPOLICY="$2"
525 elif [[ $1 = '-gccachesampling' ]]
527 GCCACHESAMPLINGFLAG=true
528 elif [[ $1 = '-mgc' ]]
531 JAVAOPTS="$JAVAOPTS -mgc"
532 elif [[ $1 = '-dmalloc' ]]
535 elif [[ $1 = '-recover' ]]
538 JAVAOPTS="$JAVAOPTS -task"
539 elif [[ $1 = '-useprofile' ]]
541 JAVAOPTS="$JAVAOPTS -useprofile $2"
543 elif [[ $1 = '-webinterface' ]]
545 JAVAOPTS="$JAVAOPTS -webinterface"
546 elif [[ $1 = '-instructionfailures' ]]
548 JAVAOPTS="$JAVAOPTS -instructionfailures"
549 elif [[ $1 = '-joptimize' ]]
551 JAVAOPTS="$JAVAOPTS -optimize"
552 elif [[ $1 = '-noloop' ]]
554 JAVAOPTS="$JAVAOPTS -noloop"
555 elif [[ $1 = '-dcopts' ]]
557 JAVAOPTS="$JAVAOPTS -dcopts"
558 elif [[ $1 = '-delaycomp' ]]
560 JAVAOPTS="$JAVAOPTS -delaycomp"
561 EXTRAOPTIONS="$EXTRAOPTIONS -DDELAYCOMP"
562 elif [[ $1 = '-hybrid' ]]
564 JAVAOPTS="$JAVAOPTS -hybrid"
565 EXTRAOPTIONS="$EXTRAOPTIONS -DHYBRID"
566 elif [[ $1 = '-minimize' ]]
568 JAVAOPTS="$JAVAOPTS -minimize"
570 elif [[ $1 = '-ooojava' ]]
573 JAVAOPTS="$JAVAOPTS -ooojava $2 $3"
574 EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
578 elif [[ $1 = '-ooodebug-disable-task-mem-pool' ]]
580 EXTRAOPTIONS="$EXTRAOPTIONS -DOOO_DISABLE_TASKMEMPOOL"
582 elif [[ $1 = '-mempool-detect-misuse' ]]
584 EXTRAOPTIONS="$EXTRAOPTIONS -DMEMPOOL_DETECT_MISUSE"
586 elif [[ $1 = '-heapsize-mb' ]]
588 EXTRAOPTIONS="$EXTRAOPTIONS -DINITIALHEAPSIZE_MB=($2)"
591 elif [[ $1 = '-nostalltr' ]]
593 JAVAOPTS="$JAVAOPTS -nostalltr"
595 elif [[ $1 = '-printlinenum' ]]
597 JAVAOPTS="$JAVAOPTS -printlinenum"
599 elif [[ $1 = '-rcr' ]]
601 JAVAOPTS="$JAVAOPTS -rcr"
603 EXTRAOPTIONS="$EXTRAOPTIONS -DRCR -I$ROBUSTROOT/Runtime/oooJava"
605 elif [[ $1 = '-rcr_debug' ]]
607 JAVAOPTS="$JAVAOPTS -rcr_debug"
610 elif [[ $1 = '-rcr_debug_verbose' ]]
612 JAVAOPTS="$JAVAOPTS -rcr_debug_verbose"
613 RCR_DEBUG_VERBOSE=true
615 elif [[ $1 = '-debug-deque' ]]
617 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG_DEQUE"
619 elif [[ $1 = '-coreprof' ]]
622 JAVAOPTS="$JAVAOPTS -coreprof"
623 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF -I$ROBUSTROOT/Runtime/coreprof"
625 elif [[ $1 = '-coreprof-eventwords' ]]
627 EXTRAOPTIONS="$EXTRAOPTIONS -DCP_MAXEVENTWORDS=($2)"
630 elif [[ $1 = '-coreprof-checkoverflow' ]]
632 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF_CHECKOVERFLOW"
634 elif [[ $1 = '-coreprof-enable' ]]
636 EXTRAOPTIONS="$EXTRAOPTIONS -D$2"
639 elif [[ $1 = '-mlp' ]]
642 EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
643 JAVAOPTS="$JAVAOPTS -mlp $2 $3"
647 elif [[ $1 = '-mlpdebug' ]]
649 JAVAOPTS="$JAVAOPTS -mlpdebug"
651 elif [[ $1 = '-check' ]]
654 JAVAOPTS="$JAVAOPTS -conscheck"
655 elif [[ $1 = '-enable-assertions' ]]
657 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
658 elif [[ $1 = '-specdir' ]]
664 elif [[ $1 = '-debug' ]]
667 EXTRAOPTIONS="$EXTRAOPTIONS -g -rdynamic"
668 elif [[ $1 = '-rawpath' ]]
671 elif [[ $1 = '-runtimedebug' ]]
673 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
674 elif [[ $1 = '-dsmcaching' ]]
676 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
677 elif [[ $1 = '-rangeprefetch' ]]
679 EXTRAOPTIONS="$EXTRAOPTIONS -DRANGEPREFETCH"
680 elif [[ $1 = '-nooptimize' ]]
682 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
683 elif [[ $1 = '-optimize' ]]
685 EXTRAOPTIONS="$EXTRAOPTIONS -O3"
686 elif [[ $1 = '-thread' ]]
688 JAVAOPTS="$JAVAOPTS -thread"
689 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
691 elif [[ $1 = '-recovery' ]]
693 EXTRAOPTIONS="$EXTRAOPTIONS -DRECOVERY"
695 elif [[ $1 = '-recoverystats' ]]
697 JAVAOPTS="$JAVAOPTS -recoverystats"
698 EXTRAOPTIONS="$EXTRAOPTIONS -DRECOVERYSTATS"
699 elif [[ $1 = '-distributioninfo' ]]
701 JAVAOPTS="$JAVAOPTS -distributioninfo"
702 elif [[ $1 = '-disall' ]]
704 JAVAOPTS="$JAVAOPTS -disall"
705 elif [[ $1 = '-disstart' ]]
707 JAVAOPTS="$JAVAOPTS -disstart $2"
709 elif [[ $1 = '-noc' ]]
712 elif [[ $1 = '-curdir' ]]
716 elif [[ $1 = '-outputdir' ]]
718 JAVAOPTS="$JAVAOPTS -outputdir $2"
721 SRCFILES="$SRCFILES $1"
726 BUILDDIR="$CURDIR/$tmpbuilddirectory"
728 BAMBOORUNTIME=$ROBUSTROOT/Runtime/bamboo
736 if $CHECKFLAG #Generate structure files for repair tool
738 JAVAOPTS="$JAVAOPTS -struct structfile"
745 #base multicore gc files
746 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/MGC/ -classlibrary $ROBUSTROOT/ClassLibrary/MGC/gnu/"
753 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
755 #base bristlecone files
756 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
762 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
765 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaSTM"
768 #threading java stuff
769 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
772 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
776 # Build bristlecone/java sources
780 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main \
781 -dir $BUILDDIR $JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/ \
782 -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ $SRCFILES
786 #if ! ${ROBUSTROOT}/ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
789 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
790 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ -dir $BUILDDIR -precise \
797 if $EXITAFTERANALYSIS
802 # Build all of the consistency specs
804 if $CHECKFLAG # CHECKFLAG
807 mkdir $BUILDDIR/specdir
808 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
810 echo > $BUILDDIR/specs
812 # compile specs into C code
813 for i in * # iterate over all directories
815 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
818 cat $BUILDDIR/structfile.struct $i.label > $i.struct
819 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
820 cp size.[c,h] $BUILDDIR/specdir
821 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
822 echo $i >> $BUILDDIR/specs
824 done # iterate over all directories
830 echo > $BUILDDIR/checkers.h
831 for i in `cat $BUILDDIR/specs`
833 gcc -O0 -g -fbounds-check -c $i\_aux.c
834 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
838 #build and link everything
843 MAKEFILE="Makefile.raw"
849 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
853 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DCACHEFLUSH"
858 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
863 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DDEBUG"
867 then # profile version
868 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DPROFILE"
871 if $ACCURATEPROFILEFLAG
872 then # accurateprofile version
873 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DACCURATEPROFILE"
878 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DUSEIO"
882 then #INTERRUPT version
883 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
884 fi #INTERRUPT version
888 MAKEFILE="$MAKEFILE.io"
889 echo "+++++++++++use Makefile.raw.io++++++++++++++++"
891 MAKEFILE="$MAKEFILE.$RAWCONFIG"
894 cp $BAMBOORUNTIME/RAW/$MAKEFILE ./Makefile
900 cp ../Runtime/coreprof/*.c ./coreprof/
901 cp ../Runtime/coreprof/*.h ./coreprof/
902 cp $BAMBOORUNTIME/*.c ./
903 cp $BAMBOORUNTIME/*.h ./
904 cp $BAMBOORUNTIME/RAW/*.c ./
905 cp $BAMBOORUNTIME/RAW/*.h ./
906 cp $BAMBOORUNTIME/RAW/*.S ./
907 cp $BAMBOORUNTIME/RAW/*.s ./
908 cp ../$tmpbuilddirectory/*.c ./
909 cp ../$tmpbuilddirectory/*.h ./
915 TILERADIR="$CURDIR/tilera"
919 MAKEFILE="Makefile.tilera.$TILERACONFIG"
920 SIMHVC="sim.hvc.$TILERACONFIG"
921 PCIHVC="pci.hvc.$TILERACONFIG"
926 elif $TILERAZLINUXFLAG
927 then # TILERAZLINUXFLAG
928 TILERA_INDIR="ZLinux"
929 MAKEFILE="Makefile.tilera.$TILERACONFIG"
939 export TILERACFLAGS="-DMULTICORE -DCLOSE_PRINT -DTILERA"
942 export TILERACFLAGS="-DTASK -DMULTICORE -DCLOSE_PRINT -DTILERA"
945 if $TILERAMEMPROFFLAG
946 then # not only with 1 core
947 PCIHVC="$PCIHVC.memprof"
948 TILERACFLAGS="${TILERACFLAGS} -DBAMBOO_MEMPROF"
953 TILERACFLAGS="${TILERACFLAGS} -DTILERA_BME"
954 elif $TILERAZLINUXFLAG
955 then # TILERAZLINUXFLAG
956 TILERACFLAGS="${TILERACFLAGS} -DTILERA_ZLINUX"
961 TILERACFLAGS="${TILERACFLAGS} -DCACHEFLUSH"
966 TILERACFLAGS="${TILERACFLAGS} -DRAWPATH"
971 TILERACFLAGS="${TILERACFLAGS} -DDEBUG"
975 then # profile version
976 TILERACFLAGS="${TILERACFLAGS} -DPROFILE"
979 if $ACCURATEPROFILEFLAG
980 then # accurateprofile version
981 TILERACFLAGS="${TILERACFLAGS} -DACCURATEPROFILE"
984 if $PROFILEINTERRUPTFLAG
985 then # profile_interrupt version
986 TILERACFLAGS="${TILERACFLAGS} -DPROFILE_INTERRUPT"
991 TILERACFLAGS="${TILERACFLAGS} -DUSEIO"
995 then #INTERRUPT version
996 TILERACFLAGS="${TILERACFLAGS} -DINTERRUPT"
997 fi #INTERRUPT version
1001 TILERACFLAGS="${TILERACFLAGS} -DMGC"
1005 then #MULTICOREGC version
1006 TILERACFLAGS="${TILERACFLAGS} -DMULTICORE_GC -D${GCCORES}"
1010 then # GC_PROFILE version
1011 TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE"
1015 then # GC_PROFILE_S version
1016 TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE_S"
1020 then # SMEMLOCAL version
1021 TILERACFLAGS="${TILERACFLAGS} -DSMEML"
1025 then # SMEMFIXED version
1026 TILERACFLAGS="${TILERACFLAGS} -DSMEMF"
1030 then # SMEMMIXED version
1031 TILERACFLAGS="${TILERACFLAGS} -DSMEMM"
1035 then # SMEMGLOBAL version
1036 TILERACFLAGS="${TILERACFLAGS} -DSMEMG"
1039 if $GCCACHELOCALFLAG
1040 then # CACHE_LOCAL version
1041 TILERACFLAGS="${TILERACFLAGS} -DCACHE_LOCAL"
1045 then # CACHE_RAN version
1046 TILERACFLAGS="${TILERACFLAGS} -DCACHE_RAN"
1049 if $GCCONTROLLERNEARFLAG
1050 then # CONTROLLER_NEAR version
1051 TILERACFLAGS="${TILERACFLAGS} -DCONTROLLER_NEAR"
1054 if $GCCONTROLLERREMOTEFLAG
1055 then # CONTROLLER_REMOTE version
1056 TILERACFLAGS="${TILERACFLAGS} -DCONTROLLER_REMOTE"
1059 if $GCSMALLPAGESIZEFLAG
1060 then # GC_SMALLPAGESIZE version
1061 TILERACFLAGS="${TILERACFLAGS} -DGC_SMALLPAGESIZE"
1064 if $GCLARGEPAGESIZEFLAG
1065 then # GC_LARGEPAGESIZE version
1066 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE"
1069 if $GCLARGEPAGESIZE2FLAG
1070 then # GC_LARGEPAGESIZE2 version
1071 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE2"
1074 if $GCLARGESHAREDHEAPFLAG
1075 then # GC_LARGESHAREDHEAP version
1076 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP"
1079 if $GCSMALLPAGESIZEFLAG2
1080 then # GC_SMALLPAGESIZE2 version
1081 TILERACFLAGS="${TILERACFLAGS} -DGC_SMALLPAGESIZE2"
1084 if $GCLARGESHAREDHEAPFLAG2
1085 then # GC_LARGESHAREDHEAP2 version
1086 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP2"
1089 if $GCCACHEADAPTFLAG
1090 then # GC_CACHE_ADAPT version
1091 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_ADAPT"
1094 if $GCCACHEADAPTPOLICYFLAG
1095 then # GC_CACHE_ADAPT version
1096 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_ADAPT_POLICY${GCCACHEADAPTPOLICY}"
1099 if $GCCACHESAMPLINGFLAG
1100 then # GC_CACHE_ADAPT version
1101 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_SAMPLING"
1106 cp $ROBUSTROOT/Tilera/Runtime/MGC/$MAKEFILE ./Makefile
1108 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$MAKEFILE ./Makefile
1111 then # TILERABMEFLAG
1112 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$SIMHVC ./sim.hvc
1113 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$PCIHVC ./pci.hvc
1114 if $TILERA56COREFLAG
1116 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc.56 ./bamboo-vmlinux-pci.hvc.56
1118 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc ./bamboo-vmlinux-pci.hvc
1121 cp ../Runtime/Queue.c ./
1122 cp ../Runtime/file.c ./
1123 cp ../Runtime/math.c ./
1126 cp ../Runtime/object.c ./
1128 cp ../Runtime/GenericHashtable.c ./
1129 cp ../Runtime/SimpleHash.c ./
1130 cp ../Runtime/ObjectHash.c ./
1131 cp ../Runtime/socket.c ./
1132 cp ../Runtime/mem.c ./
1133 cp ../Runtime/GenericHashtable.h ./
1134 cp ../Runtime/mem.h ./
1137 cp ../Runtime/object.h ./
1139 cp ../Runtime/ObjectHash.h ./
1140 cp ../Runtime/Queue.h ./
1141 cp ../Runtime/runtime.h ./
1142 cp ../Runtime/SimpleHash.h ./
1144 cp ../Runtime/coreprof/coreprof.c ./coreprof/
1145 cp ../Runtime/coreprof/coreprof.h ./coreprof/
1146 cp $BAMBOORUNTIME/multicoretask.c ./
1147 cp $BAMBOORUNTIME/multicoreruntime.c ./
1148 cp $BAMBOORUNTIME/multicoremem.c ./
1149 cp $BAMBOORUNTIME/multicoregarbage.c ./
1150 cp $BAMBOORUNTIME/GCSharedHash.c ./
1151 cp $BAMBOORUNTIME/MGCHash.c ./
1152 cp $BAMBOORUNTIME/multicoreruntime.h ./
1153 cp $BAMBOORUNTIME/multicoremem.h ./
1154 cp $BAMBOORUNTIME/multicoregarbage.h ./
1155 cp $BAMBOORUNTIME/multicorecache.h ./
1156 cp $BAMBOORUNTIME/multicoregc.h ./
1157 cp $BAMBOORUNTIME/multicorehelper.h ./
1158 cp $BAMBOORUNTIME/GCSharedHash.h ./
1159 cp $BAMBOORUNTIME/MGCHash.h ./
1160 cp ../Tilera/Runtime/*.c ./
1161 cp ../Tilera/Runtime/*.h ./
1162 cp ../Tilera/Runtime/$TILERA_INDIR/*.c ./
1163 cp ../Tilera/Runtime/$TILERA_INDIR/*.h ./
1164 if $TILERAZLINUXFLAG
1165 then # TILERAZLINUXFLAG
1166 cp ../Tilera/Runtime/$TILERA_INDIR/*.S ./
1168 #if $TILERAMEMPROFFLAG
1169 #then # TILERAMEMPROFFLAG
1170 cp ../Tilera/Runtime/$TILERA_INDIR/linux_client.c ./
1174 cp ../Tilera/Runtime/MGC/*.c ./
1175 cp ../Tilera/Runtime/MGC/*.h ./
1177 cp ../Tilera/lib/* ./
1178 cp ../$tmpbuilddirectory/*.c ./
1179 cp ../$tmpbuilddirectory/*.h ./
1183 else #!RAWFLAG && !TILERABMEFLAG && ! TILERAZLINUXFLAG
1186 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
1191 RUNTIMEFILE="$BAMBOORUNTIME/multicoreruntime.c $BAMBOORUNTIME/multicoretask.c"
1192 INCLUDES="$INCLUDES -I$BAMBOORUNTIME"
1194 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
1197 FILES="$RUNTIMEFILE \
1198 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
1199 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
1200 $ROBUSTROOT/Runtime/ObjectHash.c \
1201 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
1202 $ROBUSTROOT/Runtime/math.c \
1203 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
1207 FILES="$FILES $ROBUSTROOT/Runtime/affinity.c"
1212 FILES="$FILES $ROBUSTROOT/Runtime/STM/monitor.c"
1217 FILES="$FILES $ROBUSTROOT/Runtime/memcpy32.o $ROBUSTROOT/Runtime/instrset32.o"
1224 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRECOVERYRUNTIME"
1225 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"
1227 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
1228 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"
1234 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$STMRUNTIME"
1235 FILES="$FILES $STMRUNTIME/stmlock.c $STMRUNTIME/stm.c $STMRUNTIME/stmlookup.c $ROBUSTROOT/Runtime/thread.c $STMRUNTIME/stats.c $STMRUNTIME/commit.c $STMRUNTIME/objstr.c"
1242 FILES="$FILES $DSMRUNTIME/sandbox.c"
1244 FILES="$FILES $STMRUNTIME/sandbox.c"
1250 FILES="$FILES $DSMRUNTIME/abortreaders.c"
1255 FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
1260 FILES="$FILES $ROBUSTROOT/Runtime/coreprof/coreprof.c"
1265 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"
1270 FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"
1271 FILES="$FILES $ROBUSTROOT/Runtime/psemaphore.c"
1272 FILES="$FILES $ROBUSTROOT/Runtime/workschedule.c"
1275 FILES="$FILES $ROBUSTROOT/Runtime/deque.c"
1281 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
1284 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
1286 FILES="$FILES $tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
1289 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
1291 if $THREADSIMULATEFLAG
1293 # -lpthread for pthread functions, -lrt for message queue functions
1294 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
1300 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
1301 FILES="$FILES $tmpbuilddirectory/optionalarrays.c"
1306 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
1311 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
1312 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
1317 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
1321 echo EXTRAOPTIONS=$EXTRAOPTIONS
1325 gcc -S $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
1326 -c $tmpbuilddirectory/methods.c -lm
1333 NONMULTICOREOPTS=-DPRECISE_GC
1338 gcc -E $INCLUDES $EXTRAOPTIONS $NONMULTICOREOPTS \
1339 $tmpbuilddirectory/methods.c $FILES > tmp.c
1342 gcc $INCLUDES $EXTRAOPTIONS $NONMULTICOREOPTS \
1343 $tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin