4 #ifndef BL_REGIONSPROFSTATS_H
5 #define BL_REGIONSPROFSTATS_H
6 #include <AMReX_Config.H>
22 #include <unordered_map>
46 DataBlock(
int p,
long nrss,
long nts,
const std::string &fn,
long sp,
int si)
77 {
amrex::Abort(
"Wrong AddFunctionName for RegionsProfStats. Use (string, int)."); }
82 int width,
int height,
85 virtual void WriteSummary(std::ostream &os,
bool bwriteavg =
false,
int whichProc = 0,
86 bool graphTopPct =
true);
89 const std::string whichFuncName,
90 int whichFuncNumber,
const amrex::Box &procBox);
94 const std::string &filename,
long seekpos);
104 void WriteHTML(std::ostream &os,
bool simpleCombine =
true,
int whichProc = 0);
108 void WriteHTMLNC(std::ostream &os,
int whichProc = 0);
109 void WriteTextTrace(std::ostream &os,
bool simpleCombine =
true,
int whichProc = 0,
110 std::string delimString =
"\t");
142 bool readTraces =
true);
144 bool readTraces =
true);
Definition: AMReX_BLProfStats.H:30
Definition: AMReX_RegionsProfStats.H:38
void ReadBlock(DataBlock &dBlock, bool readRSS=true, bool readTraces=true)
Definition: AMReX_RegionsProfStats.cpp:1507
int currentDataBlock
Definition: AMReX_RegionsProfStats.H:122
void SyncFNamesAndNumbers()
Definition: AMReX_RegionsProfStats.cpp:110
void ClearBlock(DataBlock &dBlock)
Definition: AMReX_RegionsProfStats.cpp:1610
void WriteHTML(std::ostream &os, bool simpleCombine=true, int whichProc=0)
Definition: AMReX_RegionsProfStats.cpp:842
void WriteHTMLNC(std::ostream &os, int whichProc=0)
Definition: AMReX_RegionsProfStats.cpp:1097
void CreateVCallStats(CallTreeNode &callTree, amrex::Vector< amrex::BLProfiler::CallStats > &vCallStatsNC)
Definition: AMReX_RegionsProfStats.cpp:1062
TimeRange MakeRegionPlt(amrex::FArrayBox &rFab, int noregionnumber, int width, int height, amrex::Vector< amrex::Vector< amrex::Box >> ®ionBoxes)
Definition: AMReX_RegionsProfStats.cpp:203
friend int yyparse(void *)
int maxFNumber
Definition: AMReX_RegionsProfStats.H:124
RegionsProfStats()
Definition: AMReX_RegionsProfStats.cpp:87
bool TraceDataValid() const
Definition: AMReX_RegionsProfStats.H:99
bool AllCallTimesFAB(amrex::FArrayBox &actFab, const std::string &whichFuncName)
Definition: AMReX_RegionsProfStats.cpp:518
static amrex::Vector< std::string > regHeaderFileNames
Definition: AMReX_RegionsProfStats.H:130
amrex::Vector< std::map< std::string, int > > mFNameNumbersPerProc
Definition: AMReX_RegionsProfStats.H:126
static void CloseAllStreams()
Definition: AMReX_RegionsProfStats.cpp:1489
void PrintCallTreeNode(CallTreeNode &callTree, amrex::Vector< std::string > &fNumberNames)
Definition: AMReX_RegionsProfStats.cpp:1079
void SetMaxFNumber(int n)
Definition: AMReX_RegionsProfStats.H:73
virtual void InitCStatsDataBlock(int proc, long nrss, long ntracestats, const std::string &filename, long seekpos)
Definition: AMReX_RegionsProfStats.cpp:1418
bool Include(const FuncStat &fs)
Definition: AMReX_RegionsProfStats.cpp:510
amrex::Vector< std::string > numbersToFName
Definition: AMReX_RegionsProfStats.H:129
static void OpenAllStreams(const std::string &dirname)
Definition: AMReX_RegionsProfStats.cpp:1438
int GetCSVersion() const
Definition: AMReX_RegionsProfStats.H:71
static bool InitDBlocks()
Definition: AMReX_RegionsProfStats.H:97
virtual void AddTimeMinMax(double tmin, double tmax)
Definition: AMReX_RegionsProfStats.cpp:196
bool InitRegionTimeRanges(const amrex::Box &procBox)
Definition: AMReX_RegionsProfStats.cpp:316
virtual void SetCSVersion(int csv)
Definition: AMReX_RegionsProfStats.H:70
void ReadBlockNoOpen(DataBlock &dBlock, bool readRSS=true, bool readTraces=true)
Definition: AMReX_RegionsProfStats.cpp:1548
static const amrex::Vector< std::string > & GetHeaderFileNames()
Definition: AMReX_RegionsProfStats.H:112
int GetMaxFNumber() const
Definition: AMReX_RegionsProfStats.H:74
static amrex::Vector< std::ifstream * > regDataStreams
Definition: AMReX_RegionsProfStats.H:131
const amrex::Vector< std::string > & NumbersToFName() const
Definition: AMReX_RegionsProfStats.H:113
static bool persistentStreams
Definition: AMReX_RegionsProfStats.H:139
static std::map< std::string, int > regDataFileNames
Definition: AMReX_RegionsProfStats.H:132
static bool bInitDataBlocks
Definition: AMReX_RegionsProfStats.H:139
void FillRegionTimeRanges(amrex::Vector< amrex::Vector< TimeRange >> &rtr, int whichProc)
Definition: AMReX_RegionsProfStats.cpp:280
void FillAllCallTimes(amrex::Vector< amrex::Vector< Real > > &allCallTimes, const std::string whichFuncName, int whichFuncNumber, const amrex::Box &procBox)
Definition: AMReX_RegionsProfStats.cpp:594
amrex::Vector< DataBlock > dataBlocks
Definition: AMReX_RegionsProfStats.H:138
virtual void CollectFuncStats(amrex::Vector< amrex::Vector< FuncStat > > &funcStats)
Definition: AMReX_RegionsProfStats.cpp:637
virtual void AddCStatsHeaderFileName(const std::string &hfn)
Definition: AMReX_RegionsProfStats.cpp:100
static void SetInitDataBlocks(bool b)
Definition: AMReX_RegionsProfStats.H:96
std::map< std::string, int > mFNameNumbersLocal
Definition: AMReX_RegionsProfStats.H:128
virtual void WriteSummary(std::ostream &os, bool bwriteavg=false, int whichProc=0, bool graphTopPct=true)
Definition: AMReX_RegionsProfStats.cpp:665
amrex::Vector< amrex::Vector< int > > fnameRemap
Definition: AMReX_RegionsProfStats.H:127
void WriteTextTrace(std::ostream &os, bool simpleCombine=true, int whichProc=0, std::string delimString="\t")
Definition: AMReX_RegionsProfStats.cpp:1321
int csVersion
Definition: AMReX_RegionsProfStats.H:123
static std::map< Real, std::string, std::greater< Real > > mTimersTotalsSorted
Definition: AMReX_RegionsProfStats.H:134
void AddFunctionName(const std::string &)
Definition: AMReX_RegionsProfStats.H:76
void CheckRegionsData()
Definition: AMReX_RegionsProfStats.cpp:756
static void InitDataFileNames(const amrex::Vector< std::string > &hfn)
Definition: AMReX_RegionsProfStats.cpp:1408
~RegionsProfStats()
Definition: AMReX_RegionsProfStats.cpp:95
A Fortran Array of REALs.
Definition: AMReX_FArrayBox.H:229
Long size() const noexcept
Definition: AMReX_Vector.H:50
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition: AMReX.cpp:225
Definition: AMReX_BLProfStats.H:55
Definition: AMReX_RegionsProfStats.H:41
amrex::Vector< amrex::BLProfiler::CallStats > vCallStats
Definition: AMReX_RegionsProfStats.H:60
std::string fileName
Definition: AMReX_RegionsProfStats.H:53
amrex::Vector< amrex::BLProfiler::RStartStop > rStartStop
Definition: AMReX_RegionsProfStats.H:59
double timeMax
Definition: AMReX_RegionsProfStats.H:58
DataBlock()
Definition: AMReX_RegionsProfStats.H:42
long readoffset
Definition: AMReX_RegionsProfStats.H:55
long nTraceStats
Definition: AMReX_RegionsProfStats.H:52
int proc
Definition: AMReX_RegionsProfStats.H:51
int streamIndex
Definition: AMReX_RegionsProfStats.H:56
double timeMin
Definition: AMReX_RegionsProfStats.H:58
long seekpos
Definition: AMReX_RegionsProfStats.H:54
long nRSS
Definition: AMReX_RegionsProfStats.H:52
DataBlock(int p, long nrss, long nts, const std::string &fn, long sp, int si)
Definition: AMReX_RegionsProfStats.H:46