Skip to main content

constructor

// Interface constructor
SimpleNetworkClassName(SST::ComponentId_t id, Params& params, int vns);
// Base SimpleNetwork class constructor
SST::Interfaces::SimpleNetwork(SST::ComponentId_t id);

This constructor is called when a (Sub)Component loads a SimpleNetwork interface.

Requirements

Network interface  
No specific requirements beyond constructing the object.

Endpoint  
Do not call this function directly. The functions for loading SubComponents invoke this constructor.

Parameters

  • id (ComponentId_t) A unique ID generated by SST for each SubComponent
  • params (Params&) The parameter set passed into the SimpleNetwork SubComponent by the simulation configuration file if user-defined or by the parent (Sub)Component if anonymous
  • vns (int) Number of virtual networks requested to be used by the endpoint
  • returns (SimpleNetwork) The newly constructed SimpleNetwork SubComponent

Example

Excerpt from sst-elements/src/sst/elements/merlin/interfaces/linkControl.h
#include <sst/core/interfaces/simpleNetwork.h>

// SubComponent API - define an API for a type of subcomponent
class LinkControl : public SST::Interfaces::SimpleNetwork {
public:
// Tell SST that this class is a SubComponent API
SST_ELI_REGISTER_SUBCOMPONENT(LinkControl,
"merlin",
"linkcontrol",
SST_ELI_ELEMENT_VERSION(1,0,0),
"Link Control module for building Merlin-enabled NICs",
SST::Interfaces::SimpleNetwork)

/* Rest of ELI macros */
LinkControl(ComponentId_t cid, Params &params, int vns);

~LinkControl();

/* Rest of class */
};
Excerpt from sst-elements/src/sst/elements/merlin/interfaces/linkControl.cc
#include <sst_config.h>
#include "linkControl.h"

LinkControl::LinkControl(ComponentId_t cid, Params &params, int vns) :
SST::Interfaces::SimpleNetwork(cid),
rtr_link(nullptr), output_timing(nullptr), congestion_timing(nullptr),
req_vns(vns), used_vns(0), total_vns(0), vn_out_map(nullptr),
vn_remap_out(nullptr), output_queues(nullptr), router_credits(nullptr),
router_return_credits(nullptr), input_queues(nullptr),
id(-1), logical_nid(-1), use_nid_map(false), job_id(0),
curr_out_vn(0), waiting(true), have_packets(false), start_block(0),
idle_start(0), is_idle(true),
receiveFunctor(nullptr), sendFunctor(nullptr),
network_initialized(false),
output(getSimulationOutput()),
sent(0)
{
/** Constructor implementation **/
}
#include <sst/core/interfaces/simpleNetwork.h>