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>
32class SyncProfileToolList;
40 RankSync(
RankInfo num_ranks) : num_ranks(num_ranks) { link_maps.resize(num_ranks.rank); }
46 void exchangeLinkInfo(uint32_t my_rank);
48 virtual void execute(
int thread) = 0;
49 virtual void exchangeLinkUntimedData(
int thread, std::atomic<int>& msg_count) = 0;
50 virtual void finalizeLinkConfigurations() = 0;
51 virtual void prepareForComplete() = 0;
53 virtual SimTime_t getNextSyncTime() {
return nextSyncTime; }
58 virtual uint64_t getDataSize()
const = 0;
61 SimTime_t nextSyncTime;
62 TimeConverter* max_period;
63 const RankInfo num_ranks;
65 std::vector<std::map<std::string, uintptr_t>> link_maps;
67 void finalizeConfiguration(Link* link) { link->finalizeConfiguration(); }
69 void prepareForCompleteInt(Link* link) { link->prepareForComplete(); }
71 void sendUntimedData_sync(Link* link, Event* data) { link->sendUntimedData_sync(data); }
73 inline void setLinkDeliveryInfo(Link* link, uintptr_t info) { link->pair_link->setDeliveryInfo(info); }
75 inline Link* getDeliveryLink(Event* ev) {
return ev->getDeliveryLink(); }
86 virtual void before() = 0;
87 virtual void after() = 0;
88 virtual void execute() = 0;
89 virtual void processLinkUntimedData() = 0;
90 virtual void finalizeLinkConfigurations() = 0;
91 virtual void prepareForComplete() = 0;
93 virtual SimTime_t getNextSyncTime() {
return nextSyncTime; }
95 void setMaxPeriod(
TimeConverter* period) { max_period = period; }
100 virtual ActivityQueue* registerRemoteLink(
int tid,
const std::string& name,
Link* link) = 0;
103 SimTime_t nextSyncTime;
106 void finalizeConfiguration(
Link* link) { link->finalizeConfiguration(); }
108 void prepareForCompleteInt(
Link* link) { link->prepareForComplete(); }
110 void sendUntimedData_sync(Link* link, Event* data) { link->sendUntimedData_sync(data); }
112 inline void setLinkDeliveryInfo(Link* link, uintptr_t info) { link->pair_link->setDeliveryInfo(info); }
114 inline Link* getDeliveryLink(Event* ev) {
return ev->getDeliveryLink(); }
124 const std::vector<SimTime_t>& interThreadLatencies);
130 void exchangeLinkInfo();
139 void print(
const std::string& header,
Output& out)
const override;
141 uint64_t getDataSize()
const;
146 enum sync_type_t { RANK, THREAD };
156 static SimTime_t next_rankSync;
161 sync_type_t next_sync_type;
166 void computeNextInsert();
An Action is a schedulable Activity which is not an Event.
Definition: action.h:27
Base Class for a queue of Activities.
Definition: activityQueue.h:22
Definition: threadsafe.h:48
Exit Event Action.
Definition: exit.h:35
Link between two components.
Definition: link.h:38
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file.
Definition: output.h:52
Definition: rankInfo.h:22
Definition: syncManager.h:38
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.
Main control class for a SST Simulation.
Definition: simulation_impl.h:77
Definition: syncManager.h:120
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:293
void finalizeLinkConfigurations()
Finish link configuration.
Definition: syncManager.cc:398
void exchangeLinkUntimedData(std::atomic< int > &msg_count)
Cause an exchange of Initialization Data to occur.
Definition: syncManager.cc:387
void execute(void) override
Function which will be called when the time for this Activity comes to pass.
Definition: syncManager.cc:324
void prepareForComplete()
Prepare for complete() phase.
Definition: syncManager.cc:411
Definition: syncManager.h:81
virtual void registerLink(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