12 #ifndef SST_CORE_LINK_H 13 #define SST_CORE_LINK_H 15 #include "sst/core/event.h" 16 #include "sst/core/rankInfo.h" 17 #include "sst/core/serialization/serialize_impl_fwd.h" 18 #include "sst/core/sst_types.h" 19 #include "sst/core/timeConverter.h" 27 #define _LINK_DBG(fmt, args...) __DBG(DBG_LINK, Link, fmt, ##args) 33 class Simulation_impl;
38 class EventHandlerProfileTool;
48 void serialize_events(
51 SST_FRIEND_SERIALIZE();
58 enum Type_t : uint16_t { POLL, HANDLER, SYNC, UNINITIALIZED };
59 enum Mode_t : uint16_t { INIT, RUN, COMPLETE };
143 [[deprecated(
"Use of shared TimeConverter objects is deprecated. Use 'addSendLatency(SimTime_t cycles, " 144 "TimeConverter timebase)' (i.e., no pointer) instead.")]]
158 [[deprecated(
"Use of shared TimeConverter objects is deprecated. Use 'addRecvLatency(SimTime_t cycles, " 159 "TimeConverter timebase)' (i.e., no pointer) instead.")]]
190 "Use of shared TimeConverter objects is deprecated. Use 'send(SimTime_t delay, const TimeConverter& tc, " 191 "Event* event)' instead.")]]
194 send(delay, *tc, event);
234 [[deprecated(
"Use of shared TimeConverter objects is deprecated. Use 'setDefaultTimeBase(TimeConverter tc)', " 235 "(i.e., no pointer) instead.")]]
274 #ifdef __SST_DEBUG_EVENT_TRACKING__ 275 void setSendingComponentInfo(
const std::string& comp_in,
const std::string& type_in,
const std::string& port_in)
282 const std::string& getSendingComponentName() {
return comp; }
283 const std::string& getSendingComponentType() {
return ctype; }
284 const std::string& getSendingPort() {
return port; }
291 void setAsSyncLink() { type = SYNC; }
362 SimTime_t& current_time;
379 explicit Link(LinkId_t tag);
390 void setLatency(Cycle_t lat);
392 void sendUntimedData_sync(
Event* data);
393 void finalizeConfiguration();
394 void prepareForComplete();
396 std::string createUniqueGlobalLinkName(
397 RankInfo local_rank, uintptr_t local_ptr,
RankInfo remote_rank, uintptr_t remote_ptr);
401 void detachTool(AttachPoint* tool);
404 using ToolList = std::vector<std::pair<AttachPoint*, uintptr_t>>;
405 ToolList* attached_tools;
416 #ifdef __SST_DEBUG_EVENT_TRACKING__ 438 #endif // SST_CORE_LINK_H virtual void eventSent(uintptr_t key, Event *&ev)=0
Function that will be called when an event is sent on a link with registered attach points...
static void updateEventDeliveryInfo(Event *event, uintptr_t delivery_info)
Updates the delivery info in an event.
Definition: link.h:317
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:42
Definition: syncManager.h:137
Base template for handlers which take a class defined argument.
Definition: ssthandler.h:109
void send(SimTime_t delay, TimeConverter tc, Event *event)
Send an event over the link with additional delay.
Definition: link.h:205
Self Links are links from a component to itself.
Definition: link.h:424
Event::HandlerBase * getFunctor()
Get the callback function to be called when a message is delivered.
Definition: link.cc:653
A class to convert between a component's view of time and the core's view of time.
Definition: timeConverter.h:27
Definition: syncManager.h:42
bool isConfigured()
Return whether link has been configured.
Definition: link.h:272
void setDeliveryInfo(uintptr_t info)
Set the delivery_info for the link.
Definition: link.h:296
void addRecvLatency(int cycles, const std::string &timebase)
Set additional Latency to be added on to events coming in on this link.
Definition: link.cc:605
void sendUntimedData(Event *data)
Send data during the init() or complete() phase.
Definition: link.cc:722
Base serialize class.
Definition: serialize.h:113
void send(SimTime_t delay, TimeConverter *tc, Event *event)
Send an event over the link with additional delay.
Definition: link.h:192
SimTime_t latency
Latency of the link.
Definition: link.h:354
LinkId_t getId()
Return the ID of this link.
Definition: link.h:256
SimTime_t defaultTimeBase
Timebase used if no other timebase is specified.
Definition: link.h:348
void replaceFunctor(Event::HandlerBase *functor)
Replace the callback function to be called when a message is delivered.
Definition: link.cc:636
void addSendLatency(int cycles, const std::string &timebase)
Set additional Latency to be added to events being sent out of this link.
Definition: link.cc:586
Link * pair_link
Pointer to the opposite side of this link.
Definition: link.h:357
Definition: syncManager.h:94
Event * recv()
Retrieve a pending event from the Link.
Definition: link.cc:700
Event * recvUntimedData()
Receive an event (if any) during the init() or complete() phase.
Definition: link.cc:755
void setFunctor(Event::HandlerBase *functor)
Set the callback function to be called when a message is delivered.
Definition: link.cc:624
void send_impl(SimTime_t delay, Event *event)
Send an event over the link with additional delay.
Definition: link.cc:662
Main control class for a SST Simulation.
Definition: simulation_impl.h:122
Definition: rankInfo.h:23
void setDefaultTimeBase(TimeConverter *tc)
Manually set the default defaultTimeBase.
Definition: link.cc:771
Main component object for the simulation.
Definition: baseComponent.h:64
Defines a pair of links (to define a connected link)
Definition: linkPair.h:23
void send(SimTime_t delay, Event *event)
Send an event with additional delay.
Definition: link.h:214
virtual void serializeEventAttachPointKey(SST::Core::Serialization::serializer &ser, uintptr_t &key)
Function that will be called to handle the key returned from registerLinkAttachTool, if the AttachPoint tool is serializable.
Definition: link.cc:864
virtual uintptr_t registerLinkAttachTool(const AttachPointMetaData &mdata)=0
Function that will be called when an attach point is registered with the tool implementing the attach...
uintptr_t delivery_info
Holds the delivery information.
Definition: link.h:341
ActivityQueue * send_queue
Queue of events to be received by the owning component.
Definition: link.h:331
SimTime_t convertToCoreTime(SimTime_t time) const
Converts from the component's view to the core's view of time.
Definition: timeConverter.h:62
Definition: componentInfo.h:44
Attach point for inspecting, modifying or dropping events sent on the Link.
Definition: link.h:73
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:40
void send(Event *event)
Send an event with the Link's default delay.
Definition: link.h:219
Link between two components.
Definition: link.h:56
TimeConverter * getDefaultTimeBase()
Return the default Time Base for this link.
Definition: link.cc:786