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 Range, typename HC>
static void trace (tag_collection< Tag, Range, HC > &tc, const char *name, 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, const char *name, int level=1)
 enable tracing of a given item collection at a given level
template<class Derived>
static void trace_all (::CnC::context< Derived > &c, const char *name, int level=1)
 enable tracing of everything in given context
template<typename Step>
static void trace (Step step, const char *name, int level=1)
 enable tracing of a given step at a given level
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 Step>
static void time (Step step, const char *name)
 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 39 of file debug.h.


Member Function Documentation

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 trace ( tag_collection< Tag, Range, HC > &  tc,
const char *  name,
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:
tc the tag collection to be traced
name the name by which the tag collection should be identified in the trace
level trace level

Definition at line 53 of file debug.h.

00054         { tc.m_tagCollection.set_tracing( name, level ); }

static void trace ( item_collection< Tag, Item, HC > &  ic,
const char *  name,
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:
ic the item collection to be traced
name the name by which the item collection should be identified in the trace
level trace level

Definition at line 63 of file debug.h.

00064         { ic.m_itemCollection.set_tracing( name, level ); }

static void trace_all ( ::CnC::context< Derived > &  c,
const char *  name,
int  level = 1 
) [inline, static]

enable tracing of everything in given context

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

Parameters:
c the context to be traced
name the name by which the context should be identified in the trace
level trace level

Definition at line 74 of file debug.h.

00075         { c.set_tracing( name, level ); }

static void trace ( Step  step,
const char *  name,
int  level = 1 
) [inline, static]

enable tracing of a given step at a given level

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

Parameters:
step the step to be traced
name the name by which the step should be identified in the trace
level trace level

Definition at line 84 of file debug.h.

00085         { Internal::step_tracer< Step >::s_traceName = name; Internal::step_tracer< Step >::s_traceLevel = level; }

static void init_timer ( bool  cycle = false  )  [inline, static]

initalize timer

Parameters:
cycle if 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 91 of file debug.h.

00092         { Internal::chronometer::init( cycle ); }

static void finalize_timer ( const char *  name  )  [inline, static]

save collected time log to a specified file

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

Definition at line 96 of file debug.h.

00097         { Internal::chronometer::save_log( name ? name : "-" ); }

static void time ( Step  step,
const char *  name 
) [inline, static]

enable timing of a given step

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

Parameters:
step the step to be timed
name the name by which the step should be identified in the time log

Definition at line 105 of file debug.h.

00106         { Internal::step_timer< Step >::s_timingName = name; Internal::step_timer< Step >::s_timing = true; }

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:
c the context to be examined

Definition at line 113 of file debug.h.

00114         { c.init_scheduler_statistics(); }


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

Generated on Tue Aug 31 15:30:28 2010 for CnC by  doxygen 1.5.6