added pxshm persistent support for gemini.
[charm.git] / src / arch / util / persist_impl.h
1 /** @file
2  * General implementation of persistent communication support
3  * @ingroup Machine
4  */
5
6 /**
7  * \addtogroup Machine
8 */
9 /*@{*/
10
11 #define PERSIST_BUFFERS_NUM   2
12
13 typedef struct _PersistentSendsTable {
14   int destPE;
15   int sizeMax;
16   PersistentHandle   destHandle;  
17   void *destAddress[PERSIST_BUFFERS_NUM];
18   void *destSizeAddress[PERSIST_BUFFERS_NUM];
19   void *messageBuf;
20   int messageSize;
21   char used;
22 } PersistentSendsTable;
23
24 typedef struct _PersistentReceivesTable {
25   void *messagePtr[PERSIST_BUFFERS_NUM];      /* preallocated message buffer of size "sizeMax" */
26   unsigned int *recvSizePtr[PERSIST_BUFFERS_NUM];   /* pointer to the size */
27   int sizeMax;
28   struct _PersistentReceivesTable *prev, *next;
29 } PersistentReceivesTable;
30
31 extern PersistentReceivesTable *persistentReceivesTableHead;
32 extern PersistentReceivesTable *persistentReceivesTableTail;
33
34 extern PersistentHandle  *phs;
35 extern int phsSize;
36
37 void *PerAlloc(int size);
38 void PerFree(char *msg);
39 void CmiSendPersistentMsg(PersistentHandle h, int destPE, int size, void *m);
40 int PumpPersistent();
41 void swapSendSlotBuffers(PersistentSendsTable *slot);
42 void swapRecvSlotBuffers(PersistentReceivesTable *slot);
43 void setupRecvSlot(PersistentReceivesTable *slot, int maxBytes);
44
45 /*@}*/