/* -----------------------------------------------------------------------------
- * $Id: RtsFlags.c,v 1.5 1999/01/19 17:06:04 simonm Exp $
+ * $Id: RtsFlags.c,v 1.20 1999/11/02 15:06:00 simonmar Exp $
+ *
+ * (c) The AQUA Project, Glasgow University, 1994-1997
+ * (c) The GHC Team, 1998-1999
*
* Functions for parsing the argument list.
*
#include "BlockAlloc.h"
#include "ProfRts.h"
+#if defined(PROFILING)
+#include "Itimer.h"
+#endif
+
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
RtsFlags.GcFlags.minAllocAreaSize = (256 * 1024) / BLOCK_SIZE;
RtsFlags.GcFlags.minOldGenSize = (1024 * 1024) / BLOCK_SIZE;
RtsFlags.GcFlags.maxHeapSize = (64 * 1024 * 1024) / BLOCK_SIZE;
+ RtsFlags.GcFlags.heapSizeSuggestion = 0; /* none */
RtsFlags.GcFlags.pcFreeHeap = 3; /* 3% */
RtsFlags.GcFlags.oldGenFactor = 2;
RtsFlags.GcFlags.generations = 2;
+ RtsFlags.GcFlags.steps = 2;
RtsFlags.GcFlags.forceGC = rtsFalse;
RtsFlags.GcFlags.forcingInterval = 5000000; /* 5MB (or words?) */
RtsFlags.ProfFlags.doHeapProfile = rtsFalse;
#endif
-/* there really shouldn't be a threads limit for concurrent mandatory threads.
- For now, unlimitied means less than 64k (there's a storage overhead) -- SOF
-*/
-#if defined(CONCURRENT) && !defined(GRAN)
RtsFlags.ConcFlags.ctxtSwitchTime = CS_MIN_MILLISECS; /* In milliseconds */
- RtsFlags.ConcFlags.maxThreads = 65536;
- RtsFlags.ConcFlags.stkChunkSize = 1024;
- RtsFlags.ConcFlags.maxLocalSparks = 65536;
-#endif /* CONCURRENT only */
-
-#if GRAN
- RtsFlags.ConcFlags.ctxtSwitchTime = CS_MIN_MILLISECS; /* In milliseconds */
- RtsFlags.ConcFlags.maxThreads = 32;
- RtsFlags.ConcFlags.stkChunkSize = 1024;
- RtsFlags.ConcFlags.maxLocalSparks = 500;
-#endif /* GRAN */
-
+#ifdef SMP
+ RtsFlags.ConcFlags.nNodes = 1;
+#endif
#ifdef PAR
RtsFlags.ParFlags.parallelStats = rtsFalse;
RtsFlags.ParFlags.granSimStats = rtsFalse;
#endif
#ifdef TICKY_TICKY
- RtsFlags.TickyFlags.showTickyStats = rtsFalse;
- RtsFlags.TickyFlags.tickyFile = NULL;
-
- AllFlags.doUpdEntryCounts = rtsTrue; /*ToDo:move? */
+ RtsFlags.TickyFlags.showTickyStats = rtsFalse;
+ RtsFlags.TickyFlags.tickyFile = NULL;
#endif
}
" -k<size> Sets the initial thread stack size (default 1k) Egs: -K4k -K2m",
"",
" -A<size> Sets the minimum allocation area size (default 256k) Egs: -A1m -A10k",
-" -M<size> Sets the maximum heap size (default 64M) Egs: -H256k -H1G",
+" -M<size> Sets the maximum heap size (default 64M) Egs: -M256k -M1G",
+" -H<size> Sets the minimum heap size (default 0M) Egs: -H24m -H1G",
" -m<n>% Minimum % of heap which must be available (default 3%)",
" -G<n> Number of generations (default: 2)",
+" -T<n> Number of steps in younger generations (default: 2)",
" -s<file> Summary GC statistics (default file: <program>.stat)",
" -S<file> Detailed GC statistics (with -Sstderr going to stderr)",
"",
# if defined(PROFILING)
"",
" -h<break-down> Heap residency profile (output file <program>.hp)",
-" break-down: C = cost centre (default), M = module, G = group",
+" break-down: C = cost centre stack (default), M = module, G = group",
" D = closure description, Y = type description",
" T<ints>,<start> = time closure created",
" ints: no. of interval bands plotted (default 18)",
" -r<file> Produce reduction profiling statistics (with -rstderr for stderr)",
"",
#endif
-" -T<level> Trace garbage collection execution (debugging)",
-"",
# ifdef PAR
" -N<n> Use <n> PVMish processors in parallel (default: 2)",
/* NB: the -N<n> is implemented by the driver!! */
" -C<secs> Context-switch interval in seconds",
" (0 or no argument means switch as often as possible)",
" the default is .01 sec; resolution is .01 sec",
-" -e<size> Size of spark pools (default 100)",
+# ifdef SMP
+" -N<n> Use <n> OS threads (default: 1)",
+# endif
# ifdef PAR
" -q Enable activity profile (output files in ~/<program>*.gr)",
" -qb Enable binary activity profile (output file /tmp/<program>.gb)",
" -Q<size> Set pack-buffer size (default: 1024)",
-# else
-" -q[v] Enable quasi-parallel profile (output file <program>.qp)",
# endif
-" -t<num> Set maximum number of advisory threads per PE (default 32)",
-" -o<num> Set stack chunk size (default 1024)",
# ifdef PAR
" -d Turn on PVM-ish debugging",
" -O Disable output for performance measurement",
#ifdef DEBUG
case 'D':
/* hack warning: interpret the flags as a binary number */
- *(int*)(&RtsFlags.DebugFlags) = decode(rts_argv[arg]+2);
+ {
+ I_ n = decode(rts_argv[arg]+2);
+ if (n &1) RtsFlags.DebugFlags.scheduler = rtsTrue;
+ if ((n>>1)&1) RtsFlags.DebugFlags.evaluator = rtsTrue;
+ if ((n>>2)&1) RtsFlags.DebugFlags.codegen = rtsTrue;
+ if ((n>>3)&1) RtsFlags.DebugFlags.weak = rtsTrue;
+ if ((n>>4)&1) RtsFlags.DebugFlags.gccafs = rtsTrue;
+ if ((n>>5)&1) RtsFlags.DebugFlags.gc = rtsTrue;
+ if ((n>>6)&1) RtsFlags.DebugFlags.block_alloc = rtsTrue;
+ if ((n>>7)&1) RtsFlags.DebugFlags.sanity = rtsTrue;
+ if ((n>>8)&1) RtsFlags.DebugFlags.stable = rtsTrue;
+ if ((n>>9)&1) RtsFlags.DebugFlags.prof = rtsTrue;
+ }
break;
#endif
}
break;
+ case 'T':
+ RtsFlags.GcFlags.steps = decode(rts_argv[arg]+2);
+ if (RtsFlags.GcFlags.steps < 1) {
+ bad_option(rts_argv[arg]);
+ }
+ break;
+
case 'H':
- /* ignore for compatibility with older versions */
+ RtsFlags.GcFlags.heapSizeSuggestion =
+ decode(rts_argv[arg]+2) / BLOCK_SIZE;
+
+ if (RtsFlags.GcFlags.heapSizeSuggestion <= 0) {
+ bad_option(rts_argv[arg]);
+ }
break;
case 'j': /* force GC option */
}
break;
- case 'S': /* NB: no difference at present ! */
+ case 'S':
+ RtsFlags.GcFlags.giveStats ++;
+
case 's':
- RtsFlags.GcFlags.giveStats ++; /* will be VERBOSE_GC_STATS */
+ RtsFlags.GcFlags.giveStats ++;
#ifdef PAR
/* Opening all those files would almost certainly fail... */
RtsFlags.ParFlags.parallelStats = rtsTrue;
switch (rts_argv[arg][2]) {
case '\0':
case CCchar:
- RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_CC;
+ RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_CCS;
break;
case MODchar:
RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_MOD;
}
break;
- case 't':
+#ifdef SMP
+ case 'N':
if (rts_argv[arg][2] != '\0') {
- RtsFlags.ConcFlags.maxThreads
+ RtsFlags.ConcFlags.nNodes
= strtol(rts_argv[arg]+2, (char **) NULL, 10);
- } else {
- fprintf(stderr, "setupRtsFlags: missing size for -t\n");
- error = rtsTrue;
- }
+ if (RtsFlags.ConcFlags.nNodes <= 0) {
+ fprintf(stderr, "setupRtsFlags: bad value for -N\n");
+ error = rtsTrue;
+ }
+ }
break;
-
+#endif
/* =========== PARALLEL =========================== */
case 'e':
PAR_BUILD_ONLY(