本文整理汇总了C++中pup::er::isPacking方法的典型用法代码示例。如果您正苦于以下问题:C++ er::isPacking方法的具体用法?C++ er::isPacking怎么用?C++ er::isPacking使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pup::er
的用法示例。
在下文中一共展示了er::isPacking方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pup
void StreamingStrategy::pup(PUP::er &p){
Strategy::pup(p);
p | PERIOD;
p | bufferMax;
p | msgSizeMax;
//p | shortMsgPackingFlag;
p | bufSizeMax;
p | idleFlush;
//p | streaming_handler_id;
if(p.isPacking() || p.isUnpacking()) {
streamingMsgBuf = new CkQ<MessageHolder *>[CmiNumPes()];
streamingMsgCount = new int[CmiNumPes()];
bufSize = new int[CmiNumPes()];
for(int count = 0; count < CmiNumPes(); count ++) {
streamingMsgCount[count] = 0;
bufSize[count] = 0;
}
}
// packing is done once in processor 0, unpacking is done once in all processors except 0
if (p.isPacking() || p.isUnpacking()) registerFlush();
}
示例2: pup
void CentralLB::pup(PUP::er &p) {
BaseLB::pup(p);
if (p.isUnpacking()) {
initLB(CkLBOptions(seqno));
}
p|reduction_started;
int has_statsMsg=0;
if (p.isPacking()) has_statsMsg = (statsMsg!=NULL);
p|has_statsMsg;
if (has_statsMsg) {
if (p.isUnpacking())
statsMsg = new CLBStatsMsg;
statsMsg->pup(p);
}
#if (defined(_FAULT_MLOG_) || defined(_FAULT_CAUSAL_))
p | lbDecisionCount;
p | resumeCount;
#endif
}
示例3: pup
void PipeBroadcastStrategy::pup(PUP::er &p){
ComlibPrintf("[%d] PipeBroadcastStrategy::pup %s\n",CkMyPe(), (p.isPacking()==0)?(p.isUnpacking()?"UnPacking":"sizer"):("Packing"));
PipeBroadcastConverse::pup(p);
CharmStrategy::pup(p);
/*
if (p.isUnpacking()) {
converseStrategy = new PipeBroadcastConverse(0,0,this);
}
p | *converseStrategy;
if (p.isUnpacking()) {
//propagateHandle = CmiRegisterHandler((CmiHandler)propagate_handler);
ComlibPrintf("[%d] registered handler single to %d\n",CmiMyPe(),CsvAccess(pipeBcastPropagateHandle));
messageBuf = new CkQ<CharmMessageHolder *>;
converseStrategy->setHigherLevel(this);
}
*/
}
示例4: pup
void PipeBroadcastConverse::pup(PUP::er &p){
Strategy::pup(p);
ComlibPrintf("[%d] initial of PipeBroadcastConverse::pup %s\n",CkMyPe(),(p.isPacking()==0)?(p.isUnpacking()?"UnPacking":"sizer"):("Packing"));
p | pipeSize;
p | topology;
p | seqNumber;
//ComlibPrintf("[%d] PipeBroadcast converse pupping %s, size=%d, topology=%d\n",CkMyPe(), (p.isPacking()==0)?(p.isUnpacking()?"UnPacking":"sizer"):("Packing"),pipeSize,topology);
/*
if (p.isUnpacking()) {
//log_of_2_inv = 1/log((double)2);
messageBuf = new CkQ<MessageHolder *>;
//propagateHandle_frag = CmiRegisterHandler((CmiHandler)propagate_handler_frag);
ComlibPrintf("[%d] registered handler fragmented to %d\n",CkMyPe(),CsvAccess(pipeBcastPropagateHandle_frag));
}
if (p.isPacking()) {
delete messageBuf;
}
//p|(*messageBuf);
//p|fragments;
*/
}
示例5: pup
//.........这里部分代码省略.........
void MeshStreamingStrategy::pup (PUP::er &p)
{
ComlibPrintf ("[%d] MeshStreamingStrategy::pup() invoked.\n", CkMyPe());
// Call the superclass method -- easy.
Strategy::pup (p);
// Pup the instance variables -- easy.
p | num_pe;
p | num_columns;
p | num_rows;
p | row_length;
//p | my_pe;
//p | my_column;
//p | my_row;
p | max_bucket_size;
p | flush_period;
//p | strategy_id;
//p | column_handler_id;
//p | shortMsgPackingFlag;
// Handle the column_bucket[] data structure.
// For each element in column_bucket[], pup the length of the queue
// at that element followed by the contents of that queue. For each
// queue, pup the size of the message pointed to by the (char *)
// entry, followed by the memory for the (char *) entry.
if (p.isUnpacking ()) {
column_bucket = new CkQ<char *>[num_columns];
column_destQ = new CkQ<int>[num_columns];
}
/*In correct code, will only be useful for checkpointing though
for (i = 0; i < num_columns; i++) {
int length = column_bucket[i].length ();
p | length;
for (int j = 0; j < length; j++) {
char *msg = column_bucket[i].deq ();
int size = sizeof (int) + ((int *) msg)[1];
p | size;
p(msg, size);
}
}
*/
// Handle the column_bytes[] data structure.
// This is a straightforward packing of an int array.
if (p.isUnpacking ()) {
column_bytes = new int[num_columns];
}
p(column_bytes, num_columns);
// Handle the row_bucket[] data structure.
// This works exactly like the column_bucket[] above.
if (p.isUnpacking ()) {
row_bucket = new CkQ<char *>[num_rows];
}
/* In correct code, will only be useful for checkpointing though
for (i = 0; i < num_rows; i++) {
int length = row_bucket[i].length ();
p | length;
for (int j = 0; j < length; j++) {
char *msg = row_bucket[i].deq ();
int size = ((int *) msg)[0];
p | size;
p(msg, size);
}
}
*/
my_pe = CkMyPe ();
my_column = my_pe % num_columns;
my_row = my_pe / row_length;
//column_bucket = new CkQ<char *>[num_columns];
//column_bytes = new int[num_columns];
for (int i = 0; i < num_columns; i++) {
column_bytes[i] = 0;
}
// packing called once on processor 0, unpacking called once on all processors except 0
if (p.isPacking() || p.isUnpacking()) {
//column_handler_id = CkRegisterHandler ((CmiHandler) column_handler);
CcdCallOnConditionKeepOnPE(CcdPROCESSOR_BEGIN_IDLE, idle_flush_handler,
(void *) this, CkMyPe());
RegisterPeriodicFlush ();
}
}