
/* DEFS: readonly CkChareID waitqd_qdhandle;
 */
extern CkChareID waitqd_qdhandle;

/* DEFS: message ckGroupIDMsg;
 */
#ifndef CK_TEMPLATES_ONLY
void *CMessage_ckGroupIDMsg::operator new(size_t s){
  return ckGroupIDMsg::alloc(__idx, s, 0, 0);
}
void *CMessage_ckGroupIDMsg::operator new(size_t s,const int pb){
  return ckGroupIDMsg::alloc(__idx, s, 0, pb);
}
void *CMessage_ckGroupIDMsg::operator new(size_t s, int* sz){
  return ckGroupIDMsg::alloc(__idx, s, sz, 0);
}
void *CMessage_ckGroupIDMsg::operator new(size_t s, int* sz,const int pb){
  return ckGroupIDMsg::alloc(__idx, s, sz, pb);
}
void* CMessage_ckGroupIDMsg::alloc(int msgnum, size_t sz, int *sizes, int pb) {
  int offsets[1];
  offsets[0] = ALIGN8(sz);
  ckGroupIDMsg *newmsg = (ckGroupIDMsg *) CkAllocMsg(msgnum, offsets[0], pb);
  return (void *) newmsg;
}
void* CMessage_ckGroupIDMsg::pack(ckGroupIDMsg *msg) {
  return (void *) msg;
}
ckGroupIDMsg* CMessage_ckGroupIDMsg::unpack(void* buf) {
  ckGroupIDMsg *msg = (ckGroupIDMsg *) buf;
  return msg;
}
int CMessage_ckGroupIDMsg::__idx=0;
#endif

/* DEFS: message ckGroupCreateMsg;
 */
#ifndef CK_TEMPLATES_ONLY
void *CMessage_ckGroupCreateMsg::operator new(size_t s){
  return ckGroupCreateMsg::alloc(__idx, s, 0, 0);
}
void *CMessage_ckGroupCreateMsg::operator new(size_t s,const int pb){
  return ckGroupCreateMsg::alloc(__idx, s, 0, pb);
}
void *CMessage_ckGroupCreateMsg::operator new(size_t s, int* sz){
  return ckGroupCreateMsg::alloc(__idx, s, sz, 0);
}
void *CMessage_ckGroupCreateMsg::operator new(size_t s, int* sz,const int pb){
  return ckGroupCreateMsg::alloc(__idx, s, sz, pb);
}
void* CMessage_ckGroupCreateMsg::alloc(int msgnum, size_t sz, int *sizes, int pb) {
  int offsets[1];
  offsets[0] = ALIGN8(sz);
  ckGroupCreateMsg *newmsg = (ckGroupCreateMsg *) CkAllocMsg(msgnum, offsets[0], pb);
  return (void *) newmsg;
}
void* CMessage_ckGroupCreateMsg::pack(ckGroupCreateMsg *msg) {
  return (void *) msg;
}
ckGroupCreateMsg* CMessage_ckGroupCreateMsg::unpack(void* buf) {
  ckGroupCreateMsg *msg = (ckGroupCreateMsg *) buf;
  return msg;
}
int CMessage_ckGroupCreateMsg::__idx=0;
#endif

/* DEFS: mainchare waitqd_QDChare{
waitqd_QDChare();
threaded sync void waitQD(void);
void onQD(CkQdMsg*);
};
 */
#ifndef CK_TEMPLATES_ONLY
int CProxy_waitqd_QDChare::__idx=0;
#endif
#ifndef CK_TEMPLATES_ONLY
    void CProxy_waitqd_QDChare::__register(const char *s, size_t size) {
      __idx = CkRegisterChare(s, size);
    /* REG: waitqd_QDChare();
*/
      __idx_waitqd_QDChare = CkRegisterEp("waitqd_QDChare", (CkCallFnPtr)_call_waitqd_QDChare, 0, __idx);
      CkRegisterMainChare(__idx, __idx_waitqd_QDChare);

    /* REG: threaded sync void waitQD(void);
*/
      __idx_waitQD_void = CkRegisterEp("waitQD", (CkCallFnPtr)_call_waitQD_void, 0, __idx);

    /* REG: void onQD(CkQdMsg*);
*/
      __idx_onQD_CkQdMsg = CkRegisterEp("onQD", (CkCallFnPtr)_call_onQD_CkQdMsg, CMessage_CkQdMsg::__idx, __idx);
    }
#endif
#ifndef CK_TEMPLATES_ONLY
/* DEFS: waitqd_QDChare();
 */
int CProxy_waitqd_QDChare::__idx_waitqd_QDChare=0;
void CProxy_waitqd_QDChare::ckNew(int onPE)
{
      void *msg = CkAllocSysMsg();
  CkCreateChare(__idx, __idx_waitqd_QDChare, msg, 0, onPE);
}
void CProxy_waitqd_QDChare::ckNew(CkChareID* pcid, int onPE)
{
      void *msg = CkAllocSysMsg();
  CkCreateChare(__idx, __idx_waitqd_QDChare, msg, pcid, onPE);
}
  CProxy_waitqd_QDChare::CProxy_waitqd_QDChare(int onPE)
{
      void *msg = CkAllocSysMsg();
  CkCreateChare(__idx, __idx_waitqd_QDChare, msg, &_ck_cid, onPE);
}
void CProxy_waitqd_QDChare::_call_waitqd_QDChare(CkArgMsg* msg, waitqd_QDChare* obj)
{
  new (obj) waitqd_QDChare((CkArgMsg*)msg);
}

/* DEFS: threaded sync void waitQD(void);
 */
int CProxy_waitqd_QDChare::__idx_waitQD_void=0;
void CProxy_waitqd_QDChare::waitQD(void)
{
  void *msg = CkAllocSysMsg();
  CkFreeSysMsg(CkRemoteCall(__idx_waitQD_void, msg, &_ck_cid));
}
 void CProxy_waitqd_QDChare::waitQD(CkFutureID *fut)
{
      void *msg = CkAllocSysMsg();
  *fut = CkRemoteCallAsync(__idx_waitQD_void, msg, &_ck_cid);
}
void CProxy_waitqd_QDChare::_call_waitQD_void(void* msg, waitqd_QDChare* obj)
{
  CthAwaken(CthCreate((CthVoidFn)_callthr_waitQD_void, new CkThrCallArg(msg,obj), 0));
}
void CProxy_waitqd_QDChare::_callthr_waitQD_void(CkThrCallArg *arg)
{
  void *msg = arg->msg;
  waitqd_QDChare *obj = (waitqd_QDChare *) arg->obj;
  delete arg;
  int ref = CkGetRefNum(msg), src = CkGetSrcPe(msg);
  void *retMsg=CkAllocSysMsg();
  obj->waitQD();
  CkFreeSysMsg(msg);
  CkSendToFuture(ref, retMsg, src);
}

/* DEFS: void onQD(CkQdMsg*);
 */
int CProxy_waitqd_QDChare::__idx_onQD_CkQdMsg=0;
void CProxy_waitqd_QDChare::onQD(CkQdMsg*msg)
{
  CkSendMsg(__idx_onQD_CkQdMsg, msg, &_ck_cid);
}
void CProxy_waitqd_QDChare::_call_onQD_CkQdMsg(void* msg, waitqd_QDChare* obj)
{
  obj->onQD((CkQdMsg*)msg);
}
#endif /*CK_TEMPLATES_ONLY*/

/* DEFS: chare waitGC_chare{
waitGC_chare(void);
void recvGroupID(ckGroupIDMsg*);
sync ckGroupIDMsg* createGroup(ckGroupCreateMsg*);
sync ckGroupIDMsg* createNodeGroup(ckGroupCreateMsg*);
};
 */
#ifndef CK_TEMPLATES_ONLY
int CProxy_waitGC_chare::__idx=0;
#endif
#ifndef CK_TEMPLATES_ONLY
    void CProxy_waitGC_chare::__register(const char *s, size_t size) {
      __idx = CkRegisterChare(s, size);
    /* REG: waitGC_chare(void);
*/
      __idx_waitGC_chare_void = CkRegisterEp("waitGC_chare", (CkCallFnPtr)_call_waitGC_chare_void, 0, __idx);

    /* REG: void recvGroupID(ckGroupIDMsg*);
*/
      __idx_recvGroupID_ckGroupIDMsg = CkRegisterEp("recvGroupID", (CkCallFnPtr)_call_recvGroupID_ckGroupIDMsg, CMessage_ckGroupIDMsg::__idx, __idx);

    /* REG: sync ckGroupIDMsg* createGroup(ckGroupCreateMsg*);
*/
      __idx_createGroup_ckGroupCreateMsg = CkRegisterEp("createGroup", (CkCallFnPtr)_call_createGroup_ckGroupCreateMsg, CMessage_ckGroupCreateMsg::__idx, __idx);

    /* REG: sync ckGroupIDMsg* createNodeGroup(ckGroupCreateMsg*);
*/
      __idx_createNodeGroup_ckGroupCreateMsg = CkRegisterEp("createNodeGroup", (CkCallFnPtr)_call_createNodeGroup_ckGroupCreateMsg, CMessage_ckGroupCreateMsg::__idx, __idx);
    }
#endif
#ifndef CK_TEMPLATES_ONLY
/* DEFS: waitGC_chare(void);
 */
int CProxy_waitGC_chare::__idx_waitGC_chare_void=0;
void CProxy_waitGC_chare::ckNew(int onPE)
{
      void *msg = CkAllocSysMsg();
  CkCreateChare(__idx, __idx_waitGC_chare_void, msg, 0, onPE);
}
void CProxy_waitGC_chare::ckNew(CkChareID* pcid, int onPE)
{
      void *msg = CkAllocSysMsg();
  CkCreateChare(__idx, __idx_waitGC_chare_void, msg, pcid, onPE);
}
  CProxy_waitGC_chare::CProxy_waitGC_chare(int onPE)
{
      void *msg = CkAllocSysMsg();
  CkCreateChare(__idx, __idx_waitGC_chare_void, msg, &_ck_cid, onPE);
}
void CProxy_waitGC_chare::_call_waitGC_chare_void(void* msg, waitGC_chare* obj)
{
  new (obj) waitGC_chare();
  CkFreeSysMsg(msg);
}

/* DEFS: void recvGroupID(ckGroupIDMsg*);
 */
int CProxy_waitGC_chare::__idx_recvGroupID_ckGroupIDMsg=0;
void CProxy_waitGC_chare::recvGroupID(ckGroupIDMsg*msg)
{
  CkSendMsg(__idx_recvGroupID_ckGroupIDMsg, msg, &_ck_cid);
}
void CProxy_waitGC_chare::_call_recvGroupID_ckGroupIDMsg(void* msg, waitGC_chare* obj)
{
  obj->recvGroupID((ckGroupIDMsg*)msg);
}

/* DEFS: sync ckGroupIDMsg* createGroup(ckGroupCreateMsg*);
 */
int CProxy_waitGC_chare::__idx_createGroup_ckGroupCreateMsg=0;
ckGroupIDMsg* CProxy_waitGC_chare::createGroup(ckGroupCreateMsg*msg)
{
  return (ckGroupIDMsg*) CkRemoteCall(__idx_createGroup_ckGroupCreateMsg, msg, &_ck_cid);
}
 void CProxy_waitGC_chare::createGroup(ckGroupCreateMsg*msg, CkFutureID *fut)
{
  *fut = CkRemoteCallAsync(__idx_createGroup_ckGroupCreateMsg, msg, &_ck_cid);
}
void CProxy_waitGC_chare::_call_createGroup_ckGroupCreateMsg(void* msg, waitGC_chare* obj)
{
  int ref = CkGetRefNum(msg), src = CkGetSrcPe(msg);
  void *retMsg=(void *) obj->createGroup((ckGroupCreateMsg*)msg);
  CkSendToFuture(ref, retMsg, src);
}

/* DEFS: sync ckGroupIDMsg* createNodeGroup(ckGroupCreateMsg*);
 */
int CProxy_waitGC_chare::__idx_createNodeGroup_ckGroupCreateMsg=0;
ckGroupIDMsg* CProxy_waitGC_chare::createNodeGroup(ckGroupCreateMsg*msg)
{
  return (ckGroupIDMsg*) CkRemoteCall(__idx_createNodeGroup_ckGroupCreateMsg, msg, &_ck_cid);
}
 void CProxy_waitGC_chare::createNodeGroup(ckGroupCreateMsg*msg, CkFutureID *fut)
{
  *fut = CkRemoteCallAsync(__idx_createNodeGroup_ckGroupCreateMsg, msg, &_ck_cid);
}
void CProxy_waitGC_chare::_call_createNodeGroup_ckGroupCreateMsg(void* msg, waitGC_chare* obj)
{
  int ref = CkGetRefNum(msg), src = CkGetSrcPe(msg);
  void *retMsg=(void *) obj->createNodeGroup((ckGroupCreateMsg*)msg);
  CkSendToFuture(ref, retMsg, src);
}
#endif /*CK_TEMPLATES_ONLY*/

#ifndef CK_TEMPLATES_ONLY
void _registerwaitqd(void)
{
  static int _done = 0; if(_done) return; _done = 1;
      _registerCkFutures();

  CkRegisterReadonly(sizeof(CkChareID), (void *) &waitqd_qdhandle);

/* REG: message ckGroupIDMsg;
*/
CMessage_ckGroupIDMsg::__register("ckGroupIDMsg", sizeof(ckGroupIDMsg),(CkPackFnPtr) ckGroupIDMsg::pack,(CkUnpackFnPtr) ckGroupIDMsg::unpack);

/* REG: message ckGroupCreateMsg;
*/
CMessage_ckGroupCreateMsg::__register("ckGroupCreateMsg", sizeof(ckGroupCreateMsg),(CkPackFnPtr) ckGroupCreateMsg::pack,(CkUnpackFnPtr) ckGroupCreateMsg::unpack);

/* REG: mainchare waitqd_QDChare{
waitqd_QDChare();
threaded sync void waitQD(void);
void onQD(CkQdMsg*);
};
*/
  CProxy_waitqd_QDChare::__register("waitqd_QDChare", sizeof(waitqd_QDChare));

/* REG: chare waitGC_chare{
waitGC_chare(void);
void recvGroupID(ckGroupIDMsg*);
sync ckGroupIDMsg* createGroup(ckGroupCreateMsg*);
sync ckGroupIDMsg* createNodeGroup(ckGroupCreateMsg*);
};
*/
  CProxy_waitGC_chare::__register("waitGC_chare", sizeof(waitGC_chare));

}
#endif
