当前位置: 首页>>代码示例>>C++>>正文


C++ CkpvAccess函数代码示例

本文整理汇总了C++中CkpvAccess函数的典型用法代码示例。如果您正苦于以下问题:C++ CkpvAccess函数的具体用法?C++ CkpvAccess怎么用?C++ CkpvAccess使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CkpvAccess函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: EmergencyExit

void EmergencyExit(void) {
#ifndef __BIGSIM__
  /* Delete _coreState to force any CkMessageWatcher to close down. */
  if (CkpvAccess(_coreState) != NULL) {
    delete CkpvAccess(_coreState);
    CkpvAccess(_coreState) = NULL;
  }
#endif
}
开发者ID:gitter-badger,项目名称:quinoa,代码行数:9,代码来源:init.C

示例2: _createTracecounter

// this is called by the Charm++ runtime system
void _createTracecounter(char **argv)
{
  DEBUGF(("%d/%d DEBUG: createTraceCounter\n", CmiMyPe(), CmiNumPes()));
  CkpvInitialize(Trace*, _trace);
  TraceCounter* tc = new TraceCounter();  _MEMCHECK(tc);
  tc->traceInit(argv);
  CkpvAccess(_trace) = tc;
  CkpvAccess(_traces)->addTrace(CkpvAccess(_trace));
}
开发者ID:quinoacomputing,项目名称:quinoa,代码行数:10,代码来源:trace-counter.C

示例3: master

CollectionMgr::CollectionMgr(SlaveInitMsg *msg) : master(msg->master)
{
  delete msg;
  if (CkpvAccess(CollectionMgr_instance) == 0) {
    CkpvAccess(CollectionMgr_instance) = this;
  } else {
    DebugM(1, "CollectionMgr::CollectionMgr() - another instance of CollectionMgr exists!\n");
  }
}
开发者ID:cheng2zhang,项目名称:tempering,代码行数:9,代码来源:CollectionMgr.C

示例4: ComlibPrintf

void ConvComlibManager::doneCreating() {
  ComlibPrintf("Called doneCreating\n");
  if (busy) {
    // we have to delay the table broadcast because we are in the middle of another one
    doneCreatingScheduled = CmiTrue;
    return;
  }
  // if we reach here it means we are not busy and we can proceed
  busy = CmiTrue;
  acksReceived = CmiNumPes() - 1;
  int count = 0;
  for (int i=1; i<=nstrats; ++i) {
    if (strategyTable[i].isNew) {
      count++;
    }
  }

  if (count > 0) {
    // create the wrapper and link the strategies there
    StrategyWrapper sw(count);
    count = 0;
    for (int i=1; i<=nstrats; ++i) {
      if (strategyTable[i].isNew) {
    	  sw.position[count] = i;
    	  sw.replace[count] = CmiFalse;
    	  sw.strategy[count] = strategyTable[i].strategy;
    	  count++;
    	  CkpvAccess(conv_com_object).inSync(i);
      }
    }

    // pup the wrapper into a message
    PUP::sizer ps;
    ps|sw;
    char *msg = (char*)CmiAlloc(ps.size() + CmiReservedHeaderSize);
    PUP::toMem pm(msg+CmiReservedHeaderSize);
    //int size = ps.size();
    //pm|size;
    pm|sw;
    //for (int i=CmiReservedHeaderSize; i<CmiReservedHeaderSize+size; ++i) {
    //  CmiPrintf("%x",((char*)msg)[i]);
    //}
    //CmiPrintf("\n");
    CmiSetHandler(msg, CkpvAccess(comlib_receive_table));
    CmiSyncBroadcastAndFree(ps.size()+CmiReservedHeaderSize, msg);

    /* NOT USED NOW!
    // call the finalizeCreation after the strategies has been packed
    for (int i=0; i<strategyTable.size(); ++i) {
      if (strategyTable[i].isNew) strategyTable[i].strategy->finalizeCreation();
    }
    */
  } else {
    busy = CmiFalse;
  }
}
开发者ID:davidheryanto,项目名称:sc14,代码行数:56,代码来源:convcomlibmanager.C

示例5: namdInitPapiCounters

static void namdInitPapiCounters(){
	if(CkMyRank()==0){
		//only initialize per OS process (i.e. a charm node)
		int retval = PAPI_library_init(PAPI_VER_CURRENT);
		if(retval != PAPI_VER_CURRENT) {
			if(CkMyPe()==0){
				CkPrintf("ERROR: PAPI library is not compatitible!");
				CkExit();
			}
		}
	#if CMK_SMP
		//now only consider systems that are compatible with POSIX
		if(PAPI_thread_init(pthread_self)!=PAPI_OK) {
			if(CkMyPe()==0){
				CkPrintf("ERROR: multi-thread mode in PAPI could not be initialized!");
				CkExit();
			}
		}
	#endif
	}
	CkpvInitialize(int *, papiEvents);
	CkpvAccess(papiEvents) = new int[NUM_PAPI_EVENTS];

#if MEASURE_PAPI_CACHE
	if(PAPI_query_event(PAPI_L1_DCM)==PAPI_OK) {
		CkpvAccess(papiEvents)[0] = PAPI_L1_DCM;
	}else{
		if(CkMyPe()==0){
			CkPrintf("WARNING: PAPI_L1_DCM doesn't exsit on this platform!\n");			
		}
		//if not default to PAPI_TOT_INS
		CkpvAccess(papiEvents)[0] = PAPI_TOT_INS;
	}

	if(PAPI_query_event(PAPI_L2_DCM)==PAPI_OK) {
		CkpvAccess(papiEvents)[1] = PAPI_L2_DCM;
	}else{
		//if not default to PAPI_TOT_CYC
		CkpvAccess(papiEvents)[1] = PAPI_TOT_CYC;
	}	
#elif MEASURE_PAPI_FLOPS
	if(PAPI_query_event(PAPI_FP_INS)==PAPI_OK) {
		CkpvAccess(papiEvents)[0] = PAPI_FP_INS;
	}else{
		if(CkMyPe()==0){
			CkPrintf("WARNING: PAPI_FP_INS doesn't exsit on this platform!\n");
		}
		//if not default to PAPI_TOT_INS
		CkpvAccess(papiEvents)[0] = PAPI_TOT_INS;
	}

	if(PAPI_query_event(PAPI_FMA_INS)==PAPI_OK) {
		CkpvAccess(papiEvents)[1] = PAPI_FMA_INS;
	}else{
		//if not default to PAPI_TOT_CYC
		CkpvAccess(papiEvents)[1] = PAPI_TOT_CYC;
	}
#endif
}
开发者ID:wware,项目名称:namd-povray-cloud,代码行数:59,代码来源:Node.C

示例6: _createTraceFoo

/**
  For each TraceFoo module, _createTraceFoo() must be defined.
  This function is called in _createTraces() generated in moduleInit.C
*/
void _createTracememory(char **argv)
{
  DEBUGF(("%d createTraceMemory\n", CkMyPe()));
  CkpvInitialize(TraceMemory*, _trace);
  CkpvAccess(_trace) = new TraceMemory(argv);
  CkpvAccess(_traces)->addTrace(CkpvAccess(_trace));
  /* Since we started after the beginning of the program, we missed a bunch of
   * allocations. We cannot record what was allocated and then deleted, but we
   * can still record all the memory that is still allocated.
   */
}
开发者ID:davidheryanto,项目名称:sc14,代码行数:15,代码来源:trace-memory.C

示例7: CkpvInitialize

Communicate::Communicate(void) 
{
  CkpvInitialize(CmmTable, CsmMessages);
  CsmHandlerIndex = CmiRegisterHandler((CmiHandler) CsmHandler);
  CsmAckHandlerIndex = CmiRegisterHandler((CmiHandler) CsmAckHandler);
  CkpvAccess(CsmMessages) = CmmNew();
  if ( CmiMyNode() * 2 + 2 < CmiNumNodes() ) nchildren = 2;
  else if ( CmiMyNode() * 2 + 1 < CmiNumNodes() ) nchildren = 1;
  else nchildren = 0;
  CkpvInitialize(int, CsmAcks);
  CkpvAccess(CsmAcks) = nchildren;
}
开发者ID:davidheryanto,项目名称:sc14,代码行数:12,代码来源:Communicate.C

示例8: iterate

   /** Call add for every in-range array element on this processor */
   void iterate(void)
   { /* Walk the groupTable for arrays (FIXME: get rid of _groupIDTable) */
     int numGroups=CkpvAccess(_groupIDTable)->size();
     for(int i=0;i<numGroups;i++) {
        IrrGroup *obj = CkpvAccess(_groupTable)->find((*CkpvAccess(_groupIDTable))[i]).getObj();
	if (obj->isArrMgr())
	{ /* This is an array manager: examine its array elements */
	  mgr=(CkArray *)obj;
	  mgr->getLocMgr()->iterate(*this);
	}
     }
   }
开发者ID:gitter-badger,项目名称:quinoa,代码行数:13,代码来源:debug-charm.C

示例9: ComlibPrintf

void PipeBroadcastConverse::insertMessage(MessageHolder *cmsg){
  ComlibPrintf("[%d] PipeBroadcastConverse::insertMessage %d\n",CkMyPe(),topology);
  char *msg = cmsg->getMessage();
  int size = cmsg->getSize();
  if (size < pipeSize) {
    // sending message in a single chunk
    CmiSetHandler(msg, CkpvAccess(pipeline_handler));
    CmiFragmentHeader *frag = getFragmentHeader(msg);
    frag->senderPe = CkMyPe();
    frag->msgSize = size;
    propagate(msg, false);

  } else {
    // sending message in multiple chunk: message doesn't fit into the pipe:
    // split it into chunks and propagate them individually
    ++seqNumber;
    ComlibPrintf("[%d] Propagating message in multiple chunks (totalsize=%d)\n",CkMyPe(),size);

    char *sendingMsg;
    char *nextChunk = msg+CmiReservedHeaderSize;
    int remaining = size-CmiReservedHeaderSize;
    int reducedPipe = pipeSize-CmiReservedHeaderSize-sizeof(PipeBcastInfo);
    int sendingMsgSize;
    CmiSetHandler(msg, CkpvAccess(pipeline_frag_handler));

    // send all the chunks one after the other
    for (int i=0; i<(int)ceil(((double)size-CmiReservedHeaderSize)/reducedPipe); ++i) {
      sendingMsgSize = reducedPipe<remaining? pipeSize : remaining+CmiReservedHeaderSize+sizeof(PipeBcastInfo);
      sendingMsg = (char*)CmiAlloc(sendingMsgSize);
      memcpy (sendingMsg, msg, CmiReservedHeaderSize);
      PipeBcastInfo *info = (PipeBcastInfo*)(sendingMsg+CmiReservedHeaderSize);
      info->srcPe = CkMyPe();
      info->bcastPe = CkMyPe();
      info->seqNumber = seqNumber;
      info->chunkNumber = i;
      info->chunkSize = reducedPipe<remaining ? reducedPipe : remaining;
      info->messageSize = size;
      memcpy (sendingMsg+CmiReservedHeaderSize+sizeof(PipeBcastInfo), nextChunk, info->chunkSize);

      remaining -= info->chunkSize;
      nextChunk += info->chunkSize;

      propagate(sendingMsg, true);
    }

  }
  //CmiSetHandler(msg, CsvAccess(pipeBcastPropagateHandle_frag));
  //conversePipeBcast(msg, cmsg->getSize());
  delete cmsg;
}
开发者ID:davidheryanto,项目名称:sc14,代码行数:50,代码来源:pipebroadcastconverse.C

示例10: Tcl_SetResult

// move all atoms by a given vector
int ScriptTcl::Tcl_moveallby(ClientData clientData,
	Tcl_Interp *interp, int argc, char *argv[]) {
  ScriptTcl *script = (ScriptTcl *)clientData;
  script->initcheck();
  if (argc != 2) {
    Tcl_SetResult(interp, "wrong # args", TCL_VOLATILE);
    return TCL_ERROR;
  }
  char **fstring;
  int fnum;
  double x, y, z;
  if (Tcl_SplitList(interp, argv[1], &fnum, &fstring) != TCL_OK)
    return TCL_ERROR;
  if ( (fnum != 3) ||
       (Tcl_GetDouble(interp, fstring[0],&x) != TCL_OK) ||
       (Tcl_GetDouble(interp, fstring[1],&y) != TCL_OK) ||
       (Tcl_GetDouble(interp, fstring[2],&z) != TCL_OK) ) {
    Tcl_SetResult(interp,"argument not a vector",TCL_VOLATILE);
    Tcl_Free((char*)fstring);
    return TCL_ERROR;
  }
  Tcl_Free((char*)fstring);

  MoveAllByMsg *msg = new MoveAllByMsg;
  msg->offset = Vector(x,y,z);
  (CProxy_PatchMgr(CkpvAccess(BOCclass_group).patchMgr)).moveAllBy(msg);

  script->barrier();
  return TCL_OK;
}
开发者ID:sunhwan,项目名称:NAMD-mini,代码行数:31,代码来源:ScriptTcl.C

示例11: DEBUGF

void TraceBluegene::traceClose() {
  DEBUGF(("%d TraceBluegene::traceClose\n", CkMyPe()));
  bgUpdateProj(2);
  if(pfp != 0)  fclose(pfp);
  pfp = NULL;
  CkpvAccess(_traces)->removeTrace(this);
}
开发者ID:luyukunphy,项目名称:namd,代码行数:7,代码来源:trace-bluegene.C

示例12: CkpvAccess

ComputeMgr::ComputeMgr()
{
    CkpvAccess(BOCclass_group).computeMgr = thisgroup;
    computeGlobalObject = 0;
    computeGlobalResultsMsgSeq = -1;
    computeGlobalResultsMsgMasterSeq = -1;
    computeDPMEObject = 0;
    computeEwaldObject = 0;
    computeNonbondedCUDAObject = 0;
    computeNonbondedMICObject = 0;
    computeNonbondedWorkArrays = new ComputeNonbondedWorkArrays;
    skipSplitting = 0;

    #if defined(NAMD_MIC)
      // Create the micPEData flag array (1 bit per PE) and initially set each PE as "not driving
      //   a MIC card" (unset).  PEs that are driving MIC card will identify themselves during startup.
      int numPEs = CkNumPes();
      int numInts = ((numPEs + (sizeof(int)*8-1)) & (~(sizeof(int)*8-1))) / (sizeof(int)*8);  // Round up to sizeof(int) then divide by the size of an int
      micPEData = new int[numInts];
      if (micPEData == NULL) { NAMD_die("Unable to allocate memory for micPEData"); }
      memset(micPEData, 0, sizeof(int) * numInts);
    #else
      micPEData = NULL;
    #endif
}
开发者ID:luyukunphy,项目名称:namd,代码行数:25,代码来源:ComputeMgr.C

示例13: pm

void
ComputeMgr::updateLocalComputes3()
{
    ComputeMap *computeMap = ComputeMap::Object();
    CProxy_ProxyMgr pm(CkpvAccess(BOCclass_group).proxyMgr);
    ProxyMgr *proxyMgr = pm.ckLocalBranch();

    ProxyMgr::nodecount = 0;

    const int nc = computeMap->numComputes();

    if ( ! CkMyRank() ) {
      for (int i=0; i<nc; i++) {
        computeMap->setNewNumPartitions(i,0);
        if (computeMap->newNode(i) != -1) {
          computeMap->setNode(i,computeMap->newNode(i));
          computeMap->setNewNode(i,-1);
        }
      }
    }
 
    for(int i=0; i<computeFlag.size(); i++) createCompute(computeFlag[i], computeMap);
    computeFlag.clear();

    proxyMgr->removeUnusedProxies();

    if (!CkMyPe())
    {
        CkStartQD(CkIndex_ComputeMgr::updateLocalComputes4((CkQdMsg*)0), &thishandle);
    }
}
开发者ID:luyukunphy,项目名称:namd,代码行数:31,代码来源:ComputeMgr.C

示例14: cm

void ComputeMgr::sendCreateNonbondedMICSlave(int pe, int index) {
  NonbondedMICSlaveMsg *msg = new NonbondedMICSlaveMsg;
  msg->master = computeNonbondedMICObject;
  msg->index = index;
  CProxy_ComputeMgr cm(CkpvAccess(BOCclass_group).computeMgr);
  cm[pe].recvCreateNonbondedMICSlave(msg);
}
开发者ID:luyukunphy,项目名称:namd,代码行数:7,代码来源:ComputeMgr.C

示例15: msmProxy

ComputeMsmSerialMgr::ComputeMsmSerialMgr() :
  msmProxy(thisgroup), msmCompute(0), numSources(0), numArrived(0),
  coordMsgs(0), coord(0), force(0), oldmsg(0), numAtoms(0),
  msmsolver(0), msmcoord(0), msmforce(0)
{
  CkpvAccess(BOCclass_group).computeMsmSerialMgr = thisgroup;
}
开发者ID:aar2163,项目名称:NAMD-energy,代码行数:7,代码来源:ComputeMsmSerial.C


注:本文中的CkpvAccess函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。