SST  15.1.0
StructuralSimulationToolkit
threadSyncDirectSkip.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_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/syncQueue.h"
19 
20 #include <cstdint>
21 #include <string>
22 #include <unordered_map>
23 
24 namespace SST {
25 
26 class ActivityQueue;
27 class Link;
28 class TimeConverter;
29 class Exit;
30 class Event;
31 class Simulation_impl;
32 class ThreadSyncQueue;
33 
35 {
36 public:
37  /** Create a new ThreadSync object */
38  ThreadSyncDirectSkip(int num_threads, int thread, Simulation_impl* sim);
39  ThreadSyncDirectSkip() {} // For serialization only
41 
42  void setMaxPeriod(TimeConverter* period);
43 
44  void before() override {}
45  void after() override;
46  void execute() override;
47 
48  /** Cause an exchange of Untimed Data to occur */
49  void processLinkUntimedData() override {}
50  /** Finish link configuration */
51  void finalizeLinkConfigurations() override {}
52  void prepareForComplete() override {}
53 
54  /** Set signals to exchange during sync */
55  void setSignals(int end, int usr, int alrm) override;
56  /** Return exchanged signals after sync */
57  bool getSignals(int& end, int& usr, int& alrm) override;
58 
59  SimTime_t getNextSyncTime() override { return nextSyncTime - 1; }
60 
61  /** Register a Link which this Sync Object is responsible for */
62  void registerLink(const std::string& UNUSED(name), Link* UNUSED(link)) override {}
63  ActivityQueue* registerRemoteLink(int UNUSED(id), const std::string& UNUSED(name), Link* UNUSED(link)) override
64  {
65  return nullptr;
66  }
67 
68  uint64_t getDataSize() const;
69 
70 private:
71  SimTime_t my_max_period;
72  int num_threads;
73  int thread;
74  static SimTime_t localMinimumNextActivityTime;
75  Simulation_impl* sim;
76  static Core::ThreadSafe::Barrier barrier[3];
77  double totalWaitTime;
78  bool single_rank;
79  static int sig_end_;
80  static int sig_usr_;
81  static int sig_alrm_;
82 };
83 
84 
85 } // namespace SST
86 
87 #endif // SST_CORE_SYNC_THREADSYNCDIRECTSKIP_H
void setSignals(int end, int usr, int alrm) override
Set signals to exchange during sync.
Definition: threadSyncDirectSkip.cc:88
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:49
Definition: syncManager.h:94
Main control class for a SST Simulation.
Definition: simulation_impl.h:122
Definition: threadSyncDirectSkip.h:34
bool getSignals(int &end, int &usr, int &alrm) override
Return exchanged signals after sync.
Definition: threadSyncDirectSkip.cc:96
void registerLink(const std::string &UNUSED(name), Link *UNUSED(link)) override
Register a Link which this Sync Object is responsible for.
Definition: threadSyncDirectSkip.h:62
void finalizeLinkConfigurations() override
Finish link configuration.
Definition: threadSyncDirectSkip.h:51
Base Class for a queue of Activities.
Definition: activityQueue.h:21