Esempio n. 1
0
  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);
    }
  }
Esempio n. 2
0
 virtual void pup(PUP::er &p, CpdListItemsRequest &req) {
   for (int i=0; i<_debugData.length(); ++i) {
     beginItem(p, i);
     void *obj = _debugData[i].obj;
     p.comment("obj");
     pup_pointer(&p, &obj);
     void *msg = _debugData[i].msg;
     p.comment("msg");
     pup_pointer(&p, &msg);
   }
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
void CkQuadView::pup(PUP::er &p) {
	CkView::pup(p);
	p.comment("Texture corners");
	p|nCorners;
	for (int i=0;i<nCorners;i++) {
		p|corners[i];
		p|texCoord[i];
	}
	
// Pup the image:
	x_tex.pup(p);

#ifdef CMK_LIVEVIZ3D_CLIENT
	if (p.isUnpacking()) { /* immediately upload image to OpenGL */
		CkAllocImage *img=x_tex.getImage();
		oglTextureFormat_t fmt=oglImageFormat(*img);
		c_tex=new oglLilTex(img->getData(),x_tex.gl_w,x_tex.gl_h,
			fmt.format,fmt.type);
		stats::get()->add(x_tex.w*x_tex.h,op_upload_pixels);
		stats::get()->add(x_tex.gl_w*x_tex.gl_h,op_uploadpad_pixels);
		/// Scale texture coordinates from the partial image to OpenGL fractions:
		double tx=x_tex.w/(double)x_tex.gl_w;
		double ty=x_tex.h/(double)x_tex.gl_h;
		for (int i=0;i<nCorners;i++) 
			texCoord[i]=c_tex->texCoord(
				CkVector3d(tx*texCoord[i].x,ty*texCoord[i].y,texCoord[i].z)
			);
		
		//Now that we've copied the view into GL, 
		// flush the old in-memory copy:
		delete img;
	}
#endif

}
Esempio n. 5
0
  virtual void pup(PUP::er &p, CpdListItemsRequest &req) {
    int length;
    void ** messages;
    int curObj=0;
    void *msg;

    length = CdsFifo_Length((CdsFifo)(CpvAccess(conditionalQueue)));
    messages = CdsFifo_Enumerate(CpvAccess(conditionalQueue));
    for (curObj=-length; curObj<0; curObj++) {
      void *msg = messages[length+curObj];
      pupSingleMessage(p, curObj-1, msg);
    }
    delete[] messages;
    
    curObj = 0;
    length = CdsFifo_Length((CdsFifo)(CkpvAccess(debugQueue)));
    messages = CdsFifo_Enumerate(CkpvAccess(debugQueue));
    
    if (CkpvAccess(lastBreakPointMsg) != NULL) {
      beginItem(p, -1);
      envelope *env=(envelope *)UsrToEnv(CkpvAccess(lastBreakPointMsg));
      p.comment("name");
      char *type=(char*)"Breakpoint";
      p(type,strlen(type));
      p.comment("charmMsg");
      p.synchronize(PUP::sync_begin_object);
      CkUnpackMessage(&env);
      CpdPupMessage(p, EnvToUsr(env));
      p.synchronize(PUP::sync_end_object);
    }

    for(curObj=req.lo; curObj<req.hi; curObj++)
      if ((curObj>=0) && (curObj<length))
      {
        void *msg=messages[curObj]; /* converse message */
        pupSingleMessage(p, curObj, msg);
      }
    delete[] messages;

  }
Esempio n. 6
0
  virtual void pup(PUP::er &p,CpdListItemsRequest &req) {
    CkHashtableIterator *it=tab->iterator();
    void *objp;
    int curObj=0;
    while (NULL!=(objp=it->next())) {
      if (curObj>=req.lo && curObj<req.hi) {
	CpdListAccessor *acc=*(CpdListAccessor **)objp;
	char *pathName=(char *)acc->getPath();
	beginItem(p,curObj);
        p.comment("name");
	p(pathName,strlen(pathName));
      }
      curObj++;
    }
  }
Esempio n. 7
0
void CkViewpoint::pup(PUP::er &p) {
	p.comment("CkViewpoint {");
	p.comment("axes");
	p|X; p|Y; p|Z;
	p.comment("origin");
	p|R;
	p.comment("eye");
	p|E;
	p.comment("width and height");
	p|wid; p|ht;
	p.comment("perspective");
	p|isPerspective;
	p.comment("} CkViewpoint");
	if (p.isUnpacking()) buildM();
}
Esempio n. 8
0
/***************** CkView *****************/
void CkView::pup(PUP::er &p) {
	p.comment("View ID:");
	id.pup(p);
	p.comment("View Priority:");
	p|prio;
}
Esempio n. 9
0
// 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);
}