12 #ifndef SST_CORE_SYNCMANAGER_H
13 #define SST_CORE_SYNCMANAGER_H
15 #include "sst/core/sst_types.h"
17 #include "sst/core/action.h"
18 #include "sst/core/link.h"
19 #include "sst/core/rankInfo.h"
20 #include "sst/core/threadsafe.h"
23 #include <unordered_map>
28 class Simulation_impl;
30 class ThreadSyncQueue;
41 virtual void execute(
int thread) = 0;
42 virtual void exchangeLinkUntimedData(
int thread, std::atomic<int>& msg_count) = 0;
43 virtual void finalizeLinkConfigurations() = 0;
44 virtual void prepareForComplete() = 0;
46 virtual SimTime_t getNextSyncTime() {
return nextSyncTime; }
51 virtual uint64_t getDataSize()
const = 0;
54 SimTime_t nextSyncTime;
57 void finalizeConfiguration(
Link* link) {
58 link->finalizeConfiguration();
61 void prepareForCompleteInt(
Link* link) {
62 link->prepareForComplete();
65 void sendUntimedData_sync(
Link* link,
Event* data) {
66 link->sendUntimedData_sync(data);
78 virtual void before() = 0;
79 virtual void after() = 0;
80 virtual void execute() = 0;
81 virtual void processLinkUntimedData() = 0;
82 virtual void finalizeLinkConfigurations() = 0;
83 virtual void prepareForComplete() = 0;
85 virtual SimTime_t getNextSyncTime() {
return nextSyncTime; }
87 void setMaxPeriod(
TimeConverter* period) {max_period = period;}
95 SimTime_t nextSyncTime;
98 void finalizeConfiguration(
Link* link) {
99 link->finalizeConfiguration();
102 void prepareForCompleteInt(
Link* link) {
103 link->prepareForComplete();
106 void sendUntimedData_sync(
Link* link,
Event* data) {
107 link->sendUntimedData_sync(data);
128 void print(
const std::string& header,
Output &out)
const override;
130 uint64_t getDataSize()
const;
133 enum sync_type_t { RANK, THREAD};
143 static SimTime_t next_rankSync;
148 sync_type_t next_sync_type;
151 void computeNextInsert();
158 #endif // SST_CORE_SYNCMANAGER_H
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:54
An Action is a schedulable Activity which is not an Event.
Definition: action.h:30
Definition: syncManager.h:113
A class to convert between a component's view of time and the core's view of time.
Definition: timeConverter.h:25
void finalizeLinkConfigurations()
Finish link configuration.
Definition: syncManager.cc:246
Definition: syncManager.h:33
virtual void registerLink(LinkId_t link_id, Link *link)=0
Register a Link which this Sync Object is responsible for.
Exit Event Action.
Definition: exit.h:34
Definition: syncManager.h:73
void execute(void) override
Function which will be called when the time for this Activity comes to pass.
Definition: syncManager.cc:175
ActivityQueue * registerLink(const RankInfo &to_rank, const RankInfo &from_rank, LinkId_t link_id, Link *link)
Register a Link which this Sync Object is responsible for.
Definition: syncManager.cc:150
void exchangeLinkUntimedData(std::atomic< int > &msg_count)
Cause an exchange of Initialization Data to occur.
Definition: syncManager.cc:234
Main control class for a SST Simulation.
Definition: simulation_impl.h:72
Definition: rankInfo.h:21
void prepareForComplete()
Prepare for complete() phase.
Definition: syncManager.cc:259
virtual ActivityQueue * registerLink(const RankInfo &to_rank, const RankInfo &from_rank, LinkId_t link_id, Link *link)=0
Register a Link which this Sync Object is responsible for.
Base Class for a queue of Activities.
Definition: activityQueue.h:22
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:31
void print(const std::string &header, Output &out) const override
Generic print-print function for this Activity.
Definition: syncManager.cc:280
Definition: threadsafe.h:50
Link between two components.
Definition: link.h:32