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>
30 class ThreadSyncQueue;
41 virtual void execute(
int thread) = 0;
42 virtual void exchangeLinkInitData(
int thread, std::atomic<int>& msg_count) = 0;
43 virtual void finalizeLinkConfigurations() = 0;
45 virtual SimTime_t getNextSyncTime() {
return nextSyncTime; }
50 virtual uint64_t getDataSize()
const = 0;
53 SimTime_t nextSyncTime;
56 void finalizeConfiguration(
Link* link) {
57 link->finalizeConfiguration();
60 void sendInitData_sync(
Link* link,
Event* init_data) {
61 link->sendInitData_sync(init_data);
73 virtual void before() = 0;
74 virtual void after() = 0;
75 virtual void execute() = 0;
76 virtual void processLinkInitData() = 0;
77 virtual void finalizeLinkConfigurations() = 0;
79 virtual SimTime_t getNextSyncTime() {
return nextSyncTime; }
81 void setMaxPeriod(
TimeConverter* period) {max_period = period;}
89 SimTime_t nextSyncTime;
92 void finalizeConfiguration(
Link* link) {
93 link->finalizeConfiguration();
96 void sendInitData_sync(
Link* link,
Event* init_data) {
97 link->sendInitData_sync(init_data);
117 void print(
const std::string& header,
Output &out)
const;
120 enum sync_type_t { RANK, THREAD};
125 static std::mutex sync_mutex;
130 static SimTime_t next_rankSync;
132 SimTime_t next_threadSync;
136 sync_type_t next_sync_type;
139 void computeNextInsert();
146 #endif // SST_CORE_SYNCMANAGER_H
Output object provides consistant method for outputing data to stdout, stderr and/or sst debug file...
Definition: output.h:54
Definition: syncManager.h:68
An Action is a schedulable Activity which is not an Event.
Definition: action.h:30
Definition: syncManager.h:103
Main control class for a SST Simulation.
Definition: simulation.h:75
A class to convert between a component's view of time and the core's view of time.
Definition: timeConverter.h:25
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.
void finalizeLinkConfigurations()
Finish link configuration.
Definition: syncManager.cc:230
Definition: syncManager.h:33
void exchangeLinkInitData(std::atomic< int > &msg_count)
Cause an exchange of Initialization Data to occur.
Definition: syncManager.cc:218
Exit Event Action.
Definition: exit.h:34
virtual void registerLink(LinkId_t link_id, Link *link)=0
Register a Link which this Sync Object is responsible for.
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:124
Definition: rankInfo.h:21
void print(const std::string &header, Output &out) const
Generic print-print function for this Activity.
Definition: syncManager.cc:261
void execute(void)
Function which will be called when the time for this Activity comes to pass.
Definition: syncManager.cc:153
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
Definition: threadsafe.h:42
Link between two components.
Definition: link.h:33