void hostInfo(void *itemIter, pup_er pp, CpdListItemsRequest *req) { PUP::er &p = *(PUP::er *)pp; struct sockaddr_in addr; CpdListBeginItem(pp, 0); #if CMK_HAS_GET_MYADDRESS get_myaddress(&addr); #else CmiAbort("hostInfo: get_myaddress does not work on this machine"); #endif char *address = (char*)&addr.sin_addr.s_addr; PUPv(address, 4); int pid = getpid(); PUPn(pid); }
void add(int cur, Chare *obj, int group) { PUP::er &p=*pp; beginItem(p,cur); p.comment("id"); char *n = (char*)malloc(30); int s=obj->ckDebugChareID(n, 30); CkAssert(s > 0); p(n,s); free(n); PUPn(group); p.comment("name"); n=obj->ckDebugChareName(); p(n,strlen(n)); free(n); }
// 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); }
void asf::parameter_pixel_image::pup(PUP::er &p) { parameter_interpolated_image::pup(p); PUPn(m_meta_bounds); PUPn(pixel_meta); }
void asf::pixel_viewport::pup(PUP::er &p) { PUPn(m_src); PUPn(m_zoom); set(m_src,m_zoom); }
void asf::parameter_interpolated_image::pup(PUP::er &p) { parameter::pup(p); PUPn(n_band); }