LAMA
tracing::TraceConfig Class Reference

This class is used to define/set the runtime configuration for tracing. More...

#include <TraceConfig.hpp>

Inheritance diagram for tracing::TraceConfig:

Public Member Functions

 ~TraceConfig ()
bool isEnabled ()
 Query if tracing is enabled.
bool isThreadEnabled (lama::Thread::Id threadId)
bool isVampirTraceEnabled ()
bool isTimeTraceEnabled ()
const char * getFilePrefix () const
RegionTablegetRegionTable ()
 Get region timings for the current thread.
void traceOff ()

Static Public Member Functions

static TraceConfiggetInstance ()
 Get reference to the actual trace configuration.
static boost::shared_ptr
< TraceConfig
getInstancePtr ()
 Get the actual trace configuration as a shared pointer.

Private Member Functions

 TraceConfig ()
void setParam (const std::string &param)
void setKey (const std::string &key, const std::string &value)
void enableVampirTrace (bool flag)
RegionTablegetRegionTable (lama::Thread::Id)
 LAMA_LOG_DECL_STATIC_LOGGER (logger)

Private Attributes

lama::Thread::Id mMaster
 id of mather thread
bool mEnabled
bool mTimeTraceEnabled
bool mVampirTraceEnabled
bool mThreadEnabled
 true if trace should also be done for threads
std::string mTraceFilePrefix
std::map< lama::Thread::Id,
boost::shared_ptr< RegionTable > > 
mRegionTables
 Each thread will have its own table for region timing.
lama::CommunicatorPtr mComm
 communicator used for distribution, parallel execution
lama::ContextPtr mCUDAContext
 hold CUDA context for CUDA tracing ( workaround for older VampirTrace libs )

Static Private Attributes

static boost::shared_ptr
< TraceConfig
config
 The only one instance allocated at program start.

Detailed Description

This class is used to define/set the runtime configuration for tracing.

This class is a singleton. The only one object holds member variables that specify the current settings for tracing, e.g. what kind of information is collected or whether it is enabled at all.

The singleton object will be allocated on demand after program start. A static object cannot be used as MPI or VampirTrace might be uninitialized.

The destructor of the trace configuration is used to write out the collected information at runtime, e.g. the collected time information of the regions.


Constructor & Destructor Documentation


Member Function Documentation

void tracing::TraceConfig::enableVampirTrace ( bool  flag) [private]

References LAMA_CONTEXT_ACCESS.

const char* tracing::TraceConfig::getFilePrefix ( ) const [inline]
static TraceConfig& tracing::TraceConfig::getInstance ( ) [inline, static]

Get reference to the actual trace configuration.

Returns:
the only instance of this class.

Referenced by tracing::TraceRegionRecord::spentLast().

boost::shared_ptr< TraceConfig > tracing::TraceConfig::getInstancePtr ( ) [static]

Get the actual trace configuration as a shared pointer.

Referenced by tracing::TraceRegionRecord::start(), tracing::TraceRegionRecord::stop(), and tracing::TraceRegionRecord::TraceRegionRecord().

Get region timings for the current thread.

Returns:
pointers to the RegionTable for the calling thread (might be NULL)

References lama::Thread::getSelf().

Referenced by tracing::TraceRegionRecord::spentLast().

Query if tracing is enabled.

void tracing::TraceConfig::setKey ( const std::string &  key,
const std::string &  value 
) [private]
void tracing::TraceConfig::setParam ( const std::string &  param) [private]

Field Documentation

boost::shared_ptr< TraceConfig > tracing::TraceConfig::config [static, private]

The only one instance allocated at program start.

communicator used for distribution, parallel execution

hold CUDA context for CUDA tracing ( workaround for older VampirTrace libs )

id of mather thread

std::map<lama::Thread::Id, boost::shared_ptr<RegionTable> > tracing::TraceConfig::mRegionTables [private]

Each thread will have its own table for region timing.

Use of shared pointer for entry in map

true if trace should also be done for threads


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