SST
6.1.0
StructuralSimulationToolkit
|
Main introspector object for the simulation. More...
#include <introspector.h>
Public Types | |
enum | collect_type { GATHER, ALLGATHER, BROADCAST, REDUCE, ALLREDUCE } |
Types of boost MPI collective operations that introspector can perform. More... | |
enum | mpi_operation { MINIMUM, MAXIMUM, SUM, NOT_APPLICABLE } |
Types of funciton objects for the reduce collective. More... | |
Public Member Functions | |
Introspector () | |
Constructor. More... | |
virtual void | setup () |
Called after all components/introspectors have been constructed, but before simulation time has begun. More... | |
virtual void | finish () |
Called after simulation completes, but before objects are destroyed. More... | |
std::list< IntrospectedComponent * > | getModelsByName (const std::string CompName) |
Get component of a certain type indicated by CompName on this rank. More... | |
std::list< IntrospectedComponent * > | getModelsByType (const std::string CompType) |
Get component of a certain type indicated by CompType on this rank. More... | |
template<typename typeT > | |
typeT | getData (IntrospectedComponent *c, std::string dataname) |
Query the components indicated by "c" to retrieve components' statistics & data. More... | |
virtual bool | triggeredUpdate () |
Introspector-writers will implement their own triggeredUpdate function. More... | |
void | collectInt (collect_type ctype, uint64_t invalue, mpi_operation op=NOT_APPLICABLE, int rank=0) |
Introspectors communicate among themselves with Boost MPI to exchange their integer data, invalue. More... | |
void | oneTimeCollect (SimTime_t time, Event::HandlerBase *functor) |
One time introspectors collective communication. More... | |
TimeConverter * | registerClock (std::string freq, Clock::HandlerBase *handler) |
Registers a clock for this component. More... | |
void | unregisterClock (TimeConverter *tc, Clock::HandlerBase *handler) |
SimTime_t | getFreq () |
Data Fields | |
std::list< IntrospectedComponent * > | MyCompList |
List of components that this introspector is monitoring. More... | |
uint64_t | minvalue |
Minimum value of the integer values collected from all introspectors by Introspector::collectInt(). More... | |
uint64_t | maxvalue |
Maximum value of the integer values collected from all introspectors by Introspector::collectInt(). More... | |
uint64_t | value |
Result value of the reduction operation in Introspector::collectInt(). More... | |
uint64_t * | arrayvalue |
Data vector that holds data collected from all introspectors by Introspector::collectInt(). More... | |
Protected Attributes | |
TimeConverter * | defaultTimeBase |
Timebase used if no other timebase is specified for calls like Component::getCurrentSimTime(). More... | |
Main introspector object for the simulation.
All models inherit from this. Introspection interface is a unified way to gather statistics and arbitrary data from components.
Types of boost MPI collective operations that introspector can perform.
Types of funciton objects for the reduce collective.
SST::Introspector::Introspector | ( | ) |
Constructor.
Generally only called by the factory class.
id | Unique introspector ID |
References arrayvalue.
void SST::Introspector::collectInt | ( | collect_type | ctype, |
uint64_t | invalue, | ||
mpi_operation | op = NOT_APPLICABLE , |
||
int | rank = 0 |
||
) |
Introspectors communicate among themselves with Boost MPI to exchange their integer data, invalue.
This function initiates a specific type of collective communicaiton indicated by ctype. The data are operated based on ctype and on the MPI operation, op. An introspector type can have periodic collective communication by calling this function in a member function registered with an event handler that is triggered by a clock.
ctype | Types of collective communication. Currently supported options are Broadcast, (all)gather, and (all)reduce |
invalue | The local value to be communicated |
op | Types of the MPI operations for the (all)reduce algorithm to combine the values. Currently supported options are summarize, minimum and maximum. Default is set to none |
rank | The rank where the introspector resides. Default is set to 0. If ctype is broadcast, rank here indicates the rank that will transmitting the value |
References arrayvalue, maxvalue, minvalue, and value.
|
inlinevirtual |
Called after simulation completes, but before objects are destroyed.
A good place to print out statistics.
typeT SST::Introspector::getData | ( | IntrospectedComponent * | c, |
std::string | dataname | ||
) |
Query the components indicated by "c" to retrieve components' statistics & data.
Return the value of the data indicated by "dataname". The function is usually called by introspector-pull mechanism in Introspector::triggeredUpdate().
c | Pointer to the component |
dataname | Name of the data |
References SST::IntrospectedComponent::getMonitor().
std::list< IntrospectedComponent * > SST::Introspector::getModelsByName | ( | const std::string | CompName | ) |
Get component of a certain type indicated by CompName on this rank.
Name is unique so the fuction actually returns a list with only one component. This function is usually used in Introspector::setup().
CompName | Component's name |
References SST::Simulation::getComponent(), SST::Simulation::getSimulation(), and MyCompList.
std::list< IntrospectedComponent * > SST::Introspector::getModelsByType | ( | const std::string | CompType | ) |
Get component of a certain type indicated by CompType on this rank.
If CompType is blank, a list of all local components is returned. This function is usually used in Introspector::setup().
CompType | Component's type |
References SST::Simulation::getComponentInfoMap(), SST::Simulation::getSimulation(), and MyCompList.
void SST::Introspector::oneTimeCollect | ( | SimTime_t | time, |
Event::HandlerBase * | functor | ||
) |
One time introspectors collective communication.
The event handling functors that calls a given member communication function is inserted into the queue and will be triggered at time specified by, time. The introspector-write implements their own communication function if they want something other than the basic collective operations, broadcast, (all)reduce and (all)gather.
time | The simulation time when the introspectors will communicate among themselves |
functor | Event handling functor that invokes member communication function |
References SST::Simulation::getSimulation(), and SST::Simulation::insertActivity().
TimeConverter * SST::Introspector::registerClock | ( | std::string | freq, |
Clock::HandlerBase * | handler | ||
) |
Registers a clock for this component.
freq | Frequency for the clock in SI units |
handler | Pointer to Clock::HandlerBase which is to be invoked at the specified interval |
regAll | Should this clock perioud be used as the default time base for all of the links connected to this component |
References defaultTimeBase, SST::Simulation::getSimulation(), and SST::Simulation::registerClock().
|
inlinevirtual |
Called after all components/introspectors have been constructed, but before simulation time has begun.
|
inlinevirtual |
Introspector-writers will implement their own triggeredUpdate function.
This function calls Introspector::getData() to retrieve components' data, and is a good place to manipulate the data (print to screen, MPI collective communication, etc).
Referenced by SST::IntrospectedComponent::triggerUpdate().
uint64_t* SST::Introspector::arrayvalue |
Data vector that holds data collected from all introspectors by Introspector::collectInt().
Referenced by collectInt(), and Introspector().
|
protected |
Timebase used if no other timebase is specified for calls like Component::getCurrentSimTime().
Often set by Component::registerClock() function
Referenced by registerClock().
uint64_t SST::Introspector::maxvalue |
Maximum value of the integer values collected from all introspectors by Introspector::collectInt().
Referenced by collectInt().
uint64_t SST::Introspector::minvalue |
Minimum value of the integer values collected from all introspectors by Introspector::collectInt().
Referenced by collectInt().
std::list<IntrospectedComponent*> SST::Introspector::MyCompList |
List of components that this introspector is monitoring.
Referenced by getModelsByName(), and getModelsByType().
uint64_t SST::Introspector::value |
Result value of the reduction operation in Introspector::collectInt().
Referenced by collectInt().