\tr{<something>.time} {\em in your home directory}. You can
process the \tr{.time} files into PostScript using \tr{hp2ps},
\index{hp2ps}
-as described elsewhere in this guide. The only thing is:
-because of the weird file names, you probably need to use
-\tr{hp2ps} as a filter; so:
+as described elsewhere in this guide.
+
+Because of the weird file names, you probably need to use
+\tr{hp2ps} as a filter. Also, you probably want to give \tr{hp2ps}
+a \tr{-t0} flag, so that no ``inconsequential'' data is ignored---in
+parallel-land it's all consequential. So:
\begin{verbatim}
-% hp2ps < fooo.001.time > temp.ps
+% hp2ps -t0 < fooo.001.time > temp.ps
\end{verbatim}
%$$ The first line of the
%************************************************************************
%* *
+\subsubsection{Other useful info about running parallel programs}
+%* *
+%************************************************************************
+
+The ``garbage-collection statistics'' RTS options can be useful
+for seeing what parallel programs are doing. If you do either
+\tr{+RTS -Sstderr}\index{-Sstderr RTS option} or \tr{+RTS -sstderr},
+then you'll get mutator, garbage-collection, etc., times on standard
+error which, for PVM programs, appears in \tr{/tmp/pvml.nnn}.
+
+Whether doing \tr{+RTS -Sstderr} or not, a handy way to watch
+what's happening overall is: \tr{tail -f /tmp/pvml.nnn}.
+
+%************************************************************************
+%* *
\subsubsection[parallel-rts-opts]{RTS options for Concurrent/Parallel Haskell}
\index{RTS options, concurrent}
\index{RTS options, parallel}
# duplicated from the bottom
$chk[$i] .= $_;
- } elsif ( /^\L\$C(\d+)$/ ) {
+ } elsif ( /^L\$C(\d+)$/ ) {
$chk[++$i] .= $_;
$chkcat[$i] = 'literal';
$chksymb[$i] = $1;
# teach it to drop through to the fast entry point:
$c = $chk[$slowchk{$symb}];
if ( defined($fastchk{$symb}) ) {
- $c =~ s/^\s+ldil.*\n\s+ldo.*\n\s+bv.*\n(.*\n)?\s+\.EXIT/\1\t.EXIT/;
+ $c =~ s/^\s+ldil.*\n\s+ldo.*\n\s+bv.*\n(.*\n)?\s+\.EXIT/$1\t.EXIT/;
}
print OUTASM "\t.SPACE \$TEXT\$\n\t.SUBSPA \$CODE\$\n\t\.align 4\n";
REAL_NAME(f) "_wrapper:\n" \
"\tmovl %%esp,80(%%ebx)\n" \
"\tmovl 100(%%ebx),%%esp\n" \
- "\tmovl %%eax,%0" : "=r" (args)); \
- __asm__ volatile ( \
- "movl %%esp,%0\n" \
+ "\tmovl %%eax,%0\n" \
+ "\tincl _SP_stack_ptr\n" \
+ "\tmovl _SP_stack_ptr,%%eax\n" \
+ "\tmovl %%esp,_SP_stack(,%%eax,4)\n" \
"\tsubl $64,%%esp" \
- : "=r" (SP_stack[++SP_stack_ptr])); \
+ : "=r" (args)); \
SaveAllStgContext();
#define WRAPPER_RETURN(x) \
#define STATS_FILENAME_MAXLEN 128
-#define TICKY_FILENAME_FMT "%0.121s.ticky"
-#define STAT_FILENAME_FMT "%0.122s.stat"
+#define GR_FILENAME_FMT "%0.124s.gr"
+#define GR_FILENAME_FMT_GUM "%0.120s.%03d.gr"
+#define HP_FILENAME_FMT "%0.124s.hp"
+#define LIFE_FILENAME_FMT "%0.122s.life"
#define PROF_FILENAME_FMT "%0.122s.prof"
#define PROF_FILENAME_FMT_GUM "%0.118s.%03d.prof"
+#define QP_FILENAME_FMT "%0.124s.qp"
+#define STAT_FILENAME_FMT "%0.122s.stat"
+#define TICKY_FILENAME_FMT "%0.121s.ticky"
#define TIME_FILENAME_FMT "%0.122s.time"
#define TIME_FILENAME_FMT_GUM "%0.118s.%03d.time"
-#define HP_FILENAME_FMT "%0.124s.hp"
\end{code}
%************************************************************************
CompilePreludishly(ghc/ListSetOps,lhs, )
CompilePreludishly(ghc/Maybes,lhs, -fhaskell-1.3)
CompilePreludishly(ghc/PackedString,lhs,)
-CompilePreludishly(ghc/Regex,lhs, -fhaskell-1.3 '-#include"ghcRegex.h"')
+CompilePreludishly(ghc/Regex,lhs, -fhaskell-1.3 '-#include"ghcRegex.h"' -monly-4-regs)
CompilePreludishly(ghc/MatchPS,lhs, -ighc -fhaskell-1.3)
CompilePreludishly(ghc/Pretty,lhs, -ighc -fhaskell-1.3)
#if GhcWithReadline == YES
where
getTokens :: [String] -> String -> IO [String]
getTokens ts "" = return (reverse ts)
+ getTokens ts (c:cs) | isSpace c = getTokens ts cs
getTokens ts s =
getToken s >>= \ (t, s') ->
getTokens (t:ts) s'
getToken :: String -> IO (String, String)
getToken (c:cs)
| c == '<' || c == '>' = return ([c], cs)
- | isSpace c = getToken cs
| c == '"' || c == '\'' = accumQuote c "" cs
| otherwise = accumToken [c] cs
#endif
/* A patchlevel change is something *very minor* */
#ifndef ProjectPatchLevel
-#define ProjectPatchLevel patchlevel 0
+#define ProjectPatchLevel patchlevel 1
#endif
/* GhcBuildeeVersion is something CPP-testable (ProjectVersion * 100) */
#ifndef GhcBuildeeVersion
hooks/OutOfVM.lc \
hooks/PatErrorHdr.lc \
hooks/TraceHooks.lc \
+ hooks/SizeHooks.lc \
io/closeFile.lc \
io/createDirectory.lc \
io/env.lc \
CompileClibishly(hooks/OutOfVM,)
CompileClibishly(hooks/PatErrorHdr,)
CompileClibishly(hooks/TraceHooks,)
+CompileClibishly(hooks/SizeHooks,)
CompileClibishly(io/closeFile,)
CompileClibishly(io/createDirectory,)
CompileClibishly(io/env,)
if (IS_THUNK(info) && IS_UPDATABLE(info)) {
#ifdef DEBUG
- P_ rbh = convertToRBH(closure);
+ P_ rbh =
+#else
+ (void)
#endif
+ convertToRBH(closure);
+
ASSERT(rbh != NULL);
}
}
--- /dev/null
+\begin{code}
+#include "rtsdefs.h"
+#include "storage/SMinternal.h" /* DEFAULT_* here */
+
+I_ SM_word_heap_size = DEFAULT_HEAP_SIZE;
+StgFloat SM_pc_free_heap = DEFAULT_PC_FREE;
+I_ SM_word_stk_size = DEFAULT_STACKS_SIZE;
+\end{code}
\begin{code}
#ifdef GRAN
-char gr_filename[32]; /*ToDo: magic short filename constant????? WDP 95/07 */
+char gr_filename[STATS_FILENAME_MAXLEN];
I_ do_gr_sim = 0;
int
if (do_gr_sim) {
char *extension = do_gr_binary ? "gb" : "gr";
- sprintf(gr_filename, "%0.28s.%0.2s", prog_argv[0], extension);
+ sprintf(gr_filename, GR_FILENAME_FMT, prog_argv[0], extension);
if ((gr_file = fopen(gr_filename, "w")) == NULL) {
fprintf(stderr, "Can't open granularity simulation report file %s\n", gr_filename);
#endif /* GRAN */
#ifdef PAR
-char gr_filename[50]; /*ToDo: (small) magic constant alert!!!! WDP 95/07 */
+char gr_filename[STATS_FILENAME_MAXLEN];
I_ do_gr_profile = 0;
I_ do_sp_profile = 0;
char *extension = do_gr_binary ? "gb" : "gr";
- sprintf(gr_filename, "%0.28s.%03d.%0.2s", prog_argv[0], thisPE, extension);
+ sprintf(gr_filename, GR_FILENAME_FMT_GUM, prog_argv[0], thisPE, extension);
if ((gr_file = fopen(gr_filename, "w")) == NULL) {
fprintf(stderr, "Can't open activity report file %s\n", gr_filename);
#if defined(GRAN)
I_ do_gr_sim = 0;
FILE *gr_file = NULL;
-char gr_filename[32];
+char gr_filename[STATS_FILENAME_MAXLEN];
init_gr_simulation(rts_argc,rts_argv,prog_argc,prog_argv)
char *prog_argv[], *rts_argv[];
if(do_gr_sim)
{
char *extension = do_gr_binary? "gb": "gr";
- sprintf(gr_filename, "%0.28s.%0.2s", prog_argv[0],extension);
+ sprintf(gr_filename, GR_FILENAME_FMT, prog_argv[0],extension);
if ((gr_file = fopen(gr_filename,"w")) == NULL )
{
init_qp_profiling(STG_NO_ARGS)
{
I_ i;
- char qp_filename[32];
+ char qp_filename[STATS_FILENAME_MAXLEN];
- sprintf(qp_filename, "%0.24s.qp", prog_argv[0]);
+ sprintf(qp_filename, QP_FILENAME_FMT, prog_argv[0]);
if ((qp_file = fopen(qp_filename,"w")) == NULL ) {
fprintf(stderr, "Can't open quasi-parallel profile report file %s\n",
qp_filename);
init_qp_profiling(STG_NO_ARGS)
{
I_ i;
- char qp_filename[32];
+ char qp_filename[STATS_FILENAME_MAXLEN];
- sprintf(qp_filename, "%0.24s.qp", prog_argv[0]);
+ sprintf(qp_filename, QP_FILENAME_FMT, prog_argv[0]);
if ((qp_file = fopen(qp_filename,"w")) == NULL ) {
fprintf(stderr, "Can't open quasi-parallel profile report file %s\n",
qp_filename);
tickyfile = fopen(stats_filename,"w");
}
if (tickyfile == NULL) {
- fprintf(stderr, "Can't open tickyfile %s (default %0.24s.ticky)\n",
- rts_argv[arg]+2, argv[0]);
+ fprintf(stderr, "Can't open tickyfile %s\n",
+ rts_argv[arg]+2);
error = 1;
} else {
/* Write argv and rtsv into start of ticky file */
main_statsfile = fopen(stats_filename,"w");
}
if (main_statsfile == NULL) {
- fprintf(stderr, "Can't open statsfile %s (default %0.24s.stat)\n", rts_argv[arg]+2, argv[0]);
+ fprintf(stderr, "Can't open statsfile %s\n", rts_argv[arg]+2);
error = 1;
} else {
/* Write argv and rtsv into start of stats file */
StgChar *prog_argv[];
{
I_ report, i;
- StgChar life_filename[32];
+ StgChar life_filename[STATS_FILENAME_MAXLEN];
FILE *life_file;
W_ total_life, total_upd, total_interval,
accum_life, accum_upd;
life_older += prev_older;
/* Produce liftime reports */
- sprintf(life_filename, "%0.24s.life", prog_argv[0]);
+ sprintf(life_filename, LIFE_FILENAME_FMT, prog_argv[0]);
if ( (life_file = fopen(life_filename,"w")) == NULL ) {
fprintf(stderr, "Can't open life profile report file %s\n", life_filename);
}
/* global vars to hold some storage-mgr details; */
/* decls for these are in SMinternal.h */
I_ SM_force_gc = 0;
-I_ SM_word_heap_size = DEFAULT_HEAP_SIZE;
-I_ SM_alloc_min = 0;
-StgFloat SM_pc_free_heap = DEFAULT_PC_FREE;
I_ SM_alloc_size = 0;
+I_ SM_alloc_min = 0;
I_ SM_major_gen_size = 0;
-I_ SM_word_stk_size = DEFAULT_STACKS_SIZE;
FILE *SM_statsfile = NULL;
I_ SM_trace = 0;
I_ SM_stats_summary = 0;
I_ SM_stats_verbose = 0;
I_ SM_ring_bell = 0;
+/*To SizeHooks: I_ SM_word_heap_size = DEFAULT_HEAP_SIZE; */
+/*To SizeHooks: StgFloat SM_pc_free_heap = DEFAULT_PC_FREE; */
+extern I_ SM_word_stk_size; /*To SizeHooks: = DEFAULT_STACKS_SIZE; */
+
I_ MaxResidency = 0; /* in words; for stats only */
I_ ResidencySamples = 0; /* for stats only */
/************************ Default HEAP and STACK sizes **********************/
+/* A user can change these main defaults with a
+ "hooks" file equiv to runtime/hooks/SizeHooks.lc.
+*/
+
#define DEFAULT_STACKS_SIZE 0x10002 /* 2^16 = 16Kwords = 64Kbytes */
#define DEFAULT_HEAP_SIZE 0x100002 /* 2^20 = 1Mwords = 4Mbytes */