[project @ 2003-10-08 09:42:34 by wolfgang]
[ghc-hetmet.git] / ghc / rts / parallel / HLC.h
1 /* --------------------------------------------------------------------------
2    Time-stamp: <Sun Mar 18 2001 20:16:14 Stardate: [-30]6349.22 hwloidl>
3    $Id: HLC.h,v 1.3 2001/03/22 03:51:11 hwloidl Exp $
4
5    High Level Communications Header (HLC.h)
6
7    Contains the high-level definitions (i.e. communication
8    subsystem independent) used by GUM
9    Phil Trinder, Glasgow University, 12 December 1994
10    H-W. Loidl, Heriot-Watt, November 1999
11    ----------------------------------------------------------------------- */
12
13 #ifndef __HLC_H
14 #define __HLC_H
15
16 #ifdef PAR
17
18 #include "LLC.h"
19
20 #define NEW_FISH_AGE           0
21 #define NEW_FISH_HISTORY       0
22 #define NEW_FISH_HUNGER        0
23 #define FISH_LIFE_EXPECTANCY  10
24
25
26 //@node GUM Message Sending and Unpacking Functions
27 //@subsection GUM Message Sending and Unpacking Functions
28
29 rtsBool  initMoreBuffers(void);
30
31 void     sendFetch (globalAddr *ga, globalAddr *bqga, int load);
32 void     sendResume(globalAddr *rga, int nelem, rtsPackBuffer *packBuffer);
33 void     sendAck (GlobalTaskId task, int ngas, globalAddr *gagamap);
34 void     sendFish (GlobalTaskId destPE, GlobalTaskId origPE, int age, int history, int hunger);
35 void     sendFree (GlobalTaskId destPE, int nelem, P_ data);
36 void     sendSchedule(GlobalTaskId origPE, int nelem, rtsPackBuffer *packBuffer);
37 void     sendReval(GlobalTaskId origPE, int nelem, rtsPackBuffer *data);
38
39 //@node Message-Processing Functions
40 //@subsection Message-Processing Functions
41
42 rtsBool  processMessages(void);
43 void     processFetches(void);
44 void     processTheRealFetches(void);
45
46 //@node Miscellaneous Functions
47 //@subsection Miscellaneous Functions
48
49 void     prepareFreeMsgBuffers(void);
50 void     freeRemoteGA (int pe, globalAddr *ga);
51 void     sendFreeMessages(void);
52
53 GlobalTaskId  choosePE(void);
54 StgClosure   *createBlockedFetch (globalAddr ga, globalAddr rga);
55 void          waitForTermination(void);
56
57 /* Message bouncing (startup and shutdown, mainly) */
58 void          bounceFish(void);
59 void          bounceReval(void);
60
61 void          DebugPrintGAGAMap (globalAddr *gagamap, int nGAs);
62
63 #endif /* PAR */
64 #endif /* __HLC_H */