\begin{code}
# ifdef PAR
-# define MAX_PES 128 /* Maximum number of processors */
+# define MAX_PES 256 /* Maximum number of processors */
+ /* MAX_PES is enforced by SysMan, which does not
+ allow more than this many "processors".
+ This is important because PackGA [GlobAddr.lc]
+ **assumes** that a PE# can fit in 8+ bits.
+ */
-extern I_ do_gr_profile;
extern I_ do_sp_profile;
-extern I_ do_gr_binary;
extern P_ PendingFetches;
extern GLOBAL_TASK_ID *PEs;
# define MAX_GA_WEIGHT 0 /* Treat as 2^n */
-# define PACK_GA(pe,slot) ((((W_)(pe)) << (BITS_IN(W_)/2)) | ((W_)(slot)))
-
+W_ PackGA PROTO((W_, int));
+ /* There was a PACK_GA macro here; but we turned it into the PackGA
+ routine [GlobAddr.lc] (because it needs to do quite a bit of
+ paranoia checking. Phil & Will (95/08)
+ */
\end{code}
At the moment, there is no activity profiling for GUM. This may change.
packet in the parallel (GUM) system.
\begin{code}
-# ifdef GUM
+# ifdef PAR
+void InitPackBuffer(STG_NO_ARGS);
P_ PackNearbyGraph PROTO((P_ closure,W_ *size));
P_ PackTSO PROTO((P_ tso, W_ *size));
P_ PackStkO PROTO((P_ stko, W_ *size));
P_ UnpackGraph PROTO((W_ *buffer, globalAddr **gamap, W_ *nGAs));
# endif
-# define PACK_BUFFER_SIZE 1024
-# define PACK_HEAP_REQUIRED \
- ((PACK_BUFFER_SIZE - PACK_HDR_SIZE) / (PACK_GA_SIZE + _FHS) * (SPEC_HS + 2))
-
\end{code}
\begin{code}
+# define PACK_HEAP_REQUIRED \
+ ((RTSflags.ParFlags.packBufferSize - PACK_HDR_SIZE) / (PACK_GA_SIZE + _FHS) * (SPEC_HS + 2))
+
+extern W_ *PackBuffer; /* size: can be set via option */
+extern long *buffer; /* HWL_ */
+extern W_ *freeBuffer; /* HWL_ */
+extern W_ *packBuffer; /* HWL_ */
+
+extern void InitPackBuffer(STG_NO_ARGS);
+extern void InitMoreBuffers(STG_NO_ARGS);
+extern void InitPendingGABuffer(W_ size);
+extern void AllocClosureQueue(W_ size);
+
+# define MAX_GAS (RTSflags.ParFlags.packBufferSize / PACK_GA_SIZE)
+
+
# define PACK_GA_SIZE 3 /* Size of a packed GA in words */
/* Size of a packed fetch-me in words */
# define PACK_FETCHME_SIZE (PACK_GA_SIZE + FIXED_HS)
# define PACK_PLC_SIZE 2 /* Size of a packed PLC in words */
-# define MAX_GAS (PACK_BUFFER_SIZE / PACK_GA_SIZE)
-
\end{code}
End multi-slurp protection:
\begin{code}