00001 #ifndef _MIDDLE_CONV_H_
00002 #define _MIDDLE_CONV_H_
00003
00004 #include "converse.h"
00005
00006 #define CkpvDeclare CpvDeclare
00007 #define CkpvExtern CpvExtern
00008 #define CkpvStaticDeclare CpvStaticDeclare
00009 #define CkpvInitialize CpvInitialize
00010 #define CkpvInitialized CpvInitialized
00011 #define CkpvAccess CpvAccess
00012 #define CkpvAccessOther CpvAccessOther
00013
00014 #define CksvDeclare CsvDeclare
00015 #define CksvExtern CsvExtern
00016 #define CksvStaticDeclare CsvStaticDeclare
00017 #define CksvInitialize CsvInitialize
00018 #define CksvAccess CsvAccess
00019
00020 #define CkReduce CmiReduce
00021
00022 #undef CkMyPe
00023 #undef CkNumPes
00024
00025 #define CkRegisterHandler(x) CmiRegisterHandler(x)
00026 #define CkNumberHandler(n, x) CmiNumberHandler(n, x)
00027 #define CkNumberHandlerEx(n, x, p) CmiNumberHandlerEx(n, x, p)
00028
00029 #undef CmiSyncSend
00030 #undef CmiSyncSendAndFree
00031 #undef CmiSyncBroadcast
00032 #undef CmiSyncBroadcastAndFree
00033 #undef CmiSyncBroadcastAll
00034 #undef CmiSyncBroadcastAllAndFree
00035 #undef CmiSyncListSend
00036 #undef CmiSyncListSendAndFree
00037 #undef CmiSyncMulticast
00038 #undef CmiSyncMulticastAndFree
00039
00040 #define CksdScheduler CsdScheduler
00041 #define CksdExitScheduler CsdExitScheduler
00042 #define CkDeliverMsgs CmiDeliverMsgs
00043
00044 #define CkVTimer(x) 0
00045 #define CkElapse(x)
00046
00047 #if CMK_CHARMDEBUG
00048 extern "C" int ConverseDeliver(int pe);
00049 #else
00050 #define ConverseDeliver(pe) 1
00051 #endif
00052
00053 #if ! CMK_NAMESPACES_BROKEN
00054 namespace Converse {
00055 #endif
00056
00057 static inline int CkMyPe() { return CmiMyPe(); }
00058 static inline int CkNumPes() { return CmiNumPes(); }
00059
00060 static inline void CmiSyncSend(int x, int y, char *z)
00061 {
00062 if (ConverseDeliver(x)) CmiSyncSendFn(x, y, z);
00063 }
00064 static inline void CmiSyncSendAndFree(int x, int y, char *z)
00065 {
00066 if (ConverseDeliver(x)) CmiFreeSendFn(x, y, z);
00067 }
00068 static inline void CmiSyncBroadcast(int x, char *y)
00069 {
00070 if (ConverseDeliver(x)) CmiSyncBroadcastFn(x, y);
00071 }
00072 static inline void CmiSyncBroadcastAndFree(int x, char *y)
00073 {
00074 if (ConverseDeliver(x)) CmiFreeBroadcastFn(x, y);
00075 }
00076 static inline void CmiSyncBroadcastAll(int x, char *y)
00077 {
00078 if (ConverseDeliver(x)) CmiSyncBroadcastAllFn(x, y);
00079 }
00080 static inline void CmiSyncBroadcastAllAndFree(int x, char *y)
00081 {
00082 if (ConverseDeliver(x)) CmiFreeBroadcastAllFn(x, y);
00083 }
00084 static inline void CmiSyncListSend(int x, int *y, int w, char *z)
00085 {
00086 if (ConverseDeliver(-1)) CmiSyncListSendFn(x, y, w, z);
00087 }
00088 static inline void CmiSyncListSendAndFree(int x, int *y, int w, char *z)
00089 {
00090 if (ConverseDeliver(-1)) CmiFreeListSendFn(x, y, w, z);
00091 }
00092 static inline void CmiSyncMulticast(CmiGroup x, int y, char *z)
00093 {
00094 if (ConverseDeliver(-1)) CmiSyncMulticastFn(x, y, z);
00095 }
00096 static inline void CmiSyncMulticastAndFree(CmiGroup x, int y, char *z)
00097 {
00098 if (ConverseDeliver(-1)) CmiFreeMulticastFn(x, y, z);
00099 }
00100
00101 #if 0
00102 template <class d>
00103 class Cpv {
00104 public:
00105 #if CMK_SHARED_VARS_UNAVAILABLE
00106 d data;
00107 #else
00108 d *data;
00109 #endif
00110 public:
00111 void init(void) {
00112 }
00113 d& operator = (d& val) {data = val.data;}
00114 };
00115 #endif
00116
00117 #if ! CMK_NAMESPACES_BROKEN
00118 }
00119 #endif
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132 #endif