
/* DEFS: mainchare ampimain{
readonly CkChareID handle;
readonly ampi_comm_struct ampi_comms[8];
readonly int ncomms;
ampimain();
void done(void);
};
 */
#ifndef CK_TEMPLATES_ONLY
int CProxy_ampimain::__idx=0;
#endif
#ifndef CK_TEMPLATES_ONLY
    void CProxy_ampimain::__register(const char *s, size_t size) {
      __idx = CkRegisterChare(s, size);
  CkRegisterReadonly(sizeof(CkChareID), (void *) &ampimain::handle);

  CkRegisterReadonly(sizeof(ampi_comm_struct[8]), (void *) &ampimain::ampi_comms);

  CkRegisterReadonly(sizeof(int), (void *) &ampimain::ncomms);

    /* REG: ampimain();
*/
      __idx_ampimain = CkRegisterEp("ampimain", (CkCallFnPtr)_call_ampimain, 0, __idx);
      CkRegisterMainChare(__idx, __idx_ampimain);

    /* REG: void done(void);
*/
      __idx_done_void = CkRegisterEp("done", (CkCallFnPtr)_call_done_void, 0, __idx);
    }
#endif
#ifndef CK_TEMPLATES_ONLY
/* DEFS: readonly CkChareID handle;
 */

/* DEFS: readonly ampi_comm_struct ampi_comms[8];
 */

/* DEFS: readonly int ncomms;
 */

/* DEFS: ampimain();
 */
int CProxy_ampimain::__idx_ampimain=0;
void CProxy_ampimain::ckNew(int onPE)
{
      void *msg = CkAllocSysMsg();
  CkCreateChare(__idx, __idx_ampimain, msg, 0, onPE);
}
void CProxy_ampimain::ckNew(CkChareID* pcid, int onPE)
{
      void *msg = CkAllocSysMsg();
  CkCreateChare(__idx, __idx_ampimain, msg, pcid, onPE);
}
  CProxy_ampimain::CProxy_ampimain(int onPE)
{
      void *msg = CkAllocSysMsg();
  CkCreateChare(__idx, __idx_ampimain, msg, &_ck_cid, onPE);
}
void CProxy_ampimain::_call_ampimain(CkArgMsg* msg, ampimain* obj)
{
  new (obj) ampimain((CkArgMsg*)msg);
}

/* DEFS: void done(void);
 */
int CProxy_ampimain::__idx_done_void=0;
void CProxy_ampimain::done(void)
{
  void *msg = CkAllocSysMsg();
  CkSendMsg(__idx_done_void, msg, &_ck_cid);
}
void CProxy_ampimain::_call_done_void(void* msg, ampimain* obj)
{
  obj->done();
  CkFreeSysMsg(msg);
}
#endif /*CK_TEMPLATES_ONLY*/

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

/* REG: mainchare ampimain{
readonly CkChareID handle;
readonly ampi_comm_struct ampi_comms[8];
readonly int ncomms;
ampimain();
void done(void);
};
*/
  CProxy_ampimain::__register("ampimain", sizeof(ampimain));

}
extern "C" void CkRegisterMainModule(void) {
  _registerampimain();
  _REGISTER_DONE();
}
#endif
