14#ifndef SST_CORE_INTERFACES_SIMPLENETWORK_H
15#define SST_CORE_INTERFACES_SIMPLENETWORK_H
17#include "sst/core/params.h"
18#include "sst/core/serialization/serializable.h"
19#include "sst/core/sst_types.h"
20#include "sst/core/ssthandler.h"
21#include "sst/core/subcomponent.h"
22#include "sst/core/warnmacros.h"
26#include <unordered_map>
34namespace SST::Interfaces {
48 static const nid_t INIT_BROADCAST_ADDR;
133 if ( payload !=
nullptr )
delete payload;
141 if ( payload !=
nullptr ) req->payload = payload->
clone();
145 void setTraceID(
int id) { traceID = id; }
146 void setTraceType(
TraceType type) { trace = type; }
147 int getTraceID() {
return traceID; }
148 TraceType getTraceType() {
return trace; }
150 void serialize_order(SST::Core::Serialization::serializer& ser)
override
169 ImplementSerializable(SST::Interfaces::SimpleNetwork::Request)
174 class NetworkInspector :
public SubComponent
180 explicit NetworkInspector(ComponentId_t
id) :
184 explicit NetworkInspector() :
188 virtual ~NetworkInspector() {}
190 virtual void inspectNetworkData(
Request* req) = 0;
222 template <
typename classT, auto funcT,
typename dataT =
void>
249 template <
typename classT, auto funcT,
typename dataT =
void>
250 using Handler2 [[deprecated(
251 "The name Handler2 has been deprecated and will be removed in SST 17. Please rename Handler2 to Handler.")]]
301 virtual void init(
unsigned int UNUSED(phase))
override {}
302 virtual void complete(
unsigned int UNUSED(phase))
override {}
Main component object for the simulation.
Definition component.h:32
Definition serializable.h:25
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:43
Base class for Events - Items sent across links to communicate between components.
Definition event.h:41
virtual Event * clone()
Clones the event in for the case of a broadcast.
Definition event.cc:34
Class used to inspect network requests going through the network.
Definition simpleNetwork.h:175
Represents both network sends and receives.
Definition simpleNetwork.h:54
Event * takePayload()
Returns the payload for the request.
Definition simpleNetwork.h:81
int vn
Definition simpleNetwork.h:59
Event * inspectPayload()
Returns the payload for the request for inspection.
Definition simpleNetwork.h:95
bool head
Definition simpleNetwork.h:61
bool allow_adaptive
Definition simpleNetwork.h:63
size_t size_in_bits
Definition simpleNetwork.h:60
TraceType
Trace types.
Definition simpleNetwork.h:100
@ ROUTE
Definition simpleNetwork.h:102
@ NONE
Definition simpleNetwork.h:101
@ FULL
Definition simpleNetwork.h:103
nid_t dest
Definition simpleNetwork.h:57
Request()
Constructor.
Definition simpleNetwork.h:107
nid_t src
Definition simpleNetwork.h:58
bool tail
Definition simpleNetwork.h:62
void givePayload(Event *event)
Sets the payload field for this request.
Definition simpleNetwork.h:73
Generic network interface.
Definition simpleNetwork.h:40
virtual void setNotifyOnReceive(HandlerBase *functor)=0
Registers a functor which will fire when a new request is received from the network.
virtual void setNotifyOnSend(HandlerBase *functor)=0
Registers a functor which will fire when a request is sent to the network.
virtual Request * recv(int vn)=0
Receive a Request from the network.
virtual bool isNetworkInitialized() const =0
Check to see if network is initialized.
SSTHandlerBase< bool, int > HandlerBase
Base handler for event delivery.
Definition simpleNetwork.h:196
SimpleNetwork(SST::ComponentId_t id)
Constructor, designed to be used via 'loadUserSubComponent or loadAnonymousSubComponent'.
Definition simpleNetwork.h:257
virtual void complete(unsigned int UNUSED(phase)) override
Used during the complete phase after the end of simulation.
Definition simpleNetwork.h:302
virtual Request * recvUntimedData()=0
Receive any data during untimed phases (init() and complete()).
virtual bool send(Request *req, int vn)=0
Returns a handle to the underlying SST::Link.
virtual const UnitAlgebra & getLinkBW() const =0
Returns the final BW of the link managed by the simpleNetwork instance.
virtual void sendUntimedData(Request *req)=0
Sends a network request during untimed phases (init() and complete()).
virtual void finish() override
Called after simulation completes, but before objects are destroyed.
Definition simpleNetwork.h:303
virtual void init(unsigned int UNUSED(phase)) override
Used during the init phase.
Definition simpleNetwork.h:301
virtual bool spaceToSend(int vn, int num_bits)=0
Checks if there is sufficient space to send on the specified virtual network.
int64_t nid_t
All Addresses can be 64-bit.
Definition simpleNetwork.h:45
virtual void setup() override
Called after all components have been constructed and initialization has completed,...
Definition simpleNetwork.h:300
SSTHandler< bool, int, classT, dataT, funcT > Handler
Used to create checkpointable handlers to notify the endpoint when the SimpleNetwork sends or recieve...
Definition simpleNetwork.h:223
virtual nid_t getEndpointID() const =0
Returns the endpoint ID.
virtual bool requestToReceive(int vn)=0
Checks if there is a waiting network request request pending in the specified virtual network.
Link between two components.
Definition link.h:57
Base template for handlers which take a class defined argument.
Definition ssthandler.h:79
Base template for the class.
Definition ssthandler.h:1102
SubComponent is a class loadable through the factory which allows dynamic functionality to be added t...
Definition subcomponent.h:29
Performs Unit math in full precision.
Definition unitAlgebra.h:107