Block-Structured AMR Software Framework
CommProfStats Class Reference

#include <AMReX_CommProfStats.H>

Inheritance diagram for CommProfStats:
BLProfStats

Classes

struct  BarrierEntry
 
struct  DataBlock
 
struct  NameTagEntry
 
struct  ReductionEntry
 
struct  SendRecvPair
 
struct  SendRecvPairUnpaired
 

Public Member Functions

 CommProfStats ()
 
 ~CommProfStats ()
 
void CheckCommData (amrex::Vector< long > &nBMin, amrex::Vector< long > &nBMax, amrex::Vector< long > &nRMin, amrex::Vector< long > &nRMax)
 
void FillSendFAB (long &totalSends, long &totalSentData, amrex::Vector< long > &totalSendsPerProc, amrex::Vector< long > &totalSentDataPerProc, amrex::FArrayBox &sendFAB, bool proxmap)
 
void ReportSyncPointDataSetup (long &nBMax, long &nRMax)
 
void ReportSyncPointData (amrex::Vector< amrex::Vector< Real > > &barrierExitTimes, amrex::Vector< amrex::Vector< Real > > &barrierWaitTimes, amrex::Vector< amrex::Vector< Real > > &reductionWaitTimes, bool bDoReductions=false)
 
void ReportStats (long &totalSentData, long &totalNCommStats, amrex::Vector< long > &totalFuncCalls, int bytesPerSlot, amrex::Vector< long > &msgSizes, int &minMsgSize, int &maxMsgSize, Real &timeMin, Real &timeMax, Real &timerTime, amrex::Vector< int > &rankNodeNumbers)
 
void WriteTopoFab ()
 
void FindTimeRange (BLProfStats::TimeRange &tr)
 
void TimelineFAB (amrex::FArrayBox &timelineFAB, const amrex::Box &probDomain, const BLProfStats::TimeRange tr, const int rankMin, const int rankMax, const int rankStride, const Real ntnMultiplier, const amrex::Vector< Real > &ntnNumbers, const Real bnMultiplier, const amrex::Vector< Real > &bnNumbers)
 
void SendRecvData (const std::string &filename, const double tlo, const double thi)
 
void SendRecvList (std::multimap< Real, SendRecvPairUnpaired > &srMMap)
 
virtual void InitCommDataBlock (const int proc, const long ncommstats, const std::string &filename, const long seekpos, const std::string &nodename="", const int nodenumber=-1)
 
int AfterBarrier (const int proc, const double t)
 
virtual void AddBarrier (long bnum, const std::string &bname, long index)
 
virtual void AddReduction (const long rnum, const long index)
 
virtual void AddTimeMinMax (const double tmin, const double tmax)
 
virtual void AddTimerTime (const double tt)
 
virtual void AddNameTag (const long ntnindex, const long seekindex)
 
virtual void AddNameTagName (const std::string &name)
 
const amrex::Vector< std::string > & NameTagNames ()
 
const amrex::Vector< std::string > & BarrierNames ()
 
virtual void AddTagRange (const long tmin, const long tmax)
 
virtual void AddGridLevel (const int level, const int ngrids)
 
virtual void AddGrid3D (int level, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi, int xc, int yc, int zc, int xn, int yn, int zn, int proc)
 
virtual void SetCPVersion (const int cpv)
 
virtual void SetCSSize (const int css)
 
virtual void AddFinestLevel (const int lev)
 
virtual void AddMaxLevel (const int lev)
 
virtual void AddRefRatio (const int lev, const amrex::IntVect &rr)
 
void SetRefRatio (const amrex::Vector< amrex::IntVect > &rr)
 
const amrex::Vector< amrex::IntVect > & GetRefRatio () const
 
virtual void AddTopoCoord (const int nid, const int node, const int tx, const int ty, const int tz, const bool servicenode=false)
 
virtual void AddProbDomain (const int lev, const amrex::Box &pd)
 
void SetProbDomain (const amrex::Vector< amrex::Box > &pd)
 
const amrex::Vector< amrex::Box > & GetProbDomain () const
 
virtual void AddCommHeaderFileName (const std::string &hfn)
 
const std::map< int, long > & GLMap () const
 
const std::map< int, int > & GLSizeMap () const
 
void InitEdisonTopoMF ()
 
void WriteEdisonTopoMF ()
 
virtual void AddEdisonPID (int X, int Y, int Z, int cab, int row, int cage, int slot, int cpu, int pid)
 
bool IsSend (const amrex::BLProfiler::CommFuncType &cft)
 
bool IsRecv (const amrex::BLProfiler::CommFuncType &cft)
 
bool IsBlockingRecv (const amrex::BLProfiler::CommFuncType &cft)
 
- Public Member Functions inherited from BLProfStats
 BLProfStats ()
 
 ~BLProfStats ()
 
void AddRegionName (const std::string &rname, int rnumber)
 
std::set< int > WhichRegions (int proc, Real t)
 
void SetProc (int p)
 
int GetProc () const
 
void SetMaxRNumber (int n)
 
int GetMaxRNumber () const
 
void InitFilterTimeRanges ()
 
void SetFilterTimeRanges (const amrex::Vector< std::list< TimeRange > > &ftr)
 
const amrex::Vector< std::list< TimeRange > > & GetFilterTimeRanges () const
 
void SetRegionTimeRanges (const amrex::Vector< amrex::Vector< amrex::Vector< TimeRange > > > &rtr)
 
void SetRegionTimeRanges (const TimeRange &tr, const int n, const int r, const int t)
 
const amrex::Vector< amrex::Vector< amrex::Vector< TimeRange > > > & GetRegionTimeRanges ()
 
const std::map< std::string, int > & RegionNames ()
 
const std::map< int, std::string > & RegionNumbers ()
 
const std::map< int, std::string > & BarrierNumbersToNames ()
 
void MakeFilterFile (const std::string &ffname)
 
void SetFilter (FilterStatus fs, const std::string &rname, int rnumber)
 
void SetFilter (FilterStatus fs)
 
virtual void SetBLPVersion (const int blpv)
 
virtual void AddFunctionName (const std::string &fname)
 
virtual void InitBLProfDataBlock (const int proc, const std::string &filename, const long seekpos)
 
virtual void CollectFuncStats (amrex::Vector< amrex::Vector< FuncStat > > &funcStats)
 
virtual void WriteSummary (std::ostream &ios, bool bwriteavg=false, int whichProc=0, bool graphTopPct=true)
 
virtual void AddCalcEndTime (double cet)
 
virtual void SetCSVersion (int)
 
virtual void AddCStatsHeaderFileName (const std::string &)
 
virtual void AddFunctionName (const std::string &, int)
 
virtual void InitCStatsDataBlock (int, long, long, const std::string &, long)
 
virtual TimeRange MakeRegionPlt (amrex::FArrayBox &, int, int, int, amrex::Vector< amrex::Vector< amrex::Box >> &)
 
void CheckData ()
 
const amrex::Vector< std::string > & BLPFNames ()
 
void SetFNames (const amrex::Vector< std::string > &fNames)
 

Static Public Member Functions

static int GetCPVersion ()
 
static int GetCSSize ()
 
static int GetFinestLevel ()
 
static int GetMaxLevel ()
 
static void SetInitDataBlocks (bool b)
 
static bool InitDBlocks ()
 
static void InitDataFileNames (const amrex::Vector< std::string > &hfn)
 
static void InitProxMap ()
 
static const amrex::Vector< std::string > & GetHeaderFileNames ()
 
static void OpenAllStreams (const std::string &dirname)
 
static void CloseAllStreams ()
 
- Static Public Member Functions inherited from BLProfStats
static int Verbose ()
 
static void SetVerbose (int vlevel=0)
 
static void SetDirName (const std::string &dirname)
 
static void SetNOutFiles (const int nof)
 
static int GetNOutFiles ()
 
static void SetNProcs (int p)
 
static int GetNProcs ()
 
static bool AddPiece (std::list< TimeRange > &addToHere, const TimeRange &pieceToAdd)
 
static std::list< TimeRangeRangeIntersection (std::list< TimeRange > &rangeList, const TimeRange &pieceToIntersect)
 
static bool RemovePiece (std::list< TimeRange > &removeFromHere, const TimeRange &pieceToRemove)
 
static void SetInitDataBlocks (bool b)
 
static bool InitDBlocks ()
 
static void SetGPercent (Real p)
 
static void OpenAllStreams (const std::string &dirname)
 
static void CloseAllStreams ()
 
static bool TimeRangeInitialized ()
 

Private Member Functions

void ReadCommStats (DataBlock &dBlock)
 
void ReadCommStatsNoOpen (DataBlock &dBlock)
 
bool ReadCommStats (DataBlock &dBlock, const int nmessages)
 
void ClearCommStats (DataBlock &dBlock)
 

Private Attributes

int currentDataBlock
 
int tagMin
 
int tagMax
 
std::stack< double > nestedTimeStack
 
amrex::Vector< DataBlockdataBlocks
 
amrex::Vector< std::string > nameTagNames
 
amrex::Vector< std::string > barrierNames
 
amrex::Vector< std::map< int, amrex::IntVect > > TopoMap
 
std::map< int, long > glMap
 
std::map< int, int > glSizeMap
 
amrex::Vector< Real > edisonNodeFab
 
amrex::Vector< Real > edisonCPUFab
 
amrex::Vector< amrex::Vector< amrex::Vector< int > > > edisonNodeXYZ
 

Static Private Attributes

static int cpVersion
 
static int csSize
 
static int finestLevel
 
static int maxLevel
 
static bool persistentStreams
 
static amrex::Vector< amrex::IntVectcalcRefRatios
 
static amrex::Vector< amrex::BoxprobDomain
 
static bool bInitDataBlocks
 
static amrex::Vector< int > rankFromProx
 
static amrex::Vector< int > proxFromRank
 
static bool bProxMapOK
 
static amrex::Vector< std::string > commHeaderFileNames
 
static std::map< std::string, int > commDataFileNames
 
static amrex::Vector< std::ifstream * > commDataStreams
 

Friends

int yyparse (void *)
 

Additional Inherited Members

- Public Types inherited from BLProfStats
enum  FilterStatus {
  UNDEFINED , ON , OFF , INCLUDEALL ,
  INCLUDENONE
}
 
- Protected Member Functions inherited from BLProfStats
bool InTimeRange (int proc, Real calltime)
 
- Protected Attributes inherited from BLProfStats
int maxRNumber
 
int currentProc
 
int currentDataBlock
 
Real calcEndTime
 
Real minRegionTime
 
Real maxRegionTime
 
std::map< std::string, int > regionNames
 
std::map< int, std::string > regionNumbers
 
std::map< int, std::string > barrierNumbersToNames
 
std::set< int > includeSet
 
std::set< int > excludeSet
 
bool bDefaultInclude
 
amrex::Vector< amrex::Vector< amrex::Vector< TimeRange > > > regionTimeRanges
 
amrex::Vector< std::list< TimeRange > > filterTimeRanges
 
amrex::Vector< std::string > blpFNames
 
amrex::Vector< BLPDataBlockblpDataBlocks
 
- Static Protected Attributes inherited from BLProfStats
static int verbose
 
static int blProfVersion
 
static int dataNProcs
 
static int nOutFiles
 
static std::string dirName
 
static bool bInitDataBlocks
 
static bool bTimeRangeInitialized
 
static std::map< std::string, int > blpDataFileNames
 
static Real gPercent
 
static amrex::Vector< std::ifstream * > blpDataStreams
 

Constructor & Destructor Documentation

◆ CommProfStats()

CommProfStats::CommProfStats ( )

◆ ~CommProfStats()

CommProfStats::~CommProfStats ( )

Member Function Documentation

◆ AddBarrier()

void CommProfStats::AddBarrier ( long  bnum,
const std::string &  bname,
long  index 
)
virtual

Reimplemented from BLProfStats.

◆ AddCommHeaderFileName()

void CommProfStats::AddCommHeaderFileName ( const std::string &  hfn)
virtual

Reimplemented from BLProfStats.

◆ AddEdisonPID()

void CommProfStats::AddEdisonPID ( int  X,
int  Y,
int  Z,
int  cab,
int  row,
int  cage,
int  slot,
int  cpu,
int  pid 
)
virtual

Reimplemented from BLProfStats.

◆ AddFinestLevel()

virtual void CommProfStats::AddFinestLevel ( const int  lev)
inlinevirtual

Reimplemented from BLProfStats.

◆ AddGrid3D()

void CommProfStats::AddGrid3D ( int  level,
int  xlo,
int  ylo,
int  zlo,
int  xhi,
int  yhi,
int  zhi,
int  xc,
int  yc,
int  zc,
int  xn,
int  yn,
int  zn,
int  proc 
)
virtual

Reimplemented from BLProfStats.

◆ AddGridLevel()

void CommProfStats::AddGridLevel ( const int  level,
const int  ngrids 
)
virtual

Reimplemented from BLProfStats.

◆ AddMaxLevel()

virtual void CommProfStats::AddMaxLevel ( const int  lev)
inlinevirtual

Reimplemented from BLProfStats.

◆ AddNameTag()

void CommProfStats::AddNameTag ( const long  ntnindex,
const long  seekindex 
)
virtual

Reimplemented from BLProfStats.

◆ AddNameTagName()

void CommProfStats::AddNameTagName ( const std::string &  name)
virtual

Reimplemented from BLProfStats.

◆ AddProbDomain()

void CommProfStats::AddProbDomain ( const int  lev,
const amrex::Box pd 
)
virtual

Reimplemented from BLProfStats.

◆ AddReduction()

void CommProfStats::AddReduction ( const long  rnum,
const long  index 
)
virtual

Reimplemented from BLProfStats.

◆ AddRefRatio()

void CommProfStats::AddRefRatio ( const int  lev,
const amrex::IntVect rr 
)
virtual

Reimplemented from BLProfStats.

◆ AddTagRange()

void CommProfStats::AddTagRange ( const long  tmin,
const long  tmax 
)
virtual

Reimplemented from BLProfStats.

◆ AddTimeMinMax()

void CommProfStats::AddTimeMinMax ( const double  tmin,
const double  tmax 
)
virtual

Reimplemented from BLProfStats.

◆ AddTimerTime()

void CommProfStats::AddTimerTime ( const double  tt)
virtual

Reimplemented from BLProfStats.

◆ AddTopoCoord()

void CommProfStats::AddTopoCoord ( const int  nid,
const int  node,
const int  tx,
const int  ty,
const int  tz,
const bool  servicenode = false 
)
virtual

Reimplemented from BLProfStats.

◆ AfterBarrier()

int CommProfStats::AfterBarrier ( const int  proc,
const double  t 
)

◆ BarrierNames()

const amrex::Vector<std::string>& CommProfStats::BarrierNames ( )
inline

◆ CheckCommData()

void CommProfStats::CheckCommData ( amrex::Vector< long > &  nBMin,
amrex::Vector< long > &  nBMax,
amrex::Vector< long > &  nRMin,
amrex::Vector< long > &  nRMax 
)

◆ ClearCommStats()

void CommProfStats::ClearCommStats ( DataBlock dBlock)
private

◆ CloseAllStreams()

void CommProfStats::CloseAllStreams ( )
static

◆ FillSendFAB()

void CommProfStats::FillSendFAB ( long &  totalSends,
long &  totalSentData,
amrex::Vector< long > &  totalSendsPerProc,
amrex::Vector< long > &  totalSentDataPerProc,
amrex::FArrayBox sendFAB,
bool  proxmap 
)

◆ FindTimeRange()

void CommProfStats::FindTimeRange ( BLProfStats::TimeRange tr)

◆ GetCPVersion()

static int CommProfStats::GetCPVersion ( )
inlinestatic

◆ GetCSSize()

static int CommProfStats::GetCSSize ( )
inlinestatic

◆ GetFinestLevel()

static int CommProfStats::GetFinestLevel ( )
inlinestatic

◆ GetHeaderFileNames()

static const amrex::Vector<std::string>& CommProfStats::GetHeaderFileNames ( )
inlinestatic

◆ GetMaxLevel()

static int CommProfStats::GetMaxLevel ( )
inlinestatic

◆ GetProbDomain()

const amrex::Vector<amrex::Box>& CommProfStats::GetProbDomain ( ) const
inline

◆ GetRefRatio()

const amrex::Vector<amrex::IntVect>& CommProfStats::GetRefRatio ( ) const
inline

◆ GLMap()

const std::map<int, long>& CommProfStats::GLMap ( ) const
inline

◆ GLSizeMap()

const std::map<int, int>& CommProfStats::GLSizeMap ( ) const
inline

◆ InitCommDataBlock()

void CommProfStats::InitCommDataBlock ( const int  proc,
const long  ncommstats,
const std::string &  filename,
const long  seekpos,
const std::string &  nodename = "",
const int  nodenumber = -1 
)
virtual

Reimplemented from BLProfStats.

◆ InitDataFileNames()

void CommProfStats::InitDataFileNames ( const amrex::Vector< std::string > &  hfn)
static

◆ InitDBlocks()

static bool CommProfStats::InitDBlocks ( )
inlinestatic

◆ InitEdisonTopoMF()

void CommProfStats::InitEdisonTopoMF ( )

◆ InitProxMap()

void CommProfStats::InitProxMap ( )
static

◆ IsBlockingRecv()

bool CommProfStats::IsBlockingRecv ( const amrex::BLProfiler::CommFuncType &  cft)

◆ IsRecv()

bool CommProfStats::IsRecv ( const amrex::BLProfiler::CommFuncType &  cft)

◆ IsSend()

bool CommProfStats::IsSend ( const amrex::BLProfiler::CommFuncType &  cft)

◆ NameTagNames()

const amrex::Vector<std::string>& CommProfStats::NameTagNames ( )
inline

◆ OpenAllStreams()

void CommProfStats::OpenAllStreams ( const std::string &  dirname)
static

◆ ReadCommStats() [1/2]

void CommProfStats::ReadCommStats ( DataBlock dBlock)
private

◆ ReadCommStats() [2/2]

bool CommProfStats::ReadCommStats ( DataBlock dBlock,
const int  nmessages 
)
private

◆ ReadCommStatsNoOpen()

void CommProfStats::ReadCommStatsNoOpen ( DataBlock dBlock)
private

◆ ReportStats()

void CommProfStats::ReportStats ( long &  totalSentData,
long &  totalNCommStats,
amrex::Vector< long > &  totalFuncCalls,
int  bytesPerSlot,
amrex::Vector< long > &  msgSizes,
int &  minMsgSize,
int &  maxMsgSize,
Real &  timeMin,
Real &  timeMax,
Real &  timerTime,
amrex::Vector< int > &  rankNodeNumbers 
)

◆ ReportSyncPointData()

void CommProfStats::ReportSyncPointData ( amrex::Vector< amrex::Vector< Real > > &  barrierExitTimes,
amrex::Vector< amrex::Vector< Real > > &  barrierWaitTimes,
amrex::Vector< amrex::Vector< Real > > &  reductionWaitTimes,
bool  bDoReductions = false 
)

◆ ReportSyncPointDataSetup()

void CommProfStats::ReportSyncPointDataSetup ( long &  nBMax,
long &  nRMax 
)

◆ SendRecvData()

void CommProfStats::SendRecvData ( const std::string &  filename,
const double  tlo,
const double  thi 
)

◆ SendRecvList()

void CommProfStats::SendRecvList ( std::multimap< Real, SendRecvPairUnpaired > &  srMMap)

◆ SetCPVersion()

virtual void CommProfStats::SetCPVersion ( const int  cpv)
inlinevirtual

Reimplemented from BLProfStats.

◆ SetCSSize()

virtual void CommProfStats::SetCSSize ( const int  css)
inlinevirtual

Reimplemented from BLProfStats.

◆ SetInitDataBlocks()

static void CommProfStats::SetInitDataBlocks ( bool  b)
inlinestatic

◆ SetProbDomain()

void CommProfStats::SetProbDomain ( const amrex::Vector< amrex::Box > &  pd)
inline

◆ SetRefRatio()

void CommProfStats::SetRefRatio ( const amrex::Vector< amrex::IntVect > &  rr)
inline

◆ TimelineFAB()

void CommProfStats::TimelineFAB ( amrex::FArrayBox timelineFAB,
const amrex::Box probDomain,
const BLProfStats::TimeRange  tr,
const int  rankMin,
const int  rankMax,
const int  rankStride,
const Real  ntnMultiplier,
const amrex::Vector< Real > &  ntnNumbers,
const Real  bnMultiplier,
const amrex::Vector< Real > &  bnNumbers 
)

◆ WriteEdisonTopoMF()

void CommProfStats::WriteEdisonTopoMF ( )

◆ WriteTopoFab()

void CommProfStats::WriteTopoFab ( )

Friends And Related Function Documentation

◆ yyparse

int yyparse ( void *  )
friend

Member Data Documentation

◆ barrierNames

amrex::Vector<std::string> CommProfStats::barrierNames
private

◆ bInitDataBlocks

bool CommProfStats::bInitDataBlocks
staticprivate

◆ bProxMapOK

bool CommProfStats::bProxMapOK
staticprivate

◆ calcRefRatios

Vector< IntVect > CommProfStats::calcRefRatios
staticprivate

◆ commDataFileNames

std::map< std::string, int > CommProfStats::commDataFileNames
staticprivate

◆ commDataStreams

Vector< std::ifstream * > CommProfStats::commDataStreams
staticprivate

◆ commHeaderFileNames

Vector< std::string > CommProfStats::commHeaderFileNames
staticprivate

◆ cpVersion

int CommProfStats::cpVersion
staticprivate

◆ csSize

int CommProfStats::csSize
staticprivate

◆ currentDataBlock

int CommProfStats::currentDataBlock
private

◆ dataBlocks

amrex::Vector<DataBlock> CommProfStats::dataBlocks
private

◆ edisonCPUFab

amrex::Vector<Real> CommProfStats::edisonCPUFab
private

◆ edisonNodeFab

amrex::Vector<Real> CommProfStats::edisonNodeFab
private

◆ edisonNodeXYZ

amrex::Vector<amrex::Vector<amrex::Vector<int> > > CommProfStats::edisonNodeXYZ
private

◆ finestLevel

int CommProfStats::finestLevel
staticprivate

◆ glMap

std::map<int, long> CommProfStats::glMap
private

◆ glSizeMap

std::map<int, int> CommProfStats::glSizeMap
private

◆ maxLevel

int CommProfStats::maxLevel
staticprivate

◆ nameTagNames

amrex::Vector<std::string> CommProfStats::nameTagNames
private

◆ nestedTimeStack

std::stack<double> CommProfStats::nestedTimeStack
private

◆ persistentStreams

bool CommProfStats::persistentStreams
staticprivate

◆ probDomain

Vector< Box > CommProfStats::probDomain
staticprivate

◆ proxFromRank

Vector< int > CommProfStats::proxFromRank
staticprivate

◆ rankFromProx

Vector< int > CommProfStats::rankFromProx
staticprivate

◆ tagMax

int CommProfStats::tagMax
private

◆ tagMin

int CommProfStats::tagMin
private

◆ TopoMap

amrex::Vector<std::map<int, amrex::IntVect> > CommProfStats::TopoMap
private

The documentation for this class was generated from the following files: