The Gaudi Framework  master (594c33fa)
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 777 of file pfm_gen_analysis.cpp.

Constructor & Destructor Documentation

◆ S_module()

S_module::S_module ( )
inline

Definition at line 789 of file pfm_gen_analysis.cpp.

789 { clear(); }

Member Function Documentation

◆ add_sample()

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

Definition at line 817 of file pfm_gen_analysis.cpp.

817  {
818  samples[index] += value;
819  return;
820  }

◆ clear()

void S_module::clear ( )
inline

Definition at line 790 of file pfm_gen_analysis.cpp.

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

◆ get_arch()

std::string S_module::get_arch ( )
inline

Definition at line 815 of file pfm_gen_analysis.cpp.

815 { return arch; }

◆ get_c_mask()

unsigned int S_module::get_c_mask ( )
inline

Definition at line 814 of file pfm_gen_analysis.cpp.

814 { return cmask; }

◆ get_event()

std::string S_module::get_event ( )
inline

Definition at line 816 of file pfm_gen_analysis.cpp.

816 { return event; }

◆ get_inv_mask()

unsigned int S_module::get_inv_mask ( )
inline

Definition at line 813 of file pfm_gen_analysis.cpp.

813 { return inv; }

◆ get_max()

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

Definition at line 821 of file pfm_gen_analysis.cpp.

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

◆ get_module_name()

std::string S_module::get_module_name ( )
inline

Definition at line 830 of file pfm_gen_analysis.cpp.

830 { return module_name; }

◆ get_smpl_period()

unsigned int S_module::get_smpl_period ( )
inline

Definition at line 812 of file pfm_gen_analysis.cpp.

812 { return sp; }

◆ get_total_num_samples()

unsigned int S_module::get_total_num_samples ( )
inline

Definition at line 831 of file pfm_gen_analysis.cpp.

831 { 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 799 of file pfm_gen_analysis.cpp.

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

◆ set_total()

void S_module::set_total ( unsigned int  total)
inline

Definition at line 808 of file pfm_gen_analysis.cpp.

808  {
809  total_num_samples = total;
810  return;
811  }

Member Data Documentation

◆ arch

std::string S_module::arch
private

Definition at line 782 of file pfm_gen_analysis.cpp.

◆ cmask

unsigned int S_module::cmask
private

Definition at line 784 of file pfm_gen_analysis.cpp.

◆ event

std::string S_module::event
private

Definition at line 783 of file pfm_gen_analysis.cpp.

◆ inv

unsigned int S_module::inv
private

Definition at line 785 of file pfm_gen_analysis.cpp.

◆ module_name

std::string S_module::module_name
private

Definition at line 781 of file pfm_gen_analysis.cpp.

◆ samples

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

Definition at line 779 of file pfm_gen_analysis.cpp.

◆ sp

unsigned int S_module::sp
private

Definition at line 786 of file pfm_gen_analysis.cpp.

◆ total_num_samples

unsigned int S_module::total_num_samples
private

Definition at line 780 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:785
std::map::clear
T clear(T... args)
S_module::sp
unsigned int sp
Definition: pfm_gen_analysis.cpp:786
S_module::clear
void clear()
Definition: pfm_gen_analysis.cpp:790
S_module::module_name
std::string module_name
Definition: pfm_gen_analysis.cpp:781
std::map::erase
T erase(T... args)
S_module::samples
std::map< std::string, unsigned int > samples
Definition: pfm_gen_analysis.cpp:779
S_module::event
std::string event
Definition: pfm_gen_analysis.cpp:783
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:782
S_module::cmask
unsigned int cmask
Definition: pfm_gen_analysis.cpp:784
std::map::end
T end(T... args)
S_module::total_num_samples
unsigned int total_num_samples
Definition: pfm_gen_analysis.cpp:780
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