
/* DEFS: readonly CkGroupID loadbalancer;
 */
extern CkGroupID loadbalancer;

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

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

/* DEFS: group CentralLB{
void CentralLB(void);
void ProcessAtSync(void);
void ReceiveStats(CLBStatsMsg*);
void ResumeClients(void);
void ReceiveMigration(CLBMigrateMsg*);
};
 */
#ifndef CK_TEMPLATES_ONLY
int CProxy_CentralLB::__idx=0;
#endif
#ifndef CK_TEMPLATES_ONLY
    void CProxy_CentralLB::__register(const char *s, size_t size) {
      __idx = CkRegisterChare(s, size);
    /* REG: void CentralLB(void);
*/
      __idx_CentralLB_void = CkRegisterEp("CentralLB", (CkCallFnPtr)_call_CentralLB_void, 0, __idx);

    /* REG: void ProcessAtSync(void);
*/
      __idx_ProcessAtSync_void = CkRegisterEp("ProcessAtSync", (CkCallFnPtr)_call_ProcessAtSync_void, 0, __idx);

    /* REG: void ReceiveStats(CLBStatsMsg*);
*/
      __idx_ReceiveStats_CLBStatsMsg = CkRegisterEp("ReceiveStats", (CkCallFnPtr)_call_ReceiveStats_CLBStatsMsg, CMessage_CLBStatsMsg::__idx, __idx);

    /* REG: void ResumeClients(void);
*/
      __idx_ResumeClients_void = CkRegisterEp("ResumeClients", (CkCallFnPtr)_call_ResumeClients_void, 0, __idx);

    /* REG: void ReceiveMigration(CLBMigrateMsg*);
*/
      __idx_ReceiveMigration_CLBMigrateMsg = CkRegisterEp("ReceiveMigration", (CkCallFnPtr)_call_ReceiveMigration_CLBMigrateMsg, CMessage_CLBMigrateMsg::__idx, __idx);
    }
#endif
#ifndef CK_TEMPLATES_ONLY
/* DEFS: void CentralLB(void);
 */
int CProxy_CentralLB::__idx_CentralLB_void=0;
CkGroupID CProxy_CentralLB::ckNew(void)
{
      void *msg = CkAllocSysMsg();
  return CkCreateGroup(__idx, __idx_CentralLB_void, msg, 0, 0);
}
CkGroupID CProxy_CentralLB::ckNewSync(void)
{
      void *msg = CkAllocSysMsg();
  return CkCreateGroupSync(__idx, __idx_CentralLB_void, msg);
}
  CProxy_CentralLB::CProxy_CentralLB(int retEP, CkChareID *cid)
{
      void *msg = CkAllocSysMsg();
  _ck_gid = CkCreateGroup(__idx, __idx_CentralLB_void, msg, retEP, cid);
  _setChare(0);
}
  CProxy_CentralLB::CProxy_CentralLB(void)
{
      void *msg = CkAllocSysMsg();
  _ck_gid = CkCreateGroup(__idx, __idx_CentralLB_void, msg, 0, 0);
  _setChare(0);
}
void CProxy_CentralLB::_call_CentralLB_void(void* msg, CentralLB* obj)
{
  new (obj) CentralLB();
  CkFreeSysMsg(msg);
}

/* DEFS: void ProcessAtSync(void);
 */
int CProxy_CentralLB::__idx_ProcessAtSync_void=0;
void CProxy_CentralLB::_call_ProcessAtSync_void(void* msg, CentralLB* obj)
{
  obj->ProcessAtSync();
  CkFreeSysMsg(msg);
}

/* DEFS: void ReceiveStats(CLBStatsMsg*);
 */
int CProxy_CentralLB::__idx_ReceiveStats_CLBStatsMsg=0;
void CProxy_CentralLB::_call_ReceiveStats_CLBStatsMsg(void* msg, CentralLB* obj)
{
  obj->ReceiveStats((CLBStatsMsg*)msg);
}

/* DEFS: void ResumeClients(void);
 */
int CProxy_CentralLB::__idx_ResumeClients_void=0;
void CProxy_CentralLB::_call_ResumeClients_void(void* msg, CentralLB* obj)
{
  obj->ResumeClients();
  CkFreeSysMsg(msg);
}

/* DEFS: void ReceiveMigration(CLBMigrateMsg*);
 */
int CProxy_CentralLB::__idx_ReceiveMigration_CLBMigrateMsg=0;
void CProxy_CentralLB::_call_ReceiveMigration_CLBMigrateMsg(void* msg, CentralLB* obj)
{
  obj->ReceiveMigration((CLBMigrateMsg*)msg);
}
#endif /*CK_TEMPLATES_ONLY*/

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

  CkRegisterReadonly(sizeof(CkGroupID), (void *) &loadbalancer);

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

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

/* REG: group CentralLB{
void CentralLB(void);
void ProcessAtSync(void);
void ReceiveStats(CLBStatsMsg*);
void ResumeClients(void);
void ReceiveMigration(CLBMigrateMsg*);
};
*/
  CProxy_CentralLB::__register("CentralLB", sizeof(CentralLB));

}
#endif
