summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpartain <unknown>1996-01-10 12:39:42 +0000
committerpartain <unknown>1996-01-10 12:39:42 +0000
commit7fa716e248a1f11fa686965f57aebbb83b74fa7b (patch)
tree7c8bcfcf13796b83ac20e46851ebf6212dd40f97
parenta29ea442a7b893af60633b370bc7a0459cd3e072 (diff)
downloadhaskell-7fa716e248a1f11fa686965f57aebbb83b74fa7b.tar.gz
[project @ 1996-01-10 12:38:57 by partain]
Alleged 0.26-pl1 changes
-rw-r--r--ghc/docs/users_guide/parallel.lit26
-rw-r--r--ghc/driver/ghc-asm-hppa.lprl4
-rw-r--r--ghc/includes/COptWraps.lh9
-rw-r--r--ghc/includes/GhcConstants.lh10
-rw-r--r--ghc/lib/Jmakefile2
-rw-r--r--ghc/misc/examples/hsh/Hsh.hs2
-rw-r--r--ghc/mkworld/only4-ghc.ljm2
-rw-r--r--ghc/runtime/Jmakefile2
-rw-r--r--ghc/runtime/gum/Pack.lc6
-rw-r--r--ghc/runtime/hooks/SizeHooks.lc8
-rw-r--r--ghc/runtime/main/GranSim.lc8
-rw-r--r--ghc/runtime/main/Threads.lc12
-rw-r--r--ghc/runtime/main/main.lc6
-rw-r--r--ghc/runtime/profiling/LifeProfile.lc4
-rw-r--r--ghc/runtime/storage/SMinit.lc9
-rw-r--r--ghc/runtime/storage/SMinternal.lh4
16 files changed, 78 insertions, 36 deletions
diff --git a/ghc/docs/users_guide/parallel.lit b/ghc/docs/users_guide/parallel.lit
index 335e8febcf..b01dec5eb0 100644
--- a/ghc/docs/users_guide/parallel.lit
+++ b/ghc/docs/users_guide/parallel.lit
@@ -487,11 +487,14 @@ The above will create files named \tr{<something>.prof} and/or
\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
@@ -539,6 +542,21 @@ because of the weird file names, you probably need to use
%************************************************************************
%* *
+\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}
diff --git a/ghc/driver/ghc-asm-hppa.lprl b/ghc/driver/ghc-asm-hppa.lprl
index 7f3ec83c7c..7515b3aab2 100644
--- a/ghc/driver/ghc-asm-hppa.lprl
+++ b/ghc/driver/ghc-asm-hppa.lprl
@@ -81,7 +81,7 @@ sub mangle_asm {
# duplicated from the bottom
$chk[$i] .= $_;
- } elsif ( /^\L\$C(\d+)$/ ) {
+ } elsif ( /^L\$C(\d+)$/ ) {
$chk[++$i] .= $_;
$chkcat[$i] = 'literal';
$chksymb[$i] = $1;
@@ -353,7 +353,7 @@ sub mangle_asm {
# 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";
diff --git a/ghc/includes/COptWraps.lh b/ghc/includes/COptWraps.lh
index c444df76be..7aa82867fa 100644
--- a/ghc/includes/COptWraps.lh
+++ b/ghc/includes/COptWraps.lh
@@ -405,11 +405,12 @@ gets whatever it's after.
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) \
diff --git a/ghc/includes/GhcConstants.lh b/ghc/includes/GhcConstants.lh
index 9971f85fab..08e6ea610c 100644
--- a/ghc/includes/GhcConstants.lh
+++ b/ghc/includes/GhcConstants.lh
@@ -141,13 +141,17 @@ filenames (with disastrous results). No more than 128 chars, please!
#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}
%************************************************************************
diff --git a/ghc/lib/Jmakefile b/ghc/lib/Jmakefile
index 1eb1578e7a..4702053dc7 100644
--- a/ghc/lib/Jmakefile
+++ b/ghc/lib/Jmakefile
@@ -1077,7 +1077,7 @@ CompilePreludishly(ghc/FiniteMap,lhs, -ighc -fhaskell-1.3)
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
diff --git a/ghc/misc/examples/hsh/Hsh.hs b/ghc/misc/examples/hsh/Hsh.hs
index ffe2f167ed..141d974cec 100644
--- a/ghc/misc/examples/hsh/Hsh.hs
+++ b/ghc/misc/examples/hsh/Hsh.hs
@@ -159,6 +159,7 @@ parseCommand = getTokens []
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'
@@ -166,7 +167,6 @@ parseCommand = getTokens []
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
diff --git a/ghc/mkworld/only4-ghc.ljm b/ghc/mkworld/only4-ghc.ljm
index 05edeb845d..dcaf5ac656 100644
--- a/ghc/mkworld/only4-ghc.ljm
+++ b/ghc/mkworld/only4-ghc.ljm
@@ -16,7 +16,7 @@
#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
diff --git a/ghc/runtime/Jmakefile b/ghc/runtime/Jmakefile
index aa221ee856..ea1edaf7b3 100644
--- a/ghc/runtime/Jmakefile
+++ b/ghc/runtime/Jmakefile
@@ -155,6 +155,7 @@ CLIB_LC = \
hooks/OutOfVM.lc \
hooks/PatErrorHdr.lc \
hooks/TraceHooks.lc \
+ hooks/SizeHooks.lc \
io/closeFile.lc \
io/createDirectory.lc \
io/env.lc \
@@ -267,6 +268,7 @@ CompileClibishly(hooks/OutOfStk,)
CompileClibishly(hooks/OutOfVM,)
CompileClibishly(hooks/PatErrorHdr,)
CompileClibishly(hooks/TraceHooks,)
+CompileClibishly(hooks/SizeHooks,)
CompileClibishly(io/closeFile,)
CompileClibishly(io/createDirectory,)
CompileClibishly(io/env,)
diff --git a/ghc/runtime/gum/Pack.lc b/ghc/runtime/gum/Pack.lc
index 412370afb0..f6f1dfc1b5 100644
--- a/ghc/runtime/gum/Pack.lc
+++ b/ghc/runtime/gum/Pack.lc
@@ -292,8 +292,12 @@ P_ closure;
if (IS_THUNK(info) && IS_UPDATABLE(info)) {
#ifdef DEBUG
- P_ rbh = convertToRBH(closure);
+ P_ rbh =
+#else
+ (void)
#endif
+ convertToRBH(closure);
+
ASSERT(rbh != NULL);
}
}
diff --git a/ghc/runtime/hooks/SizeHooks.lc b/ghc/runtime/hooks/SizeHooks.lc
new file mode 100644
index 0000000000..43059c11a4
--- /dev/null
+++ b/ghc/runtime/hooks/SizeHooks.lc
@@ -0,0 +1,8 @@
+\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}
diff --git a/ghc/runtime/main/GranSim.lc b/ghc/runtime/main/GranSim.lc
index de603ddbc2..eb7d303f99 100644
--- a/ghc/runtime/main/GranSim.lc
+++ b/ghc/runtime/main/GranSim.lc
@@ -433,7 +433,7 @@ TIME v;
\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
@@ -446,7 +446,7 @@ int prog_argc, rts_argc;
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);
@@ -536,7 +536,7 @@ end_gr_simulation(STG_NO_ARGS)
#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;
@@ -551,7 +551,7 @@ int prog_argc, rts_argc;
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);
diff --git a/ghc/runtime/main/Threads.lc b/ghc/runtime/main/Threads.lc
index a767ec940a..a5f175fc0d 100644
--- a/ghc/runtime/main/Threads.lc
+++ b/ghc/runtime/main/Threads.lc
@@ -2195,7 +2195,7 @@ PROC p;
#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[];
@@ -2206,7 +2206,7 @@ int prog_argc, rts_argc;
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 )
{
@@ -2326,9 +2326,9 @@ static void
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);
@@ -3646,9 +3646,9 @@ static void
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);
diff --git a/ghc/runtime/main/main.lc b/ghc/runtime/main/main.lc
index 98002a3bd9..75a1bb3230 100644
--- a/ghc/runtime/main/main.lc
+++ b/ghc/runtime/main/main.lc
@@ -676,8 +676,8 @@ char *argv[], *rts_argv[];
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 */
@@ -709,7 +709,7 @@ char *argv[], *rts_argv[];
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 */
diff --git a/ghc/runtime/profiling/LifeProfile.lc b/ghc/runtime/profiling/LifeProfile.lc
index c591aa0bb2..dc5b74b11c 100644
--- a/ghc/runtime/profiling/LifeProfile.lc
+++ b/ghc/runtime/profiling/LifeProfile.lc
@@ -157,7 +157,7 @@ life_profile_finish(alloc, prog_argv)
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;
@@ -177,7 +177,7 @@ life_profile_finish(alloc, prog_argv)
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);
}
diff --git a/ghc/runtime/storage/SMinit.lc b/ghc/runtime/storage/SMinit.lc
index cff23ba7a7..6b1ec5f944 100644
--- a/ghc/runtime/storage/SMinit.lc
+++ b/ghc/runtime/storage/SMinit.lc
@@ -19,18 +19,19 @@ A filehandle to which any storage-manager statistics should be written.
/* 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 */
diff --git a/ghc/runtime/storage/SMinternal.lh b/ghc/runtime/storage/SMinternal.lh
index 832b5cfedd..697933787c 100644
--- a/ghc/runtime/storage/SMinternal.lh
+++ b/ghc/runtime/storage/SMinternal.lh
@@ -73,6 +73,10 @@ extern char *xmalloc PROTO((size_t));
/************************ 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 */