SST/macro
Public Member Functions | Protected Attributes | List of all members
sstmac::hw::simple_topology Class Reference

#include <simple_topology.h>

Inheritance diagram for sstmac::hw::simple_topology:
Inheritance graph
Collaboration diagram for sstmac::hw::simple_topology:
Collaboration graph

Public Member Functions

virtual std::string to_string () const
 
virtual ~simple_topology ()
 
 simple_topology ()
 
void init_factory_params (sprockit::sim_parameters *params)
 
virtual void finalize_init ()
 
int num_leaf_switches () const
 Structured topologies can be direct (torus) or indirect (fat tree). More...
 
int num_switches () const
 
int num_endpoints () const
 
int num_nodes () const
 
void compute_switch_coords (switch_id swid, coordinates &coords) const
 Compute coordinates (e.g. More...
 
int convert_to_port (int dim, int dir) const
 
void connect_objects (internal_connectable_map &objects)
 Given a set of connectables, connect them appropriately. More...
 
coordinates node_coords (node_id uid) const
 Compute coordinates (e.g. More...
 
void minimal_route_to_coords (const coordinates &src_coords, const coordinates &dest_coords, structured_routable::path &path) const
 Workhorse function for implementing minimal_route_to_switch and #minimal_route_to_node. More...
 
int minimal_distance (const coordinates &src_coords, const coordinates &dest_coords) const
 The function accepts either source or node coordinates. More...
 
virtual int num_hops_to_node (node_id src, node_id dst) const
 
virtual int ndimensions () const
 The number of distinct 'dimensions' in the topology. More...
 
virtual int diameter () const
 
virtual int radix () const
 
void configure_vc_routing (std::map< routing::algorithm_t, int > &m) const
 
switch_id switch_number (const coordinates &coords) const
 
virtual std::vector< node_idnodes_connected_to_switch (switch_id swaddr) const
 
virtual switch_id endpoint_to_ejection_switch (node_id nodeaddr, int &switch_port) const
 
virtual switch_id endpoint_to_injection_switch (node_id nodeaddr, int &switch_port) const
 
virtual void productive_path (int dim, const coordinates &src, const coordinates &dst, structured_routable::path &path) const
 
- Public Member Functions inherited from sstmac::hw::structured_topology
virtual ~structured_topology ()
 
virtual void build_internal_connectables (internal_connectable_map &connectables, sprockit::factory< connectable > *factory, partition *part, int my_rank, sprockit::sim_parameters *params, connectable *dummy)
 
virtual void build_endpoint_connectables (end_point_connectable_map &connectables, sprockit::factory< connectable > *factory, partition *part, int my_rank, sprockit::sim_parameters *params)
 
virtual void build_interface_connectables (int conc, end_point_connectable_map &connectables, sprockit::factory2< connectable > *nic_factory, partition *part, int my_rank, sprockit::sim_parameters *params, sprockit::factory_type *interconnect)
 
virtual void minimal_routes_to_coords (const coordinates &src_coords, const coordinates &dest_coords, structured_routable::path &current_path, structured_routable::path_set &paths) const
 
virtual int endpoints_per_switch (switch_id addr) const
 Given a switch address, return number of nodes connected to it. More...
 
coordinates switch_coords (switch_id swid) const
 Compute coordinates (e.g. More...
 
coordinates endpoint_coords (node_id nid) const
 
virtual int endpoint_to_ejection_port (node_id addr) const
 
virtual int endpoint_to_injection_port (node_id addr) const
 
virtual int endpoint_to_switch_port (node_id nid) const
 
void finalize_init ()
 
virtual void productive_paths (structured_routable::path_set &paths, const coordinates &current, const coordinates &dst)
 
std::string label (node_id nid) const
 
std::string label (switch_id sid) const
 
virtual void minimal_route_to_switch (switch_id current_sw_addr, switch_id dest_sw_addr, structured_routable::path &path) const
 Implementation of topology::minimal_route_to_switch. More...
 
virtual void minimal_routes_to_switch (switch_id current_sw_addr, switch_id dest_sw_addr, structured_routable::path &current_path, structured_routable::path_set &paths) const
 
virtual void eject_paths_on_switch (node_id dest_addr, switch_id sw_addr, structured_routable::path_set &paths) const
 
virtual std::vector< node_idnodes_connected_to_injection_switch (switch_id swaddr) const
 
virtual std::vector< node_idnodes_connected_to_ejection_switch (switch_id swid) const
 
virtual coordinates neighbor_at_port (switch_id sid, int port) const
 
virtual node_id node_addr (const coordinates &coords) const
 
virtual node_id node_addr (const coordinates &sw_coords, int port) const
 
virtual void send_partners (traffic_pattern::type_t ty, node_id src_node, std::vector< node_id > &partners) const
 
virtual void recv_partners (traffic_pattern::type_t ty, node_id src_node, std::vector< node_id > &partners) const
 

Protected Attributes

int num_switches_
 
int num_nodes_
 
int num_switches_with_extra_node_
 
hw::topology * actual_topology_
 
- Protected Attributes inherited from sstmac::hw::structured_topology
int eject_geometric_id_
 
int injection_redundancy_
 
bool outputgraph_
 

Additional Inherited Members

- Protected Member Functions inherited from sstmac::hw::structured_topology
void configure_injection_geometry (std::vector< int > &redundancies)
 
 structured_topology ()
 
void partners (bool get_send_partner, traffic_pattern::type_t ty, node_id src, std::vector< node_id > &partner_list) const
 
virtual void nearest_neighbor_partners (const coordinates &src_sw_coords, int port, std::vector< node_id > &partners) const
 
virtual void tornado_recv_partners (const coordinates &src_sw_coords, int port, std::vector< node_id > &partners) const
 
virtual void tornado_send_partners (const coordinates &src_sw_coords, int port, std::vector< node_id > &partners) const
 
virtual void bit_complement_partners (const coordinates &src_sw_coords, int port, std::vector< node_id > &partners) const
 

Detailed Description

Definition at line 32 of file simple_topology.h.

Constructor & Destructor Documentation

virtual sstmac::hw::simple_topology::~simple_topology ( )
virtual

Referenced by to_string().

sstmac::hw::simple_topology::simple_topology ( )
inline

Definition at line 44 of file simple_topology.h.

References finalize_init(), and init_factory_params().

Here is the call graph for this function:

Member Function Documentation

void sstmac::hw::simple_topology::compute_switch_coords ( switch_id  swid,
coordinates coords 
) const
virtual

Compute coordinates (e.g.

X,Y,Z for 3D torus)

Parameters
swidThe unique index defining a switch location
coords[inout] The unique coordinates of the switch

Implements sstmac::hw::structured_topology.

Referenced by num_nodes().

void sstmac::hw::simple_topology::configure_vc_routing ( std::map< routing::algorithm_t, int > &  m) const
inline

Definition at line 113 of file simple_topology.h.

References endpoint_to_ejection_switch(), endpoint_to_injection_switch(), nodes_connected_to_switch(), productive_path(), and switch_number().

Here is the call graph for this function:

void sstmac::hw::simple_topology::connect_objects ( internal_connectable_map &  objects)
virtual

Given a set of connectables, connect them appropriately.

Parameters
objectsThe set of objects to connect
clonerIf in parallel mode, not all objects may exist. The factory creates missing objects.
Exceptions
value_errorIf invalid switchid is passed to cloner

Implements sstmac::hw::structured_topology.

Referenced by num_nodes().

int sstmac::hw::simple_topology::convert_to_port ( int  dim,
int  dir 
) const

Referenced by num_nodes().

virtual int sstmac::hw::simple_topology::diameter ( ) const
virtual

Implements sstmac::hw::structured_topology.

Referenced by num_nodes().

virtual switch_id sstmac::hw::simple_topology::endpoint_to_ejection_switch ( node_id  nodeaddr,
int &  switch_port 
) const
virtual

Reimplemented from sstmac::hw::structured_topology.

Referenced by configure_vc_routing().

virtual switch_id sstmac::hw::simple_topology::endpoint_to_injection_switch ( node_id  nodeaddr,
int &  switch_port 
) const
virtual

Reimplemented from sstmac::hw::structured_topology.

Referenced by configure_vc_routing().

virtual void sstmac::hw::simple_topology::finalize_init ( )
virtual

Referenced by simple_topology().

void sstmac::hw::simple_topology::init_factory_params ( sprockit::sim_parameters *  params)
virtual

Reimplemented from sstmac::hw::structured_topology.

Referenced by simple_topology().

int sstmac::hw::simple_topology::minimal_distance ( const coordinates src_coords,
const coordinates dest_coords 
) const
virtual

The function accepts either source or node coordinates.

This gives the minimal distance counting the number of hops between switches. If node coordinates are given, the last coordinate is just ignored.

Parameters
src_coords.The source coordinates. This can be either switch or node coordinates.
dest_coords.The destination coordinates. This can be either switch or node coordinates.
Returns
The number of hops to final destination

Implements sstmac::hw::structured_topology.

Referenced by num_nodes().

void sstmac::hw::simple_topology::minimal_route_to_coords ( const coordinates src_coords,
const coordinates dest_coords,
structured_routable::path path 
) const
virtual

Workhorse function for implementing minimal_route_to_switch and #minimal_route_to_node.

Given source/dest coordinates, find the minimal path.

Parameters
current_sw_addrThe addr of the current switch
dest_sw_addrThe addr of the destination switch
path[inout] A complete path descriptor to the destination switch

Implements sstmac::hw::structured_topology.

Referenced by num_nodes().

virtual int sstmac::hw::simple_topology::ndimensions ( ) const
virtual

The number of distinct 'dimensions' in the topology.

This can correspond directly to standard X,Y,Z dimensions or the the number of levels in a fat tree. The keyword topology_redundant vector should have this many entries.

Implements sstmac::hw::structured_topology.

Referenced by num_nodes().

coordinates sstmac::hw::simple_topology::node_coords ( node_id  nid) const
virtual

Compute coordinates (e.g.

X,Y,Z for 3D torus). In many cases, this will just be the switch coordinates if #nps_ = 1, one node per switch. If there are multiple nodes per switch, this will usually be the coordinates of the connected injection switch PLUS an extra index describing if it is the 0th, 1st, 2nd node on that switch. e.g. nps = 1, inj_sw = <0,2,1>, node = <0,2,1> e.g. nps = 3, inj_sw = <0,2,1>, node = <0,2,1,1>

Parameters
nidThe unique index defining a node location
Returns
The unique coordinates of the node

Reimplemented from sstmac::hw::structured_topology.

Referenced by num_nodes().

virtual std::vector<node_id> sstmac::hw::simple_topology::nodes_connected_to_switch ( switch_id  swaddr) const
virtual

Reimplemented from sstmac::hw::structured_topology.

Referenced by configure_vc_routing().

int sstmac::hw::simple_topology::num_endpoints ( ) const
inlinevirtual

Reimplemented from sstmac::hw::structured_topology.

Definition at line 66 of file simple_topology.h.

References num_nodes_.

virtual int sstmac::hw::simple_topology::num_hops_to_node ( node_id  src,
node_id  dst 
) const
virtual

Reimplemented from sstmac::hw::structured_topology.

Referenced by num_nodes().

int sstmac::hw::simple_topology::num_leaf_switches ( ) const
inlinevirtual

Structured topologies can be direct (torus) or indirect (fat tree).

We therefore need to distinguish the total number of switches and the number of leaf switches - i.e. those directly connected to nodes. For direct topologies, num_switches and num_leaf_switches are the same. For indirect, num_leaf_switches < num_switches.

Returns
The number of leaf switches directly connected to compute nodes

Implements sstmac::hw::structured_topology.

Definition at line 56 of file simple_topology.h.

References num_switches_.

int sstmac::hw::simple_topology::num_nodes ( ) const
inlinevirtual
int sstmac::hw::simple_topology::num_switches ( ) const
inline

Definition at line 61 of file simple_topology.h.

References num_switches_.

virtual void sstmac::hw::simple_topology::productive_path ( int  dim,
const coordinates src,
const coordinates dst,
structured_routable::path path 
) const
virtual
Parameters
dimThe dimension you want to move in. You might need to traverse other dimensions FIRST before you make progress on this dimension.
srcThe coordinates of the source switch
dstThe coordinates of the dest switch
path[inout] The path configuration for making progress on dim

Implements sstmac::hw::structured_topology.

Referenced by configure_vc_routing().

virtual int sstmac::hw::simple_topology::radix ( ) const
inlinevirtual

Definition at line 108 of file simple_topology.h.

References num_switches_.

switch_id sstmac::hw::simple_topology::switch_number ( const coordinates coords) const
virtual
virtual std::string sstmac::hw::simple_topology::to_string ( ) const
inlinevirtual

Definition at line 38 of file simple_topology.h.

References ~simple_topology().

Here is the call graph for this function:

Member Data Documentation

hw::topology* sstmac::hw::simple_topology::actual_topology_
protected

Definition at line 140 of file simple_topology.h.

int sstmac::hw::simple_topology::num_nodes_
protected

Definition at line 138 of file simple_topology.h.

Referenced by num_endpoints(), and num_nodes().

int sstmac::hw::simple_topology::num_switches_
protected

Definition at line 137 of file simple_topology.h.

Referenced by num_leaf_switches(), num_switches(), and radix().

int sstmac::hw::simple_topology::num_switches_with_extra_node_
protected

Definition at line 139 of file simple_topology.h.


The documentation for this class was generated from the following file: