SST
6.0.0
StructuralSimulationToolkit
|
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). More... | |
Public Member Functions | |
IntrospectedComponent (ComponentId_t id) | |
Constructor. More... | |
void | regPowerStats (Pdissipation_t pusage) |
Register/update power dissipation data in the central power database. More... | |
std::pair< bool, Pdissipation_t > | readPowerStats (Component *c) |
Read power dissipation data of this component from database. More... | |
void | registerIntrospector (std::string name) |
Add the pointer to a introspector to an internal list, MyIntroList. More... | |
void | registerMonitor (std::string dataName, IntrospectedComponent::MonitorBase *handler) |
Add the data to the map of monitors to specify which data to be monitored More... | |
std::pair< bool, IntrospectedComponent::MonitorBase * > | getMonitor (std::string dataname) |
Find monitor indicated by "dataname" from the map. More... | |
void | triggerUpdate () |
'Component-push' mechanism. More... | |
SimTime_t | getFreq () |
Get the period set by defaultTimeBase, which is usually set by Component::registerClock(). More... | |
bool | isTimeToPush (Cycle_t current, const char *name) |
Check if current is the time for the component to push/report data (e.g. More... | |
Public Member Functions inherited from SST::Component | |
Component (ComponentId_t id) | |
Constructor. More... | |
virtual void | emergencyShutdown (void) |
Called when SIGINT or SIGTERM has been seen. More... | |
ComponentId_t | getId () const |
Returns unique component ID. | |
const std::string & | getName () const |
Returns component Name. | |
virtual void | init (unsigned int phase) |
Component's type, set by the factory when the object is created. More... | |
virtual void | setup () |
Called after all components have been constructed and inialization has completed, but before simulation time has begun. More... | |
virtual void | finish () |
Called after simulation completes, but before objects are destroyed. More... | |
virtual bool | Status () |
Currently unused function. | |
virtual void | printStatus (Output &out) |
Called by the Simulation to request that the component print it's current status. More... | |
bool | isPortConnected (const std::string &name) const |
Determine if a port name is connected to any links. | |
Link * | configureLink (std::string name, TimeConverter *time_base, Event::HandlerBase *handler=NULL) |
Configure a Link. More... | |
Link * | configureLink (std::string name, std::string time_base, Event::HandlerBase *handler=NULL) |
Configure a Link. More... | |
Link * | configureLink (std::string name, Event::HandlerBase *handler=NULL) |
Configure a Link. More... | |
Link * | configureSelfLink (std::string name, TimeConverter *time_base, Event::HandlerBase *handler=NULL) |
Configure a SelfLink (Loopback link) More... | |
Link * | configureSelfLink (std::string name, std::string time_base, Event::HandlerBase *handler=NULL) |
Configure a SelfLink (Loopback link) More... | |
Link * | configureSelfLink (std::string name, Event::HandlerBase *handler=NULL) |
Configure a SelfLink (Loopback link) More... | |
TimeConverter * | registerClock (std::string freq, Clock::HandlerBase *handler, bool regAll=true) |
Registers a clock for this component. More... | |
TimeConverter * | registerClock (const UnitAlgebra &freq, Clock::HandlerBase *handler, bool regAll=true) |
void | unregisterClock (TimeConverter *tc, Clock::HandlerBase *handler) |
Removes a clock handler from the component. | |
Cycle_t | reregisterClock (TimeConverter *freq, Clock::HandlerBase *handler) |
Reactivates an existing Clock and Handler. More... | |
Cycle_t | getNextClockCycle (TimeConverter *freq) |
Returns the next Cycle that the TimeConverter would fire. | |
TimeConverter * | registerOneShot (std::string timeDelay, OneShot::HandlerBase *handler) |
Registers a OneShot event for this component. More... | |
TimeConverter * | registerOneShot (const UnitAlgebra &timeDelay, OneShot::HandlerBase *handler) |
TimeConverter * | registerTimeBase (std::string base, bool regAll=true) |
Registers a default time base for the component and optionally sets the the component's links to that timebase. More... | |
TimeConverter * | getTimeConverter (const std::string &base) |
TimeConverter * | getTimeConverter (const UnitAlgebra &base) |
SimTime_t | getCurrentSimTime (TimeConverter *tc) const |
return the time since the simulation began in units specified by the parameter. More... | |
SimTime_t | getCurrentSimTime () const |
return the time since the simulation began in the default timebase | |
SimTime_t | getCurrentSimTime (std::string base) |
return the time since the simulation began in timebase specified More... | |
SimTime_t | getCurrentSimTimeNano () const |
Utility function to return the time since the simulation began in nanoseconds. | |
SimTime_t | getCurrentSimTimeMicro () const |
Utility function to return the time since the simulation began in microseconds. | |
SimTime_t | getCurrentSimTimeMilli () const |
Utility function to return the time since the simulation began in milliseconds. | |
template<typename T > | |
Statistic< T > * | registerStatisticCore (std::string statName, std::string statSubId="") |
Registers a statistic. More... | |
template<typename T > | |
Statistic< T > * | registerStatistic (std::string statName, std::string statSubId="") |
template<typename T > | |
Statistic< T > * | registerStatistic (const char *statName, const char *statSubId="") |
bool | registerExit () |
Register that the simulation should not end until this component says it is OK to. More... | |
bool | unregisterExit () |
Indicate permission for the simulation to end. More... | |
void | registerAsPrimaryComponent () |
Register as a primary component, which allows the component to specifiy when it is and is not OK to end simulation. More... | |
void | primaryComponentDoNotEndSim () |
Tells the simulation that it should not exit. More... | |
void | primaryComponentOKToEndSim () |
Tells the simulation that it is now OK to end simulation. More... | |
Module * | loadModule (std::string type, Params ¶ms) |
Loads a module from an element Library. More... | |
Module * | loadModuleWithComponent (std::string type, Component *comp, Params ¶ms) |
Loads a module from an element Library. More... | |
SubComponent * | loadSubComponent (std::string type, Component *comp, Params ¶ms) |
Loads a SubComponent from an element Library. More... | |
Data Fields | |
std::list< Introspector * > | MyIntroList |
List of id of introspectors that monitor this component. More... | |
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. More... | |
Protected Attributes | |
MonitorMap_t | monitorMap |
Database of monitors (arbitrary data that a compopent wishes to be monitored) available through introspectedComponent::MonitorBase* getMonitor() | |
Protected Attributes inherited from SST::Component | |
TimeConverter * | defaultTimeBase |
Timebase used if no other timebase is specified for calls like Component::getCurrentSimTime(). More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from SST::Component | |
static bool | isPortValidForComponent (const std::string &comp_name, const std::string &port_name) |
Protected Member Functions inherited from SST::Component | |
void | setDefaultTimeBase (TimeConverter *tc) |
Manually set the default detaulTimeBase. | |
Link * | selfLink (std::string name, Event::HandlerBase *handler=NULL) |
Creates a new selfLink. | |
SharedRegion * | getLocalSharedRegion (const std::string &key, size_t size) |
Find a lookup table. | |
SharedRegion * | getGlobalSharedRegion (const std::string &key, size_t size, SharedRegionMerger *merger=NULL) |
Simulation * | getSimulation () const |
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 |
|
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().
|
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().