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"
25 #include <unordered_map>
33 namespace Interfaces {
43 bool delegate_send =
false;
44 bool delegate_recv =
false;
51 #define PRI_NID PRIi64
53 static const nid_t INIT_BROADCAST_ADDR;
138 if ( payload !=
nullptr )
delete payload;
146 if ( payload !=
nullptr ) req->payload = payload->
clone();
150 void setTraceID(
int id) { traceID = id; }
151 void setTraceType(
TraceType type) { trace = type; }
152 int getTraceID() {
return traceID; }
153 TraceType getTraceType() {
return trace; }
189 virtual void inspectNetworkData(
Request* req) = 0;
221 template <
typename classT,
typename dataT =
void>
232 #if !SST_BUILDING_CORE
234 "sendInitData() has been deprecated and will be removed in SST 14. Please use sendUntimedData() instead.")]]
243 #if !SST_BUILDING_CORE
245 "recvInitData() has been deprecated and will be removed in SST 14. Please use recvUntimedData() instead.")]]
302 virtual void init(
unsigned int UNUSED(phase))
override {}
303 virtual void complete(
unsigned int UNUSED(phase))
override {}
Definition: serializable.h:139
Definition: serializable.h:119
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:35
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:35
virtual Event * clone()
Clones the event in for the case of a broadcast.
Definition: event.cc:35
Class used to inspect network requests going through the network.
Definition: simpleNetwork.h:180
Represents both network sends and receives.
Definition: simpleNetwork.h:59
int vn
Definition: simpleNetwork.h:64
Event * inspectPayload()
Returns the payload for the request for inspection.
Definition: simpleNetwork.h:100
bool head
Definition: simpleNetwork.h:66
bool allow_adaptive
Definition: simpleNetwork.h:68
size_t size_in_bits
Definition: simpleNetwork.h:65
TraceType
Trace types.
Definition: simpleNetwork.h:105
@ ROUTE
Definition: simpleNetwork.h:107
@ NONE
Definition: simpleNetwork.h:106
@ FULL
Definition: simpleNetwork.h:108
nid_t dest
Definition: simpleNetwork.h:62
Request()
Constructor.
Definition: simpleNetwork.h:112
nid_t src
Definition: simpleNetwork.h:63
bool tail
Definition: simpleNetwork.h:67
void givePayload(Event *event)
Sets the payload field for this request.
Definition: simpleNetwork.h:78
Event * takePayload()
Returns the payload for the request.
Definition: simpleNetwork.h:86
Generic network interface.
Definition: simpleNetwork.h:39
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.
int64_t nid_t
All Addresses can be 64-bit.
Definition: simpleNetwork.h:50
virtual bool isNetworkInitialized() const =0
Check to see if network is initialized.
SimpleNetwork(SST::ComponentId_t id)
Constructor, designed to be used via 'loadUserSubComponent or loadAnonymousSubComponent'.
Definition: simpleNetwork.h:227
virtual void complete(unsigned int UNUSED(phase)) override
Used during the complete phase after the end of simulation.
Definition: simpleNetwork.h:303
virtual Request * recvInitData()
Receive any data during the init() phase.
Definition: simpleNetwork.cc:69
virtual bool send(Request *req, int vn)=0
Send a Request to the network.
virtual void sendInitData(Request *req)
Sends a network request during the init() phase.
Definition: simpleNetwork.cc:55
virtual void sendUntimedData(Request *req)
Sends a network request during untimed phases (init() and complete()).
Definition: simpleNetwork.cc:26
virtual void finish() override
Called after simulation completes, but before objects are destroyed.
Definition: simpleNetwork.h:304
virtual const UnitAlgebra & getLinkBW() const =0
Returns the final BW of the link managed by the simpleNetwork instance.
virtual void init(unsigned int UNUSED(phase)) override
Used during the init phase.
Definition: simpleNetwork.h:302
virtual bool spaceToSend(int vn, int num_bits)=0
Checks if there is sufficient space to send on the specified virtual network.
virtual Request * recvUntimedData()
Receive any data during untimed phases (init() and complete()).
Definition: simpleNetwork.cc:40
virtual void setup() override
Called after all components have been constructed and initialization has completed,...
Definition: simpleNetwork.h:301
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.
Handlers with 1 handler defined argument to callback from caller.
Definition: ssthandler.h:171
Handler class with user-data argument.
Definition: ssthandler.h:220
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:109