SST 16.0.0
Structural Simulation Toolkit
heartbeat.h
1// Copyright 2009-2026 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-2026, 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#include "sst/core/timeConverter.h"
21
22#include <set>
23
24namespace SST {
25
26class Simulation;
27class TimeConverter;
28
29/**
30 \class SimulatorHeartbeat
31 An optional heartbeat to show progress in a simulation
32*/
33class SimulatorHeartbeat : public Action
34{
35public:
36 /**
37 Create a new heartbeat object for the simulation core to show progress
38 */
39 SimulatorHeartbeat(Config* cfg, int this_rank, Simulation* sim, TimeConverter period);
40 ~SimulatorHeartbeat() = default;
41
42 // Used to re-schedule the new heartbeat event during restart
43 void schedule();
44
45 void serialize_order(SST::Core::Serialization::serializer& ser) override;
46 ImplementSerializable(SST::SimulatorHeartbeat)
47
48private:
49 SimulatorHeartbeat() = default;
51 SimulatorHeartbeat& operator=(const SimulatorHeartbeat&) = delete;
52
53 void execute() override;
54 int rank;
55 TimeConverter m_period;
56 double lastTime;
57};
58
59} // namespace SST
60
61#endif // SST_CORE_HEARTBEAT_H
Class to contain SST Simulation Configuration variables.
Definition config.h:52
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:43
Main control class for a SST Simulation.
Definition simulation.h:121
An optional heartbeat to show progress in a simulation.
Definition heartbeat.h:34
SimulatorHeartbeat(Config *cfg, int this_rank, Simulation *sim, TimeConverter period)
Create a new heartbeat object for the simulation core to show progress.
void execute() override
Function which will be called when the time for this Activity comes to pass.
Definition heartbeat.cc:56
A class to convert between a component's view of time and the core's view of time.
Definition timeConverter.h:31