Main component object for the simulation. More...
#include <introspectedComponent.h>
Data Structures | |
class | MonitorBase |
class | MonitorFunction |
class | MonitorFunction< classT, returnT, void > |
class | MonitorPointer |
class | MonitorPointer< ptrT, void > |
Public Types | |
typedef std::map< std::string, IntrospectedComponent::MonitorBase * > | MonitorMap_t |
Return the value of the integer data indicated by "dataID" and "index" (if the data structure is a table). | |
Public Member Functions | |
IntrospectedComponent (ComponentId_t id) | |
Constructor. | |
void | regPowerStats (Pdissipation_t pusage) |
Register/update power dissipation data in the central power database. | |
std::pair< bool, Pdissipation_t > | readPowerStats (Component *c) |
Read power dissipation data of this component from database. | |
void | registerIntrospector (std::string name) |
Add the pointer to a introspector to an internal list, MyIntroList. | |
void | registerMonitor (std::string dataName, IntrospectedComponent::MonitorBase *handler) |
Add the data to the map of monitors to specify which data to be monitored | |
std::pair< bool, IntrospectedComponent::MonitorBase * > | getMonitor (std::string dataname) |
Find monitor indicated by "dataname" from the map. | |
void | triggerUpdate () |
'Component-push' mechanism. | |
SimTime_t | getFreq () |
Get the period set by defaultTimeBase, which is usually set by Component::registerClock(). | |
bool | isTimeToPush (Cycle_t current, const char *name) |
Check if current is the time for the component to push/report data (e.g. | |
Data Fields | |
std::list< Introspector * > | MyIntroList |
List of id of introspectors that monitor this component. | |
Static Public Attributes | |
static PowerDatabase | PDB |
Central power/energy database that stores power dissipation data (including current power, total energy, peak power, etc) of the components on the same rank. | |
Protected Attributes | |
MonitorMap_t | monitorMap |
Database of monitors (arbitrary data that a compopent wishes to be monitored) available through introspectedComponent::MonitorBase* getMonitor(). | |
Friends | |
class | boost::serialization::access |
Main component object for the simulation.
All models inherit from this.
typedef std::map<std::string, IntrospectedComponent::MonitorBase*> SST::IntrospectedComponent::MonitorMap_t |
Return the value of the integer data indicated by "dataID" and "index" (if the data structure is a table).
Each component type needs to implement its own getIntData. The function is usually called by introspector pull mechanism.
dataID | ID of the integer data | |
index | of the table (if the data structure is a table); default is set to 0 Return the value of the double data indicated by "dataID" and "index" (if the data structure is a table). Each component type needs to implement its own getDoubleData. The function is usually called by introspector pull mechanism. | |
dataID | ID of the integer data | |
index | of the table (if the data structure is a table); default is set to 0 |
SST::IntrospectedComponent::IntrospectedComponent | ( | ComponentId_t | id | ) |
Constructor.
Generally only called by the factory class.
id | Unique component ID | |
sim | Pointer to the global simulation object |
SimTime_t SST::IntrospectedComponent::getFreq | ( | ) | [inline] |
Get the period set by defaultTimeBase, which is usually set by Component::registerClock().
This can be used by clever components to ensure they only compute statistics data when needed. Returns the time between two handler function calls. (For introspectors, this means time between introspections.)
References SST::Component::defaultTimeBase, and SST::TimeConverter::getFactor().
Referenced by isTimeToPush().
std::pair< bool, IntrospectedComponent::MonitorBase * > SST::IntrospectedComponent::getMonitor | ( | std::string | dataname | ) |
Find monitor indicated by "dataname" from the map.
This is called in Introspector::getData()
dataname | name of the data |
References monitorMap.
Referenced by SST::Introspector::getData().
bool SST::IntrospectedComponent::isTimeToPush | ( | Cycle_t | current, | |
const char * | name | |||
) |
Check if current is the time for the component to push/report data (e.g.
power) by querying its introspector.
current | Current cycle from component's view | |
type | Name of the introspector that component queries about push frequency |
References getFreq(), SST::Simulation::getIntrospector(), and SST::Simulation::getSimulation().
std::pair< bool, Pdissipation_t > SST::IntrospectedComponent::readPowerStats | ( | Component * | c | ) |
Read power dissipation data of this component from database.
c | Pointer to the component that one whats to query power from the central power database |
References SST::Component::getId(), and PDB.
void SST::IntrospectedComponent::registerIntrospector | ( | std::string | name | ) |
Add the pointer to a introspector to an internal list, MyIntroList.
Indicates the introspector monitors the component.
name | Name of the introspector that monitors the component |
References SST::Simulation::getIntrospector(), SST::Simulation::getSimulation(), and MyIntroList.
void SST::IntrospectedComponent::registerMonitor | ( | std::string | dataName, | |
IntrospectedComponent::MonitorBase * | handler | |||
) |
Add the data to the map of monitors to specify which data to be monitored
The map, monitorMap, stores both the name and the handler of the data.
dataName | Description of the data | |
handler | Pointer to IntrospectedComponent::MonitorBase which is to be invoked in Introspector::getData() |
References monitorMap.
void SST::IntrospectedComponent::regPowerStats | ( | Pdissipation_t | pusage | ) |
Register/update power dissipation data in the central power database.
pusage | Structure that contains power dissipation data of a component |
References SST::Component::getId(), and PDB.
void SST::IntrospectedComponent::triggerUpdate | ( | ) |
'Component-push' mechanism.
Component asks its introspector(s) to pull data in.
References MyIntroList, and SST::Introspector::triggeredUpdate().
std::list<Introspector*> SST::IntrospectedComponent::MyIntroList |
List of id of introspectors that monitor this component.
Referenced by registerIntrospector(), and triggerUpdate().
PowerDatabase SST::IntrospectedComponent::PDB [static] |
Central power/energy database that stores power dissipation data (including current power, total energy, peak power, etc) of the components on the same rank.
Referenced by readPowerStats(), and regPowerStats().