SST 15.0
Structural Simulation Toolkit
heartbeat.h
1// Copyright 2009-2025 NTESS. Under the terms
2// of Contract DE-NA0003525 with NTESS, the U.S.
3// Government retains certain rights in this software.
4//
5// Copyright (c) 2009-2025, NTESS
6// All rights reserved.
7//
8// This file is part of the SST software package. For license
9// information, see the LICENSE file in the top level directory of the
10// distribution.
11
12#ifndef SST_CORE_HEARTBEAT_H
13#define SST_CORE_HEARTBEAT_H
14
15#include "sst/core/action.h"
16#include "sst/core/config.h"
17#include "sst/core/cputimer.h"
18#include "sst/core/output.h"
19#include "sst/core/sst_types.h"
20
21#include <set>
22
23namespace SST {
24
25class Simulation_impl;
26class TimeConverter;
27
28/**
29 \class SimulatorHeartbeat
30 An optional heartbeat to show progress in a simulation
31*/
32class SimulatorHeartbeat : public Action
33{
34public:
35 /**
36 Create a new heartbeat object for the simulation core to show progress
37 */
38 SimulatorHeartbeat(Config* cfg, int this_rank, Simulation_impl* sim, TimeConverter* period);
39 ~SimulatorHeartbeat() = default;
40
41 // Used to re-schedule the new heartbeat event during restart
42 void schedule();
43
44 void serialize_order(SST::Core::Serialization::serializer& ser) override;
45 ImplementSerializable(SST::SimulatorHeartbeat)
46
47private:
48 SimulatorHeartbeat() = default;
50 SimulatorHeartbeat& operator=(const SimulatorHeartbeat&) = delete;
51
52 void execute() override;
53 int rank;
54 TimeConverter* m_period;
55 double lastTime;
56};
57
58} // namespace SST
59
60#endif // SST_CORE_HEARTBEAT_H
Class to contain SST Simulation Configuration variables.
Definition config.h:41
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:45
Main control class for a SST Simulation.
Definition simulation_impl.h:87
An optional heartbeat to show progress in a simulation.
Definition heartbeat.h:33
void execute() override
Function which will be called when the time for this Activity comes to pass.
Definition heartbeat.cc:55
SimulatorHeartbeat(Config *cfg, int this_rank, Simulation_impl *sim, TimeConverter *period)
Create a new heartbeat object for the simulation core to show progress.
A class to convert between a component's view of time and the core's view of time.
Definition timeConverter.h:28