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

Method CheckCommData

Src/Extern/ProfParser/AMReX_CommProfStats.cpp:492–637  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

490
491// ----------------------------------------------------------------------
492void CommProfStats::CheckCommData(Vector<long> &nBMin, Vector<long> &nBMax,
493 Vector<long> &nRMin, Vector<long> &nRMax)
494{
495 int myProc(ParallelDescriptor::MyProc());
496 cout << myProc << ": " << "------------------------------------ checking comm data." << endl;
497 SHOWVAL(dataNProcs);
498 SHOWVAL(csSize);
499 SHOWVAL(dataBlocks.size());
500 cout << myProc << ": " << "----" << endl;
501
502 Vector<long> nBarriers(dataNProcs, 0);
503 Vector<long> nReductions(dataNProcs, 0);
504 if(nBMin.size() != dataNProcs) {
505 nBMin.resize(dataNProcs, std::numeric_limits<long>::max());
506 }
507 if(nBMax.size() != dataNProcs) {
508 nBMax.resize(dataNProcs, std::numeric_limits<long>::min());
509 }
510 if(nRMin.size() != dataNProcs) {
511 nRMin.resize(dataNProcs, std::numeric_limits<long>::max());
512 }
513 if(nRMax.size() != dataNProcs) {
514 nRMax.resize(dataNProcs, std::numeric_limits<long>::min());
515 }
516
517 int idb;
518
519 for(idb = 0; idb < dataBlocks.size(); ++idb) { // ---- go through dataBlocks
520 DataBlock &dBlock = dataBlocks[idb];
521 if(verbose) {
522 cout << myProc << ": " << "CommProfProc " << dBlock.proc << " nCommStats "
523 << dBlock.size << " datafile " << dBlock.fileName << " seekpos "
524 << dBlock.seekpos << endl;
525 cout << myProc << ": " << "barriers.size() = " << dBlock.barriers.size()
526 << " " << dBlock.proc << endl;
527 }
528
529 ReadCommStats(dBlock);
530
531 // --------------------- check barrier integrity
532 for(int idbb(0); idbb < dBlock.barriers.size(); ++idbb) {
533 BarrierEntry &be = dBlock.barriers[idbb];
534 int bNumber(be.number);
535 std::string bName(be.name);
536 int bIndex(be.seekIndex);
537 int nCS(dBlock.vCommStats.size());
538
539 if(bIndex > nCS-1 || bIndex+1 > nCS-1) {
540 cerr << "**** Error: bad bIndex: " << bIndex << " " << nCS << endl;
541 continue;
542 }
543 BLProfiler::CommStats &cs = dBlock.vCommStats[bIndex];
544 BLProfiler::CommStats &csNext = dBlock.vCommStats[bIndex + 1];
545
546 if(cs.cfType == BLProfiler::Barrier && csNext.cfType == BLProfiler::Barrier &&
547 cs.tag == csNext.tag && // these are the barrier numbers
548 cs.tag == bNumber )
549 {

Callers 1

CheckProfDataMethod · 0.80

Calls 3

MyProcFunction · 0.50
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected