2 #ifndef BL_MEMPROFILER_H
3 #define BL_MEMPROFILER_H
4 #include <AMReX_Config.H>
32 static void add (
const std::string& name, std::function<
MemInfo()>&&
f);
33 static void add (
const std::string& name, std::function<
NBuildsInfo()>&&
f);
35 static void report (
const std::string& prefix = std::string());
47 void report_ (
const std::string& prefix,
const std::string& memory_log_name)
const;
53 friend std::ostream&
operator<< (std::ostream& os,
60 friend std::ostream&
operator<< (std::ostream& os,
Definition: AMReX_MemProfiler.H:19
void report_(const std::string &prefix, const std::string &memory_log_name) const
Definition: AMReX_MemProfiler.cpp:79
std::vector< std::function< NBuildsInfo()> > the_funcs_builds
Definition: AMReX_MemProfiler.H:71
~MemProfiler()
Definition: AMReX_MemProfiler.H:43
std::vector< std::string > the_names_builds
Definition: AMReX_MemProfiler.H:70
static std::unique_ptr< MemProfiler > the_instance
Definition: AMReX_MemProfiler.H:65
static MemProfiler & getInstance()
Definition: AMReX_MemProfiler.cpp:51
MemProfiler & operator=(const MemProfiler &)=delete
static void add(const std::string &name, std::function< MemInfo()> &&f)
Definition: AMReX_MemProfiler.cpp:25
static void report(const std::string &prefix=std::string())
Definition: AMReX_MemProfiler.cpp:66
static void Finalize()
Definition: AMReX_MemProfiler.cpp:60
std::vector< std::function< MemInfo()> > the_funcs
Definition: AMReX_MemProfiler.H:68
MemProfiler(const MemProfiler &)=delete
friend std::ostream & operator<<(std::ostream &os, const MemProfiler::Bytes &bytes)
Definition: AMReX_MemProfiler.cpp:331
MemProfiler()
Definition: AMReX_MemProfiler.H:42
std::vector< std::string > the_names
Definition: AMReX_MemProfiler.H:67
static int f(amrex::Real t, N_Vector y_data, N_Vector y_rhs, void *user_data)
Definition: AMReX_SundialsIntegrator.H:44
Definition: AMReX_Amr.cpp:49
Definition: AMReX_MemProfiler.H:56
int mn
Definition: AMReX_MemProfiler.H:57
int mx
Definition: AMReX_MemProfiler.H:58
Definition: AMReX_MemProfiler.H:49
Long mx
Definition: AMReX_MemProfiler.H:51
Long mn
Definition: AMReX_MemProfiler.H:50
Definition: AMReX_MemProfiler.H:22
Long current_bytes
Definition: AMReX_MemProfiler.H:23
Long hwm_bytes
Definition: AMReX_MemProfiler.H:24
Definition: AMReX_MemProfiler.H:27
int current_builds
Definition: AMReX_MemProfiler.H:28
int hwm_builds
Definition: AMReX_MemProfiler.H:29