33#ifndef MADNESS_WORLD_WORLDPROFILE_H__INCLUDED
34#define MADNESS_WORLD_WORLDPROFILE_H__INCLUDED
121 template <
class Archive>
133 static std::vector<WorldProfileEntry>
items;
138 static std::vector<WorldProfileEntry>&
nvitems();
142 static int find(
const std::string&
name);
190#ifdef WORLD_PROFILE_ENABLE
191# define PROFILE_STRINGIFY(s) #s
193# define PROFILE_BLOCK(name) \
194 static const int __name##_id=madness::WorldProfile::register_id(PROFILE_STRINGIFY(name)); \
195 madness::WorldProfileObj name(__name##_id)
197# define PROFILE_FUNC \
198 static const int __profile_id=madness::WorldProfile::register_id(__FUNCTION__); \
199 madness::WorldProfileObj __profile_obj(__profile_id)
201# define PROFILE_MEMBER_FUNC(classname) \
202 static const int __profile_id=madness::WorldProfile::register_id(PROFILE_STRINGIFY(classname), __FUNCTION__); \
203 madness::WorldProfileObj __profile_obj(__profile_id)
208# define PROFILE_BLOCK(name)
210# define PROFILE_MEMBER_FUNC(classname)
Spinlock using pthread spinlock operations.
Definition worldmutex.h:253
Definition worldprofile.h:167
void resume(double now, const RMIStats &stats)
Resume profiling.
Definition worldprofile.cc:431
double cpu_start
Time that I was at top of stack.
Definition worldprofile.h:174
RMIStats stats_base
Msg stats when I start executing.
Definition worldprofile.h:173
~WorldProfileObj()
Definition worldprofile.cc:436
static thread_local WorldProfileObj * call_stack
Current top of this thread's call stack.
Definition worldprofile.h:168
WorldProfileObj *const prev
Pointer to the entry that called me.
Definition worldprofile.h:170
static thread_local int mythreadid
My unique thread id.
Definition worldprofile.h:169
RMIStats stats_start
Msg stats when I was at top of stack;.
Definition worldprofile.h:175
const int id
My entry in the world profiler.
Definition worldprofile.h:171
void pause(double now, const RMIStats &stats)
Pause profiling while we are not executing ... accumulate time in self.
Definition worldprofile.cc:419
const double cpu_base
Time that I started executing.
Definition worldprofile.h:172
Singleton-like class for holding profiling data and functionality.
Definition worldprofile.h:131
static void recv_stats(World &world, ProcessID p)
Private. Accumlates data from process into parallel statistics. Implemented in worldstuff....
Definition worldprofile.cc:388
static Spinlock mutex
Definition worldprofile.h:134
static std::vector< WorldProfileEntry > items
Definition worldprofile.h:133
static double wall_start
Definition worldprofile.h:136
static int find(const std::string &name)
Returns id of the entry associated with the name. Returns -1 if not found;.
Definition worldprofile.cc:142
static void clear()
Clears all profiling information.
Definition worldprofile.cc:180
static std::vector< WorldProfileEntry > & nvitems()
Definition worldprofile.cc:136
static WorldProfileEntry & get_entry(int id)
Returns a reference to the specified entry. Throws if id is invalid.
Definition worldprofile.cc:191
static double cpu_start
Definition worldprofile.h:135
static int register_id(const char *name)
Returns id for the name, registering if necessary.
Definition worldprofile.cc:155
static void print(World &world)
Prints global profiling information. Global fence involved. Implemented in worldstuff....
Definition worldprofile.cc:295
A parallel world class.
Definition world.h:132
char * p(char *buf, const char *name, int k, int initial_level, double thresh, int order)
Definition derivatives.cc:72
static double function(const coord_3d &r)
Normalized gaussian.
Definition functionio.cc:100
auto T(World &world, response_space &f) -> response_space
Definition global_functions.cc:34
Macros and tools pertaining to the configuration of MADNESS.
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
std::string name(const FuncType &type, const int ex=-1)
Definition ccpairfunction.h:28
static const double b
Definition nonlinschro.cc:119
static const double a
Definition nonlinschro.cc:118
Simple container for parallel profile statistic.
Definition worldprofile.h:51
T min
Definition worldprofile.h:52
T sum
Definition worldprofile.h:52
void clear()
Zeros all data.
Definition worldprofile.h:77
ProcessID pmax
Definition worldprofile.h:53
T value
Definition worldprofile.h:52
T max
Definition worldprofile.h:52
void init_par_stats(ProcessID me)
Copies local stats into parallel stats in prep for global reduction.
Definition worldprofile.h:58
ProcessID pmin
Definition worldprofile.h:53
void par_reduce(const ProfileStat< T > &other)
Reduction of parallel data (max, min, sum)
Definition worldprofile.h:64
Definition worldrmi.h:147
Used to store profiler info.
Definition worldprofile.h:84
static bool inclusivebytcmp(const WorldProfileEntry &a, const WorldProfileEntry &b)
Definition worldprofile.cc:90
int depth[MAX_NTHREAD]
depth of recursive calls by thread (0 if no active calls)
Definition worldprofile.h:87
ProfileStat< unsigned long > inmsg_recv
No. of active messages recv ... inclusive.
Definition worldprofile.h:95
ProfileStat< unsigned long > xnmsg_sent
No. of active messages sent ... exclusive.
Definition worldprofile.h:92
ProfileStat< unsigned long > xnbyt_recv
No. of bytes recv ... exclusive.
Definition worldprofile.h:98
ProfileStat< unsigned long > inbyt_recv
No. of bytes recv ... inclusive.
Definition worldprofile.h:99
ProfileStat< double > xcpu
exclusive cpu time (i.e., excluding calls)
Definition worldprofile.h:90
ProfileStat< unsigned long > count
count of times called
Definition worldprofile.h:89
ProfileStat< unsigned long > inbyt_sent
No. of bytes sent ... inclusive.
Definition worldprofile.h:97
void par_reduce(const WorldProfileEntry &other)
Definition worldprofile.cc:108
ProfileStat< double > icpu
inclusive cpu call (i.e., including calls)
Definition worldprofile.h:91
ProfileStat< unsigned long > xnmsg_recv
No. of active messages recv ... exclusive.
Definition worldprofile.h:94
void serialize(const Archive &ar)
Definition worldprofile.h:122
static const int MAX_NTHREAD
Definition worldprofile.h:86
ProfileStat< unsigned long > inmsg_sent
No. of active messages sent ... inclusive.
Definition worldprofile.h:93
static bool exclusivecmp(const WorldProfileEntry &a, const WorldProfileEntry &b)
Definition worldprofile.cc:78
WorldProfileEntry & operator=(const WorldProfileEntry &other)
Definition worldprofile.cc:60
void init_par_stats(ProcessID me)
Definition worldprofile.cc:94
static bool inclusivecmp(const WorldProfileEntry &a, const WorldProfileEntry &b)
Definition worldprofile.cc:82
static bool exclusivebytcmp(const WorldProfileEntry &a, const WorldProfileEntry &b)
Definition worldprofile.cc:86
void clear()
Definition worldprofile.cc:122
ProfileStat< unsigned long > xnbyt_sent
No. of bytes sent ... exclusive.
Definition worldprofile.h:96
std::string name
name of the entry
Definition worldprofile.h:85
int me
Definition test_binsorter.cc:10
static madness::WorldMemInfo stats
Definition worldmem.cc:64
Implements Mutex, MutexFair, Spinlock, ConditionVariable.
Lowest level API for sending active messages — you should probably be looking at worldam....
Defines types used by the parallel runtime.
int ProcessID
Used to clearly identify process number/rank.
Definition worldtypes.h:43