00001
00002
00003
00004
00005
00006 #ifndef CONV_CCS_H
00007 #define CONV_CCS_H
00008
00009 #include "converse.h"
00010 #include "sockRoutines.h"
00011 #include "ccs-server.h"
00012
00013 #include "ckhashtable.h"
00014
00015 #ifdef __cplusplus
00016 extern "C" {
00017 #endif
00018
00019
00020
00021 #define CMK_CCS_VERSION "2"
00022
00023 extern int _ccsHandlerIdx;
00024
00025 #if CMK_CCS_AVAILABLE
00026
00027 typedef CkHashtable_c CcsHandlerTable;
00028 CpvExtern(CcsHandlerTable, ccsTab);
00029
00030 typedef struct CcsDelayedReply_struct {
00031 CcsImplHeader *hdr;
00032 } CcsDelayedReply;
00033
00034 typedef void (*CcsHandlerFn)(void *userPtr,int reqLen,const void *reqData);
00035
00036
00037 typedef struct CcsHandlerRec {
00038 const char *name;
00039 CmiHandler fnOld;
00040 CcsHandlerFn fn;
00041 void *userPtr;
00042 CmiReduceMergeFn mergeFn;
00043 int nCalls;
00044 CmiUInt2 redID;
00045 } CcsHandlerRec;
00046
00052 void CcsRegisterHandler(const char *ccs_handlername, CmiHandler fn);
00053
00054 CcsHandlerRec *CcsGetHandler(const char *name);
00055
00060 void CcsRegisterHandlerFn(const char *ccs_handlername, CcsHandlerFn fn, void *userPtr);
00061
00065 void CcsSetMergeFn(const char *name, CmiReduceMergeFn newMerge);
00066
00067 #define SIMPLE_REDUCTION(name) void * CcsMerge_##name(int *size,void *local,void **remote,int n)
00068 #define SIMPLE_POLYMORPH_REDUCTION(nameBase) \
00069 SIMPLE_REDUCTION(nameBase##_int); \
00070 SIMPLE_REDUCTION(nameBase##_float); \
00071 SIMPLE_REDUCTION(nameBase##_double)
00072 SIMPLE_REDUCTION(concat);
00073 SIMPLE_REDUCTION(logical_and);
00074 SIMPLE_REDUCTION(logical_or);
00075 SIMPLE_REDUCTION(bitvec_and);
00076 SIMPLE_REDUCTION(bitvec_and);
00077 SIMPLE_POLYMORPH_REDUCTION(sum);
00078 SIMPLE_POLYMORPH_REDUCTION(product);
00079 SIMPLE_POLYMORPH_REDUCTION(max);
00080 SIMPLE_POLYMORPH_REDUCTION(min);
00081 #undef SIMPLE_REDUCTION
00082 #undef SIMPLE_POLYMORPH_REDUCTION
00083
00084 void CcsReleaseMessages();
00085 void CcsInit(char **argv);
00086 int CcsEnabled(void);
00087 int CcsIsRemoteRequest(void);
00088 void CcsCallerId(skt_ip_t *pip, unsigned int *pport);
00089 void CcsSendReply(int replyLen, const void *replyData);
00090 void CcsSendReplyNoError(int replyLen, const void *replyData);
00091 CcsDelayedReply CcsDelayReply(void);
00092 void CcsSendDelayedReply(CcsDelayedReply d,int replyLen, const void *replyData);
00093 void CcsNoReply();
00094 void CcsNoDelayedReply(CcsDelayedReply d);
00095
00096 #else
00097 typedef void *CcsDelayedReply;
00098 #define CcsReleaseMessages()
00099 #define CcsInit(argv)
00100 #define CcsRegisterHandler(x,y) 0
00101 #define CcsRegisterHandlerFn(x,y,p) 0
00102 #define CcsSetMergeFn(x,y) 0
00103 #define CcsEnabled() 0
00104 #define CcsIsRemoteRequest() 0
00105 #define CcsCallerId(x,y)
00106 #define CcsDelayReply() 0
00107 #define CcsSendReply(s,r)
00108 #define CcsSendReplyNoError(s,r)
00109 #define CcsSendDelayedReply(d,s,r);
00110 #define CcsNoReply()
00111 #define CcsNoDelayedReply(d)
00112 #endif
00113
00114 #ifdef __cplusplus
00115 }
00116 #endif
00117 #endif