The Gaudi Framework  v39r1 (adb068b2)
S_module Class Reference
Collaboration diagram for S_module:

Public Member Functions

 S_module ()
 
void clear ()
 
void init (const char *name, const char *architecture, const char *event_name, unsigned int c_mask, unsigned int inv_mask, unsigned int smpl_period)
 
void set_total (unsigned int total)
 
unsigned int get_smpl_period ()
 
unsigned int get_inv_mask ()
 
unsigned int get_c_mask ()
 
std::string get_arch ()
 
std::string get_event ()
 
void add_sample (const char *index, unsigned int value)
 
bool get_max (char *index, unsigned int &value)
 
std::string get_module_name ()
 
unsigned int get_total_num_samples ()
 

Private Attributes

std::map< std::string, unsigned int > samples
 
unsigned int total_num_samples
 
std::string module_name
 
std::string arch
 
std::string event
 
unsigned int cmask
 
unsigned int inv
 
unsigned int sp
 

Detailed Description

Definition at line 775 of file pfm_gen_analysis.cpp.

Constructor & Destructor Documentation

◆ S_module()

S_module::S_module ( )
inline

Definition at line 787 of file pfm_gen_analysis.cpp.

787 { clear(); }

Member Function Documentation

◆ add_sample()

void S_module::add_sample ( const char *  index,
unsigned int  value 
)
inline

Definition at line 815 of file pfm_gen_analysis.cpp.

815  {
816  samples[index] += value;
817  return;
818  }

◆ clear()

void S_module::clear ( )
inline

Definition at line 788 of file pfm_gen_analysis.cpp.

788  {
789  samples.clear();
790  total_num_samples = 0;
791  sp = 0;
792  module_name = "";
793  cmask = 0;
794  inv = 0;
795  sp = 0;
796  }

◆ get_arch()

std::string S_module::get_arch ( )
inline

Definition at line 813 of file pfm_gen_analysis.cpp.

813 { return arch; }

◆ get_c_mask()

unsigned int S_module::get_c_mask ( )
inline

Definition at line 812 of file pfm_gen_analysis.cpp.

812 { return cmask; }

◆ get_event()

std::string S_module::get_event ( )
inline

Definition at line 814 of file pfm_gen_analysis.cpp.

814 { return event; }

◆ get_inv_mask()

unsigned int S_module::get_inv_mask ( )
inline

Definition at line 811 of file pfm_gen_analysis.cpp.

811 { return inv; }

◆ get_max()

bool S_module::get_max ( char *  index,
unsigned int &  value 
)
inline

Definition at line 819 of file pfm_gen_analysis.cpp.

819  {
820  auto max_pos = std::max_element( samples.begin(), samples.end(),
821  []( const auto& lhs, const auto& rhs ) { return lhs.second < rhs.second; } );
822  if ( max_pos == samples.end() ) return false;
823  strcpy( index, ( max_pos->first ).c_str() );
824  value = max_pos->second;
825  samples.erase( max_pos );
826  return true;
827  }

◆ get_module_name()

std::string S_module::get_module_name ( )
inline

Definition at line 828 of file pfm_gen_analysis.cpp.

828 { return module_name; }

◆ get_smpl_period()

unsigned int S_module::get_smpl_period ( )
inline

Definition at line 810 of file pfm_gen_analysis.cpp.

810 { return sp; }

◆ get_total_num_samples()

unsigned int S_module::get_total_num_samples ( )
inline

Definition at line 829 of file pfm_gen_analysis.cpp.

829 { return total_num_samples; }

◆ init()

void S_module::init ( const char *  name,
const char *  architecture,
const char *  event_name,
unsigned int  c_mask,
unsigned int  inv_mask,
unsigned int  smpl_period 
)
inline

Definition at line 797 of file pfm_gen_analysis.cpp.

798  {
799  module_name = name;
800  arch = architecture;
801  event = event_name;
802  cmask = c_mask;
803  inv = inv_mask;
804  sp = smpl_period;
805  }

◆ set_total()

void S_module::set_total ( unsigned int  total)
inline

Definition at line 806 of file pfm_gen_analysis.cpp.

806  {
807  total_num_samples = total;
808  return;
809  }

Member Data Documentation

◆ arch

std::string S_module::arch
private

Definition at line 780 of file pfm_gen_analysis.cpp.

◆ cmask

unsigned int S_module::cmask
private

Definition at line 782 of file pfm_gen_analysis.cpp.

◆ event

std::string S_module::event
private

Definition at line 781 of file pfm_gen_analysis.cpp.

◆ inv

unsigned int S_module::inv
private

Definition at line 783 of file pfm_gen_analysis.cpp.

◆ module_name

std::string S_module::module_name
private

Definition at line 779 of file pfm_gen_analysis.cpp.

◆ samples

std::map<std::string, unsigned int> S_module::samples
private

Definition at line 777 of file pfm_gen_analysis.cpp.

◆ sp

unsigned int S_module::sp
private

Definition at line 784 of file pfm_gen_analysis.cpp.

◆ total_num_samples

unsigned int S_module::total_num_samples
private

Definition at line 778 of file pfm_gen_analysis.cpp.


The documentation for this class was generated from the following file:
std::strcpy
T strcpy(T... args)
std::max_element
T max_element(T... args)
S_module::inv
unsigned int inv
Definition: pfm_gen_analysis.cpp:783
std::map::clear
T clear(T... args)
S_module::sp
unsigned int sp
Definition: pfm_gen_analysis.cpp:784
S_module::clear
void clear()
Definition: pfm_gen_analysis.cpp:788
S_module::module_name
std::string module_name
Definition: pfm_gen_analysis.cpp:779
std::map::erase
T erase(T... args)
S_module::samples
std::map< std::string, unsigned int > samples
Definition: pfm_gen_analysis.cpp:777
S_module::event
std::string event
Definition: pfm_gen_analysis.cpp:781
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
std::map::begin
T begin(T... args)
S_module::arch
std::string arch
Definition: pfm_gen_analysis.cpp:780
S_module::cmask
unsigned int cmask
Definition: pfm_gen_analysis.cpp:782
std::map::end
T end(T... args)
S_module::total_num_samples
unsigned int total_num_samples
Definition: pfm_gen_analysis.cpp:778
Gaudi::ParticleProperties::index
size_t index(const Gaudi::ParticleProperty *property, const Gaudi::Interfaces::IParticlePropertySvc *service)
helper utility for mapping of Gaudi::ParticleProperty object into non-negative integral sequential id...
Definition: IParticlePropertySvc.cpp:39