SST  14.0.0
StructuralSimulationToolkit
threadSyncDirectSkip.h
1 // Copyright 2009-2024 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-2024, 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_SYNC_THREADSYNCDIRECTSKIP_H
13 #define SST_CORE_SYNC_THREADSYNCDIRECTSKIP_H
14 
15 #include "sst/core/action.h"
16 #include "sst/core/sst_types.h"
17 #include "sst/core/sync/syncManager.h"
18 #include "sst/core/sync/threadSyncQueue.h"
19 
20 #include <unordered_map>
21 
22 namespace SST {
23 
24 class ActivityQueue;
25 class Link;
26 class TimeConverter;
27 class Exit;
28 class Event;
29 class Simulation_impl;
30 class ThreadSyncQueue;
31 
33 {
34 public:
35  /** Create a new ThreadSync object */
36  ThreadSyncDirectSkip(int num_threads, int thread, Simulation_impl* sim);
37  ThreadSyncDirectSkip() {} // For serialization only
39 
40  void setMaxPeriod(TimeConverter* period);
41 
42  void before() override {}
43  void after() override;
44  void execute(void) override;
45 
46  /** Cause an exchange of Untimed Data to occur */
47  void processLinkUntimedData() override {}
48  /** Finish link configuration */
49  void finalizeLinkConfigurations() override {}
50  void prepareForComplete() override {}
51 
52  SimTime_t getNextSyncTime() override { return nextSyncTime - 1; }
53 
54  /** Register a Link which this Sync Object is responsible for */
55  void registerLink(const std::string& UNUSED(name), Link* UNUSED(link)) override {}
56  ActivityQueue* registerRemoteLink(int UNUSED(id), const std::string& UNUSED(name), Link* UNUSED(link)) override
57  {
58  return nullptr;
59  }
60 
61  uint64_t getDataSize() const;
62 
63  void serialize_order(SST::Core::Serialization::serializer& ser) override;
64  ImplementSerializable(SST::ThreadSyncDirectSkip)
65 
66 private:
67  SimTime_t my_max_period;
68  int num_threads;
69  int thread;
70  static SimTime_t localMinimumNextActivityTime;
71  Simulation_impl* sim;
72  static Core::ThreadSafe::Barrier barrier[3];
73  double totalWaitTime;
74  bool single_rank;
75 };
76 
77 
78 } // namespace SST
79 
80 #endif // SST_CORE_SYNC_THREADSYNCDIRECTSKIP_H
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:35
A class to convert between a component&#39;s view of time and the core&#39;s view of time.
Definition: timeConverter.h:27
Definition: action.cc:18
void processLinkUntimedData() override
Cause an exchange of Untimed Data to occur.
Definition: threadSyncDirectSkip.h:47
Definition: syncManager.h:87
Main control class for a SST Simulation.
Definition: simulation_impl.h:70
Definition: threadSyncDirectSkip.h:32
void registerLink(const std::string &UNUSED(name), Link *UNUSED(link)) override
Register a Link which this Sync Object is responsible for.
Definition: threadSyncDirectSkip.h:55
void finalizeLinkConfigurations() override
Finish link configuration.
Definition: threadSyncDirectSkip.h:49
Base Class for a queue of Activities.
Definition: activityQueue.h:21