MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / ReportSyncPointData

Method ReportSyncPointData

Src/Extern/ProfParser/AMReX_CommProfStats.cpp:790–859  ·  view source on GitHub ↗

----------------------------------------------------------------------

Source from the content-addressed store, hash-verified

788
789// ----------------------------------------------------------------------
790void CommProfStats::ReportSyncPointData(Vector<Vector<Real> > &barrierExitTimes,
791 Vector<Vector<Real> > &barrierWaitTimes,
792 Vector<Vector<Real> > &reductionWaitTimes,
793 bool bDoReductions)
794{
795 procNodeNumber.resize(dataNProcs);
796
797 for(int idb(0); idb < dataBlocks.size(); ++idb) { // ---- go through dataBlocks
798 //cout << idb + 1 << " " << flush;
799 //if((idb + 1) % 20 == 0) {
800 //cout << endl;
801 //}
802 DataBlock &dBlock = dataBlocks[idb];
803
804 if (persistentStreams){
805 ReadCommStatsNoOpen(dBlock);
806 } else {
807 ReadCommStats(dBlock);
808 }
809
810 // ------------------------------------------------ collect barrier timings
811 for(int i(0); i < dBlock.barriers.size(); ++i) {
812 BarrierEntry &be = dBlock.barriers[i];
813 if(be.seekIndex < 0) { // ---- skip these unused entries, results from flushing
814 //cout << "***************** be.seekIndex < 0 :: = " << be.seekIndex
815 //<< " i = " << i << " dBlock.barriers.size() = " << dBlock.barriers.size()
816 //<< " be.name = " << be.name << endl;
817 continue;
818 }
819 BLProfiler::CommStats &cs = dBlock.vCommStats[be.seekIndex];
820 BLProfiler::CommStats &csNext = dBlock.vCommStats[be.seekIndex + 1];
821
822 if(InTimeRange(dBlock.proc, cs.timeStamp)) {
823 barrierWaitTimes[dBlock.proc][be.number] = csNext.timeStamp - cs.timeStamp;
824 barrierExitTimes[dBlock.proc][be.number] = csNext.timeStamp;
825 }
826
827 //double zeroBarrierTime = barrierExitTimes[0][be.number];
828 //for(int isk(0); isk < barrierSkewTimes.size(); ++isk) {
829 //barrierSkewTimes[isk][be.number] = barrierExitTimes[isk][be.number] - zeroBarrierTime;
830 //}
831 }
832 bExitTimesDone = true;
833 bSkewTimesDone = true;
834
835 // ------------------------------------------------ collect reduction wait times
836 for(int i(0); i < dBlock.reductions.size(); ++i) {
837 ReductionEntry &re = dBlock.reductions[i];
838 BLProfiler::CommStats &cs = dBlock.vCommStats[re.seekIndex];
839 BLProfiler::CommStats &csNext = dBlock.vCommStats[re.seekIndex + 1];
840
841 if(bDoReductions) {
842 if(InTimeRange(dBlock.proc, cs.timeStamp)) {
843 reductionWaitTimes[dBlock.proc][re.number] = csNext.timeStamp - cs.timeStamp;
844 }
845 }
846 }
847

Callers 1

RunSyncPointDataMethod · 0.80

Calls 2

resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected