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

Method ReportStats

Src/Extern/ProfParser/AMReX_CommProfStats.cpp:863–939  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

861
862// ----------------------------------------------------------------------
863void CommProfStats::ReportStats(long &totalSentData, long &totalNCommStats,
864 Vector<long> &totalFuncCalls,
865 int bytesPerSlot, Vector<long> &msgSizes,
866 int &minMsgSize, int &maxMsgSize,
867 Real &timeMin, Real &timeMax, Real &timerTime,
868 Vector<int> &rankNodeNumbers)
869{
870 amrex::ignore_unused(timerTime);
871
872 amrex::Print(Print::AllProcs) << ParallelDescriptor::MyProc() << "::Processing "
873 << dataBlocks.size() << " data blocks:" << endl;
874
875 int nMsgSizes(msgSizes.size());
876 int slot(0), highSlot(nMsgSizes - 1);
877
878 for(int idb(0); idb < dataBlocks.size(); ++idb) { // ---- go through dataBlocks
879 if(verbose) {
880 //cout << idb + 1 << " " << flush;
881 //if((idb + 1) % 20 == 0) {
882 //cout << endl;
883 //}
884 }
885 DataBlock &dBlock = dataBlocks[idb];
886 if (persistentStreams){
887 ReadCommStatsNoOpen(dBlock);
888 } else {
889 ReadCommStats(dBlock);
890 }
891
892 rankNodeNumbers[dBlock.proc] = dBlock.nodeNumber;
893
894 totalNCommStats += dBlock.size;
895 for(int i(0); i < dBlock.vCommStats.size(); ++i) { // ------- sum sent data
896 BLProfiler::CommStats &cs = dBlock.vCommStats[i];
897 if(IsSend(cs.cfType)) {
898 if(cs.size != BLProfiler::AfterCall()) {
899 if(InTimeRange(dBlock.proc, cs.timeStamp)) {
900 totalSentData += cs.size;
901 slot = std::min(cs.size/bytesPerSlot, highSlot);
902 ++msgSizes[slot];
903 minMsgSize = std::min(cs.size, minMsgSize);
904 maxMsgSize = std::max(cs.size, maxMsgSize);
905 }
906 }
907 }
908 }
909
910 for(int i(0); i < dBlock.vCommStats.size(); ++i) { // ----- sum function calls
911 BLProfiler::CommStats &cs = dBlock.vCommStats[i];
912 if((cs.size > -1 && cs.cfType != BLProfiler::Waitsome) ||
913 (cs.size == BLProfiler::BeforeCall() && cs.cfType == BLProfiler::Waitsome))
914 {
915 if(InTimeRange(dBlock.proc, cs.timeStamp)) {
916 if(cs.cfType >= 0 && cs.cfType < totalFuncCalls.size()) {
917 ++totalFuncCalls[cs.cfType];
918 } else {
919 std::cout << "--------:: totalFuncCalls.size() cs.cfType = " << totalFuncCalls.size()
920 << " " << cs.cfType << std::endl;

Callers 1

RunStatsMethod · 0.80

Calls 3

PrintClass · 0.85
MyProcFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected