本文整理汇总了C++中pup::er::synchronize方法的典型用法代码示例。如果您正苦于以下问题:C++ er::synchronize方法的具体用法?C++ er::synchronize怎么用?C++ er::synchronize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pup::er
的用法示例。
在下文中一共展示了er::synchronize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pupSingleMessage
void pupSingleMessage(PUP::er &p, int curObj, void *msg) {
beginItem(p,curObj);
int isCharm=0;
const char *type="Converse";
p.comment("name");
char name[128];
if (msg == (void*)-1) {
type="Sentinel";
p((char*)type, strlen(type));
return;
}
#if ! CMK_BIGSIM_CHARM
if (CmiGetHandler(msg)==_charmHandlerIdx) {isCharm=1; type="Local Charm";}
if (CmiGetXHandler(msg)==_charmHandlerIdx) {isCharm=1; type="Network Charm";}
#else
isCharm=1; type="BG";
#endif
if (curObj < 0) type="Conditional";
sprintf(name,"%s %d: %s (%d)","Message",curObj,type,CmiGetHandler(msg));
p(name, strlen(name));
if (isCharm)
{ /* charm message */
p.comment("charmMsg");
p.synchronize(PUP::sync_begin_object);
envelope *env=(envelope *)msg;
CkUnpackMessage(&env);
//messages[curObj]=env;
CpdPupMessage(p, EnvToUsr(env));
//CkPupMessage(p, &messages[curObj], 0);
p.synchronize(PUP::sync_end_object);
}
}
示例2: pup
virtual void pup(PUP::er &p, CpdListItemsRequest &req) {
envelope *env = (envelope*)(((unsigned int)req.lo) + (((unsigned long)req.hi)<<32)+sizeof(CmiChunkHeader));
beginItem(p, 0);
const char *type="Converse";
p.comment("name");
char name[128];
if (CmiGetHandler(env)==_charmHandlerIdx) {type="Local Charm";}
if (CmiGetXHandler(env)==_charmHandlerIdx) {type="Network Charm";}
sprintf(name,"%s 0: %s (%d)","Message",type,CmiGetHandler(env));
p(name, strlen(name));
p.comment("charmMsg");
p.synchronize(PUP::sync_begin_object);
CpdPupMessage(p, EnvToUsr(env));
p.synchronize(PUP::sync_end_object);
}
示例3: CpdPupMessage
// Interpret data in a message in a user-friendly way.
// Ignores most of the envelope fields used by CkPupMessage,
// and instead concentrates on user data
void CpdPupMessage(PUP::er &p, void *msg)
{
envelope *env=UsrToEnv(msg);
//int wasPacked=env->isPacked();
int size=env->getTotalsize();
int prioBits=env->getPriobits();
int from=env->getSrcPe();
PUPn(from);
//PUPn(wasPacked);
PUPn(prioBits);
int userSize=size-sizeof(envelope)-sizeof(int)*CkPriobitsToInts(prioBits);
PUPn(userSize);
int msgType = env->getMsgIdx();
PUPn(msgType);
int envType = env->getMsgtype();
PUPn(envType);
//p.synchronize(PUP::sync_last_system);
int ep=CkMessageToEpIdx(msg);
PUPn(ep);
// Pup the information specific to this envelope type
if (envType == ForArrayEltMsg || envType == ArrayEltInitMsg) {
int arrID = env->getArrayMgr().idx;
PUPn(arrID);
CkArrayIndex &idx = env->getsetArrayIndex();
int nInts = idx.nInts;
int dimension = idx.dimension;
PUPn(nInts);
PUPn(dimension);
p.comment("index");
if (dimension >=4 && dimension <=6) {
p((short int *)idx.index, dimension);
} else {
p(idx.index, nInts);
}
} else if (envType == ForNodeBocMsg || envType == ForBocMsg) {
int groupID = env->getGroupNum().idx;
PUPn(groupID);
} else if (envType == BocInitMsg || envType == NodeBocInitMsg) {
int groupID = env->getGroupNum().idx;
PUPn(groupID);
} else if (envType == NewVChareMsg || envType == ForVidMsg || envType == FillVidMsg) {
p.comment("ptr");
void *ptr = env->getVidPtr();
pup_pointer(&p, &ptr);
} else if (envType == ForChareMsg) {
p.comment("ptr");
void *ptr = env->getObjPtr();
pup_pointer(&p, &ptr);
}
/* user data */
p.comment("data");
p.synchronize(PUP::sync_begin_object);
if (_entryTable[ep]->messagePup!=NULL)
_entryTable[ep]->messagePup(p,msg);
else
CkMessage::ckDebugPup(p,msg);
p.synchronize(PUP::sync_end_object);
}