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" 37 SST_ELI_REGISTER_REALTIMEACTION(
39 "Signal handler that causes an immediate, but non-emergency shutdown. This is the default action for the " 40 "'--exit-after' option.")
43 virtual void execute()
override;
44 virtual void begin(time_t scheduled_time)
override;
51 SST_ELI_REGISTER_REALTIMEACTION(
53 "Signal handler that causes an emergency shutdown. This is the default action for SIGTERM and SIGINT.")
56 virtual void execute()
override;
63 SST_ELI_REGISTER_REALTIMEACTION(
65 "Signal handler that causes SST-Core to print its status. This is the default action for SIGUSR1.")
68 void execute()
override;
75 SST_ELI_REGISTER_REALTIMEACTION(
77 "Signal handler that causes SST-Core to print its status along with component status. This is the default " 78 "action for SIGUSR2.")
81 void execute()
override;
88 SST_ELI_REGISTER_REALTIMEACTION(
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(
106 "Signal handler that causes SST to generate a heartbeat message (status and some resource usage information). " 107 "This is the default action for the '--heartbeat-wall-period' option.")
110 virtual void execute()
override;
111 virtual void begin(time_t scheduled_time)
override;
115 static std::atomic<uint64_t> thr_max_tv_depth_;
125 void begin(time_t begin_time);
127 void execute(uint32_t elapsed);
128 uint32_t getNextAlarmTime()
const;
131 uint32_t alarm_interval_;
132 uint32_t next_alarm_time_;
143 void execute()
override;
144 void addIntervalAction(uint32_t interval,
RealTimeAction* action);
145 virtual void begin(time_t scheduled_time)
override;
147 std::vector<RealTimeIntervalAction> interval_actions_;
151 static uint32_t elapsed_;
181 static void installSignalHandlers();
182 static void SimulationSigEndHandler(
int sig);
183 static void SimulationSigUsrHandler(
int sig);
184 static void SimulationSigAlrmHandler(
int sig);
187 bool getSignals(
int& sig_end,
int& sig_usr,
int& sig_alrm);
200 bool can_checkpoint_ =
false;
203 std::map<int, RealTimeAction*> signal_actions_;
205 static sig_atomic_t sig_alrm_from_os_;
206 static sig_atomic_t sig_usr_from_os_;
207 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:193
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:43
Definition: realtime.h:139
Definition: realtime.h:34
Definition: realtime.h:85
void notifySignal()
Simulation run loop calls this when a signal has been received from the OS.
Definition: realtime.cc:575
Definition: serializable.h:24
An event to trigger at a real-time interval.
Definition: realtimeAction.h:28
Definition: realtime.h:60
Definition: rankInfo.h:21
void begin()
Begin monitoring signals.
Definition: realtime.cc:564
Definition: realtime.h:120
Definition: realtime.h:72
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:545
Definition: realtime.h:101
Class to manage real-time events (signals and alarms)
Definition: realtime.h:156
Definition: realtime.h:48
void performSignal(int signum)
This is a request to execute the handler in response to a particular signal.
Definition: realtime.cc:629
Definition: threadsafe.h:47