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::ompt_handle< Api > Struct Template Reference

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

+ Collaboration diagram for tim::component::ompt_handle< Api >:

Public Types

using api_type = Api
 
using this_type = ompt_handle< api_type >
 
using value_type = void
 
using base_type = base< this_type, value_type >
 
using storage_type = typename base_type::storage_type
 
using toolset_type = typename trait::ompt_handle< api_type >::type
 
using tracker_type = policy::instance_tracker< this_type >
 

Public Member Functions

void start ()
 
void stop ()
 
void set_prefix (const std::string &_prefix)
 
void get () const
 

Static Public Member Functions

static std::string label ()
 
static std::string description ()
 
static auto & get_initializer ()
 
static void configure ()
 
static void preinit ()
 
static void global_init ()
 
static void global_finalize ()
 
static std::string get_prefix ()
 
template<typename... Args>
static opaque get_opaque (Args &&...)
 

Detailed Description

template<typename Api>
struct tim::component::ompt_handle< Api >

Definition at line 58 of file components.hpp.

Member Typedef Documentation

◆ api_type

template<typename Api >
using tim::component::ompt_handle< Api >::api_type = Api

Definition at line 62 of file components.hpp.

◆ base_type

Definition at line 65 of file components.hpp.

◆ storage_type

template<typename Api >
using tim::component::ompt_handle< Api >::storage_type = typename base_type::storage_type

Definition at line 66 of file components.hpp.

◆ this_type

Definition at line 63 of file components.hpp.

◆ toolset_type

Definition at line 67 of file components.hpp.

◆ tracker_type

Definition at line 68 of file components.hpp.

◆ value_type

template<typename Api >
using tim::component::ompt_handle< Api >::value_type = void

Definition at line 64 of file components.hpp.

Member Function Documentation

◆ configure()

template<typename Api >
static void tim::component::ompt_handle< Api >::configure ( )
inlinestatic

Definition at line 84 of file components.hpp.

85 {
86 static int32_t _once = 0;
87 if(_once++ == 0)
89 }
static auto & get_initializer()
Definition: components.hpp:78

References tim::component::ompt_handle< Api >::get_initializer().

Referenced by tim::component::ompt_handle< Api >::global_init().

◆ description()

template<typename Api >
static std::string tim::component::ompt_handle< Api >::description ( )
inlinestatic

Definition at line 71 of file components.hpp.

72 {
73 return std::string(
74 "Control switch for enabling/disabling OpenMP tools defined by the ") +
75 demangle<api_type>() + " tag";
76 }
tim::mpl::apply< std::string > string
Definition: macros.hpp:53

◆ get()

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

Definition at line 69 of file declaration.hpp.

69{}

◆ get_initializer()

template<typename Api >
static auto & tim::component::ompt_handle< Api >::get_initializer ( )
inlinestatic

Definition at line 78 of file components.hpp.

79 {
80 static std::function<void()> _instance = []() {};
81 return _instance;
82 }

Referenced by tim::component::ompt_handle< Api >::configure().

◆ 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 }

◆ get_prefix()

template<typename Api >
static std::string tim::component::ompt_handle< Api >::get_prefix ( )
inlinestatic

Definition at line 137 of file components.hpp.

138 {
139 tim::auto_lock_t lk(get_persistent_data().m_mutex);
140 return get_persistent_data().m_prefix;
141 }
std::unique_lock< mutex_t > auto_lock_t
Unique lock type around mutex_t.
Definition: locking.hpp:42

◆ global_finalize()

template<typename Api >
static void tim::component::ompt_handle< Api >::global_finalize ( )
inlinestatic

Definition at line 105 of file components.hpp.

static bool set(bool val, enable_if_t< is_available< U >::value &&get_value< U >(), int >=0)
SET specialization if component is available.

References tim::trait::runtime_enabled< T >::set().

◆ global_init()

template<typename Api >
static void tim::component::ompt_handle< Api >::global_init ( )
inlinestatic

Definition at line 98 of file components.hpp.

99 {
100 // if handle gets initialized (i.e. used), it indicates we want to disable
102 configure();
103 }

References tim::component::ompt_handle< Api >::configure(), and tim::trait::runtime_enabled< T >::set().

◆ label()

template<typename Api >
static std::string tim::component::ompt_handle< Api >::label ( )
inlinestatic

Definition at line 70 of file components.hpp.

70{ return "ompt_handle"; }

◆ preinit()

template<typename Api >
static void tim::component::ompt_handle< Api >::preinit ( )
inlinestatic

Definition at line 91 of file components.hpp.

92 {
93 static thread_local auto _data_tracker =
94 tim::storage_initializer::get<ompt_data_tracker<api_type>>();
95 consume_parameters(_data_tracker);
96 }
void consume_parameters(ArgsT &&...)
Definition: types.hpp:285

References tim::consume_parameters().

◆ set_prefix()

template<typename Api >
void tim::component::ompt_handle< Api >::set_prefix ( const std::string &  _prefix)
inline

Definition at line 129 of file components.hpp.

130 {
131 if(_prefix.empty())
132 return;
133 tim::auto_lock_t lk(get_persistent_data().m_mutex);
134 get_persistent_data().m_prefix = _prefix + "/";
135 }
char const std::string & _prefix
Definition: config.cpp:55

References tim::_prefix.

◆ start()

template<typename Api >
void tim::component::ompt_handle< Api >::start ( )
inline

Definition at line 107 of file components.hpp.

108 {
109#if defined(TIMEMORY_USE_OMPT)
111 if(m_tot == 0)
113#endif
114 }
void start(TupleT< Tp... > &obj, Args &&... args)
Definition: functional.cpp:316

References tim::trait::runtime_enabled< T >::set(), and tim::invoke::start().

◆ stop()

template<typename Api >
void tim::component::ompt_handle< Api >::stop ( )
inline

Definition at line 116 of file components.hpp.

117 {
118#if defined(TIMEMORY_USE_OMPT)
120 if(m_tot == 0)
122#endif
123 }
void stop(TupleT< Tp... > &obj, Args &&... args)
Definition: functional.cpp:386

References tim::trait::runtime_enabled< T >::set(), and tim::invoke::stop().


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