build: Fix --no-build-shared option to properly cancel --build-shared
[charm.git] / src / conv-core / conv-ooc.h
blob6afdb1a64b959382f448feca80532f65778a1aa7
1 /**
2 * Converse Out-Of-Core (OOC) extended memory support.
3 * The basic idea is to manually shuffle objects
4 * in and out of memory to disk files. We can do this
5 * better than the OS's virtual memory can, because we
6 * know about the message queue, and hence have more
7 * information about what pages will be needed soon.
9 * OOC Implemented by Mani Potnuru, 1/2003
11 #ifndef __CMI_COMMON_OOC_H
12 #define __CMI_COMMON_OOC_H
14 #include <stdio.h> /* for FILE */
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 /**
21 * This struct is our representation for
22 * out-of-core "managers", which actually talk to
23 * out-of-core capable objects. For example, the
24 * Charm++ Array Manager is a Prefetch Manager.
26 typedef struct _CooPrefetchManager {
27 /**
28 * Return the out-of-core objid (from CooRegisterObject)
29 * that this Converse message will access. If the message
30 * will not access an object, return -1.
32 int (* msg2ObjId) (void *msg);
34 /**
35 * Write this object (registered with RegisterObject)
36 * to this writable file.
38 void (* writeToSwap) (FILE *swapfile,void *objptr);
40 /**
41 * Read this object (registered with RegisterObject)
42 * from this readable file.
44 void (* readFromSwap) (FILE *swapfile,void *objptr);
45 } CooPrefetchManager;
47 /**
48 * Register a new Out-Of-Core manager at this Converse
49 * handler index.
50 * @param pf The new object manager to register.
51 * @param handlerIdx The Converse handler to override.
53 extern void CooRegisterManager(CooPrefetchManager *pf,int handlerIdx);
56 /**
57 * Register a new prefetchable out-of-core object into the
58 * prefetch table. Returns the object's new objid.
59 * @param pf The new object's manager, which must previously have been
60 * passed to RegisterManager.
61 * @param objsize The new object's (current) memory size, in bytes.
62 * @param objptr The new object's location. This pointer is
63 * only used to pass back to writeToSwap or readFromSwap.
65 extern int CooRegisterObject(CooPrefetchManager *pf,int objsize,void *objptr);
67 /**
68 * Delete this object from the prefetch tables. This can
69 * happen when the object is destroyed, or when it migrates away.
71 extern void CooDeregisterObject(int objid);
74 /**
75 * This object's size on disk just changed.
76 * @param objid The object, as returned by CooRegisterObject.
77 * @param newsize The object's new storage size, in bytes.
79 extern void CooSetSize(int objid,int newsize);
81 /**
82 * This object is needed in memory--load it from disk
83 * unless it's already in memory.
84 * @param objid The object, as returned by CooRegisterObject.
86 extern void CooBringIn(int objid);
89 #ifdef __cplusplus
91 #endif
93 #endif