CnC
 All Classes Namespaces Functions Variables Typedefs Enumerator Friends Groups Pages
Static Public Member Functions
debug Struct Reference

Debugging interface providing tracing and timing capabilities. More...

List of all members.

Static Public Member Functions

static void CNC_API set_num_threads (int n)
 sets the number of threads used by the application
template<typename Tag , typename Tuner >
static void trace (tag_collection< Tag, Tuner > &tc, int level=1)
 enable tracing of a given tag collection at a given level
template<typename Tag , typename Item , typename HC >
static void trace (item_collection< Tag, Item, HC > &ic, int level=1)
 enable tracing of a given item collection at a given level
template<typename UserStep , typename Tuner >
static void trace (step_collection< UserStep, Tuner > &sc, int level=1)
 enable tracing of a given step-collection at a given level (off=0)
template<class Derived >
static void trace_all (::CnC::context< Derived > &c, int level=1)
 enable tracing of everything in given context (off=0)
static void init_timer (bool cycle=false)
 initalize timer
static void finalize_timer (const char *name)
 save collected time log to a specified file
template<typename UserStep , typename Tuner >
static void time (step_collection< UserStep, Tuner > &sc)
 enable timing of a given step
template<class Derived >
static void collect_scheduler_statistics (::CnC::context< Derived > &c)
 enable collection scheduler statistics per context

Detailed Description

Debugging interface providing tracing and timing capabilities.

   \#include <cnc/debug.h>

   For a meaningful tracing the runtime requires a function cnc_format for
   every non-standard item and tag type. The expected signature is:
   @code 

std::ostream & cnc_format( std::ostream & os, const your_type & p ) Make sure it is defined in the corresponding namespace.

Definition at line 46 of file debug.h.


Member Function Documentation

static void collect_scheduler_statistics ( ::CnC::context< Derived > &  c)
inlinestatic

enable collection scheduler statistics per context

Statistics will be print upon destructino of a context.

Parameters:
cthe context to be examined

Definition at line 118 of file debug.h.

{ c.init_scheduler_statistics(); }
static void finalize_timer ( const char *  name)
inlinestatic

save collected time log to a specified file

Parameters:
namethe file to write the time log, pass "-" for printing to stdout

Definition at line 102 of file debug.h.

{ Internal::chronometer::save_log( name ? name : "-" ); }
static void init_timer ( bool  cycle = false)
inlinestatic

initalize timer

Parameters:
cycleif true, use cycle counter only Cycle counters might overflow: TSC results are incorrect if the measured time-interval is larger than a full turn-around.

Definition at line 97 of file debug.h.

{ Internal::chronometer::init( cycle ); }
static void CNC_API set_num_threads ( int  n)
static

sets the number of threads used by the application

Overwrites environment variable CNC_NUM_THREADS. To be effective, it must be called prior to context creation.

static void time ( step_collection< UserStep, Tuner > &  sc)
inlinestatic

enable timing of a given step

To be used in a safe environment only (no steps in flight)

Parameters:
scthe step-collection to be timed

Definition at line 110 of file debug.h.

{ sc.set_timing(); }
static void trace ( tag_collection< Tag, Tuner > &  tc,
int  level = 1 
)
inlinestatic

enable tracing of a given tag collection at a given level

To be used in a safe environment only (no steps in flight)

Parameters:
tcthe tag collection to be traced
leveltrace level

Definition at line 59 of file debug.h.

{ tc.m_tagCollection.set_tracing( level ); }
static void trace ( item_collection< Tag, Item, HC > &  ic,
int  level = 1 
)
inlinestatic

enable tracing of a given item collection at a given level

To be used in a safe environment only (no steps in flight).

Parameters:
icthe item collection to be traced
leveltrace level

Definition at line 68 of file debug.h.

{ ic.m_itemCollection.set_tracing( level ); }
static void trace ( step_collection< UserStep, Tuner > &  sc,
int  level = 1 
)
inlinestatic

enable tracing of a given step-collection at a given level (off=0)

To be used in a safe environment only (no steps in flight)

Parameters:
scthe step-collection to be traced
leveltrace level

Definition at line 77 of file debug.h.

{
sc.set_tracing( level );
CNC_ASSERT( sc.trace_level() == level );
}
static void trace_all ( ::CnC::context< Derived > &  c,
int  level = 1 
)
inlinestatic

enable tracing of everything in given context (off=0)

To be used in a safe environment only (no steps in flight) names of collections are unavailable unless tracing them was enabled explicitly.

Parameters:
cthe context to be traced
leveltrace level

Definition at line 90 of file debug.h.

{ c.set_tracing( level ); }

The documentation for this struct was generated from the following file: