12 #ifndef SST_CORE_REAL_TIME_ALARM_MANAGER_H 13 #define SST_CORE_REAL_TIME_ALARM_MANAGER_H 15 #include "sst/core/realtimeAction.h" 16 #include "sst/core/serialization/serializable.h" 17 #include "sst/core/sst_types.h" 18 #include "sst/core/threadsafe.h" 19 #include "sst/core/warnmacros.h" 40 SST_ELI_REGISTER_REALTIMEACTION(
ExitCleanRealTimeAction,
"sst",
"rt.exit.clean", SST_ELI_ELEMENT_VERSION(0, 1, 0),
41 "Signal handler that causes an immediate, but non-emergency shutdown. This is the default action for the " 42 "'--exit-after' option.")
45 virtual void execute()
override;
46 virtual void begin(time_t scheduled_time)
override;
54 SST_ELI_ELEMENT_VERSION(0, 1, 0),
55 "Signal handler that causes an emergency shutdown. This is the default action for SIGTERM and SIGINT.")
58 virtual void execute()
override;
66 "Signal handler that causes SST-Core to print its status. This is the default action for SIGUSR1.")
69 void execute()
override;
77 SST_ELI_ELEMENT_VERSION(0, 1, 0),
78 "Signal handler that causes SST-Core to print its status along with component status. This is the default " 79 "action for SIGUSR2.")
82 void execute()
override;
90 "Signal handler that causes SST to generate a checkpoint. This is the default action for the " 91 "'--checkpoint-wall-period' option.")
94 virtual void execute()
override;
95 virtual void begin(time_t scheduled_time)
override;
104 SST_ELI_REGISTER_REALTIMEACTION(
HeartbeatRealTimeAction,
"sst",
"rt.heartbeat", SST_ELI_ELEMENT_VERSION(0, 1, 0),
105 "Signal handler that causes SST to generate a heartbeat message (status and some resource usage information). " 106 "This is the default action for the '--heartbeat-wall-period' option.")
109 virtual void execute()
override;
110 virtual void begin(time_t scheduled_time)
override;
114 static std::atomic<uint64_t> thr_max_tv_depth_;
124 SST_ELI_ELEMENT_VERSION(0, 1, 0),
125 "Signal handler that causes SST to break into an interactive console based on the --interactive-console flag.")
128 void execute()
override;
129 bool isValidSigalrmAction()
override {
return false; }
139 void begin(time_t begin_time);
141 void execute(uint32_t elapsed);
142 uint32_t getNextAlarmTime()
const;
145 uint32_t alarm_interval_;
146 uint32_t next_alarm_time_;
157 void execute()
override;
158 void addIntervalAction(uint32_t interval,
RealTimeAction* action);
159 virtual void begin(time_t scheduled_time)
override;
162 std::vector<RealTimeIntervalAction> interval_actions_;
166 static uint32_t elapsed_;
196 static void installSignalHandlers();
197 static void SimulationSigEndHandler(
int sig);
198 static void SimulationSigUsrHandler(
int sig);
199 static void SimulationSigAlrmHandler(
int sig);
202 bool getSignals(
int& sig_end,
int& sig_usr,
int& sig_alrm);
215 bool can_checkpoint_ =
false;
218 std::map<int, RealTimeAction*> signal_actions_;
220 static sig_atomic_t sig_alrm_from_os_;
221 static sig_atomic_t sig_usr_from_os_;
222 static sig_atomic_t sig_end_from_os_;
bool canInitiateCheckpoint()
Check whether or not any of the Actions registered with the manager can initiate a checkpoint...
Definition: realtime.h:208
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:42
Definition: realtime.h:153
Definition: realtime.h:37
Definition: realtime.h:86
void notifySignal()
Simulation run loop calls this when a signal has been received from the OS.
Definition: realtime.cc:608
Definition: serializable.h:23
An event to trigger at a real-time interval.
Definition: realtimeAction.h:31
Definition: realtime.h:62
Definition: realtime.h:120
Definition: rankInfo.h:23
bool canInitiateCheckpoint() override
Let's the core know if this action may trigger a checkpoint so that all the checkpoint infrastructure...
Definition: realtime.h:130
void begin()
Begin monitoring signals.
Definition: realtime.cc:595
Definition: realtime.h:134
Definition: realtime.h:73
bool canInitiateCheckpoint() override
Let's the core know if this action may trigger a checkpoint so that all the checkpoint infrastructure...
Definition: realtime.h:97
void registerSignal(RealTimeAction *action, int signum)
Register actions.
Definition: realtime.cc:576
Definition: realtime.h:101
Class to manage real-time events (signals and alarms)
Definition: realtime.h:171
Definition: realtime.h:50
void performSignal(int signum)
This is a request to execute the handler in response to a particular signal.
Definition: realtime.cc:664
Definition: threadsafe.h:49