12 #ifndef SST_CORE_CORETEST_MESSAGEMESH_ENCLOSINGCOMPONENT_H 13 #define SST_CORE_CORETEST_MESSAGEMESH_ENCLOSINGCOMPONENT_H 15 #include "sst/core/testElements/message_mesh/messageEvent.h" 17 #include "sst/core/component.h" 18 #include "sst/core/event.h" 19 #include "sst/core/link.h" 20 #include "sst/core/rng/rng.h" 21 #include "sst/core/ssthandler.h" 22 #include "sst/core/subcomponent.h" 26 namespace MessageMesh {
60 template <
typename classT,
typename dataT =
void>
63 virtual void setNotifyOnReceive(
HandlerBase* functor) { rFunctor = functor; }
79 virtual void send(
MessageEvent* ev,
int incoming_port) = 0;
86 SST_ELI_REGISTER_COMPONENT(
89 "message_mesh.enclosing_component",
90 SST_ELI_ELEMENT_VERSION(1,0,0),
91 "Base element that encloses the SubComponents that actually provide the functionality",
92 COMPONENT_CATEGORY_NETWORK
95 SST_ELI_DOCUMENT_PARAMS(
96 {
"id",
"Id for this componentd",
""},
99 SST_ELI_DOCUMENT_STATISTICS(
102 SST_ELI_DOCUMENT_PORTS(
105 SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
106 {
"ports",
"Slot that the ports objects go in",
"SST::CoreTest::MessageMesh::PortInterface" },
107 {
"route",
"Slot that the ports objects go in",
"SST::CoreTest::MessageMesh::RouteInterface" }
118 std::vector<PortInterface*> ports;
131 SST_ELI_REGISTER_SUBCOMPONENT(
134 "message_mesh.port_slot",
135 SST_ELI_ELEMENT_VERSION(1,0,0),
136 "SubComponent implementing PortInterface that simply defers to another loaded PortInterface",
140 SST_ELI_DOCUMENT_PARAMS(
143 SST_ELI_DOCUMENT_STATISTICS(
146 SST_ELI_DOCUMENT_PORTS(
149 SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
150 {
"port",
"Slot to load the real PortInterface object",
"SST::CoreTest::MessageMesh::PortInterface" }
156 void send(
MessageEvent* ev)
override { port->send(ev); }
157 void setNotifyOnReceive(
HandlerBase* functor)
override { port->setNotifyOnReceive(functor); }
168 SST_ELI_REGISTER_SUBCOMPONENT(
171 "message_mesh.message_port",
172 SST_ELI_ELEMENT_VERSION(1,0,0),
173 "SubComponent implementing PortInterface for sending and receiving messages",
177 SST_ELI_DOCUMENT_PARAMS(
180 SST_ELI_DOCUMENT_STATISTICS(
183 SST_ELI_DOCUMENT_PORTS(
184 {
"port",
"Port to send or receive on", {
"" } },
187 SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
194 void handleEvent(
Event* ev);
204 SST_ELI_REGISTER_SUBCOMPONENT(
207 "message_mesh.route_message",
208 SST_ELI_ELEMENT_VERSION(1,0,0),
209 "SubComponent implementing message routing",
213 SST_ELI_DOCUMENT_PARAMS(
216 SST_ELI_DOCUMENT_STATISTICS(
219 SST_ELI_DOCUMENT_PORTS(
222 SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
225 RouteMessage(ComponentId_t
id,
Params& params,
const std::vector<PortInterface*>& ports,
int my_id);
228 void send(
MessageEvent* ev,
int incoming_port)
override;
231 const std::vector<PortInterface*> ports;
240 #endif // SST_CORE_CORETEST_MESSAGEMESH_ENCLOSINGCOMPONENT_H Implements the base class for random number generators for the SST core.
Definition: rng.h:29
Handlers with 1 handler defined argument to callback from caller.
Definition: ssthandler.h:210
Definition: enclosingComponent.h:82
SSTHandlerBase< void, Event * > HandlerBase
Base handler for event delivery.
Definition: enclosingComponent.h:39
Handler class with user-data argument.
Definition: ssthandler.h:284
Main component object for the simulation.
Definition: component.h:30
Definition: messageEvent.h:21
Definition: enclosingComponent.h:164
Definition: enclosingComponent.h:28
Definition: enclosingComponent.h:127
Definition: enclosingComponent.h:200
Parameter store.
Definition: params.h:55
void finish()
Called after complete phase, but before objects are destroyed.
Definition: enclosingComponent.cc:72
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:34
void setup()
Called after all components have been constructed and initialization has completed, but before simulation time has begun.
Definition: enclosingComponent.cc:60
SubComponent is a class loadable through the factory which allows dynamic functionality to be added t...
Definition: subcomponent.h:28
Definition: enclosingComponent.h:71
Link between two components.
Definition: link.h:51