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

Method CheckData

Src/Extern/ProfParser/AMReX_BLProfStats.cpp:410–442  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

408
409// ----------------------------------------------------------------------
410void BLProfStats::CheckData() {
411 if( ! ParallelDescriptor::IOProcessor()) {
412 return;
413 }
414 int nFuncs(blpFNames.size());
415 long dataSizeNC(nFuncs * sizeof(long));
416 long dataSizeTT(nFuncs * sizeof(Real));
417 long dataSize(dataSizeNC + dataSizeTT);
418 std::map<std::string, long> maxSeekPerFile;
419
420 for(int idb(0); idb < blpDataBlocks.size(); ++idb) {
421 BLPDataBlock &dBlock = blpDataBlocks[idb];
422 long dbSP(dBlock.seekpos);
423 std::string fullFileName(dirName + '/' + dBlock.fileName);
424 maxSeekPerFile[fullFileName] = std::max(maxSeekPerFile[fullFileName], dbSP);
425 }
426
427 bool bad(false);
428 long diff(-1);
429 std::map<std::string, long>::iterator it;
430 for(it = maxSeekPerFile.begin(); it != maxSeekPerFile.end(); ++it) {
431 diff = it->second + dataSize - FileSize(it->first);
432 if(diff != 0) {
433 bad = true;
434 cout << "fName maxSeek fSize diff = " << it->first << " " << it->second << " "
435 << FileSize(it->first) << " " << diff << endl;
436 }
437 }
438 if(bad) {
439 cerr << "**** Error in BLProfStats::CheckData: data and file size mismatch." << endl;
440 }
441
442}
443
444
445// ----------------------------------------------------------------------

Callers 1

CheckProfDataMethod · 0.80

Calls 4

IOProcessorFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected