SST  6.1.0
StructuralSimulationToolkit
SST::IntrospectedComponent Class Reference

Main component object for the simulation. More...

#include <introspectedComponent.h>

Inheritance diagram for SST::IntrospectedComponent:
SST::Component

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_treadPowerStats (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.
 
LinkconfigureLink (std::string name, TimeConverter *time_base, Event::HandlerBase *handler=NULL)
 Configure a Link. More...
 
LinkconfigureLink (std::string name, std::string time_base, Event::HandlerBase *handler=NULL)
 Configure a Link. More...
 
LinkconfigureLink (std::string name, Event::HandlerBase *handler=NULL)
 Configure a Link. More...
 
LinkconfigureSelfLink (std::string name, TimeConverter *time_base, Event::HandlerBase *handler=NULL)
 Configure a SelfLink (Loopback link) More...
 
LinkconfigureSelfLink (std::string name, std::string time_base, Event::HandlerBase *handler=NULL)
 Configure a SelfLink (Loopback link) More...
 
LinkconfigureSelfLink (std::string name, Event::HandlerBase *handler=NULL)
 Configure a SelfLink (Loopback link) More...
 
TimeConverterregisterClock (std::string freq, Clock::HandlerBase *handler, bool regAll=true)
 Registers a clock for this component. More...
 
TimeConverterregisterClock (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.
 
TimeConverterregisterOneShot (std::string timeDelay, OneShot::HandlerBase *handler)
 Registers a OneShot event for this component. More...
 
TimeConverterregisterOneShot (const UnitAlgebra &timeDelay, OneShot::HandlerBase *handler)
 
TimeConverterregisterTimeBase (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...
 
TimeConvertergetTimeConverter (const std::string &base)
 
TimeConvertergetTimeConverter (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...
 
ModuleloadModule (std::string type, Params &params)
 Loads a module from an element Library. More...
 
ModuleloadModuleWithComponent (std::string type, Component *comp, Params &params)
 Loads a module from an element Library. More...
 
SubComponentloadSubComponent (std::string type, Component *comp, Params &params)
 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
TimeConverterdefaultTimeBase
 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.
 
LinkselfLink (std::string name, Event::HandlerBase *handler=NULL)
 Creates a new selfLink.
 
SharedRegiongetLocalSharedRegion (const std::string &key, size_t size)
 Find a lookup table.
 
SharedRegiongetGlobalSharedRegion (const std::string &key, size_t size, SharedRegionMerger *merger=NULL)
 
SimulationgetSimulation () const
 

Detailed Description

Main component object for the simulation.

All models inherit from this.

Member Typedef Documentation

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.

Parameters
dataIDID of the integer data
indexof 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.
dataIDID of the integer data
indexof the table (if the data structure is a table); default is set to 0

Constructor & Destructor Documentation

SST::IntrospectedComponent::IntrospectedComponent ( ComponentId_t  id)

Constructor.

Generally only called by the factory class.

Parameters
idUnique component ID
simPointer to the global simulation object

Member Function Documentation

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()

Parameters
datanamename 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.

Parameters
currentCurrent cycle from component's view
typeName 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.

Parameters
cPointer 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.

Parameters
nameName 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.

Parameters
dataNameDescription of the data
handlerPointer 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.

Parameters
pusageStructure 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().

Field Documentation

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().


The documentation for this class was generated from the following files: