|
SST 16.0.0
Structural Simulation Toolkit
|
Link between two components. More...
#include <link.h>
Data Structures | |
| class | AttachPoint |
| Attach point for inspecting, modifying or dropping events sent on the Link. More... | |
Public Member Functions | |
| void | addSendLatency (int cycles, const std::string &timebase) |
| Set additional Latency to be added to events being sent out of this Link. | |
| void | addSendLatency (SimTime_t cycles, TimeConverter timebase) |
| Set additional Latency to be added to events being sent out of this Link. | |
| void | addRecvLatency (int cycles, const std::string &timebase) |
| Set additional latency to be added on to events coming in on this Link. | |
| void | addRecvLatency (SimTime_t cycles, TimeConverter timebase) |
| Set additional latency to be added on to events coming in on this Link. | |
| void | setFunctor (Event::HandlerBase *functor) |
| Set the callback function to be called when a message is delivered. | |
| void | replaceFunctor (Event::HandlerBase *functor) |
| Replace the callback function to be called when a message is delivered. | |
| Event::HandlerBase * | getFunctor () |
| Get the callback function to be called when a message is delivered. | |
| void | send (SimTime_t delay, TimeConverter tc, Event *event) |
| Sends an Event over a Link with an additional delay specified with a TimeConverter. | |
| void | send (SimTime_t delay, Event *event) |
| Sends an event over a Link with additional delay specified by the Link's default timebase. | |
| void | send (Event *event) |
| Send an Event with no additional delay. | |
| Event * | recv () |
| Retrieve a pending Event from the Link. | |
| void | setDefaultTimeBase (TimeConverter tc) |
| Manually set the default defaultTimeBase. | |
| TimeConverter | getDefaultTimeBase () |
| Return the default timebase for this Link. | |
| LinkId_t | getId () |
| Return the ID of this Link. | |
| void | sendUntimedData (Event *data) |
| Send data during the init() or complete() phase. | |
| Event * | recvUntimedData () |
| Receive an Event (if any) during the init() or complete() phase. | |
| bool | isConfigured () |
| Return whether Link has been configured. | |
Protected Member Functions | |
| void | setAsSyncLink () |
| void | setDeliveryInfo (uintptr_t info) |
| Set the delivery_info for the Link. | |
| void | setTag (uint32_t new_tag) |
| Set the tag field for event link ordering. | |
| SimTime_t | getLatency () |
| Get the latency on the link in units of core atomic time base. | |
| uintptr_t | getDeliveryInfo () |
| Get the delivery_info for the link. | |
| Link * | getPairLink () |
| Get the pair_link. | |
| void | send_impl (SimTime_t delay, Event *event) |
| Sends an Event over a Link with an additional delay specified with a TimeConverter. | |
Static Protected Member Functions | |
| static void | updateEventDeliveryInfo (Event *event, uintptr_t delivery_info) |
| Updates the delivery info in an event. | |
Protected Attributes | |
| ActivityQueue * | send_queue |
| Queue of events to be received by the owning component. | |
| uintptr_t | delivery_info |
| Holds the delivery information. | |
| SimTime_t | defaultTimeBase |
| Timebase used if no other timebase is specified. | |
| SimTime_t | latency |
| Latency of the Link. | |
| Link * | pair_link |
| Pointer to the opposite side of this Link. | |
Static Protected Attributes | |
| static bool | is_restart_same_parallelism = false |
| Variable used by Link restarts to know whether stored rank data for remote links is still valid (i.e. | |
Friends | |
| class | SST::Core::Serialization::serialize_impl< Link * > |
| class | LinkPair |
| class | RankSync |
| class | ThreadSync |
| class | Simulation |
| class | SyncManager |
| class | ComponentInfo |
| class | BaseComponent |
Link between two components.
Carries events
| void SST::Link::addRecvLatency | ( | int | cycles, |
| const std::string & | timebase ) |
Set additional latency to be added on to events coming in on this Link.
| cycles | Number of cycles to be added |
| timebase | Base units of cycles |
References SST::TimeLord::getSimCycles(), SST::Simulation::getSimulation(), SST::Simulation::getTimeLord(), and pair_link.
| void SST::Link::addRecvLatency | ( | SimTime_t | cycles, |
| TimeConverter | timebase ) |
Set additional latency to be added on to events coming in on this Link.
| cycles | Number of cycles to be added |
| timebase | Base units of cycles |
References SST::TimeConverter::convertToCoreTime(), and pair_link.
| void SST::Link::addSendLatency | ( | int | cycles, |
| const std::string & | timebase ) |
Set additional Latency to be added to events being sent out of this Link.
| cycles | Number of cycles to be added |
| timebase | Base units of cycles |
References SST::TimeLord::getSimCycles(), SST::Simulation::getSimulation(), SST::Simulation::getTimeLord(), and latency.
| void SST::Link::addSendLatency | ( | SimTime_t | cycles, |
| TimeConverter | timebase ) |
Set additional Latency to be added to events being sent out of this Link.
| cycles | Number of cycles to be added |
| timebase | Base units of cycles |
References SST::TimeConverter::convertToCoreTime(), and latency.
| TimeConverter SST::Link::getDefaultTimeBase | ( | ) |
Return the default timebase for this Link.
References defaultTimeBase, SST::Simulation::getSimulation(), SST::TimeLord::getTimeConverter(), and SST::Simulation::getTimeLord().
| Event::HandlerBase * SST::Link::getFunctor | ( | ) |
Get the callback function to be called when a message is delivered.
Polling Links will return nullptr.
References pair_link.
|
inline |
Return the ID of this Link.
References attached_tools, and id.
Referenced by SST::RankSyncParallelSkip::registerLink(), SST::RankSyncSerialSkip::registerLink(), and SST::ThreadSyncSimpleSkip::registerLink().
|
inlineprotected |
Get the latency on the link in units of core atomic time base.
NOTE: This is a core only API and not part of the public stable API
References latency.
|
inline |
| Event * SST::Link::recv | ( | ) |
Retrieve a pending Event from the Link.
For Links which do not have a set event handler, they can be polled with this function. Returns nullptr if there is no pending Event. Not available for HANDLER-type Links.
References SST::Output::fatal(), SST::Simulation::getCurrentSimCycle(), SST::Activity::getDeliveryTime(), SST::Simulation::getSimulation(), SST::Simulation::getSimulationOutput(), and pair_link.
| Event * SST::Link::recvUntimedData | ( | ) |
Receive an Event (if any) during the init() or complete() phase.
References SST::Activity::getDeliveryTime(), SST::Simulation::getSimulation(), and pair_link.
| void SST::Link::replaceFunctor | ( | Event::HandlerBase * | functor | ) |
Replace the callback function to be called when a message is delivered.
Any previous handler will be deleted. Not available for Polling Links.
| functor | Functor to call when message is delivered |
References SST::Output::fatal(), SST::Simulation::getSimulation(), SST::Simulation::getSimulationOutput(), pair_link, and SST::SSTHandlerBase< returnT, argT >::transferAttachedToolInfo().
|
inline |
|
inline |
Sends an event over a Link with additional delay specified by the Link's default timebase.
References defaultTimeBase, and send_impl().
|
inline |
Sends an Event over a Link with an additional delay specified with a TimeConverter.
I.e. the total delay is the Link's delay + the additional specified delay.
| delay | Additional delay |
| tc | TimeConverter to specify timebase for the additional delay |
| event | Event to send |
References SST::TimeConverter::convertToCoreTime(), and send_impl().
|
protected |
Sends an Event over a Link with an additional delay specified with a TimeConverter.
I.e. the total delay is the Link's delay + the additional specified delay.
| delay | Additional total delay to add in units of the core timebase |
| event | Event to send |
References attached_tools, delivery_info, SST::Output::fatal(), SST::Simulation::getSimulation(), SST::Simulation::getSimulationOutput(), latency, pair_link, and send_queue.
| void SST::Link::sendUntimedData | ( | Event * | data | ) |
Send data during the init() or complete() phase.
| Data | event to send |
References delivery_info, SST::Output::fatal(), SST::Simulation::getSimulation(), SST::Simulation::getSimulationOutput(), pair_link, send_queue, and SST::Activity::setDeliveryTime().
| void SST::Link::setDefaultTimeBase | ( | TimeConverter | tc | ) |
Manually set the default defaultTimeBase.
| tc | TimeConverter object for the timebase |
References defaultTimeBase, and SST::TimeConverter::getFactor().
| void SST::Link::setFunctor | ( | Event::HandlerBase * | functor | ) |
Set the callback function to be called when a message is delivered.
Not available for Polling Links.
| functor | Functor to call when message is delivered |
References SST::Output::fatal(), SST::Simulation::getSimulation(), SST::Simulation::getSimulationOutput(), and pair_link.
|
inlineprotected |
|
inlinestaticprotected |
Updates the delivery info in an event.
This is used during a restart and is implemented here because Link is a friend of Event.
| event | Event to update |
| delivery_info | New delivery info (pointer to handler cast as uintptr_t) |
References delivery_info.
| ToolList* SST::Link::attached_tools |
This stores any tools connected to the Link::AttachPoint.
The first entry in the list will always contain the Link id since the pointer to the attached_tools list is now using that memory location.
Referenced by getId(), and send_impl().
|
protected |
Timebase used if no other timebase is specified.
Used to specify the units for added delays when sending, such as in Link::send(). Often set by the Component::registerClock() function if the regAll argument is true.
Referenced by getDefaultTimeBase(), send(), and setDefaultTimeBase().
|
protected |
Holds the delivery information.
This is stored as a uintptr_t, but is actually a pointer converted using reinterpret_cast. For Links connected to a Component/SubComponent, this holds a pointer to the delivery functor. For Links connected to a Sync object, this holds a pointer to the remote Link to send the event on after synchronization.
Referenced by getDeliveryInfo(), SST::ThreadSync::getDeliveryInfo(), send_impl(), sendUntimedData(), setDeliveryInfo(), and updateEventDeliveryInfo().
| LinkId_t SST::Link::id |
The Link id is a globally unique id.
For serial loads, the ids start at 1 and increment for each new Link.
On a parallel load, the top 32-bits is filled with the MPI rank and the bottom 32-bits start at 1 and increment for each new rank. The ids for links that cross a rank boundary need to be reconciled so that the Link objects on both ranks agree on the ID. This is done by having the "lower" rank send the Link name and it's id for the Link to the "higher" rank, which will then use that id for the Link. "Higher" and "lower" are determined in a way that hopefully spreads out the MPI traffic across all the ranks and isn't just a direct greater/less than comparison. It is determined as follows:
1 - A rank is lower than the N/2 ranks after it, wrapping around to 0 when needed.
2 - A rank is higher than the N/2 ranks before it, wrapping around to N-1 when needed.
The id is used in several places:
Referenced by getId().
|
staticprotected |
Variable used by Link restarts to know whether stored rank data for remote links is still valid (i.e.
did we restart with the exact same rank/thread count or not).
|
protected |
Latency of the Link.
It is used by the partitioner as the weight. This latency is added to the delay put on the event by the component.
Referenced by addSendLatency(), addSendLatency(), getLatency(), SST::ThreadSync::getLatency(), and send_impl().