timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::component::caliper_config Struct Reference

Component which provides Caliper cali::ConfigManager. More...

#include "timemory/components/caliper/components.hpp"

+ Collaboration diagram for tim::component::caliper_config:

Public Types

using value_type = void
 
using this_type = caliper_config
 
using base_type = base< this_type, value_type >
 
using value_type = void
 
using instance_tracker_t = policy::instance_tracker< caliper_config, false >
 
using arg_map_t = std::map< std::string, std::string >
 
using arg_vec_t = std::vector< std::string >
 
using storage_type = empty_storage
 

Public Member Functions

void start ()
 
void stop ()
 
void get () const
 

Static Public Member Functions

static std::string label ()
 
static std::string description ()
 
static std::string label ()
 
static std::string description ()
 
static auto & get_manager ()
 
static void configure (const arg_vec_t &_args, const arg_map_t &_kwargs={})
 
template<typename... Args>
static opaque get_opaque (Args &&...)
 

Detailed Description

Component which provides Caliper cali::ConfigManager.

Definition at line 81 of file components.hpp.

Member Typedef Documentation

◆ arg_map_t

using tim::component::caliper_config::arg_map_t = std::map<std::string, std::string>

Definition at line 159 of file timemory.hpp.

◆ arg_vec_t

using tim::component::caliper_config::arg_vec_t = std::vector<std::string>

Definition at line 160 of file timemory.hpp.

◆ base_type

◆ instance_tracker_t

◆ storage_type

Definition at line 66 of file declaration.hpp.

◆ this_type

◆ value_type [1/2]

Definition at line 83 of file components.hpp.

◆ value_type [2/2]

Definition at line 157 of file timemory.hpp.

Member Function Documentation

◆ configure()

static void tim::component::caliper_config::configure ( const arg_vec_t _args,
const arg_map_t _kwargs = {} 
)
inlinestatic

Definition at line 171 of file timemory.hpp.

171 {})
172 {
174 {
175 std::stringstream ss;
176 for(auto& itr : _args)
177 ss << "," << itr;
178 if(!ss.str().empty())
179 cmd = ss.str().substr(1);
180 }
181 {
182 std::stringstream ss;
183 for(auto& itr : _kwargs)
184 {
185 auto _arg = itr.second;
186 if(_arg.empty())
187 {
188 ss << "," << itr.first;
189 }
190 else
191 {
192 ss << "," << itr.first << "=(" << _arg << ")";
193 }
194 }
195 if(!ss.str().empty())
196 {
197 if(!cmd.empty())
198 cmd += ",";
199 cmd += ss.str().substr(1);
200 }
201 }
202 if(!cmd.empty())
203 {
205 std::cerr << "Configuring caliper with :: " << cmd << std::endl;
206 get_manager().add(cmd.c_str());
207 if(get_manager().error())
208 {
209 std::cerr << "Caliper config error: " << get_manager().error_msg()
210 << std::endl;
211 }
212 }
213 else
214 {
216 std::cerr << "Caliper was not configured" << std::endl;
217 }
218 }
std::array< char *, 4 > _args
tim::mpl::apply< std::string > string
Definition: macros.hpp:53

◆ description() [1/2]

static std::string tim::component::caliper_config::description ( )
inlinestatic

Definition at line 88 of file components.hpp.

88{ return "Caliper configuration manager"; }

◆ description() [2/2]

static std::string tim::component::caliper_config::description ( )
inlinestatic

Definition at line 163 of file timemory.hpp.

163{ return "Caliper configuration manager"; }

◆ get()

void tim::component::empty_base::get ( ) const
inlineinherited

Definition at line 69 of file declaration.hpp.

69{}

◆ get_manager()

static auto & tim::component::caliper_config::get_manager ( )
inlinestatic

Definition at line 165 of file timemory.hpp.

166 {
167 static cali::ConfigManager _instance;
168 return _instance;
169 }

Referenced by start(), and stop().

◆ get_opaque()

template<typename... Args>
static opaque tim::component::empty_base::get_opaque ( Args &&  ...)
inlinestaticinherited

Definition at line 72 of file declaration.hpp.

73 {
74 return opaque{};
75 }

◆ label() [1/2]

static std::string tim::component::caliper_config::label ( )
inlinestatic

Definition at line 87 of file components.hpp.

87{ return "caliper_config"; }

◆ label() [2/2]

static std::string tim::component::caliper_config::label ( )
inlinestatic

Definition at line 162 of file timemory.hpp.

162{ return "caliper_config"; }

◆ start()

void tim::component::caliper_config::start ( )
inline

Definition at line 273 of file timemory.hpp.

274 {
275 auto cnt = instance_tracker_t::start();
276 if(cnt == 0)
277 {
279 "Starting Caliper ConfigManager");
280 get_manager().start();
281 }
282 }
void start(TupleT< Tp... > &obj, Args &&... args)
Definition: functional.cpp:316
#define CONDITIONAL_PRINT_HERE(CONDITION,...)
Definition: macros.hpp:183

References CONDITIONAL_PRINT_HERE, tim::debug, get_manager(), and tim::invoke::start().

◆ stop()

void tim::component::caliper_config::stop ( )
inline

Definition at line 284 of file timemory.hpp.

285 {
286 auto cnt = instance_tracker_t::stop();
287 if(cnt == 0)
288 {
290 "Flushing Caliper ConfigManager");
291 get_manager().flush();
292 }
293 }
void stop(TupleT< Tp... > &obj, Args &&... args)
Definition: functional.cpp:386

References CONDITIONAL_PRINT_HERE, tim::debug, get_manager(), and tim::invoke::stop().


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