---------------------------------------------------------------
| 61 | |
| 62 | //--------------------------------------------------------------- |
| 63 | void TestReductionCalls() { |
| 64 | BL_PROFILE("TestReductionCalls()"); |
| 65 | |
| 66 | if(ParallelDescriptor::IOProcessor()) { |
| 67 | cout << "Testing reduction calls." << endl; |
| 68 | } |
| 69 | |
| 70 | //long nChunks(100), chunkSize(1000000); |
| 71 | long nChunks(10), chunkSize(1000000); |
| 72 | Real totalTime(0.0); |
| 73 | |
| 74 | for(long t(0); t < nChunks; ++t) { |
| 75 | Real startTime(ParallelDescriptor::second()); |
| 76 | for(long n(0); n < chunkSize; ++n) { |
| 77 | BL_COMM_PROFILE_ALLREDUCE(BLProfiler::AllReduceR, BLProfiler::BeforeCall(), true); |
| 78 | BL_COMM_PROFILE_ALLREDUCE(BLProfiler::AllReduceR, sizeof(Real), false); |
| 79 | } |
| 80 | totalTime += ParallelDescriptor::second() - startTime; |
| 81 | } |
| 82 | |
| 83 | long nCalls(nChunks * chunkSize * 2); // ---- two calls in loop above |
| 84 | long millionCalls(nCalls / 1000000); |
| 85 | cout << ParallelDescriptor::MyProc() |
| 86 | << ":: TestFunctionCalls: NCalls/proc = " << millionCalls |
| 87 | << " million totalTime = " << totalTime |
| 88 | << " mCPS = " << millionCalls / totalTime << endl; |
| 89 | } |
| 90 | |
| 91 | |
| 92 | //--------------------------------------------------------------- |
nothing calls this directly
no test coverage detected