#include "charm++.h"
#include <stdio.h>

#include "migrator.top.h"
#include "server.top.h"
#include "migrator.h"

migrator::migrator(Msg *msg)
{
  RegMsg *regMsg = new (MsgIndex(RegMsg)) RegMsg;
  regMsg->grpid = thisgroup;
  regMsg->methodId = GetEntryPtr(migrator, callback, CallbackMsg);
  CSendMsgBranch(server, Register, RegMsg, regMsg, msg->dummy, CMyPe());
  delete msg;
}

void
migrator::callback(CallbackMsg *msg)
{
  CPrintf("Callback Method called on processor %d\n", CMyPe());
  CPrintf("Exiting\n");
  delete msg;
  CharmExit();
}

#include "migrator.bot.h"
