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 -abcclose turnoff array boundary checks
105 echo -builddir setup different build directory
106 echo -robustroot set up the ROBUSTROOT to directory other than default one
107 echo -readset turn on readset
108 echo -mac distributed shared memory mac support
109 echo -check generate check code
110 echo -dmalloc link in dmalloc
111 echo -64bit compile for 64 bit machine
112 echo -32bit compile for 32 bit machine
113 echo -joptimize java compiler optimizations
114 echo -noloop turnoff loop optimizations
115 echo -recover compile task code
116 echo -fastcheck fast checkpointing for Bristlecone
117 echo -specdir directory
118 echo -printflat print out flat representation
119 echo -selfloop task - this task cannot self loop forever
120 echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
121 echo -taskstate do task state analysis
122 echo -tagstate do tag state analysis
123 echo -optional enable optional
124 echo -debug generate debug symbols
125 echo -prefetch do prefetch analysis
126 echo -heapsize-mb NUM set initial heap size in MB, default is 256
127 echo -garbagestats Print garbage collection statistics
128 echo -webinterface enable web interface
129 echo -runtimedebug printout runtime debug messages
130 echo "-thread use support for multiple threads"
131 echo "-optimize call gcc with -O9 (optimize)"
132 echo "-nooptimize call gcc with -O0 (do not optimize)"
133 echo -curdir directory
134 echo -mainclass class with main method
136 echo -nojava do not run bristlecone compiler
137 echo -instructionfailures inject code for instructionfailures
138 echo -profile build with profile options
139 echo "-enable-assertions execute assert statements during compilation"
140 echo -justanalyze exit after compiler analyses complete
141 echo -assembly generate assembly
142 echo -recovery compile recovery code
143 echo -dsmtask support work and task class library
144 echo -recoverystats print out recovery record
145 echo -src-after-pp prints source code after preprocessor to tmp.c
149 tmpbuilddirectory="tmpbuilddirectory"
155 ROBUSTROOT=~/research/Robust/src
156 DSMRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface/
157 STMRUNTIME=$ROBUSTROOT/Runtime/STM/
158 DSMRECOVERYRUNTIME=$ROBUSTROOT/Runtime/DSTM/interface_recovery/
159 REPAIRROOT=~/research/Repair/RepairCompiler/
175 RCR_DEBUG_VERBOSE=false
181 TILERAZLINUXFLAG=false
182 TILERAMEMPROFFLAG=false
191 ACCURATEPROFILEFLAG=false
192 PROFILEINTERRUPTFLAG=false
195 THREADSIMULATEFLAG=false;
196 MULTICOREGCFLAG=false;
197 GCMEMLOCALFLAG=false;
198 GCMEMFIXEDFLAG=false;
199 GCMEMMIXEDFLAG=false;
200 GCMEMGLOBALFLAG=false;
201 GCCACHELOCALFLAG=false;
202 GCCACHERANFLAG=false;
203 GCCONTROLLERNEARFLAG=false;
204 GCCONTROLLERREMOTEFLAG=false;
205 GCSMALLPAGESIZEFLAG=false;
206 GCLARGEPAGESIZEFLAG=false;
207 GCLARGEPAGESIZE2FLAG=false;
208 GCLARGESHAREDHEAPFLAG=false;
209 GCSMALLPAGESIZEFLAG2=false;
210 GCLARGESHAREDHEAPFLAG2=false;
211 GCCACHEADAPTFLAG=false
212 GCCACHEADAPTPOLICYFLAG=false
213 GCCACHEADAPTPOLICY=''
214 GCCACHESAMPLINGFLAG=false
226 EXITAFTERANALYSIS=false
229 TILERAN1COREFLAG=false
230 TILERA56COREFLAG=false
240 if [[ $1 = '-help' ]]
245 elif [[ $1 = '-justanalyze' ]]
247 EXITAFTERANALYSIS=true
249 elif [[ $1 = '-src-after-pp' ]]
253 elif [[ $1 = '-assembly' ]]
256 elif [[ $1 = '-abortreaders' ]]
259 EXTRAOPTIONS="$EXTRAOPTIONS -DABORTREADERS"
260 JAVAOPTS="$JAVAOPTS -abortreaders"
261 elif [[ $1 = '-sandbox' ]]
264 EXTRAOPTIONS="$EXTRAOPTIONS -DSANDBOX"
265 JAVAOPTS="$JAVAOPTS -sandbox"
266 elif [[ $1 = '-numa' ]]
268 EXTRAOPTIONS="$EXTRAOPTIONS -DAFFINITY -D_GNU_SOURCE"
270 elif [[ $1 = '-robustroot' ]]
274 elif [[ $1 = '-builddir' ]]
276 tmpbuilddirectory="$2"
278 elif [[ $1 = '-nojava' ]]
281 elif [[ $1 = '-eventmonitor' ]]
283 JAVAOPTS="$JAVAOPTS -eventmonitor"
285 EXTRAOPTIONS="$EXTRAOPTIONS -DEVENTMONITOR"
286 elif [[ $1 = '-garbagestats' ]]
288 EXTRAOPTIONS="$EXTRAOPTIONS -DGARBAGESTATS"
289 elif [[ $1 = '-64bit' ]]
291 EXTRAOPTIONS="$EXTRAOPTIONS -DBIT64 -m64"
292 elif [[ $1 = '-32bit' ]]
294 EXTRAOPTIONS="$EXTRAOPTIONS -m32"
295 elif [[ $1 = '-fastcheck' ]]
297 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTCHECK"
298 JAVAOPTS="$JAVAOPTS -fastcheck"
304 elif [[ $1 = '-mainclass' ]]
306 JAVAOPTS="$JAVAOPTS -mainclass $2"
308 elif [[ $1 = '-selfloop' ]]
310 JAVAOPTS="$JAVAOPTS -selfloop $2"
312 elif [[ $1 = '-excprefetch' ]]
314 JAVAOPTS="$JAVAOPTS -excprefetch $2"
316 elif [[ $1 = '-arraypad' ]]
318 JAVAOPTS="$JAVAOPTS -arraypad"
319 elif [[ $1 = '-dsm' ]]
321 JAVAOPTS="$JAVAOPTS -dsm"
323 elif [[ $1 = '-fastmemcpy' ]]
326 EXTRAOPTIONS="$EXTRAOPTIONS -DFASTMEMCPY"
327 elif [[ $1 = '-singleTM' ]]
329 JAVAOPTS="$JAVAOPTS -singleTM"
330 EXTRAOPTIONS="$EXTRAOPTIONS -DSTM"
332 elif [[ $1 = '-stmarray' ]]
334 JAVAOPTS="$JAVAOPTS -stmarray"
335 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMARRAY"
337 elif [[ $1 = '-dualview' ]]
339 JAVAOPTS="$JAVAOPTS -dualview"
340 EXTRAOPTIONS="$EXTRAOPTIONS -DDUALVIEW"
342 elif [[ $1 = '-readset' ]]
344 JAVAOPTS="$JAVAOPTS -readset"
345 EXTRAOPTIONS="$EXTRAOPTIONS -DREADSET"
346 elif [[ $1 = '-stmdebug' ]]
348 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMDEBUG"
349 elif [[ $1 = '-stmstats' ]]
351 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMSTATS"
352 elif [[ $1 = '-stmlog' ]]
354 EXTRAOPTIONS="$EXTRAOPTIONS -DSTMLOG"
355 elif [[ $1 = '-prefetch' ]]
357 JAVAOPTS="$JAVAOPTS -prefetch"
358 elif [[ $1 = '-transstats' ]]
360 EXTRAOPTIONS="$EXTRAOPTIONS -DTRANSSTATS"
361 elif [[ $1 = '-printflat' ]]
363 JAVAOPTS="$JAVAOPTS -printflat"
364 elif [[ $1 = '-trueprob' ]]
366 JAVAOPTS="$JAVAOPTS -trueprob $2"
368 elif [[ $1 = '-inlineatomic' ]]
370 JAVAOPTS="$JAVAOPTS -inlineatomic $2"
372 elif [[ $1 = '-mac' ]]
374 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
375 elif [[ $1 = '-squeue' ]]
377 EXTRAOPTIONS="$EXTRAOPTIONS -DSQUEUE"
378 elif [[ $1 = '-corepin' ]]
380 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPIN"
382 elif [[ $1 = '-profile' ]]
385 EXTRAOPTIONS="$EXTRAOPTIONS -pg"
386 elif [[ $1 = '-gcprofile' ]]
389 elif [[ $1 = '-gcprofile_s' ]]
392 elif [[ $1 = '-accurateprofile' ]]
394 ACCURATEPROFILEFLAG=true
395 elif [[ $1 = '-profile_interrupt' ]]
397 PROFILEINTERRUPTFLAG=true
398 elif [[ $1 = '-useio' ]]
401 elif [[ $1 = '-taskstate' ]]
403 JAVAOPTS="$JAVAOPTS -taskstate"
404 elif [[ $1 = '-tagstate' ]]
406 JAVAOPTS="$JAVAOPTS -tagstate"
407 elif [[ $1 = '-scheduling' ]]
409 JAVAOPTS="$JAVAOPTS -scheduling"
410 elif [[ $1 = '-multicore' ]]
413 JAVAOPTS="$JAVAOPTS -multicore"
414 elif [[ $1 = '-numcore' ]]
416 JAVAOPTS="$JAVAOPTS -numcore $2"
417 if [[ "$2" -gt "1" ]]
419 TILERAN1COREFLAG=true
420 if [[ "$2" -eq "56" ]]
422 TILERA56COREFLAG=true
426 elif [[ $1 = '-numcore4gc' ]]
428 JAVAOPTS="$JAVAOPTS -numcore4gc $2"
431 elif [[ $1 = '-raw' ]]
434 JAVAOPTS="$JAVAOPTS -raw"
435 elif [[ $1 = '-tilera_bme' ]]
439 elif [[ $1 = '-tilera_zlinux' ]]
442 TILERAZLINUXFLAG=true
443 elif [[ $1 = '-tilera_memprof' ]]
445 TILERAMEMPROFFLAG=true
446 elif [[ $1 = '-tileraconfig' ]]
450 elif [[ $1 = '-cacheflush' ]]
453 elif [[ $1 = '-rawconfig' ]]
457 elif [[ $1 = '-interrupt' ]]
460 elif [[ $1 = '-abcclose' ]]
462 JAVAOPTS="$JAVAOPTS -abcclose"
463 elif [[ $1 = '-optional' ]]
465 JAVAOPTS="$JAVAOPTS -optional"
467 elif [[ $1 = '-multicoregc' ]]
470 JAVAOPTS="$JAVAOPTS -multicoregc"
471 elif [[ $1 = '-gcmem_local' ]]
474 elif [[ $1 = '-gcmem_fixed' ]]
477 elif [[ $1 = '-gcmem_mixed' ]]
480 elif [[ $1 = '-gcmem_global' ]]
483 elif [[ $1 = '-gccache_local' ]]
485 GCCACHELOCALFLAG=true
486 elif [[ $1 = '-gccache_ran' ]]
489 elif [[ $1 = '-gccontroller_near' ]]
491 GCCONTROLLERNEARFLAG=true
492 elif [[ $1 = '-gccontroller_remote' ]]
494 GCCONTROLLERREMOTEFLAG=true
495 elif [[ $1 = '-gcsmallpagesize' ]]
497 GCSMALLPAGESIZEFLAG=true
498 elif [[ $1 = '-gcsmallpagesize2' ]]
500 GCSMALLPAGESIZEFLAG2=true
501 elif [[ $1 = '-gclargepagesize' ]]
503 GCLARGEPAGESIZEFLAG=true
504 elif [[ $1 = '-gclargepagesize2' ]]
506 GCLARGEPAGESIZE2FLAG=true
507 elif [[ $1 = '-gclargesharedheap' ]]
509 GCLARGESHAREDHEAPFLAG=true
510 elif [[ $1 = '-gclargesharedheap2' ]]
512 GCLARGESHAREDHEAPFLAG2=true
513 elif [[ $1 = '-gccacheadapt' ]]
515 GCCACHEADAPTFLAG=true
516 elif [[ $1 = '-gccacheadaptpolicy' ]]
518 GCCACHEADAPTPOLICYFLAG=true
519 GCCACHEADAPTPOLICY="$2"
521 elif [[ $1 = '-gccachesampling' ]]
523 GCCACHESAMPLINGFLAG=true
524 elif [[ $1 = '-mgc' ]]
527 JAVAOPTS="$JAVAOPTS -mgc"
528 elif [[ $1 = '-dmalloc' ]]
531 elif [[ $1 = '-recover' ]]
534 JAVAOPTS="$JAVAOPTS -task"
535 elif [[ $1 = '-useprofile' ]]
537 JAVAOPTS="$JAVAOPTS -useprofile $2"
539 elif [[ $1 = '-webinterface' ]]
541 JAVAOPTS="$JAVAOPTS -webinterface"
542 elif [[ $1 = '-instructionfailures' ]]
544 JAVAOPTS="$JAVAOPTS -instructionfailures"
545 elif [[ $1 = '-joptimize' ]]
547 JAVAOPTS="$JAVAOPTS -optimize"
548 elif [[ $1 = '-noloop' ]]
550 JAVAOPTS="$JAVAOPTS -noloop"
551 elif [[ $1 = '-dcopts' ]]
553 JAVAOPTS="$JAVAOPTS -dcopts"
554 elif [[ $1 = '-delaycomp' ]]
556 JAVAOPTS="$JAVAOPTS -delaycomp"
557 EXTRAOPTIONS="$EXTRAOPTIONS -DDELAYCOMP"
558 elif [[ $1 = '-hybrid' ]]
560 JAVAOPTS="$JAVAOPTS -hybrid"
561 EXTRAOPTIONS="$EXTRAOPTIONS -DHYBRID"
562 elif [[ $1 = '-minimize' ]]
564 JAVAOPTS="$JAVAOPTS -minimize"
566 elif [[ $1 = '-ooojava' ]]
569 JAVAOPTS="$JAVAOPTS -ooojava $2 $3"
570 EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
574 elif [[ $1 = '-ooodebug-disable-task-mem-pool' ]]
576 EXTRAOPTIONS="$EXTRAOPTIONS -DOOO_DISABLE_TASKMEMPOOL"
578 elif [[ $1 = '-mempool-detect-misuse' ]]
580 EXTRAOPTIONS="$EXTRAOPTIONS -DMEMPOOL_DETECT_MISUSE"
582 elif [[ $1 = '-heapsize-mb' ]]
584 EXTRAOPTIONS="$EXTRAOPTIONS -DINITIALHEAPSIZE_MB=($2)"
587 elif [[ $1 = '-nostalltr' ]]
589 JAVAOPTS="$JAVAOPTS -nostalltr"
591 elif [[ $1 = '-rcr' ]]
593 JAVAOPTS="$JAVAOPTS -rcr"
595 EXTRAOPTIONS="$EXTRAOPTIONS -DRCR -I$ROBUSTROOT/Runtime/oooJava"
597 elif [[ $1 = '-rcr_debug' ]]
599 JAVAOPTS="$JAVAOPTS -rcr_debug"
602 elif [[ $1 = '-rcr_debug_verbose' ]]
604 JAVAOPTS="$JAVAOPTS -rcr_debug_verbose"
605 RCR_DEBUG_VERBOSE=true
607 elif [[ $1 = '-debug-deque' ]]
609 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG_DEQUE"
611 elif [[ $1 = '-coreprof' ]]
614 JAVAOPTS="$JAVAOPTS -coreprof"
615 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF -I$ROBUSTROOT/Runtime/coreprof"
617 elif [[ $1 = '-coreprof-eventwords' ]]
619 EXTRAOPTIONS="$EXTRAOPTIONS -DCP_MAXEVENTWORDS=($2)"
622 elif [[ $1 = '-coreprof-checkoverflow' ]]
624 EXTRAOPTIONS="$EXTRAOPTIONS -DCOREPROF_CHECKOVERFLOW"
626 elif [[ $1 = '-coreprof-enable' ]]
628 EXTRAOPTIONS="$EXTRAOPTIONS -D$2"
631 elif [[ $1 = '-mlp' ]]
634 EXTRAOPTIONS="$EXTRAOPTIONS -DPRECISE_GC -lpthread -DMLP"
635 JAVAOPTS="$JAVAOPTS -mlp $2 $3"
639 elif [[ $1 = '-mlpdebug' ]]
641 JAVAOPTS="$JAVAOPTS -mlpdebug"
643 elif [[ $1 = '-check' ]]
646 JAVAOPTS="$JAVAOPTS -conscheck"
647 elif [[ $1 = '-enable-assertions' ]]
649 JAVAFORWARDOPTS="$JAVAFORWARDOPTS -ea"
650 elif [[ $1 = '-specdir' ]]
656 elif [[ $1 = '-debug' ]]
659 EXTRAOPTIONS="$EXTRAOPTIONS -g -rdynamic"
660 elif [[ $1 = '-rawpath' ]]
663 elif [[ $1 = '-runtimedebug' ]]
665 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
666 elif [[ $1 = '-dsmcaching' ]]
668 EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
669 elif [[ $1 = '-rangeprefetch' ]]
671 EXTRAOPTIONS="$EXTRAOPTIONS -DRANGEPREFETCH"
672 elif [[ $1 = '-nooptimize' ]]
674 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
675 elif [[ $1 = '-optimize' ]]
677 EXTRAOPTIONS="$EXTRAOPTIONS -O3"
678 elif [[ $1 = '-thread' ]]
680 JAVAOPTS="$JAVAOPTS -thread"
681 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
683 elif [[ $1 = '-recovery' ]]
685 EXTRAOPTIONS="$EXTRAOPTIONS -DRECOVERY"
687 elif [[ $1 = '-recoverystats' ]]
689 JAVAOPTS="$JAVAOPTS -recoverystats"
690 EXTRAOPTIONS="$EXTRAOPTIONS -DRECOVERYSTATS"
691 elif [[ $1 = '-distributioninfo' ]]
693 JAVAOPTS="$JAVAOPTS -distributioninfo"
694 elif [[ $1 = '-disall' ]]
696 JAVAOPTS="$JAVAOPTS -disall"
697 elif [[ $1 = '-disstart' ]]
699 JAVAOPTS="$JAVAOPTS -disstart $2"
701 elif [[ $1 = '-noc' ]]
704 elif [[ $1 = '-curdir' ]]
708 elif [[ $1 = '-outputdir' ]]
710 JAVAOPTS="$JAVAOPTS -outputdir $2"
713 SRCFILES="$SRCFILES $1"
718 BUILDDIR="$CURDIR/$tmpbuilddirectory"
720 BAMBOORUNTIME=$ROBUSTROOT/Runtime/bamboo
728 if $CHECKFLAG #Generate structure files for repair tool
730 JAVAOPTS="$JAVAOPTS -struct structfile"
737 #base multicore gc files
738 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/MGC/ -classlibrary $ROBUSTROOT/ClassLibrary/MGC/gnu/"
745 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
747 #base bristlecone files
748 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
754 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
757 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaSTM"
760 #threading java stuff
761 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
764 JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
768 # Build bristlecone/java sources
772 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main \
773 -dir $BUILDDIR $JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/ \
774 -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ $SRCFILES
778 #if ! ${ROBUSTROOT}/ourjava -Xms5m -Xmx100m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
781 if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx1500m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
782 $ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ -dir $BUILDDIR -precise \
789 if $EXITAFTERANALYSIS
794 # Build all of the consistency specs
796 if $CHECKFLAG # CHECKFLAG
799 mkdir $BUILDDIR/specdir
800 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
802 echo > $BUILDDIR/specs
804 # compile specs into C code
805 for i in * # iterate over all directories
807 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
810 cat $BUILDDIR/structfile.struct $i.label > $i.struct
811 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
812 cp size.[c,h] $BUILDDIR/specdir
813 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
814 echo $i >> $BUILDDIR/specs
816 done # iterate over all directories
822 echo > $BUILDDIR/checkers.h
823 for i in `cat $BUILDDIR/specs`
825 gcc -O0 -g -fbounds-check -c $i\_aux.c
826 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
830 #build and link everything
835 MAKEFILE="Makefile.raw"
841 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
845 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DCACHEFLUSH"
850 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"
855 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DDEBUG"
859 then # profile version
860 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DPROFILE"
863 if $ACCURATEPROFILEFLAG
864 then # accurateprofile version
865 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DACCURATEPROFILE"
870 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DUSEIO"
874 then #INTERRUPT version
875 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DINTERRUPT"
876 fi #INTERRUPT version
880 MAKEFILE="$MAKEFILE.io"
881 echo "+++++++++++use Makefile.raw.io++++++++++++++++"
883 MAKEFILE="$MAKEFILE.$RAWCONFIG"
886 cp $BAMBOORUNTIME/RAW/$MAKEFILE ./Makefile
892 cp ../Runtime/coreprof/*.c ./coreprof/
893 cp ../Runtime/coreprof/*.h ./coreprof/
894 cp $BAMBOORUNTIME/*.c ./
895 cp $BAMBOORUNTIME/*.h ./
896 cp $BAMBOORUNTIME/RAW/*.c ./
897 cp $BAMBOORUNTIME/RAW/*.h ./
898 cp $BAMBOORUNTIME/RAW/*.S ./
899 cp $BAMBOORUNTIME/RAW/*.s ./
900 cp ../$tmpbuilddirectory/*.c ./
901 cp ../$tmpbuilddirectory/*.h ./
907 TILERADIR="$CURDIR/tilera"
911 MAKEFILE="Makefile.tilera.$TILERACONFIG"
912 SIMHVC="sim.hvc.$TILERACONFIG"
913 PCIHVC="pci.hvc.$TILERACONFIG"
918 elif $TILERAZLINUXFLAG
919 then # TILERAZLINUXFLAG
920 TILERA_INDIR="ZLinux"
921 MAKEFILE="Makefile.tilera.$TILERACONFIG"
931 export TILERACFLAGS="-DMULTICORE -DCLOSE_PRINT -DTILERA"
933 export TILERACFLAGS="-DTASK -DMULTICORE -DCLOSE_PRINT -DTILERA"
936 if $TILERAMEMPROFFLAG
937 then # not only with 1 core
938 PCIHVC="$PCIHVC.memprof"
939 TILERACFLAGS="${TILERACFLAGS} -DBAMBOO_MEMPROF"
944 TILERACFLAGS="${TILERACFLAGS} -DTILERA_BME"
945 elif $TILERAZLINUXFLAG
946 then # TILERAZLINUXFLAG
947 TILERACFLAGS="${TILERACFLAGS} -DTILERA_ZLINUX"
952 TILERACFLAGS="${TILERACFLAGS} -DCACHEFLUSH"
957 TILERACFLAGS="${TILERACFLAGS} -DRAWPATH"
962 TILERACFLAGS="${TILERACFLAGS} -DDEBUG"
966 then # profile version
967 TILERACFLAGS="${TILERACFLAGS} -DPROFILE"
970 if $ACCURATEPROFILEFLAG
971 then # accurateprofile version
972 TILERACFLAGS="${TILERACFLAGS} -DACCURATEPROFILE"
975 if $PROFILEINTERRUPTFLAG
976 then # profile_interrupt version
977 TILERACFLAGS="${TILERACFLAGS} -DPROFILE_INTERRUPT"
982 TILERACFLAGS="${TILERACFLAGS} -DUSEIO"
986 then #INTERRUPT version
987 TILERACFLAGS="${TILERACFLAGS} -DINTERRUPT"
988 fi #INTERRUPT version
992 TILERACFLAGS="${TILERACFLAGS} -DMGC"
996 then #MULTICOREGC version
997 TILERACFLAGS="${TILERACFLAGS} -DMULTICORE_GC -D${GCCORES}"
1001 then # GC_PROFILE version
1002 TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE"
1006 then # GC_PROFILE_S version
1007 TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE_S"
1011 then # SMEMLOCAL version
1012 TILERACFLAGS="${TILERACFLAGS} -DSMEML"
1016 then # SMEMFIXED version
1017 TILERACFLAGS="${TILERACFLAGS} -DSMEMF"
1021 then # SMEMMIXED version
1022 TILERACFLAGS="${TILERACFLAGS} -DSMEMM"
1026 then # SMEMGLOBAL version
1027 TILERACFLAGS="${TILERACFLAGS} -DSMEMG"
1030 if $GCCACHELOCALFLAG
1031 then # CACHE_LOCAL version
1032 TILERACFLAGS="${TILERACFLAGS} -DCACHE_LOCAL"
1036 then # CACHE_RAN version
1037 TILERACFLAGS="${TILERACFLAGS} -DCACHE_RAN"
1040 if $GCCONTROLLERNEARFLAG
1041 then # CONTROLLER_NEAR version
1042 TILERACFLAGS="${TILERACFLAGS} -DCONTROLLER_NEAR"
1045 if $GCCONTROLLERREMOTEFLAG
1046 then # CONTROLLER_REMOTE version
1047 TILERACFLAGS="${TILERACFLAGS} -DCONTROLLER_REMOTE"
1050 if $GCSMALLPAGESIZEFLAG
1051 then # GC_SMALLPAGESIZE version
1052 TILERACFLAGS="${TILERACFLAGS} -DGC_SMALLPAGESIZE"
1055 if $GCLARGEPAGESIZEFLAG
1056 then # GC_LARGEPAGESIZE version
1057 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE"
1060 if $GCLARGEPAGESIZE2FLAG
1061 then # GC_LARGEPAGESIZE2 version
1062 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGEPAGESIZE2"
1065 if $GCLARGESHAREDHEAPFLAG
1066 then # GC_LARGESHAREDHEAP version
1067 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP"
1070 if $GCSMALLPAGESIZEFLAG2
1071 then # GC_SMALLPAGESIZE2 version
1072 TILERACFLAGS="${TILERACFLAGS} -DGC_SMALLPAGESIZE2"
1075 if $GCLARGESHAREDHEAPFLAG2
1076 then # GC_LARGESHAREDHEAP2 version
1077 TILERACFLAGS="${TILERACFLAGS} -DGC_LARGESHAREDHEAP2"
1080 if $GCCACHEADAPTFLAG
1081 then # GC_CACHE_ADAPT version
1082 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_ADAPT"
1085 if $GCCACHEADAPTPOLICYFLAG
1086 then # GC_CACHE_ADAPT version
1087 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_ADAPT_POLICY${GCCACHEADAPTPOLICY}"
1090 if $GCCACHESAMPLINGFLAG
1091 then # GC_CACHE_ADAPT version
1092 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_SAMPLING"
1097 cp $ROBUSTROOT/Tilera/Runtime/MGC/$MAKEFILE ./Makefile
1099 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$MAKEFILE ./Makefile
1102 then # TILERABMEFLAG
1103 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$SIMHVC ./sim.hvc
1104 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/$PCIHVC ./pci.hvc
1105 if $TILERA56COREFLAG
1107 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc.56 ./bamboo-vmlinux-pci.hvc.56
1109 cp $ROBUSTROOT/Tilera/Runtime/$TILERA_INDIR/bamboo-vmlinux-pci.hvc ./bamboo-vmlinux-pci.hvc
1112 cp ../Runtime/Queue.c ./
1113 cp ../Runtime/file.c ./
1114 cp ../Runtime/math.c ./
1117 cp ../Runtime/object.c ./
1119 cp ../Runtime/GenericHashtable.c ./
1120 cp ../Runtime/SimpleHash.c ./
1121 cp ../Runtime/ObjectHash.c ./
1122 cp ../Runtime/socket.c ./
1123 cp ../Runtime/mem.c ./
1124 cp ../Runtime/GenericHashtable.h ./
1125 cp ../Runtime/mem.h ./
1128 cp ../Runtime/object.h ./
1130 cp ../Runtime/ObjectHash.h ./
1131 cp ../Runtime/Queue.h ./
1132 cp ../Runtime/runtime.h ./
1133 cp ../Runtime/SimpleHash.h ./
1135 cp ../Runtime/coreprof/coreprof.c ./coreprof/
1136 cp ../Runtime/coreprof/coreprof.h ./coreprof/
1137 cp $BAMBOORUNTIME/multicoretask.c ./
1138 cp $BAMBOORUNTIME/multicoreruntime.c ./
1139 cp $BAMBOORUNTIME/multicoremem.c ./
1140 cp $BAMBOORUNTIME/multicoregarbage.c ./
1141 cp $BAMBOORUNTIME/GCSharedHash.c ./
1142 cp $BAMBOORUNTIME/MGCHash.c ./
1143 cp $BAMBOORUNTIME/multicoreruntime.h ./
1144 cp $BAMBOORUNTIME/multicoremem.h ./
1145 cp $BAMBOORUNTIME/multicoregarbage.h ./
1146 cp $BAMBOORUNTIME/multicorecache.h ./
1147 cp $BAMBOORUNTIME/multicoregc.h ./
1148 cp $BAMBOORUNTIME/multicorehelper.h ./
1149 cp $BAMBOORUNTIME/GCSharedHash.h ./
1150 cp $BAMBOORUNTIME/MGCHash.h ./
1151 cp ../Tilera/Runtime/*.c ./
1152 cp ../Tilera/Runtime/*.h ./
1153 cp ../Tilera/Runtime/$TILERA_INDIR/*.c ./
1154 cp ../Tilera/Runtime/$TILERA_INDIR/*.h ./
1155 if $TILERAZLINUXFLAG
1156 then # TILERAZLINUXFLAG
1157 cp ../Tilera/Runtime/$TILERA_INDIR/*.S ./
1159 #if $TILERAMEMPROFFLAG
1160 #then # TILERAMEMPROFFLAG
1161 cp ../Tilera/Runtime/$TILERA_INDIR/linux_client.c ./
1165 cp ../Tilera/Runtime/MGC/*.c ./
1166 cp ../Tilera/Runtime/MGC/*.h ./
1168 cp ../Tilera/lib/* ./
1169 cp ../$tmpbuilddirectory/*.c ./
1170 cp ../$tmpbuilddirectory/*.h ./
1174 else #!RAWFLAG && !TILERABMEFLAG && ! TILERAZLINUXFLAG
1177 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
1182 RUNTIMEFILE="$BAMBOORUNTIME/multicoreruntime.c $BAMBOORUNTIME/multicoretask.c"
1183 INCLUDES="$INCLUDES -I$BAMBOORUNTIME"
1185 RUNTIMEFILE="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/task.c"
1188 FILES="$RUNTIMEFILE \
1189 $ROBUSTROOT/Runtime/file.c $ROBUSTROOT/Runtime/Queue.c \
1190 $ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/option.c \
1191 $ROBUSTROOT/Runtime/ObjectHash.c \
1192 $ROBUSTROOT/Runtime/garbage.c $ROBUSTROOT/Runtime/socket.c \
1193 $ROBUSTROOT/Runtime/math.c \
1194 $ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
1198 FILES="$FILES $ROBUSTROOT/Runtime/affinity.c"
1203 FILES="$FILES $ROBUSTROOT/Runtime/STM/monitor.c"
1208 FILES="$FILES $ROBUSTROOT/Runtime/memcpy32.o $ROBUSTROOT/Runtime/instrset32.o"
1215 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRECOVERYRUNTIME"
1216 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"
1218 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"
1219 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"
1225 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$STMRUNTIME"
1226 FILES="$FILES $STMRUNTIME/stmlock.c $STMRUNTIME/stm.c $STMRUNTIME/stmlookup.c $ROBUSTROOT/Runtime/thread.c $STMRUNTIME/stats.c $STMRUNTIME/commit.c $STMRUNTIME/objstr.c"
1233 FILES="$FILES $DSMRUNTIME/sandbox.c"
1235 FILES="$FILES $STMRUNTIME/sandbox.c"
1241 FILES="$FILES $DSMRUNTIME/abortreaders.c"
1246 FILES="$FILES $ROBUSTROOT/Runtime/localobjects.c"
1251 FILES="$FILES $ROBUSTROOT/Runtime/coreprof/coreprof.c"
1256 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"
1261 FILES="$FILES $ROBUSTROOT/Runtime/mlp_runtime.c"
1262 FILES="$FILES $ROBUSTROOT/Runtime/psemaphore.c"
1263 FILES="$FILES $ROBUSTROOT/Runtime/workschedule.c"
1266 FILES="$FILES $ROBUSTROOT/Runtime/deque.c"
1272 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
1275 EXTRAOPTIONS="$EXTRAOPTIONS -DMULTICORE"
1277 FILES="$FILES $tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c $ROBUSTROOT/Runtime/chash.c"
1280 EXTRAOPTIONS="$EXTRAOPTIONS -DRAW"
1282 if $THREADSIMULATEFLAG
1284 # -lpthread for pthread functions, -lrt for message queue functions
1285 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADSIMULATE -lpthread -lrt"
1291 EXTRAOPTIONS="$EXTRAOPTIONS -DOPTIONAL"
1292 FILES="$FILES $tmpbuilddirectory/optionalarrays.c"
1297 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
1302 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
1303 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
1308 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
1312 echo EXTRAOPTIONS=$EXTRAOPTIONS
1316 gcc -S $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
1317 -c $tmpbuilddirectory/methods.c -lm
1324 NONMULTICOREOPTS=-DPRECISE_GC
1329 gcc -E $INCLUDES $EXTRAOPTIONS $NONMULTICOREOPTS \
1330 $tmpbuilddirectory/methods.c $FILES > tmp.c
1333 gcc $INCLUDES $EXTRAOPTIONS $NONMULTICOREOPTS \
1334 $tmpbuilddirectory/methods.c $FILES -lm -o $MAINFILE.bin