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

C++ CkPrintf函数代码示例

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

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



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

示例1: _printStats

static inline void _printStats(void)
{
  DEBUGF(("[%d] _printStats\n", CkMyPe()));
  int i;
  if(_printSS || _printCS) {
    Stats *total = new Stats();
    _MEMCHECK(total);
    for(i=0;i<CkNumPes();i++)
      total->combine(_allStats[i]);
    CkPrintf("Charm Kernel Summary Statistics:\n");
    for(i=0;i<CkNumPes();i++) {
      CkPrintf("Proc %d: [%d created, %d processed]\n", i,
               _allStats[i]->getCharesCreated(),
               _allStats[i]->getCharesProcessed());
    }
    CkPrintf("Total Chares: [%d created, %d processed]\n",
             total->getCharesCreated(), total->getCharesProcessed());
  }
  if(_printCS) {
    CkPrintf("Charm Kernel Detailed Statistics (R=requested P=processed):\n\n");

    CkPrintf("         Create    Mesgs     Create    Mesgs     Create    Mesgs\n");
    CkPrintf("         Chare     for       Group     for       Nodegroup for\n");
    CkPrintf("PE   R/P Mesgs     Chares    Mesgs     Groups    Mesgs     Nodegroups\n");
    CkPrintf("---- --- --------- --------- --------- --------- --------- ----------\n");

    for(i=0;i<CkNumPes();i++) {
      CkPrintf("%4d  R  %9d %9d %9d %9d %9d %9d\n      P  %9d %9d %9d %9d %9d %9d\n",i,
               _allStats[i]->getCharesCreated(),
               _allStats[i]->getForCharesCreated(),
               _allStats[i]->getGroupsCreated(),
               _allStats[i]->getGroupMsgsCreated(),
               _allStats[i]->getNodeGroupsCreated(),
               _allStats[i]->getNodeGroupMsgsCreated(),
               _allStats[i]->getCharesProcessed(),
               _allStats[i]->getForCharesProcessed(),
               _allStats[i]->getGroupsProcessed(),
               _allStats[i]->getGroupMsgsProcessed(),
               _allStats[i]->getNodeGroupsProcessed(),
	       _allStats[i]->getNodeGroupMsgsProcessed());
    }
  }
}
开发者ID:gitter-badger,项目名称:quinoa,代码行数:43,代码来源:init.C


示例2: CkPrintf

/** Extract elements adjacent to edge [n1,n2] along with element-local node
    numberings and nodes opposite input edge **/
int FEM_Adapt::findAdjData(int n1, int n2, int *e1, int *e2, int *e1n1, 
			    int *e1n2, int *e1n3, int *e2n1, int *e2n2, 
			    int *e2n3, int *n3, int *n4)
{
  // Set some default values in case e1 is not there
  (*e1n1) = (*e1n2) = (*e1n3) = (*n3) = -1;

  //if n1,n2 is not an edge return 
  if(n1<0 || n2<0) return -1;
  if(theMesh->node.is_valid(n1)==0 || theMesh->node.is_valid(n2)==0) return -1;
  if(theMesh->n2n_exists(n1,n2)!=1 || theMesh->n2n_exists(n2,n1)!=1) return -1; 

  (*e1) = theMesh->getElementOnEdge(n1, n2); // assumed to return local element
  if ((*e1) == -1) {
    CkPrintf("[%d]Warning: No Element on edge %d->%d\n",theMod->idx,n1,n2);
    return -1;
  }
  (*e1n1) = find_local_node_index((*e1), n1);
  (*e1n2) = find_local_node_index((*e1), n2);
  (*e1n3) = 3 - (*e1n1) - (*e1n2);
  (*n3) = theMesh->e2n_getNode((*e1), (*e1n3));
  (*e2) = theMesh->e2e_getNbr((*e1), get_edge_index((*e1n1), (*e1n2)));
  // Set some default values in case e2 is not there
  (*e2n1) = (*e2n2) = (*e2n3) = (*n4) = -1;
  if ((*e2) != -1) { // e2 exists
    (*e2n1) = find_local_node_index((*e2), n1);
    (*e2n2) = find_local_node_index((*e2), n2);
    (*e2n3) = 3 - (*e2n1) - (*e2n2);
    //if ((*e2) > -1) { // if e2 is a ghost, there is no e2n data
    (*n4) = theMesh->e2n_getNode((*e2), (*e2n3));
    //}
  }
  if(*n3 == *n4) {
    CkPrintf("[%d]Warning: Identical elements %d:(%d,%d,%d) & %d:(%d,%d,%d)\n",theMod->idx,*e1,n1,n2,*n3,*e2,n1,n2,*n4);
    return -1;
  }
  return 1;
}
开发者ID:davidheryanto,项目名称:sc14,代码行数:40,代码来源:adapt.C


示例3: TestDriver

  TestDriver(CkArgMsg *m) {
    delete m;

    CProxy_Destination destinationChare =
      CProxy_Destination::ckNew(CkNumPes() - 1);

    CkPrintf("Size of Converse envelope: %d bytes\n", CmiReservedHeaderSize);
    CkPrintf("Size of Charm++ envelope: %d bytes\n", sizeof(envelope));
    CkPrintf("Default alignment: %d bytes\n", ALIGN_BYTES);

    int msgSizes[] = {varSize1, varSize2};
    std::vector<TestMessage *> allMsgs;
    int prio = 1234;
    for (int i = 0; i < nCheck; i++) {
      TestMessage *msg = new (msgSizes, prio) TestMessage();
      allMsgs.push_back(msg);
    }
    alignmentTest(allMsgs, "source");

    for (int i = 0; i < allMsgs.size(); i++) {
      destinationChare.receiveMessage(allMsgs[i]);
    }
  }
开发者ID:gitter-badger,项目名称:quinoa,代码行数:23,代码来源:alignmentCheck.C


示例4: BFSGraph

	BFSGraph(CmiUInt8 nVertex, bool directed = true) : 
	  directed(directed),	
		GraphLib::Graph<
				BFSMultiVertex, 
				BFSEdge,
				CProxy_BFSMultiVertex, 
				GraphLib::TransportType::Charm >(CmiNumPes())	{

    int dims[2] = {CkNumNodes(), CkNumPes() / CkNumNodes()};
    CkPrintf("Aggregation topology: %d %d\n", dims[0], dims[1]);
    aggregator =
      CProxy_ArrayMeshStreamer<dtype, long long, BFSMultiVertex, SimpleMeshRouter>
      ::ckNew(numMsgsBuffered, 2, dims, g, 1);
	}
开发者ID:DISLab,项目名称:xcharm,代码行数:14,代码来源:tram_multivertex_bfs.C


示例5: double

void Main::ready()  {
  int i;
  readyCount += 1;
  int BLOCK_SIZE = matrix_size*matrix_size/CkNumPes();
  double (*split_y)[BLOCK_SIZE] = (double (*)[BLOCK_SIZE]) split_bycol;

  if (readyCount == CkNumPes()) {
    // calculate
    CkPrintf("Start calculation\n");
    for (i = 0; i < CkNumPes(); i++) {	  
      object_array[i].multiply(matrix_size * matrix_size/CkNumPes(), split_y[i],i);	  
    }
  }
}
开发者ID:ogbash,项目名称:charm_tests,代码行数:14,代码来源:main.C


示例6: allDone

 void allDone() {
   double elapsedTime = CkWallTimer() - startTime;
   CkPrintf("Elapsed time for all-to-all of %8d bytes sent in %6d %10s"
            " of %2d bytes each (%3s using TRAM): %.6f seconds\n",
            iters * DATA_ITEM_SIZE, iters,
            iters == 1 ? "iteration" : "iterations", DATA_ITEM_SIZE,
            testType == directSends ? "not" : "", elapsedTime);
   if (iters == dataSizeMax / DATA_ITEM_SIZE) {
     ++testType;
     if (testType == finishedTests) {
       CkExit();
     }
     else {
       CkPrintf("\nTEST 2: Using point to point sends\n");
       iters = dataSizeMin / DATA_ITEM_SIZE;
       prepare();
     }
   }
   else {
     iters *= 2;
     prepare();
   }
 }
开发者ID:quinoacomputing,项目名称:quinoa,代码行数:23,代码来源:ataTest.C


示例7: Main

 Main(CkArgMsg *m) {
   CkPrintf("running SDAG migration test\n");
   CProxy_Test testProxy = CProxy_Test::ckNew(NUM_ELEMS);
   testProxy.wrapper(100, 200);
   for (int i = 0; i < NUM_ELEMS; i++) {
     char str[100];
     sprintf(str, "test %d", i);
     Msg* m = new (strlen(str) + 1) Msg(i, str);
     testProxy[i].method2(i * 2, i * 2 + 1);
     testProxy[i].method3(m);
     testProxy[i].methodA();
   }
   CkStartQD(CkCallback(CkIndex_Main::finished(), thisProxy));
 }
开发者ID:gitter-badger,项目名称:quinoa,代码行数:14,代码来源:migration.C


示例8: SayHi

 void SayHi(int hiNo)
 {
     if(hiNo <2 )
         startTimer = CkWallTimer();
     else if(hiNo >= numIterations)
     {
         double time = CkWallTimer() - startTimer;
         CkPrintf(" migration cost total : %f sec single migration cost: %f us\n", time, time/(hiNo-1)*1000000); 
         CkExit();
     }
     //CkPrintf("executing  %d  %d\n", CkMyPe(), hiNo);
     thisProxy[thisIndex].SayHi(hiNo+1);
     migrateMe(1-CkMyPe());
 }
开发者ID:gitter-badger,项目名称:quinoa,代码行数:14,代码来源:migrateHello.C


示例9: CkAssert

int FEM_Adapt::get_edge_index(int local_node1, int local_node2) 
{
  int sum = local_node1 + local_node2;
  CkAssert(local_node1 != local_node2);
  if (sum == 1) return 0;
  else if (sum == 3) return 1;
  else if (sum == 2) return 2;
  else {
    CkPrintf("ERROR: local node pair is strange: [%d,%d]\n", local_node1,
	    local_node2);
    CkAbort("ERROR: local node pair is strange\n");
    return -1;
  }
}
开发者ID:davidheryanto,项目名称:sc14,代码行数:14,代码来源:fem_adapt.C


示例10: Pingping

		Pingping(std::size_t index, uChareSet<Pingping, CProxy_Pingping, CBase_Pingping> *uchareset) : 
			uChare<Pingping, CProxy_Pingping, CBase_Pingping>(index, uchareset)  {
			CkPrintf("[uchare=%d, chare=%d,pe=%d]: created \n", 
					getId(), getuChareSet()->getId(), getuChareSet()->getPe());

			pingDone = pongDone = false;

			pingCounters.resize(N_uChares);
			pingCounters.assign(N_uChares, -1);
			pongCounters.resize(N_uChares);
			pongCounters.assign(N_uChares, 999);

			contribute(CkCallback(CkReductionTarget(Main, start), mainProxy));
		}
开发者ID:DISLab,项目名称:xcharm,代码行数:14,代码来源:test_pingping.C


示例11: CkPrintf

main::main(CkArgMsg* m)
  {
    //Process command-line arguments
    //Start the computation

    mainProxy = thishandle;
    if(m->argc<2)
      {
	      CkPrintf("Needs number of array elements and allreduce data size\n");
	CkExit();
      }
    units=atoi(m->argv[1]);
    allredSize=atoi(m->argv[2]);
    
    arr = CProxy_AllReduce::ckNew(thisProxy, units);

    CkPrintf("AllReduce for %d pes on %d units for %d size\n",
	     CkNumPes(),units,allredSize);

    arr.init();
    startTime = CkWallTimer();
    arr.dowork();
  }
开发者ID:brog2610,项目名称:quinoa,代码行数:23,代码来源:AllReduce.C


示例12: report

    // One worker reports back to here when it completes the workload
    void report(double result) {
      double totalTime, flops, diff;
      double ref_norm = (COEFX+COEFY)*(maxiterations+1);
      result   /= (n-2.0*RADIUS)*(n-2.0*RADIUS);
      totalTime = endTime - startTime;
      flops     = (double) (2*(4*RADIUS+1)+1) * (n-2*RADIUS)*(double)(n-2*RADIUS)*maxiterations;
      diff      = ABS(result-ref_norm);
      if (diff < EPSILON) {
        CkPrintf("Solution validates\n");
#if VERBOSE
      printf("Reference L1 norm = "FSTR", L1 norm = "FSTR"\n", 
             ref_norm, result);
#endif
        
        CkPrintf("Rate (MFlops): %lf Avg time (s) %lf\n", flops/totalTime/1.e6, 
                 totalTime/maxiterations);
      }
      else {
        CkPrintf("Solution does not validate\n");
        CkPrintf("Reference norm: %lf, norm: %lf, |diff|: %e\n", ref_norm, result, diff);
      }
      CkExit();
    }
开发者ID:ParRes,项目名称:Kernels,代码行数:24,代码来源:stencil.C


示例13: CkPrintf

/** Allocate both the FEM_ELEM_ELEM_ADJACENCY and FEM_ELEM_ELEM_ADJ_TYPES attributes
    The values in these two attributes will be generated by 
*/
void FEM_Elem::allocateElemAdjacency(){
	
  if(elemAdjacency){
	CkPrintf("FEM> WARNING: Deleting previously allocated(?) elemAdjacency array. allocateElemAdjacency() should probably only be called once.\n");
    delete elemAdjacency;
  }
  if(elemAdjacencyTypes){
   	CkPrintf("FEM> WARNING: Deleting previously allocated(?) elemAdjacencyTypes array. allocateElemAdjacency() should probably only be called once.\n");
	delete elemAdjacencyTypes;
  }

  elemAdjacency = new FEM_IndexAttribute(this,FEM_ELEM_ELEM_ADJACENCY);
  elemAdjacencyTypes = new FEM_IndexAttribute(this,FEM_ELEM_ELEM_ADJ_TYPES);

  elemAdjacency->setLength(size());
  elemAdjacency->setWidth(conn->getWidth());
  elemAdjacencyTypes->setLength(size());
  elemAdjacencyTypes->setWidth(conn->getWidth());
	
  add(elemAdjacency);
  add(elemAdjacencyTypes);

}
开发者ID:davidheryanto,项目名称:sc14,代码行数:26,代码来源:mesh_adjacency.C


示例14: Main

  Main(CkArgMsg* msg) {

    int n = atoi(msg->argv[1]);
    mainProxy = thisProxy;
    
    CkPrintf("n = %d\n",n);
    BProxy = CProxy_B::ckNew(n);
    AProxy = CProxy_A::ckNew(2);
    AProxy.F();

    CkCallback cb = CkCallback(CkReductionTarget(Main, done), thisProxy);
    CkStartQD(cb);

  }
开发者ID:sdasgup3,项目名称:parallel-programming,代码行数:14,代码来源:index.C


示例15: mcastPing

 void mcastPing(pingMsg *msg)
 {
   // Say hello world
   CkPrintf("Array %d, Element %d received ping number %d\n", aNum, thisIndex, msg->hiNo);
   // Save the section cookie, the first time you get it
   if (! isCookieSet)
   {
       sectionCookie = msg->_cookie;
       isCookieSet = true;
   }
   // Contribute to the section reduction
   mcastMgr->contribute(sizeof(int), &(msg->hiNo), CkReduction::sum_int, sectionCookie);
   delete msg;
 }
开发者ID:brog2610,项目名称:quinoa,代码行数:14,代码来源:hello.C


示例16: Main

		Main(CkArgMsg *m) {
			CkPrintf("%d:Hallo: argv[1] = %d, argv[2] = %d!\n", CmiMyPe(), atoi(m->argv[1]), atoi(m->argv[2]));

			nElements =  CkNumPes() * atoi(m->argv[1]);
			nChares =  CkNumPes() * atoi(m->argv[2]);

			mainProxy = thisProxy;
			//!!
			alltoall_proxy = new Pingping_uChareArray(nElements, nChares);
			alltoall_proxy->init();

			//thisProxy.init();
			delete m;
		}
开发者ID:DISLab,项目名称:xcharm,代码行数:14,代码来源:test_pingping.C


示例17: POSE_prepExit

/// Exit simulation program after terminus reduction
void POSE_prepExit(void *param, void *msg)
{
  CkReductionMsg *m = (CkReductionMsg *)msg;
  long long *finalBasicStats = ((long long*)m->getData());
  CkPrintf("Final basic stats: Commits: %lld  Rollbacks: %lld\n", finalBasicStats[0], finalBasicStats[1]);
  delete m;
#ifdef SEQUENTIAL_POSE
  CProxy_pose POSE_Coordinator(POSE_Coordinator_ID);
  POSE_Coordinator.prepExit();
#else
  CProxy_GVT g(TheGVT);
  g.sumGVTIterationCounts();
#endif
}
开发者ID:davidheryanto,项目名称:sc14,代码行数:15,代码来源:pose.C


示例18: BaseLB

WSLB::WSLB(const CkLBOptions &opt) : BaseLB(opt) 
{
#if CMK_LBDB_ON
  thisProxy = CProxy_WSLB(thisgroup);
  lbname = "WSLB";
  if (CkMyPe() == 0)
    CkPrintf("[%d] WSLB created\n",CkMyPe());

  mystep = 0;
  theLbdb->
    AddLocalBarrierReceiver((LDBarrierFn)(staticAtSync),(void*)(this));
  notifier = theLbdb->getLBDB()->
    NotifyMigrated((LDMigratedFn)(staticMigrated),(void*)(this));


   LBtopoFn topofn = LBTopoLookup(_lbtopo);
  if (topofn == NULL) {
    if (CkMyPe()==0) CmiPrintf("LB> Fatal error: Unknown topology: %s.\n", _lbtopo);
    CmiAbort("");
  }
  topo = topofn(CkNumPes());

  // I had to move neighbor initialization outside the constructor
  // in order to get the virtual functions of any derived classes
  // so I'll just set them to illegal values here.
  neighbor_pes = NULL;
  stats_msg_count = 0;
  statsMsgsList = NULL;
  statsDataList = NULL;
  migrates_completed = 0;
  migrates_expected = -1;
  mig_msgs_received = 0;
  mig_msgs = NULL;

  myStats.proc_speed = theLbdb->ProcessorSpeed();
//  char hostname[80];
//  gethostname(hostname,79);
//  CkPrintf("[%d] host %s speed %d\n",CkMyPe(),hostname,myStats.proc_speed);
  myStats.obj_data_sz = 0;
  myStats.comm_data_sz = 0;
  receive_stats_ready = 0;

  vacate = false;
  usage = 1.0;
  usage_int_err = 0.;

  theLbdb->CollectStatsOn();
#endif
}
开发者ID:gitter-badger,项目名称:quinoa,代码行数:49,代码来源:WSLB.C


示例19: CBase_HybridBaseLB

HybridBaseLB::HybridBaseLB(const CkLBOptions &opt): CBase_HybridBaseLB(opt)
{
#if CMK_LBDB_ON
  lbname = (char *)"HybridBaseLB";
  thisProxy = CProxy_HybridBaseLB(thisgroup);
  receiver = theLbdb->
    AddLocalBarrierReceiver((LDBarrierFn)(staticAtSync),
			    (void*)(this));
  notifier = theLbdb->getLBDB()->
    NotifyMigrated((LDMigratedFn)(staticMigrated), (void*)(this));

  statsStrategy = FULL;

  // defines topology
  if (CkNumPes() <= 4)  {
    tree = new TwoLevelTree;
  }
  else {
    tree = new ThreeLevelTree;
    if (CkNumPes() >= 4096) statsStrategy = SHRINK;
    //statsStrategy = SHRINK;

  }
  //tree = new FourLevelTree;
  if (CkMyPe() == 0)
    CkPrintf("%s: %s is created.\n", lbname, tree->name());

  // decide which load balancer to call
//  greedy = (CentralLB *)AllocateGreedyLB();
//  refine = (CentralLB *)AllocateRefineLB();

  currentLevel = 0;
  foundNeighbors = 0;
  future_migrates_expected = -1;

  vector_n_moves = 0;

  maxLoad = 0.0;
  maxCpuLoad = 0.0;
  totalLoad = 0.0;
  maxCommCount = 0;
  maxCommBytes = 0.0;
  maxMem = 0.0;

  if (_lb_args.statsOn()) theLbdb->CollectStatsOn();

  group1_created = 0;             // base class need to call initTree()
#endif
}
开发者ID:quinoacomputing,项目名称:quinoa,代码行数:49,代码来源:HybridBaseLB.C


示例20: sanitize

/// Commit (delete) all events that are done (used in sequential mode)
void eventQueue::CommitDoneEvents(sim *obj) {
#ifdef EQ_SANITIZE
  sanitize();
#endif
  Event *commitPtr = frontPtr->next;
  
  // commit calls for done events
  while (commitPtr != backPtr) {
    if (commitPtr->done) {
      obj->ResolveCommitFn(commitPtr->fnIdx, commitPtr->msg);
      obj->basicStats[0]++;
      CommitStatsHelper(obj, commitPtr);
      if (commitPtr->commitBfrLen > 0)  { // print buffered output
	CkPrintf("%s", commitPtr->commitBfr);
	if (commitPtr->commitErr) CmiAbort("Commit ERROR");
      }
    }
    commitPtr = commitPtr->next;
  }

  // now free up the memory (only delete events that are done)
  Event *link = commitPtr;
  commitPtr = commitPtr->prev;
  while (commitPtr != frontPtr) {
    if (commitPtr->done == 1) {
#ifdef MEM_TEMPORAL
      if (commitPtr->serialCPdata) {
	localTimePool->tmp_free(commitPtr->timestamp, commitPtr->serialCPdata);
      }
#else
      if (commitPtr->cpData) {
	delete commitPtr->cpData;
      }
#endif
    }
    commitPtr = commitPtr->prev;
    if (commitPtr->next->done == 1) {
      mem_usage--;
      delete commitPtr->next;
    } else {
      link = commitPtr->next;
    }
  }
  frontPtr->next = link;
  link->prev = frontPtr; 
#ifdef EQ_SANITIZE
  sanitize();
#endif
}
开发者ID:quinoacomputing,项目名称:quinoa,代码行数:50,代码来源:evq.C



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ CkpvAccess函数代码示例发布时间:2022-05-30
下一篇:
C++ CkNumPes函数代码示例发布时间: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