SST  6.0.0
StructuralSimulationToolkit
SST::Introspector Class Reference

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

TimeConverterdefaultTimeBase
 Timebase used if no other timebase is specified for calls like Component::getCurrentSimTime(). More...
 

Detailed Description

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.

Member Enumeration Documentation

Types of boost MPI collective operations that introspector can perform.

Types of funciton objects for the reduce collective.

Constructor & Destructor Documentation

SST::Introspector::Introspector ( )

Constructor.

Generally only called by the factory class.

Parameters
idUnique introspector ID

References arrayvalue.

Member Function Documentation

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.

Parameters
ctypeTypes of collective communication. Currently supported options are Broadcast, (all)gather, and (all)reduce
invalueThe local value to be communicated
opTypes 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
rankThe 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.

virtual void SST::Introspector::finish ( )
inlinevirtual

Called after simulation completes, but before objects are destroyed.

A good place to print out statistics.

template<typename typeT >
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().

Parameters
cPointer to the component
datanameName 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().

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

Parameters
CompTypeComponent'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.

Parameters
timeThe simulation time when the introspectors will communicate among themselves
functorEvent 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.

Parameters
freqFrequency for the clock in SI units
handlerPointer to Clock::HandlerBase which is to be invoked at the specified interval
regAllShould 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().

virtual void SST::Introspector::setup ( )
inlinevirtual

Called after all components/introspectors have been constructed, but before simulation time has begun.

virtual bool SST::Introspector::triggeredUpdate ( )
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().

Field Documentation

uint64_t* SST::Introspector::arrayvalue

Data vector that holds data collected from all introspectors by Introspector::collectInt().

Referenced by collectInt(), and Introspector().

TimeConverter* SST::Introspector::defaultTimeBase
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().


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