HLC.h 1.99 KB
Newer Older
1
/* --------------------------------------------------------------------------
2
   Time-stamp: <Sun Mar 18 2001 20:16:14 Stardate: [-30]6349.22 hwloidl>
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

   High Level Communications Header (HLC.h)

   Contains the high-level definitions (i.e. communication
   subsystem independent) used by GUM
   Phil Trinder, Glasgow University, 12 December 1994
   H-W. Loidl, Heriot-Watt, November 1999
   ----------------------------------------------------------------------- */

#ifndef __HLC_H
#define __HLC_H

#ifdef PAR

#include "LLC.h"

#define NEW_FISH_AGE           0
#define NEW_FISH_HISTORY       0
#define NEW_FISH_HUNGER        0
#define FISH_LIFE_EXPECTANCY  10


//@node GUM Message Sending and Unpacking Functions
//@subsection GUM Message Sending and Unpacking Functions

rtsBool  initMoreBuffers(void);

void 	 sendFetch (globalAddr *ga, globalAddr *bqga, int load);
31
void 	 sendResume(globalAddr *rga, int nelem, rtsPackBuffer *packBuffer);
32 33 34
void 	 sendAck (GlobalTaskId task, int ngas, globalAddr *gagamap);
void 	 sendFish (GlobalTaskId destPE, GlobalTaskId origPE, int age, int history, int hunger);
void 	 sendFree (GlobalTaskId destPE, int nelem, P_ data);
35 36
void 	 sendSchedule(GlobalTaskId origPE, int nelem, rtsPackBuffer *packBuffer);
void 	 sendReval(GlobalTaskId origPE, int nelem, rtsPackBuffer *data);
37 38 39 40

//@node Message-Processing Functions
//@subsection Message-Processing Functions

41
rtsBool	 processMessages(void);
42 43 44 45 46 47 48 49 50 51 52 53 54 55
void 	 processFetches(void);
void 	 processTheRealFetches(void);

//@node Miscellaneous Functions
//@subsection Miscellaneous Functions

void 	 prepareFreeMsgBuffers(void);
void 	 freeRemoteGA (int pe, globalAddr *ga);
void 	 sendFreeMessages(void);

GlobalTaskId  choosePE(void);
StgClosure   *createBlockedFetch (globalAddr ga, globalAddr rga);
void 	      waitForTermination(void);

56 57 58 59
/* Message bouncing (startup and shutdown, mainly) */
void          bounceFish(void);
void          bounceReval(void);

60 61 62 63
void          DebugPrintGAGAMap (globalAddr *gagamap, int nGAs);

#endif /* PAR */
#endif /* __HLC_H */