[project @ 1998-11-26 09:17:22 by sof]
[ghc-hetmet.git] / ghc / includes / Parallel.lh
1 %
2 % (c) Kevin Hammond, Parade/AQUA Projects, Glasgow University, February 15th. 1995
3 %
4 %     This is for GUM only.
5 %
6 %************************************************************************
7 %*                                                                      *
8 \section[Parallel.lh]{Definitions for parallel machines}
9 %*                                                                      *
10 %************************************************************************
11
12 Multi-slurp protection:
13 \begin{code}
14 #ifndef Parallel_H
15 #define Parallel_H
16 \end{code}
17
18 This section contains definitions applicable only to programs compiled
19 to run on a parallel machine.  Some of these things can probably be
20 ripped out now that we don't store GAs in closures, but beware that
21 this {\em might} break GranSim, so check first!  KH
22
23 These basic definitions need to be around, one way or the other:
24 \begin{code}
25 #define PAR_FIXED_HDR                   (GA_HDR_SIZE)
26 #define PAR_HDR_POSN                    AFTER_INFO_HDR
27 #define AFTER_PAR_HDR                   (PAR_HDR_POSN+PAR_FIXED_HDR)
28
29 #define SET_PAR_HDR(closure,ga)         /* nothing */
30 #define SET_STATIC_PAR_HDR(closure)     /* nothing */
31 \end{code}
32
33 \begin{code}
34 # ifdef PAR
35 #  define MAX_PES       256             /* Maximum number of processors */
36         /* MAX_PES is enforced by SysMan, which does not
37            allow more than this many "processors".
38            This is important because PackGA [GlobAddr.lc]
39            **assumes** that a PE# can fit in 8+ bits.
40         */
41
42 extern I_ do_sp_profile;
43
44 extern P_ PendingFetches;
45 extern GLOBAL_TASK_ID *PEs;
46
47 extern rtsBool IAmMainThread, GlobalStopPending;
48 extern rtsBool fishing;
49 extern GLOBAL_TASK_ID SysManTask;
50 extern int seed;                        /*pseudo-random-number generator seed:*/
51                                         /*Initialised in ParInit*/
52 extern I_ threadId;                     /*Number of Threads that have existed on a PE*/
53 extern GLOBAL_TASK_ID mytid;
54
55 extern int  nPEs;
56
57 extern rtsBool InGlobalGC;      /* Are we in the midst of performing global GC */
58
59 extern HashTable *pGAtoGALAtable;
60 extern HashTable *LAtoGALAtable;
61 extern GALA *freeIndirections;
62 extern GALA *liveIndirections;
63 extern GALA *freeGALAList;
64 extern GALA *liveRemoteGAs;
65 extern int thisPE;
66
67 void RunParallelSystem PROTO((StgPtr program_closure));
68 void initParallelSystem(STG_NO_ARGS);
69 void SynchroniseSystem(STG_NO_ARGS);
70
71 void registerTask PROTO((GLOBAL_TASK_ID gtid));
72 globalAddr *LAGAlookup PROTO((P_ addr));
73 P_ GALAlookup PROTO((globalAddr *ga));
74 globalAddr *MakeGlobal PROTO((P_ addr, rtsBool preferred));
75 globalAddr *setRemoteGA PROTO((P_ addr, globalAddr *ga, rtsBool preferred));
76 void splitWeight PROTO((globalAddr *to, globalAddr *from));
77 globalAddr *addWeight PROTO((globalAddr *ga));
78 void initGAtables(STG_NO_ARGS);
79 W_ taskIDtoPE PROTO((GLOBAL_TASK_ID gtid));
80 void RebuildLAGAtable(STG_NO_ARGS);
81
82 void *lookupHashTable PROTO((HashTable *table, StgWord key));
83 void insertHashTable PROTO((HashTable *table, StgWord key, void *data));
84 void freeHashTable PROTO((HashTable *table, void (*freeDataFun) PROTO((void *data))));
85 HashTable *allocHashTable(STG_NO_ARGS);
86 void *removeHashTable PROTO((HashTable *table, StgWord key, void *data));
87
88 /*
89   Redefining exit is more trouble than its worth, IMO -- SOF 
90 */
91 extern void myexit PROTO((I_));
92 #  define EXIT myexit
93 /* #  define exit : error : Wrong exit! */
94
95 # else
96 #  define EXIT exit
97 # endif
98 \end{code}
99
100 %************************************************************************
101 %*                                                                      *
102 \subsection[anti-parallel-SM]{But if we're {\em not} compiling for a parallel system...}
103 %*                                                                      *
104 %************************************************************************
105
106 Get this out of the way.  These are all null definitions.
107
108 \begin{code}
109 # if !(defined(GRAN) || defined(PAR))
110
111 #  define GA_HDR_SIZE                   0
112 #  define       GA(closure)                     /*nothing*/
113   
114 #  define SET_GA(closure,ga)            /* nothing */
115 #  define SET_STATIC_GA(closure)                /* nothing */
116 #  define SET_GRAN_HDR(closure,pe)        /* nothing */
117 #  define SET_STATIC_PROCS(closure)     /* nothing */
118   
119 #  define SET_TASK_ACTIVITY(act)                /* nothing */
120
121 #endif
122
123 #if defined(GRAN)
124
125 #  define GA_HDR_SIZE                   1
126
127 #  define PROCS_HDR_POSN                PAR_HDR_POSN
128 #  define PROCS_HDR_SIZE                1
129
130 /* Accessing components of the field */
131 #  define       PROCS(closure)          (*((P_)(closure)+PROCS_HDR_POSN))
132
133 #  define SET_PROCS(closure, procs) \
134         PROCS(closure) = (W_)(procs)    /* Set closure's location */
135 #  define SET_GRAN_HDR(closure,pe)      SET_PROCS(closure,pe)
136
137 #   define SET_STATIC_PROCS(closure)    , (W_) (Everywhere)
138
139 #  define SET_TASK_ACTIVITY(act)        /* nothing */
140 #endif
141 \end{code}
142
143 %************************************************************************
144 %*                                                                      *
145 \subsection[parallel-GAs]{Parallel-only part of fixed headers (global addresses)}
146 %*                                                                      *
147 %************************************************************************
148
149 Definitions relating to the entire parallel-only fixed-header field.
150
151 On GUM, the global addresses for each local closure are stored in a separate
152 hash table, rather then with the closure in the heap.  We call @getGA@ to
153 look up the global address associated with a local closure (0 is returned
154 for local closures that have no global address), and @setGA@ to store a new
155 global address for a local closure which did not previously have one.
156
157 \begin{code}
158 #if defined(PAR) 
159
160 #  define GA_HDR_SIZE                   0
161   
162 #  define GA(closure)                   getGA(closure)
163   
164 #  define SET_GA(closure, ga)             setGA(closure,ga)
165 #  define SET_STATIC_GA(closure)
166 #  define SET_GRAN_HDR(closure,pe)
167 #  define SET_STATIC_PROCS(closure)
168   
169 #  define MAX_GA_WEIGHT                 0       /* Treat as 2^n */
170   
171 W_ PackGA PROTO((W_, int));
172    /* There was a PACK_GA macro here; but we turned it into the PackGA
173       routine [GlobAddr.lc] (because it needs to do quite a bit of
174       paranoia checking.  Phil & Will (95/08)
175    */
176 \end{code}
177
178 At the moment, there is no activity profiling for GUM.  This may change.
179
180 \begin{code}
181
182 #  define SET_TASK_ACTIVITY(act)
183
184 \end{code}
185
186 %************************************************************************
187 %*                                                                      *
188 \subsection[parallel-heap-objs]{Special parallel-only heap objects (`closures')}
189 %*                                                                      *
190 %************************************************************************
191
192 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
193 % NB: The following definitons are BOTH for GUM and GrAnSim -- HWL
194 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
195
196 The rest of  this  file contains definitions  for  {\it  GUM  and GrAnSim}.
197 Although  we don't  create FetchMe   nodes in  GrAnSim  (we  simulate it by
198 bitmask  twiddling)  we use FetchMe_info   when converting  nodes into RBHs
199 (mainly  to keep the code as  close to GUM as  possible). So, we define all
200 the FetchMe related stuff in GrAnSim, too. % -- HWL
201
202 %************************************************************************
203 %*                                                                      *
204 \subsubsection[FETCHME-closures]{@FETCHME@ heap objects (`closures')}
205 %*                                                                      *
206 %************************************************************************
207
208 FetchMes are pointers into the global heap.  When evaluated, the value
209 they point to is read from the global heap.
210
211 A FetchMe closure has the form:
212
213 \begin{onlylatex}
214 \begin{center}
215 \end{onlylatex}
216 \begin{tabular}{||l|l||}\hline
217 \tr{FETCHME_info} & junk \\ \hline
218 \end{tabular}
219 \begin{onlylatex}
220 \end{center}
221 \end{onlylatex}
222
223 The argument word is a pointer (outside of the heap) to a globalAddr structure...
224 in particular, the one corresponding to the object to be fetched.  Note that
225 we can't just used the LAGA table, because weight-splitting may force us to
226 reassign a local GA to the @FetchMe@ so that we can give out new references.
227
228 A @FetchMe@ must have a valid @MUT_LINK@ field, because it may act as
229 a transition between an RBH on the OldMutables list and a BQ still on
230 the OldMutables list.
231
232
233 \begin{code}
234 #  define FETCHME_VHS                           IND_VHS
235 #  define FETCHME_HS                            IND_HS
236   
237 #  define FETCHME_GA_LOCN                       FETCHME_HS
238   
239 #  define FETCHME_CLOSURE_SIZE(closure)         IND_CLOSURE_SIZE(closure)
240 #  define FETCHME_CLOSURE_NoPTRS(closure)               0L
241 #  define FETCHME_CLOSURE_NoNONPTRS(closure)    (IND_CLOSURE_SIZE(closure)-IND_VHS)
242   
243 #  define SET_FETCHME_HDR(closure,infolbl,cc,size,ptrs) \
244 { SET_FIXED_HDR(closure,FetchMe_info,<bogus CC>);       \
245   SET_MUT_RESERVED_WORDS(closure);                      \
246 }
247
248 #  define FETCHME_GA(closure)           (((globalAddr **)(closure))[FETCHME_GA_LOCN])
249
250 EXTFUN(FetchMe_entry);
251 EXTDATA_RO(FetchMe_info);
252
253 \end{code}
254
255 %************************************************************************
256 %*                                                                      *
257 \subsubsection[BlockedFetch-closures]{@BlockedFetch@ heap objects (`closures')}
258 %*                                                                      *
259 %************************************************************************
260
261 @BlockedFetch@s are inbound fetch messages blocked on local closures.
262 They arise as entries in a local blocking queue when a fetch has been
263 received for a local black hole.  When awakened, we look at their
264 contents to figure out where to send a resume.
265
266 A @BlockedFetch@ closure has the form:
267
268 \begin{onlylatex}
269 \begin{center}
270 \end{onlylatex}
271 \begin{tabular}{||l|l|l||}\hline
272 \tr{BF_info} & link & node & gtid & slot & weight \\ \hline
273 \end{tabular}
274 \begin{onlylatex}
275 \end{center}
276 \end{onlylatex}
277
278 \begin{code}
279 #  define BF_VHS                            (GC_MUT_RESERVED_WORDS)
280 #  define BF_HS                     (FIXED_HS + BF_VHS)
281   
282 #  define BF_LINK_LOCN              (BF_HS)
283 #  define BF_NODE_LOCN              (BF_HS + 1)
284 #  define BF_GTID_LOCN              (BF_HS + 2)
285 #  define BF_SLOT_LOCN              (BF_HS + 3)
286 #  define BF_WEIGHT_LOCN                    (BF_HS + 4)
287   
288 #  define BF_CLOSURE_NoPTRS(closure)    2
289 #  define BF_CLOSURE_NoNONPTRS(closure) 3
290   
291 #  define BF_CLOSURE_SIZE(closure)    (BF_VHS + 5)
292   
293 #  define BF_LINK(closure)          (((PP_)closure)[BF_LINK_LOCN])
294 #  define BF_NODE(closure)          (((PP_)closure)[BF_NODE_LOCN])
295 #  define BF_GTID(closure)          (((P_)closure)[BF_GTID_LOCN])
296 #  define BF_SLOT(closure)          (((P_)closure)[BF_SLOT_LOCN])
297 #  define BF_WEIGHT(closure)        (((P_)closure)[BF_WEIGHT_LOCN])
298   
299 #  define BF_CLOSURE_PTR(closure, no) (((P_)(closure))[BF_HS + (no) - 1])
300
301 /* std start-filling-in macro: */
302 #  define SET_BF_HDR(closure,infolbl,cc)        \
303 { SET_FIXED_HDR(closure,infolbl,cc);            \
304   SET_MUT_RESERVED_WORDS(closure);              \
305 }
306
307 EXTFUN(BF_entry);
308 EXTDATA_RO(BF_info);
309
310 \end{code}
311
312 %************************************************************************
313 %*                                                                      *
314 \subsubsection[FMBQ-closures]{@FMBQ@ (FetchMe with blocking queue) heap objects (`closures')}
315 %*                                                                      *
316 %************************************************************************
317
318 FetchMe's with blocking queues are @Fetchme@ nodes which have been entered
319 (and therefore a fetch has been sent), but for which we have not yet received 
320 a @Resume@ message.  They look just like normal blocking queues, but have
321 a distinguished info pointer.
322
323 \begin{code}
324 #  define FMBQ_VHS                      BQ_VHS
325 #  define FMBQ_HS                       BQ_HS
326   
327 #  define FMBQ_CLOSURE_SIZE(closure)    BQ_CLOSURE_SIZE(closure)
328 #  define FMBQ_CLOSURE_NoPTRS(closure)  BQ_CLOSURE_NoPTRS(closure)
329 #  define FMBQ_CLOSURE_NoNONPTRS(closure)       BQ_CLOSURE_NoNONPTRS(closure)
330 #  define FMBQ_CLOSURE_PTR(closure, no) BQ_CLOSURE_PTR(closure, no)
331   
332 #  define FMBQ_ENTRIES(closure)         BQ_ENTRIES(closure)
333 #  define FMBQ_LINK(closure)            BQ_LINK(closure)
334
335 EXTFUN(FMBQ_entry);
336 EXTDATA_RO(FMBQ_info);
337 \end{code}
338
339 %************************************************************************
340 %*                                                                      *
341 \subsection[parallel-info-tables]{Special parallel-only info-table stuff}
342 %*                                                                      *
343 %************************************************************************
344
345 %************************************************************************
346 %*                                                                      *
347 \subsubsection[FETCHME_ITBL]{@FETCHME_ITBL@}
348 %*                                                                      *
349 %************************************************************************
350
351 ToDo: delete FetchMe CAT (because we don't profile and parallelize at
352 the same time...)  Even better...set things up so that we can profile
353 and parallelize at the same time!
354
355 \begin{code}
356
357 #  define FETCHME_ITBL(itbl_name,entry_code)                    \
358     CAT_DECLARE(FetchMe,INTERNAL_KIND,"FetchMe","<FetchMe>")    \
359     EXTFUN(entry_code);                                         \
360     EXTDATA_RO(MK_REP_LBL(FetchMe,,));                          \
361     const W_ itbl_name[] = {                                    \
362         (W_) entry_code                                         \
363         ,(W_) INFO_OTHER_TAG                                    \
364         ,(W_) MK_REP_REF(FetchMe,,)                             \
365         INCLUDE_PROFILING_INFO(FetchMe)                         \
366     }
367
368 #  define FETCHME_RTBL()                                        \
369     const W_ MK_REP_LBL(FetchMe,,)[] = {                        \
370         INCLUDE_TYPE_INFO(FETCHME)                              \
371         INCLUDE_SIZE_INFO(MIN_UPD_SIZE, 0L)                     \
372         INCLUDE_PAR_INFO                                        \
373         INCLUDE_COPYING_INFO(_Evacuate_FetchMe,_Scavenge_FetchMe) \
374         INCLUDE_COMPACTING_INFO(_ScanLink_FetchMe,_PRStart_FetchMe,_ScanMove_FetchMe,_PRIn_Error) \
375     }
376
377 \end{code}
378
379 %************************************************************************
380 %*                                                                      *
381 \subsubsection[BF_ITBL]{@BF_ITBL@}
382 %*                                                                      *
383 %************************************************************************
384
385 The special info table used for thread state objects (BlockedFetchs).
386
387 \begin{code}
388
389 #  define BF_ITBL()                                 \
390     CAT_DECLARE(BF,INTERNAL_KIND,"BlockedFetch","<BlockedFetch>")    \
391     EXTFUN(BF_entry);                       \
392     EXTDATA_RO(MK_REP_LBL(BF,,));                   \
393     const W_ BF_info[] = {                  \
394         (W_) BF_entry                       \
395         ,(W_) INFO_OTHER_TAG                        \
396         ,(W_) MK_REP_REF(BF,,)              \
397         INCLUDE_PROFILING_INFO(BF)          \
398         }
399
400 #  define BF_RTBL() \
401     const W_ MK_REP_LBL(BF,,)[] = { \
402         INCLUDE_TYPE_INFO(BF)                           \
403         INCLUDE_SIZE_INFO(BF_CLOSURE_SIZE(dummy),BF_CLOSURE_NoPTRS(dummy))      \
404         INCLUDE_PAR_INFO                                        \
405         INCLUDE_COPYING_INFO(_Evacuate_BF,_Scavenge_BF)         \
406         INCLUDE_COMPACTING_INFO(_ScanLink_BF,_PRStart_BF,_ScanMove_BF,_PRIn_BF) \
407         }
408
409 \end{code}
410
411 %************************************************************************
412 %*                                                                      *
413 \subsubsection[FMBQ_ITBL]{@FMBQ_ITBL@}
414 %*                                                                      *
415 %************************************************************************
416
417 Special info-table for local blocking queues.
418
419 \begin{code}
420 #  define FMBQ_ITBL()                           \
421     CAT_DECLARE(FMBQ,INTERNAL_KIND,"FMBQ","<FMBQ>")     \
422     EXTFUN(FMBQ_entry);                         \
423     EXTDATA_RO(MK_REP_LBL(FMBQ,,));             \
424     const W_ FMBQ_info[] = {                    \
425         (W_) FMBQ_entry                         \
426         ,(W_) INFO_OTHER_TAG                    \
427         ,(W_) MK_REP_REF(FMBQ,,)                \
428         INCLUDE_PROFILING_INFO(FMBQ)            \
429     }
430
431 #  define FMBQ_RTBL() \
432     const W_ MK_REP_LBL(FMBQ,,)[] = {                           \
433         INCLUDE_TYPE_INFO(FMBQ)                                 \
434         INCLUDE_SIZE_INFO(MIN_UPD_SIZE,INFO_UNUSED)             \
435         INCLUDE_PAR_INFO                                        \
436         INCLUDE_COPYING_INFO(_Evacuate_BQ,_Scavenge_BQ)         \
437         SPEC_COMPACTING_INFO(_ScanLink_BQ,_PRStart_BQ,_ScanMove_BQ,_PRIn_BQ) \
438     }
439
440 \end{code}
441
442 %************************************************************************
443 %*                                                                      *
444 \subsection[parallel-spark-pool-defs]{Parallel-only Spark pool definitions}
445 %*                                                                      *
446 %************************************************************************
447
448 \begin{code}
449 #   define HAVE_SPARK ((PendingSparksHd[REQUIRED_POOL] < PendingSparksTl[REQUIRED_POOL]) \
450                 ||  (PendingSparksHd[ADVISORY_POOL] < PendingSparksTl[ADVISORY_POOL]))
451
452 #  define HAVE_WORK     (RUNNING_THREAD || HAVE_SPARK)
453 #  define RUNNING_THREAD  (CurrentTSO != NULL)
454 \end{code}
455
456 %************************************************************************
457 %*                                                                      *
458 \subsection[parallel-pack-defs]{Parallel-only Packing definitions}
459 %*                                                                      *
460 %************************************************************************
461
462
463 Symbolic constants for the packing code.
464
465 This constant defines how many words of data we can pack into a single
466 packet in the parallel (GUM) system.
467
468 \begin{code}
469 void    InitPackBuffer(STG_NO_ARGS);
470 P_      PackTSO PROTO((P_ tso, W_ *size));
471 P_      PackStkO PROTO((P_ stko, W_ *size));
472 P_      AllocateHeap PROTO((W_ size)); /* Doesn't belong */
473
474 void    InitClosureQueue (STG_NO_ARGS);
475 P_      DeQueueClosure(STG_NO_ARGS);
476 void    QueueClosure PROTO((P_ closure));
477 rtsBool QueueEmpty(STG_NO_ARGS);
478 void    PrintPacket PROTO((P_ buffer));
479
480 P_      get_closure_info PROTO((P_ closure, W_ *size, W_ *ptrs, W_ *nonptrs, W_ *vhs, char *type));
481
482 rtsBool isOffset PROTO((globalAddr *ga)),
483         isFixed PROTO((globalAddr *ga));
484
485 void    doGlobalGC(STG_NO_ARGS);
486
487 P_      PackNearbyGraph PROTO((P_ closure,W_ *size));
488 P_      UnpackGraph PROTO((W_ *buffer, globalAddr **gamap, W_ *nGAs));
489 \end{code}
490
491 \begin{code}
492 #    define PACK_HEAP_REQUIRED  \
493       ((RTSflags.ParFlags.packBufferSize - PACK_HDR_SIZE) / (PACK_GA_SIZE + _FHS) * (SPEC_HS + 2))
494
495 extern W_      *PackBuffer;      /* size: can be set via option */
496 extern long *buffer;             /* HWL_ */
497 extern W_ *freeBuffer;           /* HWL_ */
498 extern W_ *packBuffer;           /* HWL_ */
499
500 extern void    InitPackBuffer(STG_NO_ARGS);
501 extern void    InitMoreBuffers(STG_NO_ARGS);
502 extern void    InitPendingGABuffer(W_ size); 
503 extern void    AllocClosureQueue(W_ size);
504
505 #  define MAX_GAS       (RTSflags.ParFlags.packBufferSize / PACK_GA_SIZE)
506
507
508 #  define PACK_GA_SIZE  3       /* Size of a packed GA in words */
509                                 /* Size of a packed fetch-me in words */
510 #  define PACK_FETCHME_SIZE (PACK_GA_SIZE + FIXED_HS)
511
512 #  define PACK_HDR_SIZE 1       /* Words of header in a packet */
513
514 #  define PACK_PLC_SIZE 2       /* Size of a packed PLC in words */
515
516 #endif
517 \end{code}
518 \begin{code}
519
520 #if defined(GRAN)
521 /* ToDo: Check which of the PAR routines are needed in GranSim -- HWL */
522 void  InitPackBuffer(STG_NO_ARGS);
523 P_    AllocateHeap PROTO((W_ size)); /* Doesn't belong */
524 P_    PackNearbyGraph PROTO((P_ closure, P_ tso, W_ *packbuffersize));
525 P_    PackOneNode PROTO((P_ closure, P_ tso, W_ *packbuffersize));
526 P_    UnpackGraph PROTO((P_ buffer));
527
528 void    InitClosureQueue (STG_NO_ARGS);
529 P_      DeQueueClosure(STG_NO_ARGS);
530 void    QueueClosure PROTO((P_ closure));
531 rtsBool QueueEmpty(STG_NO_ARGS);
532 void    PrintPacket PROTO((P_ buffer));
533
534 P_      get_closure_info PROTO((P_ closure, W_ *size, W_ *ptrs, W_ *nonptrs, W_ *vhs, char *type));
535
536 /* These are needed in the packing code to get the size of the packet
537    right. The closures itself are never built in GrAnSim. */
538 #  define FETCHME_VHS                           IND_VHS
539 #  define FETCHME_HS                            IND_HS
540   
541 #  define FETCHME_GA_LOCN                       FETCHME_HS
542   
543 #  define FETCHME_CLOSURE_SIZE(closure)         IND_CLOSURE_SIZE(closure)
544 #  define FETCHME_CLOSURE_NoPTRS(closure)               0L
545 #  define FETCHME_CLOSURE_NoNONPTRS(closure)    (IND_CLOSURE_SIZE(closure)-IND_VHS)
546   
547 #  define MAX_GAS       (RTSflags.GranFlags.packBufferSize / PACK_GA_SIZE)
548 #  define PACK_GA_SIZE  3       /* Size of a packed GA in words */
549                                 /* Size of a packed fetch-me in words */
550 #  define PACK_FETCHME_SIZE (PACK_GA_SIZE + FIXED_HS)
551 #  define PACK_HDR_SIZE 4       /* Words of header in a packet */
552
553 #    define PACK_HEAP_REQUIRED  \
554       ((RTSflags.GranFlags.packBufferSize - PACK_HDR_SIZE) / (PACK_GA_SIZE \
555       + _FHS) * (SPEC_HS + 2)) 
556
557 #    define PACK_FLAG_LOCN           0  
558 #    define PACK_TSO_LOCN            1
559 #    define PACK_UNPACKED_SIZE_LOCN  2
560 #    define PACK_SIZE_LOCN           3
561 #    define MAGIC_PACK_FLAG          0xfabc
562 #endif  
563
564 #endif /* Parallel_H */
565 \end{code}
566
567