12 #ifndef SST_CORE_SYNC_SYNCMANAGER_H 13 #define SST_CORE_SYNC_SYNCMANAGER_H 15 #include "sst/core/action.h" 16 #include "sst/core/link.h" 17 #include "sst/core/rankInfo.h" 18 #include "sst/core/sst_types.h" 19 #include "sst/core/threadsafe.h" 21 #include <unordered_map> 27 class Simulation_impl;
29 class ThreadSyncQueue;
32 class SyncProfileToolList;
34 class SyncProfileTool;
40 RankSync(
RankInfo num_ranks) : num_ranks(num_ranks) { link_maps.resize(num_ranks.rank); }
47 void exchangeLinkInfo(uint32_t my_rank);
49 virtual void execute(
int thread) = 0;
50 virtual void exchangeLinkUntimedData(
int thread, std::atomic<int>& msg_count) = 0;
51 virtual void finalizeLinkConfigurations() = 0;
52 virtual void prepareForComplete() = 0;
54 virtual SimTime_t getNextSyncTime() {
return nextSyncTime; }
59 virtual uint64_t getDataSize()
const = 0;
68 ImplementVirtualSerializable(
SST::RankSync) protected : SimTime_t nextSyncTime;
72 std::vector<std::map<std::string, uintptr_t>> link_maps;
74 void finalizeConfiguration(
Link* link) { link->finalizeConfiguration(); }
76 void prepareForCompleteInt(
Link* link) { link->prepareForComplete(); }
78 void sendUntimedData_sync(
Link* link,
Event* data) { link->sendUntimedData_sync(data); }
82 inline Link* getDeliveryLink(
Event* ev) {
return ev->getDeliveryLink(); }
93 virtual void before() = 0;
94 virtual void after() = 0;
95 virtual void execute() = 0;
96 virtual void processLinkUntimedData() = 0;
97 virtual void finalizeLinkConfigurations() = 0;
98 virtual void prepareForComplete() = 0;
100 virtual SimTime_t getNextSyncTime() {
return nextSyncTime; }
102 void setMaxPeriod(
TimeConverter* period) { max_period = period; }
107 virtual ActivityQueue* registerRemoteLink(
int tid,
const std::string& name,
Link* link) = 0;
118 SimTime_t nextSyncTime;
121 void finalizeConfiguration(
Link* link) { link->finalizeConfiguration(); }
123 void prepareForCompleteInt(
Link* link) { link->prepareForComplete(); }
125 void sendUntimedData_sync(
Link* link,
Event* data) { link->sendUntimedData_sync(data); }
129 inline Link* getDeliveryLink(
Event* ev) {
return ev->getDeliveryLink(); }
139 const std::vector<SimTime_t>& interThreadLatencies);
146 void exchangeLinkInfo();
155 void print(
const std::string& header,
Output& out)
const override;
157 uint64_t getDataSize()
const;
164 enum sync_type_t { RANK, THREAD };
174 static SimTime_t next_rankSync;
179 sync_type_t next_sync_type;
184 void computeNextInsert();
189 #endif // SST_CORE_SYNC_SYNCMANAGER_H Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:53
An Action is a schedulable Activity which is not an Event.
Definition: action.h:26
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:35
Definition: syncManager.h:134
virtual ActivityQueue * registerLink(const RankInfo &to_rank, const RankInfo &from_rank, const std::string &name, Link *link)=0
Register a Link which this Sync Object is responsible for.
A class to convert between a component's view of time and the core's view of time.
Definition: timeConverter.h:27
void finalizeLinkConfigurations()
Finish link configuration.
Definition: syncManager.cc:414
Definition: syncManager.h:37
void setDeliveryInfo(uintptr_t info)
Set the delivery_info for the link.
Definition: link.h:198
Definition: serializable.h:118
Exit Event Action.
Definition: exit.h:34
Link * pair_link
Pointer to the opposite side of this link.
Definition: link.h:244
Definition: syncManager.h:87
void execute(void) override
Function which will be called when the time for this Activity comes to pass.
Definition: syncManager.cc:340
void exchangeLinkUntimedData(std::atomic< int > &msg_count)
Cause an exchange of Initialization Data to occur.
Definition: syncManager.cc:403
ActivityQueue * registerLink(const RankInfo &to_rank, const RankInfo &from_rank, const std::string &name, Link *link)
Register a Link which this Sync Object is responsible for.
Definition: syncManager.cc:309
Main control class for a SST Simulation.
Definition: simulation_impl.h:70
Definition: rankInfo.h:21
void prepareForComplete()
Prepare for complete() phase.
Definition: syncManager.cc:427
Base Class for a queue of Activities.
Definition: activityQueue.h:21
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:34
virtual void registerLink(const std::string &name, Link *link)=0
Register a Link which this Sync Object is responsible for.
Definition: threadsafe.h:47
Link between two components.
Definition: link.h:50