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