00001 #ifndef _CONV_CPM_H
00002 #define _CONV_CPM_H
00003
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007
00008
00009 #include "converse.h"
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 typedef struct CpmDestinationStruct *CpmDestination;
00022
00023 typedef void *(*CpmSender)(CpmDestination, int, void *);
00024
00025 struct CpmDestinationStruct
00026 {
00027 CpmSender sendfn;
00028 int envsize;
00029 };
00030
00031 #define CpmPE(n) n
00032 #define CpmALL (-1)
00033 #define CpmOTHERS (-2)
00034
00035 CpmDestination CpmSend(int pe);
00036 CpmDestination CpmMakeThread(int pe);
00037 CpmDestination CpmMakeThreadSize(int pe, int size);
00038 CpmDestination CpmEnqueueFIFO(int pe);
00039 CpmDestination CpmEnqueueLIFO(int pe);
00040 CpmDestination CpmEnqueueIFIFO(int pe, int prio);
00041 CpmDestination CpmEnqueueILIFO(int pe, int prio);
00042 CpmDestination CpmEnqueueBFIFO(int pe, int priobits, unsigned int *prioptr);
00043 CpmDestination CpmEnqueueBLIFO(int pe, int priobits, unsigned int *prioptr);
00044 CpmDestination CpmEnqueueLFIFO(int pe, int priobits, unsigned int *prioptr);
00045 CpmDestination CpmEnqueueLLIFO(int pe, int priobits, unsigned int *prioptr);
00046 CpmDestination CpmEnqueue(int pe,int qs,int priobits,unsigned int *prioptr);
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 typedef void CpmInvokable;
00063 typedef int CpmDeclareSimple1;
00064 typedef int CpmDeclarePointer1;
00065 #define CpmDeclareSimple(c) typedef CpmDeclareSimple1 CpmType_##c
00066 #define CpmDeclarePointer(c) typedef CpmDeclarePointer1 CpmType_##c
00067
00068
00069
00070
00071
00072
00073
00074 struct CpmHeader
00075 {
00076 char convcore[CmiMsgHeaderSizeBytes];
00077 int envpos;
00078 };
00079 #define CpmEnv(msg) (((char *)msg)+(((struct CpmHeader *)msg)->envpos))
00080 #define CpmAlign(val, type) ((val+sizeof(type)-1)&(~(sizeof(type)-1)))
00081
00082
00083
00084
00085
00086
00087
00088 CpmDeclareSimple(char);
00089 #define CpmPack_char(v) do{}while(0)
00090 #define CpmUnpack_char(v) do{}while(0)
00091
00092 CpmDeclareSimple(short);
00093 #define CpmPack_short(v) do{}while(0)
00094 #define CpmUnpack_short(v) do{}while(0)
00095
00096 CpmDeclareSimple(int);
00097 #define CpmPack_int(v) do{}while(0)
00098 #define CpmUnpack_int(v) do{}while(0)
00099
00100 CpmDeclareSimple(long);
00101 #define CpmPack_long(v) do{}while(0)
00102 #define CpmUnpack_long(v) do{}while(0)
00103
00104 CpmDeclareSimple(float);
00105 #define CpmPack_float(v) do{}while(0)
00106 #define CpmUnpack_float(v) do{}while(0)
00107
00108 CpmDeclareSimple(double);
00109 #define CpmPack_double(v) do{}while(0)
00110 #define CpmUnpack_double(v) do{}while(0)
00111
00112 typedef int CpmDim;
00113 CpmDeclareSimple(CpmDim);
00114 #define CpmPack_CpmDim(v) do{}while(0)
00115 #define CpmUnpack_CpmDim(v) do{}while(0)
00116
00117 CpmDeclareSimple(Cfuture);
00118 #define CpmPack_Cfuture(v) do{}while(0)
00119 #define CpmUnpack_Cfuture(v) do{}while(0)
00120
00121 typedef char *CpmStr;
00122 CpmDeclarePointer(CpmStr);
00123 #define CpmPtrSize_CpmStr(v) (strlen(v)+1)
00124 #define CpmPtrPack_CpmStr(p, v) (strcpy(p, v))
00125 #define CpmPtrUnpack_CpmStr(v) do{}while(0)
00126 #define CpmPtrFree_CpmStr(v) do{}while(0)
00127
00128 #ifdef __cplusplus
00129 }
00130 #endif
00131
00132 #endif