SST::Simulation Class Reference

Main control class for a SST Simulation. More...

#include <simulation.h>

Inheritance diagram for SST::Simulation:
SST::SimulationBase

Public Types

typedef std::map< SimTime_t,
Clock * > 
clockMap_t
typedef std::map< SimTime_t,
OneShot * > 
oneShotMap_t
typedef std::vector< std::string > statEnableList_t
typedef std::vector< ParamsstatParamsList_t
typedef std::map
< ComponentId_t,
statEnableList_t * > 
statEnableMap_t
typedef std::map
< ComponentId_t,
statParamsList_t * > 
statParamsMap_t

Public Member Functions

void printStatus (bool fullStatus)
 Causes the current status of the simulation to be printed to stderr.
int performWireUp (ConfigGraph &graph, int myRank, SimTime_t min_part)
 Converts a ConfigGraph graph into actual set of links and components.
void setStopAtCycle (Config *cfg)
 Set cycle count, which, if reached, will cause the simulation to halt.
void initialize ()
 Perform the init() phase of simulation.
void run ()
 Perform the setup() and run phases of the simulation.
OutputgetSimulationOutput ()
 Return the base simulation Output class instance.
Config::Mode_t getSimulationMode () const
 Get the run mode of the simulation (e.g.
SimTime_t getCurrentSimCycle () const
 Return the current simulation time as a cycle count.
SimTime_t getEndSimCycle () const
 Return the end simulation time as a cycle count.
int getCurrentPriority () const
 Return the current priority.
UnitAlgebra getElapsedSimTime () const
 Return the elapsed simulation time as a time.
UnitAlgebra getFinalSimTime () const
 Return the end simulation time as a time.
int getRank () const
 Get this instance's parallel rank.
int getNumRanks () const
 Get the number of parallel ranks in the simulation.
TimeConverterregisterClock (std::string freq, Clock::HandlerBase *handler)
 Register a handler to be called on a set frequency.
TimeConverterregisterClock (const UnitAlgebra &freq, Clock::HandlerBase *handler)
void unregisterClock (TimeConverter *tc, Clock::HandlerBase *handler)
 Remove a clock handler from the list of active clock handlers.
Cycle_t reregisterClock (TimeConverter *tc, Clock::HandlerBase *handler)
 Reactivate an existing clock and handler.
Cycle_t getNextClockCycle (TimeConverter *tc)
 Returns the next Cycle that the TImeConverter would fire.
TimeConverterregisterOneShot (std::string timeDelay, OneShot::HandlerBase *handler)
 Register a OneShot event to be called after a time delay Note: OneShot cannot be canceled, and will always callback after the timedelay.
TimeConverterregisterOneShot (const UnitAlgebra &timeDelay, OneShot::HandlerBase *handler)
void insertActivity (SimTime_t time, Activity *ev)
 Insert an activity to fire at a specified time.
ExitgetExit () const
 Return the exit event.
uint64_t getTimeVortexMaxDepth () const
uint64_t getTimeVortexCurrentDepth () const
uint64_t getSyncQueueDataSize () const
LinkMapgetComponentLinkMap (ComponentId_t id) const
 Return pointer to map of links for a given component id.
const std::vector< std::string > * getComponentAllowedPorts (std::string type)
 Get a list of allowed ports for a given component type.
const ComponentInfoMapgetComponentInfoMap (void)
 Returns reference to the Component Map.
ComponentgetComponent (const std::string &name) const
 Returns the component with a given name.
ComponentgetComponent (const ComponentId_t &id) const
 returns the component with the given ID
ComponentInfogetComponentInfo (const std::string &name) const
ComponentInfogetComponentInfo (const ComponentId_t &id) const
statEnableList_tgetComponentStatisticEnableList (const ComponentId_t &id) const
statParamsList_tgetComponentStatisticParamsList (const ComponentId_t &id) const
template<typename T >
Statistic< T > * CreateStatistic (Component *comp, std::string &type, std::string &statName, std::string &statSubId, Params &params)
IntrospectorgetIntrospector (const std::string &name) const
 Returns the Introspector with the given name.
void setOutputDirectory (std::string &outDir)
 Set the output directory for this simulation.
std::string & getOutputDirectory ()
 Returns the output directory of the simulation.
void requireEvent (std::string name)
 Signifies that an event type is required for this simulation Causes to Factory to verify that the required event type can be found.
SimTime_t getNextActivityTime ()
 Returns the time of the next item to be executed that is in the TImeVortex of the Simulation.
bool isWireUpFinished ()
 Returns true when the Wireup is finished.

Static Public Member Functions

static SimulationcreateSimulation (Config *config, int my_rank, int num_ranks)
 Create new simulation.
static SimulationgetSimulation ()
 Return a pointer to the singleton instance of the Simulation.
static void setSignal (int signal)
 Sets an internal flag for signaling the simulation.
static SharedRegionManagergetSharedRegionManager ()
 Returns the Simulation's SharedRegionManager.

Friends

class Link
class Action
class Output
class boost::serialization::access
template<class Archive >
void save_construct_data (Archive &ar, const Simulation *t, const unsigned int file_version)
template<class Archive >
void load_construct_data (Archive &ar, Simulation *t, const unsigned int file_version)

Detailed Description

Main control class for a SST Simulation.

Provides base features for managing the simulation


Member Typedef Documentation

typedef std::map<SimTime_t, Clock*> SST::Simulation::clockMap_t

Map of times to clocks

typedef std::map<SimTime_t, OneShot*> SST::Simulation::oneShotMap_t

Map of times to OneShots

typedef std::vector<std::string> SST::Simulation::statEnableList_t

List of Enabled Statistics

typedef std::map<ComponentId_t, statEnableList_t*> SST::Simulation::statEnableMap_t

Map of Statistics that are requested to be enabled for a component defined in configGraph

List of Enabled Statistics Parameters

typedef std::map<ComponentId_t, statParamsList_t*> SST::Simulation::statParamsMap_t

Map of Statistic Params for a component defined in configGraph


Member Function Documentation

Simulation * SST::Simulation::createSimulation ( Config config,
int  my_rank,
int  num_ranks 
) [static]

Create new simulation.

Parameters:
config - Configuration of the simulation
my_rank - Parallel Rank of this simulation object
num_ranks - How many Ranks are in the simulation
const std::vector< std::string > * SST::Simulation::getComponentAllowedPorts ( std::string  type  ) 

Get a list of allowed ports for a given component type.

Parameters:
type - Name of component in lib.name format
Returns:
Vector of allowed port names

References SST::SimulationBase::factory, and SST::Factory::GetComponentAllowedPorts().

const ComponentInfoMap& SST::Simulation::getComponentInfoMap ( void   )  [inline]

Returns reference to the Component Map.

Returns reference to the Component ID Map

Referenced by SST::Introspector::getModelsByType().

Cycle_t SST::Simulation::getNextClockCycle ( TimeConverter tc  ) 

Returns the next Cycle that the TImeConverter would fire.

References SST::Output::fatal(), SST::TimeConverter::getFactor(), and SST::Output::STDERR.

Referenced by SST::SubComponent::getNextClockCycle(), and SST::Component::getNextClockCycle().

std::string& SST::Simulation::getOutputDirectory (  )  [inline]

Returns the output directory of the simulation.

Returns:
Directory in which simulation outputs are placed
Config::Mode_t SST::Simulation::getSimulationMode (  )  const [inline]

Get the run mode of the simulation (e.g.

init, run, both etc)

void SST::Simulation::printStatus ( bool  fullStatus  ) 

Causes the current status of the simulation to be printed to stderr.

Parameters:
fullStatus - if true, call printStatus() on all components as well as print the base Simulation's status

References SST::Output::output(), SST::TimeVortex::print(), and SST::Output::STDERR.

Referenced by run().

void SST::Simulation::requireEvent ( std::string  name  ) 

Signifies that an event type is required for this simulation Causes to Factory to verify that the required event type can be found.

Parameters:
name fully qualified libraryName.EventName

References SST::SimulationBase::factory, and SST::Factory::RequireEvent().

Cycle_t SST::Simulation::reregisterClock ( TimeConverter tc,
Clock::HandlerBase handler 
)

Reactivate an existing clock and handler.

Returns:
time when handler will next fire

References SST::Output::fatal(), SST::TimeConverter::getFactor(), and SST::Output::STDERR.

Referenced by SST::Component::reregisterClock().

void SST::Simulation::run (  ) 
void SST::Simulation::setOutputDirectory ( std::string &  outDir  )  [inline]

Set the output directory for this simulation.

Parameters:
outDir Path of directory to place simulation outputs in
void SST::Simulation::setSignal ( int  signal  )  [static]

Sets an internal flag for signaling the simulation.

Used internally

void SST::Simulation::setStopAtCycle ( Config cfg  ) 

Set cycle count, which, if reached, will cause the simulation to halt.

References SST::TimeLord::getSimCycles(), SST::TimeVortex::insert(), SST::Config::stopAtCycle, and SST::SimulationBase::timeLord.


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

Generated on 14 Sep 2015 for SST by  doxygen 1.6.1