SST  15.1.0
StructuralSimulationToolkit
timeVortex.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_TIMEVORTEX_H
13 #define SST_CORE_TIMEVORTEX_H
14 
15 #include "sst/core/activity.h"
16 #include "sst/core/activityQueue.h"
17 #include "sst/core/module.h"
18 #include "sst/core/serialization/serialize_impl_fwd.h"
19 
20 #include <cstdint>
21 #include <vector>
22 
23 namespace SST {
24 
25 class Output;
26 class Simulation_impl;
27 
28 /**
29  * Primary Event Queue
30  */
31 class TimeVortex : public ActivityQueue
32 {
33 public:
34  SST_ELI_DECLARE_BASE(TimeVortex)
35  SST_ELI_DECLARE_INFO_EXTERN(ELI::ProvidesParams)
36  SST_ELI_DECLARE_CTOR_EXTERN(SST::Params&)
37 
38  TimeVortex();
39  ~TimeVortex() {}
40 
41  // Inherited from ActivityQueue
42  virtual bool empty() override = 0;
43  virtual int size() override = 0;
44  virtual void insert(Activity* activity) override = 0;
45  virtual Activity* pop() override = 0;
46  virtual Activity* front() override = 0;
47 
48  /** Print the state of the TimeVortex */
49  virtual void print(Output& out) const;
50  virtual uint64_t getMaxDepth() const { return max_depth; }
51  virtual uint64_t getCurrentDepth() const = 0;
52  virtual void dbg_print(Output& out) const { print(out); }
53 
54  // Functions for checkpointing
55  virtual void serialize_order(SST::Core::Serialization::serializer& ser) { SST_SER(max_depth); }
56 
57  /**
58  Get a copy of the contents of the TimeVortex
59 
60  @return vector with a copy of the contents
61  */
62  virtual void getContents(std::vector<Activity*>& activities) const = 0;
63 
64 protected:
65  uint64_t max_depth;
66 };
67 
68 namespace TV::pvt {
69 
70 void pack_timevortex(TimeVortex*& s, SST::Core::Serialization::serializer& ser);
71 void unpack_timevortex(TimeVortex*& s, SST::Core::Serialization::serializer& ser);
72 
73 } // namespace TV::pvt
74 } // namespace SST
75 
76 #endif // SST_CORE_TIMEVORTEX_H
virtual void print(Output &out) const
Print the state of the TimeVortex.
Definition: timeVortex.cc:52
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:57
virtual Activity * pop() override=0
Remove and return the next activity.
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:42
Base class for all Activities in the SST Event Queue.
Definition: activity.h:47
virtual Activity * front() override=0
Returns the next activity.
Primary Event Queue.
Definition: timeVortex.h:31
Definition: action.cc:18
Definition: paramsInfo.h:39
virtual void getContents(std::vector< Activity *> &activities) const =0
Get a copy of the contents of the TimeVortex.
Parameter store.
Definition: params.h:63
Base Class for a queue of Activities.
Definition: activityQueue.h:21
virtual void insert(Activity *activity) override=0
Insert a new activity into the queue.
virtual int size() override=0
Returns the number of activities in the queue.
virtual bool empty() override=0
Returns true if the queue is empty.