SST  15.1.0
StructuralSimulationToolkit
SST::Exit Class Reference

Exit Action. More...

#include <exit.h>

Inheritance diagram for SST::Exit:
SST::Action SST::Activity SST::Core::MemPoolItem SST::Core::Serialization::serializable SST::Core::Serialization::serializable_base

Public Member Functions

 Exit (int num_threads, bool single_rank)
 Create a new ExitEvent. More...
 
void refInc (uint32_t thread)
 Increment reference count on a given thread. More...
 
void refDec (uint32_t thread)
 Decrement reference count on a given thread. More...
 
unsigned int getRefCount ()
 Get the current local reference count. More...
 
SimTime_t getEndTime ()
 Gets the end time of the simulation. More...
 
void setEndTime (SimTime_t time)
 Stores the time the simulation has ended. More...
 
SimTime_t computeEndTime ()
 Computes the end time of the simulation. More...
 
void execute () override
 Function called when Exit fires in the TimeVortex.
 
void check ()
 Function called by SyncManager to check to see if it's time to exit. More...
 
std::string toString () const override
 Creates a string representation of the Exit object. More...
 
unsigned int getGlobalCount ()
 Get the global ref_count. More...
 
NotSerializable(SST::Exit) private Exit (const Exit &)=delete
 
Exitoperator= (const Exit &)=delete
 
- Public Member Functions inherited from SST::Action
bool isEvent () const override final
 
bool isAction () const override final
 
- Public Member Functions inherited from SST::Activity
void setDeliveryTime (SimTime_t time)
 Set the time for which this Activity should be delivered.
 
SimTime_t getDeliveryTime () const
 Return the time at which this Activity will be delivered.
 
int getPriority () const
 Return the Priority of this Activity.
 
void setOrderTag (uint32_t tag)
 Sets the order tag.
 
uint32_t getOrderTag () const
 Return the order tag associated with this activity.
 
uint64_t getQueueOrder () const
 Returns the queue order associated with this activity.
 
void setQueueOrder (uint64_t order)
 Set a new Queue order.
 
virtual void copyAllDeliveryInfo (const Activity *act)
 
- Public Member Functions inherited from SST::Core::MemPoolItem
void * operator new (std::size_t size) noexcept
 Allocates memory from a memory pool for a new Activity.
 
void operator delete (void *ptr)
 Returns memory for this Activity to the appropriate memory pool. More...
 
virtual void print (const std::string &header, Output &out) const
 
- Public Member Functions inherited from SST::Core::Serialization::serializable_base
virtual const char * cls_name () const =0
 
virtual uint32_t cls_id () const =0
 
virtual std::string serialization_name () const =0
 

Data Fields

int num_threads_ = 0
 
unsigned int ref_count_ = 0
 
unsigned int * thread_counts_ = nullptr
 
unsigned int global_count_ = 0
 
SimTime_t end_time_ = 0
 
bool single_rank_ = true
 
Core::ThreadSafe::Spinlock slock_
 

Additional Inherited Members

- Static Public Attributes inherited from SST::Core::Serialization::serializable
static constexpr uint32_t NullClsId = std::numeric_limits<uint32_t>::max()
 
- Static Public Attributes inherited from SST::Core::Serialization::serializable_base
static constexpr uint32_t NullClsId = std::numeric_limits<uint32_t>::max()
 
- Protected Types inherited from SST::Core::Serialization::serializable_base
enum  cxn_flag_t { ConstructorFlag }
 
- Protected Member Functions inherited from SST::Action
void endSimulation ()
 Called to signal to the Simulation object to end the simulation.
 
void endSimulation (SimTime_t end)
 Called to signal to the Simulation object to end the simulation. More...
 
void serialize_order (SST::Core::Serialization::serializer &ser) override
 
- Protected Member Functions inherited from SST::Activity
void setPriority (uint64_t priority)
 Set the priority of the Activity.
 
std::string getDeliveryTimeInfo () const
 Gets the delivery time info as a string. More...
 
void serialize_order (SST::Core::Serialization::serializer &ser) override
 
 ImplementVirtualSerializable (SST::Activity)
 
- 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)
 

Detailed Description

Exit Action.

Tracks the number of components that have requested DoNotEndSim. Once that count reaches 0, the Exit object will end the simulation.

Constructor & Destructor Documentation

◆ Exit()

SST::Exit::Exit ( int  num_threads,
bool  single_rank 
)

Create a new ExitEvent.

Parameters
num_threadsnumber of threads on the rank
single_rankTrue if there are no other ranks

References SST::Activity::setPriority().

Member Function Documentation

◆ check()

void SST::Exit::check ( )

Function called by SyncManager to check to see if it's time to exit.

This call synchronizes across ranks.

References computeEndTime().

Referenced by execute(), and SST::SyncManager::execute().

◆ computeEndTime()

SimTime_t SST::Exit::computeEndTime ( )

Computes the end time of the simulation.

This call synchronizes across ranks.

Returns
End time of the simulation

References SST::Action::endSimulation().

Referenced by check().

◆ getEndTime()

SimTime_t SST::Exit::getEndTime ( )
inline

Gets the end time of the simulation.

Returns
Time when simulation ends

Referenced by SST::SyncManager::execute().

◆ getGlobalCount()

unsigned int SST::Exit::getGlobalCount ( )
inline

Get the global ref_count.

This is only valid after check() is called

Returns
global ref_count

Referenced by SST::SyncManager::execute().

◆ getRefCount()

unsigned int SST::Exit::getRefCount ( )

Get the current local reference count.

Returns
current local reference count

Referenced by SST::SyncManager::execute().

◆ refDec()

void SST::Exit::refDec ( uint32_t  thread)

◆ refInc()

void SST::Exit::refInc ( uint32_t  thread)

Increment reference count on a given thread.

Parameters
threadnumber of Component making call

Referenced by SST::BaseComponent::primaryComponentDoNotEndSim().

◆ setEndTime()

void SST::Exit::setEndTime ( SimTime_t  time)
inline

Stores the time the simulation has ended.

Parameters
timeCurrent simulation time

Referenced by SST::Simulation_impl::endSimulation().

◆ toString()

std::string SST::Exit::toString ( ) const
overridevirtual

Creates a string representation of the Exit object.

Returns
string representation of Exit object

Reimplemented from SST::Activity.

References SST::Activity::getDeliveryTime(), and SST::Activity::getPriority().


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