|
SST 16.0.0
Structural Simulation Toolkit
|
Main component object for the simulation. More...
#include <baseComponent.h>
Public Member Functions | |
| BaseComponent (ComponentId_t id) | |
| BaseComponent (const BaseComponent &)=delete | |
| BaseComponent & | operator= (const BaseComponent &)=delete |
| const std::string & | getType () const |
| Gets the ELI type for this BaseComponent. | |
| ComponentId_t | getId () const |
| Get the unique component ID. | |
| uint8_t | getStatisticLoadLevel () const |
| Get the BaseComponent Statistic load level. | |
| virtual void | emergencyShutdown () |
| Called when SIGINT or SIGTERM has been seen. | |
| const std::string & | getName () const |
| Get the name of the BaseComponent. | |
| const std::string & | getParentComponentName () const |
| Get the name of the parent Component for the Component tree. | |
| virtual void | init (unsigned int UNUSED(phase)) |
| Used during the init phase. | |
| virtual void | complete (unsigned int UNUSED(phase)) |
| Used during the complete phase after the end of simulation. | |
| virtual void | setup () |
| Called after all components have been constructed and initialization has completed, but before simulation time has begun. | |
| virtual void | finish () |
| Called after complete phase, but before objects are destroyed. | |
| virtual bool | Status () |
| Currently unused function. | |
| virtual void | printStatus (Output &UNUSED(out)) |
| Called by the Simulation to request that the component print its current status. | |
| UnitAlgebra | getCoreTimeBase () const |
| Get the core timebase. | |
| SimTime_t | getCurrentSimCycle () const |
| Get the current simulation time as a cycle count. | |
| int | getCurrentPriority () const |
| Get the current priority. | |
| UnitAlgebra | getElapsedSimTime () const |
| get the elapsed simulation time as a UnitAlgebra | |
| SimTime_t | getEndSimCycle () const |
| Get the end simulation time as a cycle count. | |
| UnitAlgebra | getEndSimTime () const |
| Get the end simulation time as a UnitAlgebra. | |
| RankInfo | getRank () const |
| Get this instance's parallel rank. | |
| RankInfo | getNumRanks () const |
| Get the number of parallel ranks in the simulation. | |
| SimTime_t | getCurrentSimTime () const |
| Return the simulated time since the simulation began in the default timebase. | |
| SimTime_t | getCurrentSimTime (TimeConverter base) const |
| Get the simulated time since the simulation began in units specified by the parameter. | |
| SimTime_t | getCurrentSimTime (const std::string &base) const |
| Return the simulated time since the simulation began in the specified timebase. | |
| SimTime_t | getCurrentSimTime (const char *base) const |
| Return the simulated time since the simulation began in the specified timebase. | |
| 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. | |
| double | getRunPhaseElapsedRealTime () const |
| Get the amount of real-time spent executing the run phase of the simulation. | |
| double | getInitPhaseElapsedRealTime () const |
| Get the amount of real-time spent executing the init phase of the simulation. | |
| double | getCompletePhaseElapsedRealTime () const |
| Get the amount of real-time spent executing the complete phase of the simulation. | |
| void | addWatchPoint (WatchPoint *pt) |
| Add a watch point to all handlers in the Component Tree. | |
| void | removeWatchPoint (WatchPoint *pt) |
| Remove a watch point from all handlers in the Component Tree. | |
| SubComponentSlotInfo * | getSubComponentSlotInfo (const std::string &name, bool fatalOnEmptyIndex=false) |
| const std::vector< double > & | getCoordinates () const |
| Retrieve the X,Y,Z coordinates of this component. | |
| Public Member Functions inherited from SST::Core::Serialization::serializable_base | |
| virtual const char * | cls_name () const =0 |
| virtual void | serialize_order (serializer &ser)=0 |
| virtual uint32_t | cls_id () const =0 |
| virtual std::string | serialization_name () const =0 |
Static Public Member Functions | |
| static Output & | getSimulationOutput () |
| Get the default simulation Output class instance. | |
Protected Types | |
| using | StatCreateFunction |
| Protected Types inherited from SST::Core::Serialization::serializable_base | |
| enum | cxn_flag_t { ConstructorFlag } |
Protected Member Functions | |
| bool | isSimulationRunModeInit () const |
| Check to see if the run mode was set to INIT. | |
| bool | isSimulationRunModeRun () const |
| Check to see if the run mode was set to RUN. | |
| bool | isSimulationRunModeBoth () const |
| Check to see if the run mode was set to BOTH. | |
| std::string & | getOutputDirectory () const |
| Returns the output directory of the simulation. | |
| void | requireLibrary (const std::string &name) |
| Signifies that a library is required for this simulation. | |
| bool | isPortConnected (const std::string &name) const |
| Determine if a port name is connected to any links. | |
| Link * | configureLink (const std::string &name, TimeConverter timebase, Event::HandlerBase *handler=nullptr) |
| Configure a Link. | |
| Link * | configureLink (const std::string &name, Event::HandlerBase *handler=nullptr) |
| Configure a Link. | |
| Link * | configureSelfLink (const std::string &name, TimeConverter timebase, Event::HandlerBase *handler=nullptr) |
| Configure a SelfLink (Loopback link). | |
| Link * | configureSelfLink (const std::string &name, Event::HandlerBase *handler=nullptr) |
| Configure a SelfLink (Loopback link) that uses the (Sub)Component's defaultTimeBase. | |
| TimeConverter | registerClock (TimeConverter tc, Clock::HandlerBase *handler, bool reg_all=true) |
| Registers a clock for this component. | |
| 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. | |
| Cycle_t | getNextClockCycle (TimeConverter freq) |
| Returns the next Cycle that the TimeConverter would fire. | |
| TimeConverter | registerTimeBase (const std::string &base, bool reg_all=true) |
| Registers a default timebase for the component and optionally sets the the component's links to that timebase. | |
| TimeConverter | getTimeConverter (const std::string &base) const |
| TimeConverter | getTimeConverter (const UnitAlgebra &base) const |
| bool | isStatisticShared (const std::string &stat_name, bool include_me=false) |
| void | initiateInteractive (const std::string &msg) |
| Tell the simulation object to initiate interactive mode (if currently turned on). | |
| template<typename T> | |
| Statistics::Statistic< T > * | registerStatistic (SST::Params ¶ms, const std::string &stat_name, const std::string &stat_sub_id="") |
| Registers a statistic. | |
| template<typename T> | |
| Statistics::Statistic< T > * | registerStatistic (const std::string &stat_name, const std::string &stat_sub_id="") |
| template<typename... Args> | |
| Statistics::Statistic< std::tuple< Args... > > * | registerMultiStatistic (const std::string &stat_name, const std::string &stat_sub_id="") |
| template<typename... Args> | |
| Statistics::Statistic< std::tuple< Args... > > * | registerMultiStatistic (SST::Params ¶ms, const std::string &stat_name, const std::string &stat_sub_id="") |
| template<typename T> | |
| Statistics::Statistic< T > * | registerStatistic (const char *stat_name, const char *stat_sub_id="") |
| void | performStatisticOutput (Statistics::StatisticBase *stat) |
| Called by the Components and Subcomponent to perform a statistic Output. | |
| void | performGlobalStatisticOutput () |
| Performs a global statistic Output. | |
| template<typename T> | |
| T::ProfilePoint * | registerProfilePoint (const std::string &point_name) |
| Registers a profiling point. | |
| template<class T, class... ARGS> | |
| T * | loadModule (const std::string &type, Params ¶ms, ARGS... args) |
| Loads a module from an element Library. | |
| template<class T, class... ARGS> | |
| T * | loadComponentExtension (ARGS... args) |
| template<class T> | |
| bool | isSubComponentLoadableUsingAPI (const std::string &type) |
| Check to see if a given element type is loadable with a particular API. | |
| template<class T> | |
| bool | isUserSubComponentLoadableUsingAPI (const std::string &slot_name) |
| Check to see if the element type loaded by the user into the. | |
| template<class T, class... ARGS> | |
| T * | loadAnonymousSubComponent (const std::string &type, const std::string &slot_name, int slot_num, uint64_t share_flags, Params ¶ms, ARGS... args) |
| Loads an anonymous subcomponent (not defined in input file to SST run). | |
| template<class T> | |
| T * | loadUserSubComponent (const std::string &slot_name) |
| Loads a user defined subcomponent (defined in input file to SST run). | |
| template<class T, class... ARGS> | |
| T * | loadUserSubComponent (const std::string &slot_name, uint64_t share_flags, ARGS... args) |
| Loads a user defined subcomponent (defined in input file to SST run). | |
| void | fatal (uint32_t line, const char *file, const char *func, int exit_code, const char *format,...) const |
| Convenience function for reporting fatal conditions. | |
| void | sst_assert (bool condition, uint32_t line, const char *file, const char *func, int exit_code, const char *format,...) const |
| Convenience function for testing for and reporting fatal conditions. | |
| bool | isAnonymous () |
| bool | isUser () |
| void | setDefaultTimeBase (TimeConverter tc) |
| Manually set the default defaultTimeBase. | |
| TimeConverter | getDefaultTimeBase () |
| const TimeConverter | getDefaultTimeBase () const |
| bool | doesSubComponentExist (const std::string &type) |
| uint8_t | getStatisticValidityAndLevel (const std::string &statisticName) const |
| std::vector< Profile::ComponentProfileTool * > | getComponentProfileTools (const std::string &point) |
| void | registerAsPrimaryComponent () |
| Register as a primary component, which allows the component to specify when it is and is not OK to end simulation. | |
| void | primaryComponentDoNotEndSim () |
| Tells the simulation that it should not exit. | |
| void | primaryComponentOKToEndSim () |
| Tells the simulation that it is now OK to end simulation. | |
Additional Inherited Members | |
| Static Public Attributes inherited from SST::Core::Serialization::serializable_base | |
| static constexpr uint32_t | NullClsId = std::numeric_limits<uint32_t>::max() |
| Static Protected Member Functions inherited from SST::Core::Serialization::serializable_base | |
| static void | serializable_abort (uint32_t line, const char *file, const char *func, const char *obj) |
Main component object for the simulation.
|
protected |
|
inlinevirtual |
Used during the complete phase after the end of simulation.
The method will be called each phase of complete. Complete phase ends when no components have sent any data.
| phase | Current phase number |
Reimplemented in SST::CoreTestOverhead::OverheadMeasure, and SST::Interfaces::SimpleNetwork.
|
protected |
Configure a Link.
| name | Port Name on which the link to configure is attached. |
| handler | Optional Handler to be called when an Event is received |
References configureLink().
|
inlineprotected |
Configure a Link.
| name | Port Name on which the link to configure is attached. |
| timebase | Timebase of the link provided as either a std::string, SST::UnitAlgebra, or SST::TimeConverter |
| handler | Optional Handler to be called when an Event is received |
References SST::TimeConverter::getFactor().
Referenced by configureLink(), configureSelfLink(), and configureSelfLink().
|
protected |
Configure a SelfLink (Loopback link) that uses the (Sub)Component's defaultTimeBase.
| name | Name of the self-link port |
| handler | Optional Handler to be called when an Event is received |
References configureLink(), and configureSelfLink().
|
inlineprotected |
Configure a SelfLink (Loopback link).
| name | Name of the self-link port |
| timebase | Timebase of the link. Timebase can be a std::string, SST::UnitAlgebra or SST::TimeConverter |
| handler | Optional Handler to be called when an Event is received |
References configureLink().
Referenced by configureSelfLink().
|
inlinevirtual |
Called when SIGINT or SIGTERM has been seen.
Allows components opportunity to clean up external state.
Reimplemented in SST::CoreTestCheckpoint::coreTestCheckpoint.
|
protected |
Convenience function for reporting fatal conditions.
The function will create a new Output object and call fatal() using the supplied parameters. Before calling Output::fatal(), the function will also print other information about the (sub)component that called fatal and about the simulation state.
From Output::fatal: Message will be sent to the output location and to stderr. The output will be prepended with the expanded prefix set in the object.
NOTE: fatal() will call MPI_Abort(exit_code) to terminate simulation.
| line | Line number of calling function (use CALL_INFO macro) |
| file | File name calling function (use CALL_INFO macro) |
| func | Function name calling function (use CALL_INFO macro) |
| exit_code | The exit code used for termination of simulation. will be passed to MPI_Abort() |
| format | Format string. All valid formats for printf are available. |
| ... | Arguments for format. |
References fatal().
Referenced by fatal(), SST::CoreTestMemPoolTest::MemPoolTestComponent::finish(), and registerProfilePoint().
|
inlinevirtual |
Called after complete phase, but before objects are destroyed.
A good place to print out statistics.
Reimplemented in SST::CoreTest::MessageMesh::EnclosingComponent, SST::CoreTestCheckpoint::coreTestCheckpoint, SST::CoreTestClockerComponent::coreTestClockerComponent, SST::CoreTestComponent::coreTestComponent, SST::CoreTestComponent::coreTestComponentExtMain, SST::CoreTestComponent::coreTestLinks, SST::CoreTestDistribComponent::coreTestDistribComponent, SST::CoreTestLookupTableComponent::coreTestLookupTableComponent, SST::CoreTestMemPoolTest::MemPoolTestComponent, SST::CoreTestMessageGeneratorComponent::coreTestMessageGeneratorComponent, SST::CoreTestModule::coreTestModuleLoader, SST::CoreTestOverhead::OverheadMeasure, SST::CoreTestParamComponent::coreTestParamComponent, SST::CoreTestPerfComponent::coreTestPerfComponent, SST::CoreTestRNGComponent::coreTestRNGComponent, SST::CoreTestSharedObjectsComponent::coreTestSharedObjectsComponent, SST::CoreTestStatisticsComponent::StatisticsComponentFloat, SST::CoreTestStatisticsComponent::StatisticsComponentInt, SST::Interfaces::SimpleNetwork, and SST::SubComponent.
| double SST::BaseComponent::getCompletePhaseElapsedRealTime | ( | ) | const |
Get the amount of real-time spent executing the complete phase of the simulation.
References getCompletePhaseElapsedRealTime().
Referenced by getCompletePhaseElapsedRealTime().
| UnitAlgebra SST::BaseComponent::getCoreTimeBase | ( | ) | const |
Get the core timebase.
References getCoreTimeBase().
Referenced by getCoreTimeBase().
| int SST::BaseComponent::getCurrentPriority | ( | ) | const |
Get the current priority.
References getCurrentPriority().
Referenced by getCurrentPriority().
| SimTime_t SST::BaseComponent::getCurrentSimCycle | ( | ) | const |
Get the current simulation time as a cycle count.
References getCurrentSimCycle().
Referenced by getCurrentSimCycle().
|
inline |
Return the simulated time since the simulation began in the default timebase.
References getCurrentSimTime().
Referenced by getCurrentSimTime(), getCurrentSimTime(), getCurrentSimTime(), getCurrentSimTimeMicro(), getCurrentSimTimeMilli(), and getCurrentSimTimeNano().
|
inline |
Return the simulated time since the simulation began in the specified timebase.
NOTE: This version of getCurrentSimTime() exists because both std::string and TimeConverter can be implicitly created with a const char*. Having this implementation removes ambiguity and ensures that a const char* is passed through the std::string version, which can accept timebases that are not representable with TimeConverter due to being smaller than the global timebase.
| base | Timebase frequency in SI Units |
References getCurrentSimTime().
Referenced by getCurrentSimTime().
| SimTime_t SST::BaseComponent::getCurrentSimTime | ( | const std::string & | base | ) | const |
Return the simulated time since the simulation began in the specified timebase.
NOTE: This version of getCurrentSimTime() can accept a timebase that is not normally representable because it is smaller than the global timebase set by the user. If this happens, the underlying code will use UnitAlgebra to compute the cycle count. Because UnitAlgebra is computationally intense, it is best to avoid this case during the run loop of the simulation.
| base | Timebase frequency in SI Units |
References getCurrentSimTime(), and SST::Simulation::getTimeLord().
| SimTime_t SST::BaseComponent::getCurrentSimTime | ( | TimeConverter | base | ) | const |
Get the simulated time since the simulation began in units specified by the parameter.
| tc | TimeConverter specifying the units |
References SST::TimeConverter::convertFromCoreTime(), and getCurrentSimTime().
| SimTime_t SST::BaseComponent::getCurrentSimTimeMicro | ( | ) | const |
Utility function to return the time since the simulation began in microseconds.
References SST::TimeConverter::convertFromCoreTime(), getCurrentSimTime(), getCurrentSimTimeMicro(), SST::TimeConverter::getFactor(), and SST::Simulation::getTimeLord().
Referenced by getCurrentSimTimeMicro().
| SimTime_t SST::BaseComponent::getCurrentSimTimeMilli | ( | ) | const |
Utility function to return the time since the simulation began in milliseconds.
References SST::TimeConverter::convertFromCoreTime(), getCurrentSimTime(), getCurrentSimTimeMilli(), SST::TimeConverter::getFactor(), and SST::Simulation::getTimeLord().
Referenced by SST::CoreTestMessageGeneratorComponent::coreTestMessageGeneratorComponent::finish(), and getCurrentSimTimeMilli().
| SimTime_t SST::BaseComponent::getCurrentSimTimeNano | ( | ) | const |
Utility function to return the time since the simulation began in nanoseconds.
References SST::TimeConverter::convertFromCoreTime(), getCurrentSimTime(), getCurrentSimTimeNano(), SST::TimeConverter::getFactor(), and SST::Simulation::getTimeLord().
Referenced by getCurrentSimTimeNano().
| UnitAlgebra SST::BaseComponent::getElapsedSimTime | ( | ) | const |
get the elapsed simulation time as a UnitAlgebra
References getElapsedSimTime().
Referenced by getElapsedSimTime().
| SimTime_t SST::BaseComponent::getEndSimCycle | ( | ) | const |
Get the end simulation time as a cycle count.
References getEndSimCycle().
Referenced by getEndSimCycle().
| UnitAlgebra SST::BaseComponent::getEndSimTime | ( | ) | const |
Get the end simulation time as a UnitAlgebra.
References getEndSimTime().
Referenced by getEndSimTime().
|
inline |
| double SST::BaseComponent::getInitPhaseElapsedRealTime | ( | ) | const |
Get the amount of real-time spent executing the init phase of the simulation.
References getInitPhaseElapsedRealTime().
Referenced by getInitPhaseElapsedRealTime().
|
inline |
Get the name of the BaseComponent.
Referenced by SST::Simulation::checkpoint_append_registry(), SST::CoreTestCheckpoint::coreTestCheckpoint::emergencyShutdown(), SST::CoreTestCheckpoint::coreTestCheckpoint::finish(), primaryComponentDoNotEndSim(), primaryComponentOKToEndSim(), registerAsPrimaryComponent(), registerProfilePoint(), and SST::CoreTestCheckpoint::coreTestCheckpoint::setup().
|
protected |
Returns the next Cycle that the TimeConverter would fire.
If called prior to the simulation run loop, next Cycle is 0. If called after the simulation run loop completes (e.g., during complete() or finish()), next Cycle is one past the end time of the simulation. See Note in reregisterClock() for additional guidance when calling this function after simulation ends.
| freq | Frequency of the clock |
References getNextClockCycle().
Referenced by getNextClockCycle().
| RankInfo SST::BaseComponent::getNumRanks | ( | ) | const |
Get the number of parallel ranks in the simulation.
References getNumRanks().
Referenced by getNumRanks().
|
protected |
Returns the output directory of the simulation.
References getOutputDirectory().
Referenced by getOutputDirectory().
|
inline |
| RankInfo SST::BaseComponent::getRank | ( | ) | const |
| double SST::BaseComponent::getRunPhaseElapsedRealTime | ( | ) | const |
Get the amount of real-time spent executing the run phase of the simulation.
References getRunPhaseElapsedRealTime().
Referenced by SST::CoreTestMemPoolTest::MemPoolTestComponent::finish(), and getRunPhaseElapsedRealTime().
|
static |
Get the default simulation Output class instance.
Elements do not have to use this Output object and can create their own to use instead.
References getSimulationOutput(), and SST::Simulation::getSimulationOutput().
Referenced by SST::CoreTestMemPoolTest::MemPoolTestComponent::finish(), and getSimulationOutput().
|
inline |
Get the BaseComponent Statistic load level.
|
inline |
Gets the ELI type for this BaseComponent.
Referenced by registerProfilePoint().
|
inlinevirtual |
Used during the init phase.
The method will be called each phase of initialization. Initialization ends when no components have sent any data.
| phase | Current phase number |
Reimplemented in SST::CoreTestOverhead::OverheadMeasure, SST::Interfaces::SimpleNetwork, and SST::SubComponent.
|
protected |
Tell the simulation object to initiate interactive mode (if currently turned on).
| msg | Message to print when interactive mode is entered |
References initiateInteractive().
Referenced by initiateInteractive().
|
protected |
Determine if a port name is connected to any links.
| name | Name of the port |
References isPortConnected().
Referenced by isPortConnected().
|
protected |
Check to see if the run mode was set to BOTH.
References isSimulationRunModeBoth().
Referenced by isSimulationRunModeBoth().
|
protected |
Check to see if the run mode was set to INIT.
References isSimulationRunModeInit().
Referenced by isSimulationRunModeInit().
|
protected |
Check to see if the run mode was set to RUN.
References isSimulationRunModeRun().
Referenced by isSimulationRunModeRun().
|
inlineprotected |
Check to see if a given element type is loadable with a particular API.
| name | Name of element to check in lib.name format |
Referenced by loadAnonymousSubComponent().
|
inlineprotected |
Check to see if the element type loaded by the user into the.
specified slot is loadable with a particular API. This will only check slot index 0. If you need to check other slots, please use the SubComponentSlotInfo.
| slot_name | Name of slot to check |
References SST::Output::fatal(), and SST::Output::STDERR.
|
inlineprotected |
Loads an anonymous subcomponent (not defined in input file to SST run).
| type | type of subcomponent to load in lib.name format |
| slot_name | name of the slot to load subcomponent into |
| slot_num | index of the slot to load subcomponent into |
| share_flags | Share flags to be used by subcomponent |
| params | Params object to be passed to subcomponent |
| args | Arguments to be passed to constructor. This signature is defined in the API definition |
For ease in backward compatibility to old API, this call will try to load using new API and will fallback to old if unsuccessful.
References isSubComponentLoadableUsingAPI().
|
inlineprotected |
Loads a module from an element Library.
| type | Fully Qualified library.moduleName |
| params | Parameters the module should use for configuration |
|
inlineprotected |
Loads a user defined subcomponent (defined in input file to SST run).
This version does not allow share flags (set to SHARE_NONE) or constructor arguments.
| slot_name | name of the slot to load subcomponent into |
For ease in backward compatibility to old API, this call will try to load using new API and will fallback to old if unsuccessful.
References loadUserSubComponent().
Referenced by loadUserSubComponent().
|
inlineprotected |
Loads a user defined subcomponent (defined in input file to SST run).
| slot_name | name of the slot to load subcomponent into |
| share_flags | Share flags to be used by subcomponent |
| args | Arguments to be passed to constructor. This signature is defined in the API definition |
For ease in backward compatibility to old API, this call will try to load using new API and will fallback to old if unsuccessful.
References SST::Output::fatal(), and SST::Output::STDERR.
|
protected |
Performs a global statistic Output.
This routine will force ALL Components and Subcomponents to output their statistic information. This may lead to unexpected results if the statistic counts or data is reset on output.
NOTE: Currently, this function will only output statistics that are on the same rank.
References performGlobalStatisticOutput().
Referenced by performGlobalStatisticOutput().
|
protected |
Called by the Components and Subcomponent to perform a statistic Output.
| stat | Pointer to the statistic. |
References performStatisticOutput().
Referenced by performStatisticOutput().
|
protected |
Tells the simulation that it should not exit.
The component will remain in this state until a call to primaryComponentOKToEndSim(). A component may reenter the DoNotEndSime state by calling this function after calling primaryComponentOKToEndSim(), in which case, another call to primaryComponentOKToEndSim() will need to be called to end the simulation.
Calls to this function when already in the DoNotEndSime state, will be functionally ignored, but will generate a warning if verbose is turned on.
Calls to this function on non-primary components will be ignored and will generate a warning if verbose is turned on.
References getName(), and primaryComponentDoNotEndSim().
Referenced by primaryComponentDoNotEndSim().
|
protected |
Tells the simulation that it is now OK to end simulation.
Simulation will not end until all primary components that have called primaryComponentDoNotEndSim() have called this function.
Calls to this function when already in the OKToEndSim state, will be functionally ignored, but will generate a warning if verbose is turned on.
Calls to this function on non-primary components will be ignored and will generate a warning if verbose is turned on.
References getName(), and primaryComponentOKToEndSim().
Referenced by primaryComponentOKToEndSim().
|
inlinevirtual |
Called by the Simulation to request that the component print its current status.
Useful for debugging.
| out | The Output class which should be used to print component status. |
|
protected |
Register as a primary component, which allows the component to specify when it is and is not OK to end simulation.
The simulator will not end simulation through use of the Exit object while any primary component has specified primaryComponentDoNotEndSim(). However, it is still possible for Actions other than Exit to end simulation. Once all primary components have specified primaryComponentOKToEndSim(), the Exit object will trigger and end simulation.
This must be called during simulation wireup (i.e during the constructor for the component), or a fatal error will occur.
If no component registers as a primary component, then the Exit object will not be used for that simulation and simulation termination must be accomplished through some other mechanism (e.g. –stopAt flag, or some other Action object).
References getName(), and registerAsPrimaryComponent().
Referenced by registerAsPrimaryComponent().
|
protected |
Registers a clock for this component.
| tc | TimeConverter object specifying the clock frequency. May be specified as a TimeConverter, std::string or UnitAlgebra |
| handler | Pointer to Clock::HandlerBase which is to be invoked at the specified interval |
| reg_all | Should this clock period be used as the default timebase for all of the links connected to this component |
References registerClock().
Referenced by registerClock().
|
inlineprotected |
|
inlineprotected |
Registers a statistic.
If Statistic is allowed to run (controlled by Python runtime parameters), then a statistic will be created and returned. If not allowed to run, then a NullStatistic will be returned. In either case, the returned value should be used for all future Statistic calls. The type of Statistic and the Collection Rate is set by Python runtime parameters. If no type is defined, then an Accumulator Statistic will be provided by default. If rate set to 0 or not provided, then the statistic will output results only at end of sim (if output is enabled).
| params | Parameter set to be passed to the statistic constructor. |
| stat_name | Primary name of the statistic. This name must match the defined ElementInfoStatistic in the component, and must also be enabled in the Python input file. |
| stat_sub_id | An additional sub name for the statistic |
|
protected |
Registers a default timebase for the component and optionally sets the the component's links to that timebase.
Useful for components which do not have a clock, but would like a default timebase.
| base | Frequency for the clock in SI units |
| reg_all | Should this clock period be used as the default timebase for all of the links connected to this component |
References SST::Simulation::getTimeLord(), and registerTimeBase().
Referenced by registerTimeBase().
|
protected |
Signifies that a library is required for this simulation.
Causes the Factory to verify that the required library is loaded.
NOTE: This function should rarely be required, as most dependencies are automatically detected in the simulator core. However, if the component uses an event from another library that is not wholly defined in a header file, this call may be required to ensure that all the code from the event is loaded. Similarly, if you use a class from another library that does not have ELI information, this call may also be required to make sure all dependencies are loaded.
| name | Name of library this BaseComponent depends on |
References requireLibrary().
Referenced by requireLibrary().
|
protected |
Reactivates an existing Clock and Handler.
Note: If called after the simulation run loop (e.g., in finish() or complete()), will return the next time of the clock past when the simulation ended. There can be a small lag between simulation end and detection of simulation end during which clocks can run a few extra cycles. As a result, the return value just prior to simulation end may be greater than the value returned after simulation end.
References reregisterClock().
Referenced by reregisterClock().
|
inlinevirtual |
Called after all components have been constructed and initialization has completed, but before simulation time has begun.
Reimplemented in SST::CoreTest::MessageMesh::EnclosingComponent, SST::CoreTestCheckpoint::coreTestCheckpoint, SST::CoreTestClockerComponent::coreTestClockerComponent, SST::CoreTestComponent::coreTestComponent, SST::CoreTestComponent::coreTestComponentExtMain, SST::CoreTestComponent::coreTestLinks, SST::CoreTestDistribComponent::coreTestDistribComponent, SST::CoreTestLookupTableComponent::coreTestLookupTableComponent, SST::CoreTestMemPoolTest::MemPoolTestComponent, SST::CoreTestMessageGeneratorComponent::coreTestMessageGeneratorComponent, SST::CoreTestModule::coreTestModuleLoader, SST::CoreTestOverhead::OverheadMeasure, SST::CoreTestParamComponent::coreTestParamComponent, SST::CoreTestPerfComponent::coreTestPerfComponent, SST::CoreTestRNGComponent::coreTestRNGComponent, SST::CoreTestSharedObjectsComponent::coreTestSharedObjectsComponent, SST::CoreTestStatisticsComponent::StatisticsComponentFloat, SST::CoreTestStatisticsComponent::StatisticsComponentInt, SST::Interfaces::SimpleNetwork, and SST::SubComponent.
|
protected |
Convenience function for testing for and reporting fatal conditions.
If the condition holds, fatal() will be called, otherwise, the function will return. The function will create a new Output object and call fatal() using the supplied parameters. Before calling Output::fatal(), the function will also print other information about the (sub)component that called fatal and about the simulation state.
From Output::fatal: Message will be sent to the output location and to stderr. The output will be prepended with the expanded prefix set in the object. NOTE: fatal() will call MPI_Abort(exit_code) to terminate simulation.
| condition | on which to call fatal(); fatal() is called if the bool is false. |
| line | Line number of calling function (use CALL_INFO macro) |
| file | File name calling function (use CALL_INFO macro) |
| func | Function name calling function (use CALL_INFO macro) |
| exit_code | The exit code used for termination of simulation. will be passed to MPI_Abort() |
| format | Format string. All valid formats for printf are available. |
| ... | Arguments for format. |
References sst_assert().
Referenced by sst_assert().
|
protected |
Removes a clock handler from the component.
NOTE: This operation needs to search the list until it finds the specified handler, which can be a slow operation for long lists. Consider using the return value from the clock handler to control whether a handler is removed from the list or not.
| tc | TimeConverter representing the period of the clock |
| handler | Handler to remove from the list |
References unregisterClock().
Referenced by unregisterClock().