LAMA
|
This class is used to define/set the runtime configuration for tracing. More...
#include <TraceConfig.hpp>
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 |
RegionTable * | getRegionTable () |
Get region timings for the current thread. | |
void | traceOff () |
Static Public Member Functions | |
static TraceConfig & | getInstance () |
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 ¶m) |
void | setKey (const std::string &key, const std::string &value) |
void | enableVampirTrace (bool flag) |
RegionTable * | getRegionTable (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. |
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.
References tracing::RegionTable::printTimer().
tracing::TraceConfig::TraceConfig | ( | ) | [private] |
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.
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.
References lama::Thread::getSelf().
Referenced by tracing::TraceRegionRecord::spentLast().
RegionTable * tracing::TraceConfig::getRegionTable | ( | lama::Thread::Id | threadId | ) | [private] |
References tracing::mapMutex.
bool tracing::TraceConfig::isEnabled | ( | ) | [inline] |
Query if tracing is enabled.
bool tracing::TraceConfig::isThreadEnabled | ( | lama::Thread::Id | threadId | ) | [inline] |
bool tracing::TraceConfig::isTimeTraceEnabled | ( | ) | [inline] |
bool tracing::TraceConfig::isVampirTraceEnabled | ( | ) | [inline] |
tracing::TraceConfig::LAMA_LOG_DECL_STATIC_LOGGER | ( | logger | ) | [private] |
void tracing::TraceConfig::setKey | ( | const std::string & | key, |
const std::string & | value | ||
) | [private] |
void tracing::TraceConfig::setParam | ( | const std::string & | param | ) | [private] |
void tracing::TraceConfig::traceOff | ( | ) |
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 )
bool tracing::TraceConfig::mEnabled [private] |
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
bool tracing::TraceConfig::mThreadEnabled [private] |
true if trace should also be done for threads
bool tracing::TraceConfig::mTimeTraceEnabled [private] |
std::string tracing::TraceConfig::mTraceFilePrefix [private] |
bool tracing::TraceConfig::mVampirTraceEnabled [private] |