[project @ 2001-03-21 15:33:47 by simonmar]
[ghc-hetmet.git] / ghc / rts / parallel / HLC.h
1 /* --------------------------------------------------------------------------
2    Time-stamp: <Sun Dec 05 1999 21:02:36 Stardate: [-30]4004.38 hwloidl>
3    $Id: HLC.h,v 1.2 2000/01/13 14:34:07 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 *data);
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 *data);
37
38 //@node Message-Processing Functions
39 //@subsection Message-Processing Functions
40
41 void     processMessages(void);
42 void     processFetches(void);
43 void     processTheRealFetches(void);
44
45 //@node Miscellaneous Functions
46 //@subsection Miscellaneous Functions
47
48 void     prepareFreeMsgBuffers(void);
49 void     freeRemoteGA (int pe, globalAddr *ga);
50 void     sendFreeMessages(void);
51
52 GlobalTaskId  choosePE(void);
53 StgClosure   *createBlockedFetch (globalAddr ga, globalAddr rga);
54 void          waitForTermination(void);
55
56 void          DebugPrintGAGAMap (globalAddr *gagamap, int nGAs);
57
58 #endif /* PAR */
59 #endif /* __HLC_H */