• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CkpvAccess函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ComputeHomePatches

ComputeMsmSerial::ComputeMsmSerial(ComputeID c) :
  ComputeHomePatches(c)
{
  CProxy_ComputeMsmSerialMgr::ckLocalBranch(
	CkpvAccess(BOCclass_group).computeMsmSerialMgr)->setCompute(this);
  reduction = ReductionMgr::Object()->willSubmit(REDUCTIONS_BASIC);
}
开发者ID:aar2163,项目名称:NAMD-energy,代码行数:7,代码来源:ComputeMsmSerial.C


示例17: CpdBreakPointInit

void CpdBreakPointInit()
{
  CkpvInitialize(void *, lastBreakPointMsg);
  CkpvInitialize(void *, lastBreakPointObject);
  CkpvInitialize(int, lastBreakPointIndex);
  CpvInitialize(int, _debugMsg);
  CpvInitialize(int, _debugChare);
  CpvInitialize(CpdBpFuncTable_t *, breakPointEntryTable);
  CkpvAccess(lastBreakPointMsg) = NULL;
  CkpvAccess(lastBreakPointObject) = NULL;
  CkpvAccess(lastBreakPointIndex) = 0;
  CpvAccess(_debugMsg) = CkRegisterMsg("debug_msg",0,0,0,0);
  CpvAccess(_debugChare) = CkRegisterChare("debug_Chare",0,TypeChare);
  CkRegisterChareInCharm(CpvAccess(_debugChare));
  CpvAccess(breakPointEntryTable) = new CpdBpFuncTable_t(10,0.5,CkHashFunction_int,CkHashCompare_int );
}
开发者ID:gitter-badger,项目名称:quinoa,代码行数:16,代码来源:debug-charm.C


示例18: strncpy

void ScriptTcl::setParameter(const char* param, int value) {
  ScriptParamMsg *msg = new ScriptParamMsg;
  strncpy(msg->param,param,MAX_SCRIPT_PARAM_SIZE);
  sprintf(msg->value,"%d",value);
  (CProxy_Node(CkpvAccess(BOCclass_group).node)).scriptParam(msg);
  barrier();
}
开发者ID:sunhwan,项目名称:NAMD-mini,代码行数:7,代码来源:ScriptTcl.C


示例19: _processBufferedMsgs

static inline void _processBufferedMsgs(void)
{
  CkNumberHandlerEx(_charmHandlerIdx,(CmiHandlerEx)_processHandler,
  	CkpvAccess(_coreState));
  envelope *env;
  while(NULL!=(env=(envelope*)CkpvAccess(_buffQ)->deq())) {
    if(env->getMsgtype()==NewChareMsg || env->getMsgtype()==NewVChareMsg) {
      if(env->isForAnyPE())
        _CldEnqueue(CLD_ANYWHERE, env, _infoIdx);
      else
        _processHandler((void *)env, CkpvAccess(_coreState));
    } else {
      _processHandler((void *)env, CkpvAccess(_coreState));
    }
  }
}
开发者ID:gitter-badger,项目名称:quinoa,代码行数:16,代码来源:init.C


示例20: CpdBeforeEp

// Function called right before an entry method
void CpdBeforeEp(int ep, void *obj, void *msg) {
#if CMK_CHARMDEBUG
  if (CpvAccess(cmiArgDebugFlag)) {
    DebugRecursiveEntry entry;
    entry.previousChareID = setMemoryChareIDFromPtr(obj);
    entry.alreadyUserCode = _entryTable[ep]->inCharm ? 0 : 1;
    entry.memoryBackup = NULL;
    entry.obj = obj;
    if (msg != NULL) {
      entry.msg = msg;
      CmiReference(UsrToEnv(msg));
    }
    else entry.msg = NULL;
    _debugData.push(entry);
    setMemoryStatus(entry.alreadyUserCode);
    //if (CkpvAccess(_debugEntryTable)[ep].isBreakpoint) printf("CpdBeforeEp breakpointed %d\n",ep);
    memoryBackup = &_debugData.peek().memoryBackup;
    if (!_entryTable[ep]->inCharm) {
      CpdResetMemory();
      CpdSystemExit();
    }
    CkVec<DebugPersistentCheck> &preExecutes = CkpvAccess(_debugEntryTable)[ep].preProcess;
    for (int i=0; i<preExecutes.size(); ++i) {
      preExecutes[i].object->cpdCheck(preExecutes[i].msg);
    }
  }
#endif
}
开发者ID:gitter-badger,项目名称:quinoa,代码行数:29,代码来源:debug-charm.C



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Clamp函数代码示例发布时间:2022-05-30
下一篇:
C++ CkPrintf函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap