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

Method InitProxMap

Src/Extern/ProfParser/AMReX_CommProfStats.cpp:313–335  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

311
312// ----------------------------------------------------------------------
313void CommProfStats::InitProxMap() {
314 string filename("RankProxOrder.txt");
315 ifstream rpo(filename.c_str());
316 if( ! rpo.good()) {
317 bProxMapOK = false;
318 if(ParallelDescriptor::IOProcessor()) {
319 cout << "**** Error in CommProfStats::InitProxMap: cannot open file." << endl;
320 }
321 } else {
322 int nprocs, r, p;
323 rpo >> nprocs;
324 cout << "CommProfStats::InitProxMap: nprocs = " << nprocs << endl;
325 rankFromProx.resize(nprocs);
326 proxFromRank.resize(nprocs);
327 for(int i(0); i < nprocs; ++i) {
328 rpo >> r >> p;
329 rankFromProx[p] = r;
330 proxFromRank[r] = p;
331 }
332 rpo.close();
333 bProxMapOK = true;
334 }
335}
336
337
338// ----------------------------------------------------------------------

Callers 1

ProfParserBatchFunctionsFunction · 0.45

Calls 2

IOProcessorFunction · 0.85
resizeMethod · 0.45

Tested by

no test coverage detected