CnC
 All Classes Namespaces Functions Variables Typedefs Enumerator Friends
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)
static void CNC_API trace (::CnC::graph &g, int level=1)
 enable tracing of graph internals (not including its I/O collections)
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:

 std::ostream & cnc_format( std::ostream & os, const your_type & p ) 

Make sure it is defined in the corresponding namespace.

Definition at line 56 of file debug.h.


Member Function Documentation

static void collect_scheduler_statistics ( ::CnC::context< Derived > &  c) [inline, static]

enable collection scheduler statistics per context

Statistics will be print upon destructino of a context.

Parameters:
cthe context to be examined

Definition at line 135 of file debug.h.

        { c.init_scheduler_statistics(); }
static void finalize_timer ( const char *  name) [inline, static]

save collected time log to a specified file

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

Definition at line 119 of file debug.h.

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

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 114 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) [inline, static]

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 127 of file debug.h.

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

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 69 of file debug.h.

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

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 78 of file debug.h.

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

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 87 of file debug.h.

        {
            sc.set_tracing( level );
            CNC_ASSERT( sc.trace_level() == level );
        }
static void CNC_API trace ( ::CnC::graph g,
int  level = 1 
) [static]

enable tracing of graph internals (not including its I/O collections)

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

Parameters:
gthe graph to be traced
leveltrace level
static void trace_all ( ::CnC::context< Derived > &  c,
int  level = 1 
) [inline, static]

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

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

Parameters:
cthe context to be traced
leveltrace level

Definition at line 107 of file debug.h.

        { c.set_tracing( level ); }

The documentation for this struct was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerator Friends