#ifndef _DECL_CkReduction_H_
#define _DECL_CkReduction_H_
#include "charm++.h"
/* DECLS: message CkGroupInitCallbackMsg;
 */
class CkGroupInitCallbackMsg;
class CMessage_CkGroupInitCallbackMsg:public CkArrayMessage{
  public:
    static int __idx;
    void* operator new(size_t, const int);
    void* operator new(size_t);
    void operator delete(void *p){CkFreeMsg(p);}
    void* operator new(size_t, void*p) {return p;}
    void* operator new(size_t, int*, const int);
    void* operator new(size_t, int*);
    static void*alloc(int,size_t,int*,int);
    CMessage_CkGroupInitCallbackMsg() {};
    static void *pack(CkGroupInitCallbackMsg *p);
    static CkGroupInitCallbackMsg* unpack(void* p);
    static void __register(const char *s, size_t size, CkPackFnPtr pack, CkUnpackFnPtr unpack) {
      __idx = CkRegisterMsg(s, pack, unpack, 0, size);
    }
};

/* DECLS: group CkGroupInitCallback{
CkGroupInitCallback(void);
void callMeBack(CkGroupInitCallbackMsg*);
};
 */
class CkGroupInitCallback;
class CProxy_CkGroupInitCallback:  public virtual _CK_GID{
  public:
    static int __idx;
    static void __register(const char *s, size_t size);
    CProxy_CkGroupInitCallback(CkGroupID _gid) { _ck_gid = _gid; _setChare(0); }
    CProxy_CkGroupInitCallback(CkChareID __cid) { ckSetChareId(__cid); }
    CkChareID ckGetChareId(void) { return _ck_cid; }
    void ckSetChareId(CkChareID __cid){_CHECK_CID(__cid,__idx);_ck_cid=__cid;_setChare(1);}
    CkGroupID ckGetGroupId(void) { return _ck_gid; }
    void ckSetGroupId(CkGroupID _gid){_ck_gid=_gid;_setChare(0);}
    CkGroupInitCallback* ckLocalBranch(void) {
      return (CkGroupInitCallback *) CkLocalBranch(_ck_gid);
    }
    static CkGroupInitCallback* ckLocalBranch(CkGroupID gID) {
      return (CkGroupInitCallback *) CkLocalBranch(gID);
    }
/* DECLS: CkGroupInitCallback(void);
 */
    static CkGroupID ckNew(void);
    static CkGroupID ckNewSync(void);
    CProxy_CkGroupInitCallback(int retEP, CkChareID *cid);
    CProxy_CkGroupInitCallback(void);
    static int  __idx_CkGroupInitCallback_void;
    static int  ckIdx_CkGroupInitCallback(void) { return __idx_CkGroupInitCallback_void; }
    static void _call_CkGroupInitCallback_void(void* msg, CkGroupInitCallback* obj);

/* DECLS: void callMeBack(CkGroupInitCallbackMsg*);
 */
    void callMeBack(CkGroupInitCallbackMsg*msg){
      if(_isChare())
        CkSendMsg(__idx_callMeBack_CkGroupInitCallbackMsg, msg, &_ck_cid);
      else
        CkBroadcastMsgBranch(__idx_callMeBack_CkGroupInitCallbackMsg, msg, _ck_gid);
    }
    void callMeBack(CkGroupInitCallbackMsg*msg, int onPE) {
      CkSendMsgBranch(__idx_callMeBack_CkGroupInitCallbackMsg, msg, onPE, _ck_gid);
    }
    void callMeBack(CkGroupInitCallbackMsg*msg, int npes, int *pes) {
      CkSendMsgBranchMulti(__idx_callMeBack_CkGroupInitCallbackMsg, msg, npes, pes, _ck_gid);
    }
    static int  __idx_callMeBack_CkGroupInitCallbackMsg;
    static int  ckIdx_callMeBack(CkGroupInitCallbackMsg*msg) { return __idx_callMeBack_CkGroupInitCallbackMsg; }
    static void _call_callMeBack_CkGroupInitCallbackMsg(void* msg, CkGroupInitCallback* obj);
};

/* DECLS: message CkReductionMsg;
 */
class CkReductionMsg;
class CMessage_CkReductionMsg:public CkArrayMessage{
  public:
    static int __idx;
    void* operator new(size_t, const int);
    void* operator new(size_t);
    void operator delete(void *p){CkFreeMsg(p);}
    void* operator new(size_t, void*p) {return p;}
    void* operator new(size_t, int*, const int);
    void* operator new(size_t, int*);
    static void*alloc(int,size_t,int*,int);
    CMessage_CkReductionMsg() {};
    static void *pack(CkReductionMsg *p);
    static CkReductionMsg* unpack(void* p);
    static void __register(const char *s, size_t size, CkPackFnPtr pack, CkUnpackFnPtr unpack) {
      __idx = CkRegisterMsg(s, pack, unpack, 0, size);
    }
};

/* DECLS: message CkReductionNumberMsg;
 */
class CkReductionNumberMsg;
class CMessage_CkReductionNumberMsg:public CkArrayMessage{
  public:
    static int __idx;
    void* operator new(size_t, const int);
    void* operator new(size_t);
    void operator delete(void *p){CkFreeMsg(p);}
    void* operator new(size_t, void*p) {return p;}
    void* operator new(size_t, int*, const int);
    void* operator new(size_t, int*);
    static void*alloc(int,size_t,int*,int);
    CMessage_CkReductionNumberMsg() {};
    static void *pack(CkReductionNumberMsg *p);
    static CkReductionNumberMsg* unpack(void* p);
    static void __register(const char *s, size_t size, CkPackFnPtr pack, CkUnpackFnPtr unpack) {
      __idx = CkRegisterMsg(s, pack, unpack, 0, size);
    }
};

/* DECLS: group CkReductionMgr: CkGroupInitCallback{
CkReductionMgr(void);
void ReductionStarting(CkReductionNumberMsg*);
void RecvMsg(CkReductionMsg*);
void LateMigrantMsg(CkReductionMsg*);
void MigrantDied(CkReductionNumberMsg*);
};
 */
class CkReductionMgr;
class CProxy_CkReductionMgr:  public virtual _CK_GID, public CProxy_CkGroupInitCallback{
  public:
    static int __idx;
    static void __register(const char *s, size_t size);
    CProxy_CkReductionMgr(CkGroupID _gid) :CProxy_CkGroupInitCallback(_gid){ _ck_gid = _gid; _setChare(0); }
    CProxy_CkReductionMgr(CkChareID __cid) :CProxy_CkGroupInitCallback(__cid){ ckSetChareId(__cid); }
    CkChareID ckGetChareId(void) { return _ck_cid; }
    void ckSetChareId(CkChareID __cid){_CHECK_CID(__cid,__idx);_ck_cid=__cid;_setChare(1);}
    CkGroupID ckGetGroupId(void) { return _ck_gid; }
    void ckSetGroupId(CkGroupID _gid){_ck_gid=_gid;_setChare(0);}
    CkReductionMgr* ckLocalBranch(void) {
      return (CkReductionMgr *) CkLocalBranch(_ck_gid);
    }
    static CkReductionMgr* ckLocalBranch(CkGroupID gID) {
      return (CkReductionMgr *) CkLocalBranch(gID);
    }
/* DECLS: CkReductionMgr(void);
 */
    static CkGroupID ckNew(void);
    static CkGroupID ckNewSync(void);
    CProxy_CkReductionMgr(int retEP, CkChareID *cid);
    CProxy_CkReductionMgr(void);
    static int  __idx_CkReductionMgr_void;
    static int  ckIdx_CkReductionMgr(void) { return __idx_CkReductionMgr_void; }
    static void _call_CkReductionMgr_void(void* msg, CkReductionMgr* obj);

/* DECLS: void ReductionStarting(CkReductionNumberMsg*);
 */
    void ReductionStarting(CkReductionNumberMsg*msg){
      if(_isChare())
        CkSendMsg(__idx_ReductionStarting_CkReductionNumberMsg, msg, &_ck_cid);
      else
        CkBroadcastMsgBranch(__idx_ReductionStarting_CkReductionNumberMsg, msg, _ck_gid);
    }
    void ReductionStarting(CkReductionNumberMsg*msg, int onPE) {
      CkSendMsgBranch(__idx_ReductionStarting_CkReductionNumberMsg, msg, onPE, _ck_gid);
    }
    void ReductionStarting(CkReductionNumberMsg*msg, int npes, int *pes) {
      CkSendMsgBranchMulti(__idx_ReductionStarting_CkReductionNumberMsg, msg, npes, pes, _ck_gid);
    }
    static int  __idx_ReductionStarting_CkReductionNumberMsg;
    static int  ckIdx_ReductionStarting(CkReductionNumberMsg*msg) { return __idx_ReductionStarting_CkReductionNumberMsg; }
    static void _call_ReductionStarting_CkReductionNumberMsg(void* msg, CkReductionMgr* obj);

/* DECLS: void RecvMsg(CkReductionMsg*);
 */
    void RecvMsg(CkReductionMsg*msg){
      if(_isChare())
        CkSendMsg(__idx_RecvMsg_CkReductionMsg, msg, &_ck_cid);
      else
        CkBroadcastMsgBranch(__idx_RecvMsg_CkReductionMsg, msg, _ck_gid);
    }
    void RecvMsg(CkReductionMsg*msg, int onPE) {
      CkSendMsgBranch(__idx_RecvMsg_CkReductionMsg, msg, onPE, _ck_gid);
    }
    void RecvMsg(CkReductionMsg*msg, int npes, int *pes) {
      CkSendMsgBranchMulti(__idx_RecvMsg_CkReductionMsg, msg, npes, pes, _ck_gid);
    }
    static int  __idx_RecvMsg_CkReductionMsg;
    static int  ckIdx_RecvMsg(CkReductionMsg*msg) { return __idx_RecvMsg_CkReductionMsg; }
    static void _call_RecvMsg_CkReductionMsg(void* msg, CkReductionMgr* obj);

/* DECLS: void LateMigrantMsg(CkReductionMsg*);
 */
    void LateMigrantMsg(CkReductionMsg*msg){
      if(_isChare())
        CkSendMsg(__idx_LateMigrantMsg_CkReductionMsg, msg, &_ck_cid);
      else
        CkBroadcastMsgBranch(__idx_LateMigrantMsg_CkReductionMsg, msg, _ck_gid);
    }
    void LateMigrantMsg(CkReductionMsg*msg, int onPE) {
      CkSendMsgBranch(__idx_LateMigrantMsg_CkReductionMsg, msg, onPE, _ck_gid);
    }
    void LateMigrantMsg(CkReductionMsg*msg, int npes, int *pes) {
      CkSendMsgBranchMulti(__idx_LateMigrantMsg_CkReductionMsg, msg, npes, pes, _ck_gid);
    }
    static int  __idx_LateMigrantMsg_CkReductionMsg;
    static int  ckIdx_LateMigrantMsg(CkReductionMsg*msg) { return __idx_LateMigrantMsg_CkReductionMsg; }
    static void _call_LateMigrantMsg_CkReductionMsg(void* msg, CkReductionMgr* obj);

/* DECLS: void MigrantDied(CkReductionNumberMsg*);
 */
    void MigrantDied(CkReductionNumberMsg*msg){
      if(_isChare())
        CkSendMsg(__idx_MigrantDied_CkReductionNumberMsg, msg, &_ck_cid);
      else
        CkBroadcastMsgBranch(__idx_MigrantDied_CkReductionNumberMsg, msg, _ck_gid);
    }
    void MigrantDied(CkReductionNumberMsg*msg, int onPE) {
      CkSendMsgBranch(__idx_MigrantDied_CkReductionNumberMsg, msg, onPE, _ck_gid);
    }
    void MigrantDied(CkReductionNumberMsg*msg, int npes, int *pes) {
      CkSendMsgBranchMulti(__idx_MigrantDied_CkReductionNumberMsg, msg, npes, pes, _ck_gid);
    }
    static int  __idx_MigrantDied_CkReductionNumberMsg;
    static int  ckIdx_MigrantDied(CkReductionNumberMsg*msg) { return __idx_MigrantDied_CkReductionNumberMsg; }
    static void _call_MigrantDied_CkReductionNumberMsg(void* msg, CkReductionMgr* obj);
};

extern void _registerCkReduction(void);
#endif
