12#ifndef SST_CORE_CORE_EXIT_H
13#define SST_CORE_CORE_EXIT_H
15#include "sst/core/action.h"
16#include "sst/core/sst_types.h"
17#include "sst/core/threadsafe.h"
22#include <unordered_set>
43 Exit(
int num_threads,
bool single_rank);
52 void refInc(uint32_t thread);
59 void refDec(uint32_t thread);
106 std::string
toString()
const override;
124 Exit& operator=(
const Exit&) =
delete;
126 int num_threads_ = 0;
127 unsigned int ref_count_ = 0;
128 unsigned int* thread_counts_ =
nullptr;
129 unsigned int global_count_ = 0;
130 SimTime_t end_time_ = 0;
131 bool single_rank_ =
true;
Definition threadsafe.h:138
Exit Action.
Definition exit.h:35
void check()
Function called by SyncManager to check to see if it's time to exit.
Definition exit.cc:112
Exit(int num_threads, bool single_rank)
Create a new ExitEvent.
Definition exit.cc:28
void refInc(uint32_t thread)
Increment reference count on a given thread.
Definition exit.cc:46
void refDec(uint32_t thread)
Decrement reference count on a given thread.
Definition exit.cc:54
std::string toString() const override
Creates a string representation of the Exit object.
Definition exit.cc:135
SimTime_t computeEndTime()
Computes the end time of the simulation.
Definition exit.cc:95
unsigned int getRefCount()
Get the current local reference count.
Definition exit.cc:82
unsigned int getGlobalCount()
Get the global ref_count.
Definition exit.h:114
void execute() override
Function called when Exit fires in the TimeVortex.
Definition exit.cc:88
void setEndTime(SimTime_t time)
Stores the time the simulation has ended.
Definition exit.h:80
SimTime_t getEndTime()
Gets the end time of the simulation.
Definition exit.h:73
Main control class for a SST Simulation.
Definition simulation.h:121