Block-Structured AMR Software Framework
AMReX_BLProfUtilities.H
Go to the documentation of this file.
1 // ----------------------------------------------------------------------
2 // AMReX_BLProfUtilities.H
3 // ----------------------------------------------------------------------
4 #ifndef BL_BLPROFUTILITIES_H
5 #define BL_BLPROFUTILITIES_H
6 #include <AMReX_Config.H>
7 
8 //#include <cstdlib>
9 //#include <cstdio>
10 //#include <iostream>
11 #include <string>
12 #include <cstring>
13 //#include <list>
14 //#include <vector>
15 #include <typeinfo>
16 //#include <limits>
17 //#include <algorithm>
18 //#include <sys/stat.h>
19 
20 //using std::cout;
21 //using std::endl;
22 //using std::flush;
23 //using std::string;
24 
25 //#include <AMReX_SPACE.H>
26 //#include <AMReX.H>
27 #include <AMReX_BLProfStats.H>
28 #include <AMReX_CommProfStats.H>
29 #include <AMReX_RegionsProfStats.H>
30 //#include <AMReX_Utility.H>
31 //#include <AMReX_ParallelDescriptor.H>
32 //#include <AMReX_Array.H>
33 #include <AMReX_Vector.H>
34 //#include <AMReX_IntVect.H>
35 //#include <AMReX_Box.H>
36 //#include <AMReX_FArrayBox.H>
37 //#include <AMReX_MultiFab.H>
38 //#include <AMReX_AVGDOWN_F.H>
39 
40 namespace amrex{
41 
42 // --------------------------------------------------------------------
43 std::string SanitizeName(const std::string &sname);
44 void SimpleRemoveOverlap(BoxArray &ba);
45 void avgDown_doit(const FArrayBox &fine_fab, FArrayBox &crse_fab,
46  const Box &ovlp, int scomp, int dcomp, int ncomp,
47  Vector<int> &ratio);
48 Box FixCoarseBoxSize(const Box &fineBox, int rr);
49 void avgDown(MultiFab &S_crse, MultiFab &S_fine, int scomp, int dcomp,
50  int ncomp, Vector<int> &ratio);
51 void PrintTimeRangeList(const std::list<RegionsProfStats::TimeRange> &trList);
52 void RedistFiles();
53 int NHops(const Box &tbox, const IntVect &ivfrom, const IntVect &ivto);
54 void Write2DFab(const string &filenameprefix, const int xdim, const int ydim,
55  const double *data);
56 void Write2DText(const string &filenameprefix, const int xdim, const int ydim,
57  const double *data);
58 void Write3DFab(const string &filenameprefix, const int xdim, const int ydim,
59  const int zdim, const double *data);
60 void WriteFab(const string &filenameprefix, const int xdim, const int ydim,
61  const double *data);
62 long FileSize(const std::string &filename);
63 void MakeFuncPctTimesMF(const Vector<Vector<BLProfStats::FuncStat> > &funcStats,
64  const Vector<std::string> &blpFNames,
65  const std::map<std::string, BLProfiler::ProfStats> &mProfStats,
66  Real runTime, int dataNProcs);
67 void CollectMProfStats(std::map<std::string, BLProfiler::ProfStats> &mProfStats,
68  const Vector<Vector<BLProfStats::FuncStat> > &funcStats,
69  const Vector<std::string> &fNames,
70  Real runTime, int whichProc);
71 void GraphTopPct(const std::map<std::string, BLProfiler::ProfStats> &mProfStats,
72  const Vector<Vector<BLProfStats::FuncStat> > &funcStats,
73  const Vector<std::string> &fNames,
74  Real runTime, int dataNProcs, Real gPercent);
75 }
76 // ----------------------------------------------------------------------
77 // ----------------------------------------------------------------------
78 #endif
Definition: AMReX_Amr.cpp:49
void Write2DText(const string &filenameprefix, const int xdim, const int ydim, const double *data)
Definition: AMReX_BLProfUtilities.cpp:281
void GraphTopPct(const std::map< std::string, BLProfiler::ProfStats > &mProfStats, const Vector< Vector< BLProfStats::FuncStat > > &funcStats, const Vector< std::string > &fNames, Real runTime, int dataNProcs, Real gPercent)
Definition: AMReX_BLProfUtilities.cpp:443
void RedistFiles()
Definition: AMReX_BLProfUtilities.cpp:173
void Write3DFab(const string &filenameprefix, const int xdim, const int ydim, const int zdim, const double *data)
Definition: AMReX_BLProfUtilities.cpp:302
void SimpleRemoveOverlap(BoxArray &ba)
Definition: AMReX_BLProfUtilities.cpp:70
BoxND< AMREX_SPACEDIM > Box
Definition: AMReX_BaseFwd.H:27
long FileSize(const std::string &filename)
Definition: AMReX_BLProfUtilities.cpp:341
std::string SanitizeName(const std::string &sname)
Definition: AMReX_BLProfUtilities.cpp:45
void avgDown(MultiFab &S_crse, MultiFab &S_fine, int scomp, int dcomp, int ncomp, Vector< int > &ratio)
Definition: AMReX_BLProfUtilities.cpp:132
void avgDown_doit(const FArrayBox &fine_fab, FArrayBox &crse_fab, const Box &ovlp, int scomp, int dcomp, int ncomp, Vector< int > &ratio)
Definition: AMReX_BLProfUtilities.cpp:89
void WriteFab(const string &filenameprefix, const int xdim, const int ydim, const double *data)
Definition: AMReX_BLProfUtilities.cpp:315
IntVectND< AMREX_SPACEDIM > IntVect
Definition: AMReX_BaseFwd.H:30
void Write2DFab(const string &filenameprefix, const int xdim, const int ydim, const double *data)
Definition: AMReX_BLProfUtilities.cpp:268
void MakeFuncPctTimesMF(const Vector< Vector< BLProfStats::FuncStat > > &funcStats, const Vector< std::string > &blpFNames, const std::map< std::string, BLProfiler::ProfStats > &mProfStats, Real runTime, int dataNProcs)
Definition: AMReX_BLProfUtilities.cpp:349
void CollectMProfStats(std::map< std::string, BLProfiler::ProfStats > &mProfStats, const Vector< Vector< BLProfStats::FuncStat > > &funcStats, const Vector< std::string > &fNames, Real runTime, int whichProc)
Definition: AMReX_BLProfUtilities.cpp:401
Box FixCoarseBoxSize(const Box &fineBox, int rr)
Definition: AMReX_BLProfUtilities.cpp:116
int NHops(const Box &tbox, const IntVect &ivfrom, const IntVect &ivto)
Definition: AMReX_BLProfUtilities.cpp:254
void PrintTimeRangeList(const std::list< RegionsProfStats::TimeRange > &trList)
Definition: AMReX_BLProfUtilities.cpp:158