6 For defaults, see the @initRtsFlagsDefaults@ routine.
11 I_ giveStats; /* ToDo: replace with enum type? */
13 #define VERBOSE_GC_STATS 1
15 I_ stksSize; /* this size is stored to record number of *words* */
16 I_ heapSize; /* this size is stored to record number of *words* */
18 rtsBool allocAreaSizeGiven;
19 I_ specifiedOldGenSize; /* zero => use the rest of the heap */
21 I_ minAllocAreaSize; /* derived from: pcFreeHeap, heap-size */
23 rtsBool force2s; /* force the use of 2-space copying collection;
24 forced to rtsTrue if we do *heap* profiling.
26 rtsBool forceGC; /* force a major GC every <interval> bytes */
27 I_ forcingInterval; /* actually, stored as a number of *words* */
30 /* bit 1 set: chatty GC summaries
31 2 set: details of minor collections
32 4 set: details of major collections, except marking
33 8 set: ditto, but marking this time
34 16 set: GC of ForeignObjs
35 32 set: GC of Concurrent things
37 #define DEBUG_TRACE_MINOR_GC 2
38 #define DEBUG_TRACE_MAJOR_GC 4
39 #define DEBUG_TRACE_MARKING 8
40 #define DEBUG_TRACE_FOREIGNOBJS 16
41 #define DEBUG_TRACE_CONCURRENT 32
43 rtsBool lazyBlackHoling;
44 rtsBool doSelectorsAtGC;
45 rtsBool squeezeUpdFrames;
51 #if defined(PROFILING) || defined(PAR)
52 /* with PROFILING, full cost-centre stuff (also PROFILING_FLAGS);
53 with PAR, just the four fixed cost-centres.
55 struct COST_CENTRE_FLAGS {
57 # define COST_CENTRES_SUMMARY 1
58 # define COST_CENTRES_VERBOSE 2 /* incl. serial time profile */
59 # define COST_CENTRES_ALL 3
62 # define SORTCC_LABEL 'C'
63 # define SORTCC_TIME 'T'
64 # define SORTCC_ALLOC 'A'
66 I_ ctxtSwitchTicks; /* derived */
67 I_ profilerTicks; /* derived */
68 I_ msecsPerTick; /* derived */
73 struct PROFILING_FLAGS {
75 # define NO_HEAP_PROFILING 0 /* N.B. Used as indexes into arrays */
77 # define HEAP_BY_MOD 2
78 # define HEAP_BY_GRP 3
79 # define HEAP_BY_DESCR 4
80 # define HEAP_BY_TYPE 5
81 # define HEAP_BY_TIME 6
86 # define DESCRchar 'D'
100 struct CONCURRENT_FLAGS {
101 I_ ctxtSwitchTime; /* in milliseconds */
106 #endif /* CONCURRENT */
110 rtsBool parallelStats; /* Gather parallel statistics */
111 rtsBool granSimStats; /* Full .gr profile (rtsTrue) or only END events? */
112 rtsBool granSimStats_Binary;
114 rtsBool outputDisabled; /* Disable output for performance purposes */
123 rtsBool granSimStats; /* Full .gr profile (rtsTrue) or only END events? */
124 rtsBool granSimStats_suppressed; /* No .gr profile at all */
125 rtsBool granSimStats_Binary;
126 rtsBool granSimStats_Sparks;
127 rtsBool granSimStats_Heap;
130 W_ packBufferSize_internal;
132 I_ proc; /* number of processors */
133 I_ max_fishes; /* max number of spark or thread steals */
134 TIME time_slice; /* max time slice of one reduction thread */
136 /* Communication Cost Variables -- set in main program */
137 W_ gran_latency; /* Latency for single packet */
138 W_ gran_additional_latency; /* Latency for additional packets */
140 W_ gran_lunblocktime; /* Time for local unblock */
141 W_ gran_gunblocktime; /* Time for global unblock */
142 W_ gran_mpacktime; /* Cost of creating a packet */
143 W_ gran_munpacktime; /* Cost of receiving a packet */
144 W_ gran_mtidytime; /* Cost of cleaning up after send */
146 W_ gran_threadcreatetime; /* Thread creation costs */
147 W_ gran_threadqueuetime; /* Cost of adding a thread to the running/runnable queue */
148 W_ gran_threaddescheduletime; /* Cost of descheduling a thread */
149 W_ gran_threadscheduletime; /* Cost of scheduling a thread */
150 W_ gran_threadcontextswitchtime; /* Cost of context switch */
152 /* Instruction Costs */
153 W_ gran_arith_cost; /* arithmetic instructions (+,i,< etc) */
154 W_ gran_branch_cost; /* branch instructions */
155 W_ gran_load_cost; /* load into register */
156 W_ gran_store_cost; /* store into memory */
157 W_ gran_float_cost; /* floating point operations */
159 W_ gran_heapalloc_cost; /* heap allocation costs */
161 /* Overhead for granularity control mechanisms */
162 /* overhead per elem of spark queue */
163 W_ gran_pri_spark_overhead;
164 /* overhead per elem of thread queue */
165 W_ gran_pri_sched_overhead;
167 /* GrAnSim-Light: This version puts no bound on the number of
168 processors but in exchange doesn't model communication costs
169 (all communication is 0 cost). Mainly intended to show maximal
170 degree of parallelism in the program (*not* to simulate the
171 execution on a real machine). */
175 rtsBool DoFairSchedule ; /* fair scheduling alg? default: unfair */
176 rtsBool DoReScheduleOnFetch ; /* async. communication? */
177 rtsBool DoStealThreadsFirst; /* prefer threads over sparks when stealing */
178 rtsBool SimplifiedFetch; /* fast but inaccurate fetch modelling */
179 rtsBool DoAlwaysCreateThreads; /* eager thread creation */
180 rtsBool DoGUMMFetching; /* bulk fetching */
181 rtsBool DoThreadMigration; /* allow to move threads */
182 I_ FetchStrategy; /* what to do when waiting for data */
183 rtsBool PreferSparksOfLocalNodes; /* prefer local over global sparks */
184 rtsBool DoPrioritySparking; /* sparks sorted by priorities */
185 rtsBool DoPriorityScheduling; /* threads sorted by priorities */
186 I_ SparkPriority; /* threshold for cut-off mechanism */
188 rtsBool RandomPriorities;
189 rtsBool InversePriorities;
190 rtsBool IgnorePriorities;
191 I_ ThunksToPack; /* number of thunks in packet + 1 */
192 rtsBool RandomSteal; /* steal spark/thread from random proc */
193 rtsBool NoForward; /* no forwarding of fetch messages */
194 rtsBool PrintFetchMisses; /* print number of fetch misses */
198 rtsBool event_trace_all;
205 rtsBool showTickyStats;
208 /* see also: doUpdEntryCounts in AllFlags */
210 #endif /* TICKY_TICKY */
216 struct GC_FLAGS GcFlags;
217 struct DEBUG_FLAGS DebugFlags; /* unused at present */
219 #if defined(PROFILING) || defined(PAR)
220 struct COST_CENTRE_FLAGS CcFlags;
223 struct PROFILING_FLAGS ProfFlags;
226 struct CONCURRENT_FLAGS ConcFlags;
229 struct PAR_FLAGS ParFlags;
232 struct GRAN_FLAGS GranFlags;
235 struct TICKY_FLAGS TickyFlags;
239 extern struct RTS_FLAGS RTSflags;
242 Routines that operate-on/to-do-with RTS flags:
244 void initRtsFlagsDefaults (STG_NO_ARGS);
245 void setupRtsFlags PROTO((int *argc, char *argv[],
246 int *rts_argc, char *rts_argv[]));
249 OLD: This is the maximum identifier length that can be used for a cost
250 centre or description string. It includes the terminating null
253 The printf formats are here, so we are less likely to make overly-long
254 filenames (with disastrous results). No more than 128 chars, please!
257 #define STATS_FILENAME_MAXLEN 128
259 #define GR_FILENAME_FMT "%0.124s.gr"
260 #define GR_FILENAME_FMT_GUM "%0.120s.%03d.%s"
261 #define HP_FILENAME_FMT "%0.124s.hp"
262 #define LIFE_FILENAME_FMT "%0.122s.life"
263 #define PROF_FILENAME_FMT "%0.122s.prof"
264 #define PROF_FILENAME_FMT_GUM "%0.118s.%03d.prof"
265 #define QP_FILENAME_FMT "%0.124s.qp"
266 #define STAT_FILENAME_FMT "%0.122s.stat"
267 #define TICKY_FILENAME_FMT "%0.121s.ticky"
268 #define TIME_FILENAME_FMT "%0.122s.time"
269 #define TIME_FILENAME_FMT_GUM "%0.118s.%03d.time"
272 Multi-slurp protection:
274 #endif /* RTSFLAGS_H */