4 #ifndef BL_BLPROFSTATS_H
5 #define BL_BLPROFSTATS_H
6 #include <AMReX_Config.H>
23 static std::stringstream hs;
103 if (os.fail()) {
amrex::Error(
"output for TimeRange failed"); }
156 static bool AddPiece(std::list<TimeRange> &addToHere,
157 const TimeRange &pieceToAdd);
159 const TimeRange &pieceToIntersect);
160 static bool RemovePiece(std::list<TimeRange> &removeFromHere,
161 const TimeRange &pieceToRemove);
168 virtual void WriteSummary(std::ostream &ios,
bool bwriteavg =
false,
int whichProc = 0,
169 bool graphTopPct =
true);
175 const std::string &,
const long ,
176 const std::string & =
"",
178 virtual void AddBarrier(
long ,
const std::string &,
long ) { }
189 int ,
int ,
int ,
int ) { }
194 const int ,
const int ,
const int ,
195 const bool =
false) { }
202 const std::string &,
long ) { }
218 int ,
int ,
int ,
int ,
std::ostream & operator<<(std::ostream &os, const BLProfStats::TimeRange &tr)
Definition: AMReX_BLProfStats.cpp:344
Definition: AMReX_BLProfStats.H:30
static int nOutFiles
Definition: AMReX_BLProfStats.H:230
virtual void SetBLPVersion(const int blpv)
Definition: AMReX_BLProfStats.H:163
void InitFilterTimeRanges()
Definition: AMReX_BLProfStats.cpp:276
int maxRNumber
Definition: AMReX_BLProfStats.H:231
int GetMaxRNumber() const
Definition: AMReX_BLProfStats.H:132
static amrex::Vector< std::ifstream * > blpDataStreams
Definition: AMReX_BLProfStats.H:258
std::map< int, std::string > regionNumbers
Definition: AMReX_BLProfStats.H:241
virtual void WriteSummary(std::ostream &ios, bool bwriteavg=false, int whichProc=0, bool graphTopPct=true)
Definition: AMReX_BLProfStats.cpp:516
virtual void InitCStatsDataBlock(int, long, long, const std::string &, long)
Definition: AMReX_BLProfStats.H:201
virtual void AddCalcEndTime(double cet)
Definition: AMReX_BLProfStats.H:170
static int GetNOutFiles()
Definition: AMReX_BLProfStats.H:120
int currentDataBlock
Definition: AMReX_BLProfStats.H:231
static void SetNOutFiles(const int nof)
Definition: AMReX_BLProfStats.H:119
bool InTimeRange(int proc, Real calltime)
Definition: AMReX_BLProfStats.cpp:319
void AddRegionName(const std::string &rname, int rnumber)
Definition: AMReX_BLProfStats.cpp:200
virtual void AddCommHeaderFileName(const std::string &)
Definition: AMReX_BLProfStats.H:197
amrex::Vector< std::list< TimeRange > > filterTimeRanges
Definition: AMReX_BLProfStats.H:249
static std::list< TimeRange > RangeIntersection(std::list< TimeRange > &rangeList, const TimeRange &pieceToIntersect)
Definition: AMReX_BLProfStats.cpp:107
virtual void SetCSVersion(int)
Definition: AMReX_BLProfStats.H:198
static void SetGPercent(Real p)
Definition: AMReX_BLProfStats.H:206
std::set< int > includeSet
Definition: AMReX_BLProfStats.H:245
friend int yyparse(void *)
void ClearBlock(BLPDataBlock &dBlock)
Definition: AMReX_BLProfStats.cpp:483
virtual void InitBLProfDataBlock(const int proc, const std::string &filename, const long seekpos)
Definition: AMReX_BLProfStats.cpp:363
virtual void AddTimerTime(const double)
Definition: AMReX_BLProfStats.H:181
virtual void AddTagRange(const long, const long)
Definition: AMReX_BLProfStats.H:184
void ReadBlock(BLPDataBlock &dBlock)
Definition: AMReX_BLProfStats.cpp:446
const std::map< std::string, int > & RegionNames()
Definition: AMReX_BLProfStats.H:146
virtual void AddBarrier(long, const std::string &, long)
Definition: AMReX_BLProfStats.H:178
static int GetNProcs()
Definition: AMReX_BLProfStats.H:129
static void SetDirName(const std::string &dirname)
Definition: AMReX_BLProfStats.H:118
virtual void AddFunctionName(const std::string &, int)
Definition: AMReX_BLProfStats.H:200
static void SetVerbose(int vlevel=0)
Definition: AMReX_BLProfStats.H:117
virtual void AddNameTag(const long, const long)
Definition: AMReX_BLProfStats.H:182
int currentProc
Definition: AMReX_BLProfStats.H:231
static std::string dirName
Definition: AMReX_BLProfStats.H:234
Real maxRegionTime
Definition: AMReX_BLProfStats.H:233
static void SetNProcs(int p)
Definition: AMReX_BLProfStats.H:128
virtual void AddMaxLevel(const int)
Definition: AMReX_BLProfStats.H:191
amrex::Vector< amrex::Vector< amrex::Vector< TimeRange > > > regionTimeRanges
Definition: AMReX_BLProfStats.H:248
static bool bTimeRangeInitialized
Definition: AMReX_BLProfStats.H:237
void SetMaxRNumber(int n)
Definition: AMReX_BLProfStats.H:131
virtual void SetCSSize(const int)
Definition: AMReX_BLProfStats.H:173
bool bDefaultInclude
Definition: AMReX_BLProfStats.H:246
static bool bInitDataBlocks
Definition: AMReX_BLProfStats.H:235
std::set< int > WhichRegions(int proc, Real t)
Definition: AMReX_BLProfStats.cpp:208
virtual void AddCStatsHeaderFileName(const std::string &)
Definition: AMReX_BLProfStats.H:199
static bool InitDBlocks()
Definition: AMReX_BLProfStats.H:204
static void SetInitDataBlocks(bool b)
Definition: AMReX_BLProfStats.H:203
virtual TimeRange MakeRegionPlt(amrex::FArrayBox &, int, int, int, amrex::Vector< amrex::Vector< amrex::Box >> &)
Definition: AMReX_BLProfStats.H:209
static std::map< std::string, int > blpDataFileNames
Definition: AMReX_BLProfStats.H:251
~BLProfStats()
Definition: AMReX_BLProfStats.cpp:195
const std::map< int, std::string > & RegionNumbers()
Definition: AMReX_BLProfStats.H:147
static void CloseAllStreams()
Definition: AMReX_BLProfStats.cpp:399
void SetFilterTimeRanges(const amrex::Vector< std::list< TimeRange > > &ftr)
Definition: AMReX_BLProfStats.cpp:269
static void OpenAllStreams(const std::string &dirname)
Definition: AMReX_BLProfStats.cpp:383
amrex::Vector< std::string > blpFNames
Definition: AMReX_BLProfStats.H:253
virtual void InitCommDataBlock(const int, const long, const std::string &, const long, const std::string &="", const int=-1)
Definition: AMReX_BLProfStats.H:174
virtual void AddGridLevel(const int, const int)
Definition: AMReX_BLProfStats.H:185
virtual void AddFunctionName(const std::string &fname)
Definition: AMReX_BLProfStats.cpp:352
static bool RemovePiece(std::list< TimeRange > &removeFromHere, const TimeRange &pieceToRemove)
Definition: AMReX_BLProfStats.cpp:127
virtual void AddFinestLevel(const int)
Definition: AMReX_BLProfStats.H:190
virtual void AddProbDomain(const int, const amrex::Box &)
Definition: AMReX_BLProfStats.H:208
virtual void SetCPVersion(const int)
Definition: AMReX_BLProfStats.H:172
void ReadBlockNoOpen(BLPDataBlock &dBlock)
Definition: AMReX_BLProfStats.cpp:476
virtual void AddNameTagName(const std::string &)
Definition: AMReX_BLProfStats.H:183
std::map< int, std::string > barrierNumbersToNames
Definition: AMReX_BLProfStats.H:243
virtual void AddEdisonPID(int, int, int, int, int, int, int, int, int)
Definition: AMReX_BLProfStats.H:217
void CheckData()
Definition: AMReX_BLProfStats.cpp:410
int GetProc() const
Definition: AMReX_BLProfStats.H:126
void SetFilter(FilterStatus fs, const std::string &rname, int rnumber)
Definition: AMReX_BLProfStats.cpp:245
static Real gPercent
Definition: AMReX_BLProfStats.H:256
static bool AddPiece(std::list< TimeRange > &addToHere, const TimeRange &pieceToAdd)
Definition: AMReX_BLProfStats.cpp:76
const amrex::Vector< std::list< TimeRange > > & GetFilterTimeRanges() const
Definition: AMReX_BLProfStats.H:136
virtual void AddReduction(const long, const long)
Definition: AMReX_BLProfStats.H:179
virtual void AddTimeMinMax(const double, const double)
Definition: AMReX_BLProfStats.H:180
void SetRegionTimeRanges(const TimeRange &tr, const int n, const int r, const int t)
Definition: AMReX_BLProfStats.H:141
FilterStatus
Definition: AMReX_BLProfStats.H:33
@ OFF
Definition: AMReX_BLProfStats.H:33
@ INCLUDENONE
Definition: AMReX_BLProfStats.H:33
@ INCLUDEALL
Definition: AMReX_BLProfStats.H:33
@ ON
Definition: AMReX_BLProfStats.H:33
@ UNDEFINED
Definition: AMReX_BLProfStats.H:33
amrex::Vector< BLPDataBlock > blpDataBlocks
Definition: AMReX_BLProfStats.H:254
static int Verbose()
Definition: AMReX_BLProfStats.H:116
virtual void CollectFuncStats(amrex::Vector< amrex::Vector< FuncStat > > &funcStats)
Definition: AMReX_BLProfStats.cpp:492
void SetFNames(const amrex::Vector< std::string > &fNames)
Definition: AMReX_BLProfStats.H:226
static int verbose
Definition: AMReX_BLProfStats.H:229
virtual void AddGrid3D(int, int, int, int, int, int, int, int, int, int, int, int, int, int)
Definition: AMReX_BLProfStats.H:186
static int dataNProcs
Definition: AMReX_BLProfStats.H:230
const std::map< int, std::string > & BarrierNumbersToNames()
Definition: AMReX_BLProfStats.H:150
void SetProc(int p)
Definition: AMReX_BLProfStats.H:125
virtual void AddRefRatio(const int, const amrex::IntVect &)
Definition: AMReX_BLProfStats.H:192
std::map< std::string, int > regionNames
Definition: AMReX_BLProfStats.H:240
void MakeFilterFile(const std::string &ffname)
Definition: AMReX_BLProfStats.cpp:227
const amrex::Vector< amrex::Vector< amrex::Vector< TimeRange > > > & GetRegionTimeRanges()
Definition: AMReX_BLProfStats.H:143
void SetRegionTimeRanges(const amrex::Vector< amrex::Vector< amrex::Vector< TimeRange > > > &rtr)
Definition: AMReX_BLProfStats.H:139
Real minRegionTime
Definition: AMReX_BLProfStats.H:233
BLProfStats()
Definition: AMReX_BLProfStats.cpp:184
const amrex::Vector< std::string > & BLPFNames()
Definition: AMReX_BLProfStats.H:225
std::set< int > excludeSet
Definition: AMReX_BLProfStats.H:245
Real calcEndTime
Definition: AMReX_BLProfStats.H:232
static bool TimeRangeInitialized()
Definition: AMReX_BLProfStats.H:221
virtual void AddTopoCoord(const int, const int, const int, const int, const int, const bool=false)
Definition: AMReX_BLProfStats.H:193
static int blProfVersion
Definition: AMReX_BLProfStats.H:230
A Fortran Array of REALs.
Definition: AMReX_FArrayBox.H:229
void Error(const std::string &msg)
Print out message to cerr and exit via amrex::Abort().
Definition: AMReX.cpp:219
Definition: AMReX_BLProfStats.H:35
amrex::Vector< long > nCalls
Definition: AMReX_BLProfStats.H:51
long readoffset
Definition: AMReX_BLProfStats.H:48
std::string fileName
Definition: AMReX_BLProfStats.H:46
int streamIndex
Definition: AMReX_BLProfStats.H:49
BLPDataBlock()
Definition: AMReX_BLProfStats.H:36
amrex::Vector< Real > totalTime
Definition: AMReX_BLProfStats.H:52
int proc
Definition: AMReX_BLProfStats.H:45
long seekpos
Definition: AMReX_BLProfStats.H:47
BLPDataBlock(int p, const std::string &fn, long sp, int si)
Definition: AMReX_BLProfStats.H:40
Definition: AMReX_BLProfStats.H:68
int stackDepth
Definition: AMReX_BLProfStats.H:73
Real totalTime
Definition: AMReX_BLProfStats.H:75
CallTreeNode()
Definition: AMReX_BLProfStats.H:69
std::map< int, CallTreeNode > calledFunctions
Definition: AMReX_BLProfStats.H:76
long nCalls
Definition: AMReX_BLProfStats.H:74
Real stackTime
Definition: AMReX_BLProfStats.H:75
int fnameNumber
Definition: AMReX_BLProfStats.H:73
Definition: AMReX_BLProfStats.H:55
Real totalTime
Definition: AMReX_BLProfStats.H:65
FuncStat()
Definition: AMReX_BLProfStats.H:56
FuncStat(long ncalls, Real tt)
Definition: AMReX_BLProfStats.H:60
long nCalls
Definition: AMReX_BLProfStats.H:64
Definition: AMReX_BLProfStats.H:108
bool operator()(const TimeRange &lhs, const TimeRange &rhs) const
Definition: AMReX_BLProfStats.H:109
Definition: AMReX_BLProfStats.H:79
bool operator!=(const TimeRange &rhs) const
Definition: AMReX_BLProfStats.H:90
TimeRange()
Definition: AMReX_BLProfStats.H:80
TimeRange operator=(const TimeRange &rhs)
Definition: AMReX_BLProfStats.H:93
std::ostream & operator<<(std::ostream &os)
Definition: AMReX_BLProfStats.H:101
Real stopTime
Definition: AMReX_BLProfStats.H:83
TimeRange(Real startT, Real stopT)
Definition: AMReX_BLProfStats.H:81
Real startTime
Definition: AMReX_BLProfStats.H:83
bool Contains(Real t) const
Definition: AMReX_BLProfStats.H:84
bool operator==(const TimeRange &rhs) const
Definition: AMReX_BLProfStats.H:87