MADNESS  0.10.1
Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
madness::WorldProfile Class Reference

Singleton-like class for holding profiling data and functionality. More...

#include <worldprofile.h>

Collaboration diagram for madness::WorldProfile:
Collaboration graph
[legend]

Static Public Member Functions

static void clear ()
 Clears all profiling information. More...
 
static WorldProfileEntryget_entry (int id)
 Returns a reference to the specified entry. Throws if id is invalid. More...
 
static void print (World &world)
 Prints global profiling information. Global fence involved. Implemented in worldstuff.cc. More...
 
static int register_id (const char *classname, const char *function)
 Returns id for the name, registering if necessary. More...
 
static int register_id (const char *name)
 Returns id for the name, registering if necessary. More...
 

Static Private Member Functions

static int find (const std::string &name)
 Returns id of the entry associated with the name. Returns -1 if not found;. More...
 
static std::vector< WorldProfileEntry > & nvitems ()
 
static void recv_stats (World &world, ProcessID p)
 Private. Accumlates data from process into parallel statistics. Implemented in worldstuff.cc. More...
 

Static Private Attributes

static double cpu_start = madness::cpu_time()
 
static std::vector< WorldProfileEntryitems
 
static Spinlock mutex
 
static double wall_start = madness::wall_time()
 

Detailed Description

Singleton-like class for holding profiling data and functionality.

Use the macros PROFILE_FUNC, PROFILE_BLOCK, PROFILE_MEMBER_FUNC

Member Function Documentation

◆ clear()

void madness::WorldProfile::clear ( )
static

Clears all profiling information.

References cpu_start, madness::cpu_time(), fred(), mutex, nvitems(), wall_start, and madness::wall_time().

◆ find()

int madness::WorldProfile::find ( const std::string &  name)
staticprivate

Returns id of the entry associated with the name. Returns -1 if not found;.

References MADNESS_EXCEPTION, madness::name(), and nvitems().

Referenced by print(), recv_stats(), and register_id().

◆ get_entry()

WorldProfileEntry & madness::WorldProfile::get_entry ( int  id)
static

Returns a reference to the specified entry. Throws if id is invalid.

References MADNESS_EXCEPTION, and nvitems().

Referenced by madness::WorldProfileObj::WorldProfileObj(), madness::WorldProfileObj::~WorldProfileObj(), madness::WorldProfileObj::pause(), print(), and recv_stats().

◆ nvitems()

std::vector< WorldProfileEntry > & madness::WorldProfile::nvitems ( )
staticprivate

References items.

Referenced by clear(), find(), get_entry(), and register_id().

◆ print()

void madness::WorldProfile::print ( World world)
static

◆ recv_stats()

void madness::WorldProfile::recv_stats ( World world,
ProcessID  p 
)
staticprivate

Private. Accumlates data from process into parallel statistics. Implemented in worldstuff.cc.

References d(), find(), get_entry(), madness::name(), p(), register_id(), madness::World::size(), and v.

Referenced by print().

◆ register_id() [1/2]

int madness::WorldProfile::register_id ( const char *  classname,
const char *  function 
)
static

Returns id for the name, registering if necessary.

References find(), fred(), mutex, madness::name(), and nvitems().

◆ register_id() [2/2]

int madness::WorldProfile::register_id ( const char *  name)
static

Returns id for the name, registering if necessary.

References find(), fred(), mutex, madness::name(), and nvitems().

Referenced by recv_stats().

Member Data Documentation

◆ cpu_start

double madness::WorldProfile::cpu_start = madness::cpu_time()
staticprivate

Referenced by clear(), and print().

◆ items

std::vector< WorldProfileEntry > madness::WorldProfile::items
staticprivate

Referenced by nvitems(), and print().

◆ mutex

Spinlock madness::WorldProfile::mutex
staticprivate

Referenced by clear(), and register_id().

◆ wall_start

double madness::WorldProfile::wall_start = madness::wall_time()
staticprivate

Referenced by clear(), and print().


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