这篇教程C++ CkExit函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CkExit函数的典型用法代码示例。如果您正苦于以下问题:C++ CkExit函数的具体用法?C++ CkExit怎么用?C++ CkExit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CkExit函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: namdInitPapiCountersstatic 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,
示例2: processGhosts void processGhosts(ghostMsg *msg) { int kk=0; int size = msg->size; switch(msg->dir) { case LEFT: for(int j=jstart;j<=jend;j++) for (int i=iend+1; i<=iend+RADIUS; i++) IN(i,j) = msg->edge[kk++]; break; case RIGHT: for(int j=jstart;j<=jend;j++) for (int i=istart-RADIUS; i<=istart-1; i++) IN(i,j) = msg->edge[kk++]; break; case BOTTOM: for (int j=jend+1; j<=jend+RADIUS; j++) for(int i=istart;i<=iend;i++){ IN(i,j) = msg->edge[kk++]; } break; case TOP: for (int j=jstart-RADIUS; j<=jstart-1; j++) for(int i=istart;i<=iend;i++) IN(i,j) = msg->edge[kk++]; break; default: CkPrintf("ERROR: invalid direction/n"); CkExit(); } delete msg; }
开发者ID:ParRes,项目名称:Kernels,代码行数:31,
示例3: CkPrintfmain::main(CkArgMsg* m) { //Process command-line arguments //Start the computation mainProxy = thishandle; if(m->argc<2) { CkPrintf("Needs number of array elements/n"); CkExit(); } units=atoi(m->argv[1]); // 4 MB size allredSize= 4194304; //atoi(m->argv[2]); baseSize = 262144; currentSize = baseSize; sizeInd = 0; numItr = 10; sizesNo = 5; timeForEach = new double[sizesNo]; iterNo = 0; for(int i=0; i<sizesNo; i++) timeForEach[i] = 0.0; 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(baseSize); }
开发者ID:gitter-badger,项目名称:quinoa,代码行数:32,
示例4: doublevoid Main::save_temp(int SIZE, double *number, int row_number){ int i,j; double (*temp)[matrix_size] = (double (*)[matrix_size]) result; for(i = 0; i < matrix_size/CkNumPes(); i++){ for(j = 0; j < matrix_size; j++) { temp[i+row_number*matrix_size/CkNumPes()][j] = number[i*matrix_size+j]; } } doneCount ++; //CkPrintf("donecount: %d ",doneCount); if (doneCount == CkNumPes()){/* for (i = 0; i < matrix_size; i++) { CkPrintf("tulemus: "); for (j = 0; j < matrix_size; j++) { CkPrintf(" %.1f ",temp[i][j]); } CkPrintf("/n"); }*/ CkExit(); }}
开发者ID:ogbash,项目名称:charm_tests,代码行数:30,
示例5: CkExitvoid Main::checkIn() { checkInCount ++; if( checkInCount >= m*n) CkExit();}
开发者ID:gitter-badger,项目名称:quinoa,代码行数:7,
示例6: CkPrintf/** Count the number of elements on edge (n1, n2) */int FEM_Mesh::countElementsOnEdge(int n1, int n2) { if (n1==n2) { CkPrintf("ERROR: You called countElementsOnEdge() with two identical nodes %d, and %d /n", n1, n2); CkExit(); } int *n1AdjElems=0, *n2AdjElems=0; int n1NumElems, n2NumElems; CkAssert(node.is_valid_any_idx(n1)); CkAssert(node.is_valid_any_idx(n2)); n2e_getAll(n1, n1AdjElems, n1NumElems); n2e_getAll(n2, n2AdjElems, n2NumElems); CkAssert(n1AdjElems!=0); CkAssert(n2AdjElems!=0); int count=0; for (int i=0; i<n1NumElems; i++) { for (int j=0; j<n2NumElems; j++) { if (n1AdjElems[i] == n2AdjElems[j]) { count++; } } } delete[] n1AdjElems; delete[] n2AdjElems; return count;}
开发者ID:davidheryanto,项目名称:sc14,代码行数:32,
示例7: Main //! /brief Constructor //! /details The main chare constructor is the main entry point of the //! program, called by the Charm++ runtime system. The constructor does //! basic initialization steps, e.g., parser the command-line, prints out //! some useful information to screen (in verbose mode), and instantiates //! a driver. Since Charm++ is fully asynchronous, the constructor //! usually spawns asynchronous objects and immediately exits. Thus in the //! body of the main chare constructor we fire up an 'execute' chare, //! which then calls back to Main::execute(). Finishing the main chare //! constructor the Charm++ runtime system then starts the //! network-migration of all global-scope data (if any). The execute chare //! calling back to Main::execute() signals the end of the migration of //! the global-scope data. Then we are ready to execute the driver. Since //! the unit test suite is parallel and asynchronous, its driver fires up //! additional Charm++ chare objects which then call back to //! Main::finalize() at some point in the future when all work has been //! finished. finalize() then exits by calling Charm++'s CkExit(), //! shutting down the runtime system. //! /see http://charm.cs.illinois.edu/manuals/html/charm++/manual.html Main( CkArgMsg* msg ) try : // Parse command line into m_cmdline using default simple pretty printer m_cmdParser( msg->argc, msg->argv, tk::Print(), m_cmdline, m_helped ), // Create pretty printer initializing output streams based on command line m_print( m_cmdline.get< tag::verbose >() ? std::cout : std::clog ), // Create UnitTest driver m_driver( tk::Main< unittest::UnitTestDriver > ( msg->argc, msg->argv, m_cmdline, tk::HeaderType::UNITTEST, UNITTEST_EXECUTABLE, m_print ) ), m_timer(1) // Start new timer measuring the serial+Charm++ runtime { // Immediately exit if any help was requested; help is printed in main() if (m_helped) CkExit(); // Save executable name to global-scope string so FileParser can access it unittest::g_executable = msg->argv[0]; delete msg; mainProxy = thisProxy; // Fire up an asynchronous execute object, which when created at some // future point in time will call back to this->execute(). This is // necessary so that this->execute() can access already migrated // global-scope data. CProxy_execute::ckNew(); // Start new timer measuring the migration of global-scope data m_timer.emplace_back(); } catch (...) { tk::processExceptionCharm(); }
开发者ID:gitter-badger,项目名称:quinoa,代码行数:48,
示例8: findarea void findarea(int x, bool done) { ckout<<"Radius of circle is: "<<x<<"Area of the circle is: "<<y*x*x<<endl; if(done) CkExit(); };
开发者ID:ChinmaySKulkarni,项目名称:Charm-Practice-Programs,代码行数:7,
示例9: processGhosts void processGhosts(ghostMsg *msg) { int k; k=0; int size = msg->size; switch(msg->dir) { case LEFT: for(int j=0;j<size;++j) for (int i=0; i<RADIUS; i++) IN(width+i,j) = msg->edge[k++]; break; case RIGHT: for(int j=0;j<size;++j) for (int i=0; i<RADIUS; i++) IN(-RADIUS+i,j) = msg->edge[k++]; break; case BOTTOM: for (int j=0; j<RADIUS; j++) for(int i=0;i<size;++i){ IN(i,height+j) = msg->edge[k++]; } break; case TOP: for (int j=0; j<RADIUS; j++) for(int i=0;i<size;++i) IN(i,-RADIUS+j) = msg->edge[k++]; break; default: CkPrintf("ERROR: invalid direction/n"); CkExit(); } delete msg; }
开发者ID:nchaimov,项目名称:ParResKernels,代码行数:31,
示例10: CkPrintfvoid TheMain::exit() { //CkPrintf("called = %d/n",called); if (++called >= CmiNumPes()) { CkPrintf("All done/n"); CkExit(); }}
开发者ID:davidheryanto,项目名称:sc14,代码行数:7,
示例11: CkExit/// Exit the simulationvoid pose::exit(void) { if (callBackSet) cb.send(); // need to make callback here else CkExit();}
开发者ID:davidheryanto,项目名称:sc14,代码行数:8,
示例12: done void done() { endt = CkWallTimer(); CkPrintf("Main: done/n"); CkPrintf("/tnumber of uchares %ld, number of sent messages %f*10^6/n", N_uChares, ((double)(N_uChares*(N_uChares-1)))/(1000000)); CkPrintf("/t%f secs, %f.4 MMsg/s /n", endt-startt, ((double)(N_uChares*(N_uChares-1)))/(1000000 *(endt-startt))); CkExit(); }
开发者ID:DISLab,项目名称:xcharm,代码行数:7,
示例13: maindone void maindone(void) { niter++; if(niter == START_TRACE_ITER) _traceControl.startTrace(); if(niter == END_TRACE_ITER) _traceControl.endTrace(); if(niter == iterations) { double pingTimer = CkWallTimer() - start_time; CkPrintf("Pingping %d/t/t %d /t/t%d /t/t%d /t/t%d /t/t%.1f/n", nodeIndex, CharesPerPE, PEsPerNode, PEsPerNode * CharesPerPE, payload, 1000*1000*pingTimer/(iterations-WARM_UP)); if(nodeIndex == CkNumNodes() -1) CkExit(); else { niter = 0; for(int i=0; i<PEsPerNode * CharesPerPE; i++) arr1[i].start(nodeIndex); } nodeIndex++; }else { if(niter == WARM_UP) start_time = CkWallTimer(); for(int i=0; i<PEsPerNode * CharesPerPE; i++) arr1[i].start(nodeIndex); } };
开发者ID:luyukunphy,项目名称:namd,代码行数:30,
示例14: maindone void maindone(void) { static int count = 0; count ++; CkPrintf("All done/n"); CkExit(); };
开发者ID:davidheryanto,项目名称:sc14,代码行数:7,
示例15: CkWallTimervoid Main::done() { numIterations++; if(numIterations == 1) { firstTime = CkWallTimer();#if USE_CKDIRECT CkPrintf("FIRST ITER TIME %f secs/n", firstTime - setupTime);#else CkPrintf("FIRST ITER TIME %f secs/n", firstTime - startTime);#endif compute.resetArrays(); } else { if(numIterations == NUM_ITER) { endTime[numIterations-2] = CkWallTimer() - firstTime; double sum = 0; for(int i=0; i<NUM_ITER-1; i++) sum += endTime[i];#if USE_CKDIRECT CkPrintf("AVG TIME %f secs/n", sum/(NUM_ITER-1));#else CkPrintf("AVG TIME %f secs/n", sum/(NUM_ITER-1));#endif CkExit(); } else { endTime[numIterations-2] = CkWallTimer() - firstTime; compute.resetArrays(); } }}
开发者ID:brog2610,项目名称:quinoa,代码行数:28,
示例16: done void done(void) { count--; if (count == 0) { CkPrintf("All done/n"); CkExit(); } };
开发者ID:brog2610,项目名称:quinoa,代码行数:8,
示例17: done void done(void) { counter++; if(counter == 4) { CkPrintf("All done/n"); CkExit(); } };
开发者ID:luyukunphy,项目名称:namd,代码行数:8,
示例18: done void done(int totalIter) { if(totalIter >= maxiterations) CkPrintf("Finish due to max iterations %d, total time %.3f seconds. /n", totalIter, CkWallTimer()-startTime); else CkPrintf("Finish due to convergence, iterations %d, total time %.3f seconds. /n", totalIter, CkWallTimer()-startTime); CkExit(); }
开发者ID:brog2610,项目名称:quinoa,代码行数:8,
示例19: CkPrintf// Entry point of Charm++ applicationMain::Main(CkArgMsg* msg) { // Print a message for the user CkPrintf("Hello World!/n"); // Exit the application --> This is needed. It does not work like normal C/C++ that just returning will do the job. CkExit();}
开发者ID:uwsbel,项目名称:CharmPrototyping,代码行数:9,
示例20: maindone void maindone(void) { static int count = 0; count ++;// if (count < sectionSize*3) return; CkPrintf("All done/n"); CkExit(); };
开发者ID:quinoacomputing,项目名称:quinoa,代码行数:8,
示例21: CmiWallTimervoid Main::finished(){ if (--numFinished == 0) { double elapt = CmiWallTimer()-startTime; CkPrintf("Finished in %fs %fs/step and iters is %d/n", elapt, elapt/ITER,ITER); CkExit(); }}
开发者ID:luyukunphy,项目名称:namd,代码行数:8,
示例22: exit void exit() { nDone++; // Becase each array element sends a message to all array elements, there are a total of nElements^2 messages received if (nDone == nElements*nElements){ CkPrintf("Successful Completion/n"); CkExit(); } }
开发者ID:davidheryanto,项目名称:sc14,代码行数:8,
示例23: Main Main(CkArgMsg* m) {#if CMK_BLUEGENEL BGLPersonality bgl_p; int i = rts_get_personality(&bgl_p, sizeof(BGLPersonality));#elif CMK_BLUEGENEP DCMF_Hardware_t bgp_hwt; DCMF_Hardware(&bgp_hwt);#elif XT3_TOPOLOGY XT3TorusManager xt3tm;#elif XT4_TOPOLOGY || XT5_TOPOLOGY XTTorusManager xttm;#endif mainProxy = thishandle; CkPrintf("Testing TopoManager .... /n"); TopoManager tmgr; CkPrintf("Torus Size [%d] [%d] [%d] [%d]/n", tmgr.getDimNX(), tmgr.getDimNY(), tmgr.getDimNZ(), tmgr.getDimNT());#if CMK_BLUEGENEP CkPrintf("Torus Size [%d] [%d] [%d] [%d]/n", bgp_hwt.xSize, bgp_hwt.ySize, bgp_hwt.zSize, bgp_hwt.tSize);#endif int x, y, z, t; for(int i=0; i<CkNumPes(); i++) { tmgr.rankToCoordinates(i, x, y, z, t); CkPrintf("---- Processor %d ---> x %d y %d z %d t %d/n", i, x, y, z, t);#if CMK_BLUEGENEL unsigned int tmp_t, tmp_x, tmp_y, tmp_z; rts_coordinatesForRank(i, &tmp_x, &tmp_y, &tmp_z, &tmp_t); CkPrintf("Real Processor %d ---> x %d y %d z %d t %d/n", i, tmp_x, tmp_y, tmp_z, tmp_t);#elif CMK_BLUEGENEP unsigned int tmp_t, tmp_x, tmp_y, tmp_z; #if (DCMF_VERSION_MAJOR >= 3) DCMF_NetworkCoord_t nc; DCMF_Messager_rank2network(i, DCMF_DEFAULT_NETWORK, &nc); tmp_x = nc.torus.x; tmp_y = nc.torus.y; tmp_z = nc.torus.z; tmp_t = nc.torus.t; #else DCMF_Messager_rank2torus(c, &tmp_x, &tmp_y, &tmp_z, &tmp_t); #endif CkPrintf("Real Processor %d ---> x %d y %d z %d t %d/n", i, tmp_x, tmp_y, tmp_z, tmp_t);#elif XT3_TOPOLOGY int tmp_t, tmp_x, tmp_y, tmp_z; xt3tm.realRankToCoordinates(i, tmp_x, tmp_y, tmp_z, tmp_t); CkPrintf("Real Processor %d ---> x %d y %d z %d t %d/n", i, tmp_x, tmp_y, tmp_z, tmp_t);#elif XT4_TOPOLOGY || XT5_TOPOLOGY int tmp_t, tmp_x, tmp_y, tmp_z; xttm.realRankToCoordinates(i, tmp_x, tmp_y, tmp_z, tmp_t); CkPrintf("Real Processor %d ---> x %d y %d z %d t %d/n", i, tmp_x, tmp_y, tmp_z, tmp_t);#endif } // end of for loop int size = tmgr.getDimNX() * tmgr.getDimNY() * tmgr.getDimNZ(); CkPrintf("Torus Contiguity Metric %d : %d [%f] /n", size, CkNumPes()/tmgr.getDimNT(), (float)(CkNumPes())/(tmgr.getDimNT()*size) ); CkExit(); };
开发者ID:davidheryanto,项目名称:sc14,代码行数:58,
示例24: verify_contribute void verify_contribute(CmiUInt8 r) { CkPrintf("N = %lld, r = %lld/n", N, r); if (r != N) CkAbort("test failed"); else { CkPrintf("test verified"); CkExit(); } }
开发者ID:DISLab,项目名称:xcharm,代码行数:9,
示例25: pong void pong(pingPongMsg* msg) { if(msg->left == 0) { delete msg; CkExit(); } else { msg->left --; thisProxy[1].ping(msg); } }
开发者ID:sdasgup3,项目名称:parallel-programming,代码行数:9,
示例26: getTaskIdForMigrationint getTaskIdForMigration(ObjGraph *ogr,int pe,int start){ for(int vert = start; vert < ogr->vertices.size(); vert++) { if(ogr->vertices[vert].getCurrentPe()==pe && ogr->vertices[vert].getNewPe()==-1) return vert; } CkPrintf("THERE IS A PROBLEM IN TEMPREFINELB 222 start=%d pe=%d objArraySize=%d!!!!!/n",start,pe,ogr->vertices.size()); CkExit();}
开发者ID:gitter-badger,项目名称:quinoa,代码行数:9,
示例27: receiveMessage void receiveMessage(TestMessage *msg) { allMsgs.push_back(msg); if (allMsgs.size() == nCheck) { alignmentTest(allMsgs, "destination"); for (int i = 0; i < allMsgs.size(); i++) { delete allMsgs[i]; } CkExit(); } }
开发者ID:gitter-badger,项目名称:quinoa,代码行数:10,
示例28: finalize void finalize( bool worked ) { try { if (worked && !m_timer.empty()) { m_timestamp.emplace_back( "Total runtime", m_timer[0].hms() ); m_print.time( "Timers (h:m:s)", m_timestamp ); m_print.endpart(); } } catch (...) { tk::processExceptionCharm(); } // Tell the Charm++ runtime system to exit CkExit(); }
开发者ID:gitter-badger,项目名称:quinoa,代码行数:11,
注:本文中的CkExit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CkMyPe函数代码示例 C++ CkAssert函数代码示例 |