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

Encapsulates a topology like torus, fat tree, butterfly which has a regular, well-defined structure. More...

#include <structured_topology.h>

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

Public Member Functions

virtual ~structured_topology ()
 
virtual int num_leaf_switches () const =0
 Structured topologies can be direct (torus) or indirect (fat tree). More...
 
virtual void connect_objects (internal_connectable_map &objects)=0
 Given a set of connectables, connect them appropriately. More...
 
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_route_to_coords (const coordinates &src_coords, const coordinates &dest_coords, structured_routable::path &path) const =0
 Workhorse function for implementing minimal_route_to_switch and #minimal_route_to_node. More...
 
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 minimal_distance (const coordinates &src_coords, const coordinates &dest_coords) const =0
 The function accepts either source or node coordinates. More...
 
virtual int ndimensions () const =0
 The number of distinct 'dimensions' in the topology. More...
 
virtual int diameter () const =0
 
virtual switch_id switch_number (const coordinates &coords) const =0
 
virtual void productive_path (int dim, const coordinates &src, const coordinates &dst, structured_routable::path &path) const =0
 
virtual void init_factory_params (sprockit::sim_parameters *params)
 
virtual int endpoints_per_switch (switch_id addr) const
 Given a switch address, return number of nodes connected to it. More...
 
virtual int num_nodes () const
 
virtual int num_endpoints () const
 
coordinates switch_coords (switch_id swid) const
 Compute coordinates (e.g. More...
 
virtual coordinates node_coords (node_id nid) const
 Compute coordinates (e.g. More...
 
coordinates endpoint_coords (node_id nid) 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 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 int num_hops_to_node (node_id src, node_id dst) 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
 
virtual void compute_switch_coords (switch_id swid, coordinates &coords) const =0
 Compute coordinates (e.g. More...
 

Protected Member Functions

void configure_injection_geometry (std::vector< int > &redundancies)
 
virtual std::vector< node_idnodes_connected_to_switch (switch_id swaddr) const
 
 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
 

Protected Attributes

int eject_geometric_id_
 
int injection_redundancy_
 
bool outputgraph_
 

Detailed Description

Encapsulates a topology like torus, fat tree, butterfly which has a regular, well-defined structure.

Routing on these topologies is regular enough to be done with simple math computations without resorting to a large routing table. This contrasts with unstructured topologies like #top_from_file where there is no regular structure and routing must be done via lookup table.

The major defining characteristic of a structured topology is being able to define a coordinate system. Each switch in the topology has a unique number and that number can be mapped to a unique set of coordinates. A torus has an obvious mapping of index to X,Y,Z coordinates. A butterfly or fat tree also has a well-defined coordinate system, but is slightly less intuitive.

Definition at line 36 of file structured_topology.h.

Constructor & Destructor Documentation

virtual sstmac::hw::structured_topology::~structured_topology ( )
inlinevirtual
sstmac::hw::structured_topology::structured_topology ( )
protected

Member Function Documentation

virtual void sstmac::hw::structured_topology::bit_complement_partners ( const coordinates src_sw_coords,
int  port,
std::vector< node_id > &  partners 
) const
protectedvirtual
virtual void sstmac::hw::structured_topology::build_endpoint_connectables ( end_point_connectable_map &  connectables,
sprockit::factory< connectable > *  factory,
partition part,
int  my_rank,
sprockit::sim_parameters *  params 
)
virtual

Referenced by ~structured_topology().

virtual void sstmac::hw::structured_topology::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

Referenced by ~structured_topology().

virtual void sstmac::hw::structured_topology::build_internal_connectables ( internal_connectable_map &  connectables,
sprockit::factory< connectable > *  factory,
partition part,
int  my_rank,
sprockit::sim_parameters *  params,
connectable dummy 
)
virtual

Referenced by ~structured_topology().

virtual void sstmac::hw::structured_topology::compute_switch_coords ( switch_id  swid,
coordinates coords 
) const
pure virtual
void sstmac::hw::structured_topology::configure_injection_geometry ( std::vector< int > &  redundancies)
protected
virtual void sstmac::hw::structured_topology::connect_objects ( internal_connectable_map &  objects)
pure 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

Implemented in sstmac::hw::simple_fat_tree, sstmac::hw::butterfly, sstmac::hw::dragonfly, sstmac::hw::fat_tree, sstmac::hw::hdtorus, sstmac::hw::simple_topology, sstmac::hw::tiled_dragonfly, sstmac::hw::flattened_butterfly, sstmac::hw::crossbar, sstmac::hw::fake_topology, sstmac::hw::hypercube, and sstmac::hw::xpress_ring.

Referenced by sstmac::hw::butterfly::num_switches(), sstmac::hw::fat_tree::~fat_tree(), sstmac::hw::simple_fat_tree::~simple_fat_tree(), and ~structured_topology().

virtual int sstmac::hw::structured_topology::diameter ( ) const
pure virtual
virtual void sstmac::hw::structured_topology::eject_paths_on_switch ( node_id  dest_addr,
switch_id  sw_addr,
structured_routable::path_set paths 
) const
virtual
coordinates sstmac::hw::structured_topology::endpoint_coords ( node_id  nid) const

Referenced by num_endpoints().

virtual int sstmac::hw::structured_topology::endpoint_to_ejection_port ( node_id  addr) const
virtual

Referenced by num_endpoints().

virtual switch_id sstmac::hw::structured_topology::endpoint_to_ejection_switch ( node_id  nodeaddr,
int &  switch_port 
) const
virtual
virtual int sstmac::hw::structured_topology::endpoint_to_injection_port ( node_id  addr) const
virtual

Referenced by num_endpoints().

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

Reimplemented in sstmac::hw::simple_topology.

Referenced by num_endpoints().

virtual int sstmac::hw::structured_topology::endpoint_to_switch_port ( node_id  nid) const
inlinevirtual

Definition at line 222 of file structured_topology.h.

References finalize_init(), label(), minimal_route_to_switch(), and productive_paths().

Here is the call graph for this function:

virtual int sstmac::hw::structured_topology::endpoints_per_switch ( switch_id  addr) const
inlinevirtual

Given a switch address, return number of nodes connected to it.

Definition at line 168 of file structured_topology.h.

void sstmac::hw::structured_topology::finalize_init ( )

Referenced by endpoint_to_switch_port().

virtual void sstmac::hw::structured_topology::init_factory_params ( sprockit::sim_parameters *  params)
virtual
std::string sstmac::hw::structured_topology::label ( node_id  nid) const

Referenced by endpoint_to_switch_port().

std::string sstmac::hw::structured_topology::label ( switch_id  sid) const
virtual int sstmac::hw::structured_topology::minimal_distance ( const coordinates src_coords,
const coordinates dest_coords 
) const
pure 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

Implemented in sstmac::hw::simple_fat_tree, sstmac::hw::fat_tree, sstmac::hw::butterfly, sstmac::hw::dragonfly, sstmac::hw::hdtorus, sstmac::hw::simple_topology, sstmac::hw::crossbar, sstmac::hw::xpress_ring, sstmac::hw::fake_topology, sstmac::hw::flattened_butterfly, and sstmac::hw::hypercube.

Referenced by sstmac::hw::fat_tree::default_router(), minimal_routes_to_coords(), sstmac::hw::butterfly::num_switches(), and sstmac::hw::simple_fat_tree::num_switches().

virtual void sstmac::hw::structured_topology::minimal_route_to_coords ( const coordinates src_coords,
const coordinates dest_coords,
structured_routable::path path 
) const
pure 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

Implemented in sstmac::hw::simple_fat_tree, sstmac::hw::fat_tree, sstmac::hw::butterfly, sstmac::hw::dragonfly, sstmac::hw::tiled_dragonfly, sstmac::hw::hdtorus, sstmac::hw::simple_topology, sstmac::hw::crossbar, sstmac::hw::xpress_ring, sstmac::hw::flattened_butterfly, sstmac::hw::fake_topology, and sstmac::hw::hypercube.

Referenced by sstmac::hw::fat_tree::default_router(), minimal_routes_to_coords(), sstmac::hw::butterfly::num_switches(), sstmac::hw::simple_fat_tree::num_switches(), and ~structured_topology().

virtual void sstmac::hw::structured_topology::minimal_route_to_switch ( switch_id  current_sw_addr,
switch_id  dest_sw_addr,
structured_routable::path path 
) const
virtual

Implementation of topology::minimal_route_to_switch.

For structured topologies, this basically just computes the coordinates of source, dest switch and calls minimal_route_to_coords.

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

Reimplemented in sstmac::hw::simple_fat_tree, sstmac::hw::fat_tree, and sstmac::hw::crossbar.

Referenced by sstmac::hw::fat_tree::default_router(), endpoint_to_switch_port(), minimal_routes_to_switch(), and sstmac::hw::simple_fat_tree::num_switches().

virtual void sstmac::hw::structured_topology::minimal_routes_to_coords ( const coordinates src_coords,
const coordinates dest_coords,
structured_routable::path current_path,
structured_routable::path_set paths 
) const
inlinevirtual
virtual void sstmac::hw::structured_topology::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
inlinevirtual
virtual int sstmac::hw::structured_topology::ndimensions ( ) const
pure 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.

Implemented in sstmac::hw::butterfly, sstmac::hw::simple_topology, sstmac::hw::xpress_ring, sstmac::hw::hdtorus, sstmac::hw::fake_topology, sstmac::hw::dragonfly, sstmac::hw::flattened_butterfly, sstmac::hw::abstract_fat_tree, and sstmac::hw::crossbar.

Referenced by minimal_routes_to_coords().

virtual void sstmac::hw::structured_topology::nearest_neighbor_partners ( const coordinates src_sw_coords,
int  port,
std::vector< node_id > &  partners 
) const
protectedvirtual
virtual coordinates sstmac::hw::structured_topology::neighbor_at_port ( switch_id  sid,
int  port 
) const
virtual
virtual node_id sstmac::hw::structured_topology::node_addr ( const coordinates coords) const
virtual
virtual node_id sstmac::hw::structured_topology::node_addr ( const coordinates sw_coords,
int  port 
) const
virtual
virtual coordinates sstmac::hw::structured_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 in sstmac::hw::simple_topology.

Referenced by num_endpoints().

virtual std::vector<node_id> sstmac::hw::structured_topology::nodes_connected_to_ejection_switch ( switch_id  swid) const
inlinevirtual
virtual std::vector<node_id> sstmac::hw::structured_topology::nodes_connected_to_injection_switch ( switch_id  swaddr) const
inlinevirtual

Reimplemented in sstmac::hw::butterfly, and sstmac::hw::abstract_fat_tree.

Definition at line 277 of file structured_topology.h.

References nodes_connected_to_switch().

Referenced by sstmac::hw::butterfly::ndimensions().

Here is the call graph for this function:

virtual std::vector<node_id> sstmac::hw::structured_topology::nodes_connected_to_switch ( switch_id  swaddr) const
protectedvirtual
virtual int sstmac::hw::structured_topology::num_endpoints ( ) const
inlinevirtual
virtual int sstmac::hw::structured_topology::num_hops_to_node ( node_id  src,
node_id  dst 
) const
virtual
virtual int sstmac::hw::structured_topology::num_leaf_switches ( ) const
pure virtual

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

Implemented in sstmac::hw::dragonfly, sstmac::hw::fake_topology, sstmac::hw::abstract_butterfly, sstmac::hw::hdtorus, sstmac::hw::abstract_fat_tree, sstmac::hw::simple_topology, sstmac::hw::crossbar, and sstmac::hw::xpress_ring.

Referenced by num_endpoints(), num_nodes(), and ~structured_topology().

virtual int sstmac::hw::structured_topology::num_nodes ( ) const
inlinevirtual

Reimplemented in sstmac::hw::fake_topology, and sstmac::hw::simple_topology.

Definition at line 173 of file structured_topology.h.

References num_leaf_switches().

Here is the call graph for this function:

void sstmac::hw::structured_topology::partners ( bool  get_send_partner,
traffic_pattern::type_t  ty,
node_id  src,
std::vector< node_id > &  partner_list 
) const
protected
virtual void sstmac::hw::structured_topology::productive_path ( int  dim,
const coordinates src,
const coordinates dst,
structured_routable::path path 
) const
pure 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

Implemented in sstmac::hw::simple_fat_tree, sstmac::hw::fat_tree, sstmac::hw::dragonfly, sstmac::hw::simple_topology, sstmac::hw::xpress_ring, sstmac::hw::abstract_butterfly, sstmac::hw::crossbar, sstmac::hw::flattened_butterfly, sstmac::hw::hdtorus, sstmac::hw::fake_topology, and sstmac::hw::hypercube.

Referenced by sstmac::hw::fat_tree::default_router(), minimal_routes_to_coords(), and sstmac::hw::simple_fat_tree::num_switches().

virtual void sstmac::hw::structured_topology::productive_paths ( structured_routable::path_set paths,
const coordinates current,
const coordinates dst 
)
virtual
virtual void sstmac::hw::structured_topology::recv_partners ( traffic_pattern::type_t  ty,
node_id  src_node,
std::vector< node_id > &  partners 
) const
virtual
virtual void sstmac::hw::structured_topology::send_partners ( traffic_pattern::type_t  ty,
node_id  src_node,
std::vector< node_id > &  partners 
) const
virtual
coordinates sstmac::hw::structured_topology::switch_coords ( switch_id  swid) const

Compute coordinates (e.g.

X,Y,Z for 3D torus)

Parameters
swidThe unique index defining a switch location
Returns
The unique coordinates of the switch

Referenced by num_endpoints().

virtual switch_id sstmac::hw::structured_topology::switch_number ( const coordinates coords) const
pure virtual
virtual void sstmac::hw::structured_topology::tornado_recv_partners ( const coordinates src_sw_coords,
int  port,
std::vector< node_id > &  partners 
) const
protectedvirtual
virtual void sstmac::hw::structured_topology::tornado_send_partners ( const coordinates src_sw_coords,
int  port,
std::vector< node_id > &  partners 
) const
protectedvirtual

Member Data Documentation

int sstmac::hw::structured_topology::eject_geometric_id_
protected

Definition at line 358 of file structured_topology.h.

int sstmac::hw::structured_topology::injection_redundancy_
protected

Definition at line 359 of file structured_topology.h.

bool sstmac::hw::structured_topology::outputgraph_
protected

Definition at line 360 of file structured_topology.h.


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