SST/macro
|
Encapsulates a topology like torus, fat tree, butterfly which has a regular, well-defined structure. More...
#include <structured_topology.h>
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 ¤t_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 ¤t, 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 ¤t_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_id > | nodes_connected_to_injection_switch (switch_id swaddr) const |
virtual std::vector< node_id > | nodes_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_id > | nodes_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_ |
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.
|
inlinevirtual |
Definition at line 40 of file structured_topology.h.
References build_endpoint_connectables(), build_interface_connectables(), build_internal_connectables(), connect_objects(), minimal_route_to_coords(), and num_leaf_switches().
|
protected |
Referenced by nodes_connected_to_ejection_switch().
|
protectedvirtual |
Reimplemented in sstmac::hw::dragonfly, and sstmac::hw::hdtorus.
Referenced by nodes_connected_to_ejection_switch().
|
virtual |
Referenced by ~structured_topology().
|
virtual |
Referenced by ~structured_topology().
|
virtual |
Referenced by ~structured_topology().
|
pure virtual |
Compute coordinates (e.g.
X,Y,Z for 3D torus)
swid | The unique index defining a switch location |
coords | [inout] The unique coordinates of the switch |
Implemented in sstmac::hw::simple_fat_tree, sstmac::hw::dragonfly, sstmac::hw::fat_tree, sstmac::hw::butterfly, sstmac::hw::xpress_ring, sstmac::hw::fake_topology, sstmac::hw::hdtorus, sstmac::hw::crossbar, sstmac::hw::abstract_butterfly, sstmac::hw::flattened_butterfly, and sstmac::hw::simple_topology.
Referenced by nodes_connected_to_ejection_switch(), sstmac::hw::simple_fat_tree::num_switches(), and sstmac::hw::fat_tree::switch_at_row_col().
|
protected |
Referenced by nodes_connected_to_ejection_switch().
|
pure virtual |
Given a set of connectables, connect them appropriately.
objects | The set of objects to connect |
cloner | If in parallel mode, not all objects may exist. The factory creates missing objects. |
value_error | If 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().
|
pure virtual |
|
virtual |
Reimplemented in sstmac::hw::tiled_dragonfly, and sstmac::hw::tiled_torus.
Referenced by minimal_routes_to_switch().
coordinates sstmac::hw::structured_topology::endpoint_coords | ( | node_id | nid | ) | const |
Referenced by num_endpoints().
|
virtual |
Referenced by num_endpoints().
|
virtual |
Reimplemented in sstmac::hw::butterfly, and sstmac::hw::simple_topology.
Referenced by num_endpoints(), and sstmac::hw::butterfly::num_switches().
|
virtual |
Referenced by num_endpoints().
|
virtual |
Reimplemented in sstmac::hw::simple_topology.
Referenced by num_endpoints().
|
inlinevirtual |
Definition at line 222 of file structured_topology.h.
References finalize_init(), label(), minimal_route_to_switch(), and productive_paths().
|
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 |
Reimplemented in sstmac::hw::simple_fat_tree, sstmac::hw::butterfly, sstmac::hw::fat_tree, sstmac::hw::tiled_dragonfly, sstmac::hw::dragonfly, sstmac::hw::simple_topology, sstmac::hw::hdtorus, sstmac::hw::abstract_fat_tree, sstmac::hw::flattened_butterfly, sstmac::hw::abstract_butterfly, sstmac::hw::cartesian_topology, sstmac::hw::crossbar, sstmac::hw::hypercube, sstmac::hw::xpress_ring, and sstmac::hw::tiled_torus.
Referenced by minimal_routes_to_coords().
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 |
|
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.
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. |
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().
|
pure virtual |
Workhorse function for implementing minimal_route_to_switch and #minimal_route_to_node.
Given source/dest coordinates, find the minimal path.
current_sw_addr | The addr of the current switch |
dest_sw_addr | The 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 |
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.
current_sw_addr | The addr of the current switch |
dest_sw_addr | The 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().
|
inlinevirtual |
Reimplemented in sstmac::hw::tiled_dragonfly, and sstmac::hw::tiled_torus.
Definition at line 106 of file structured_topology.h.
References diameter(), init_factory_params(), minimal_distance(), minimal_route_to_coords(), ndimensions(), productive_path(), sstmac::hw::structured_routable::path_set::resize(), and switch_number().
|
inlinevirtual |
Reimplemented in sstmac::hw::tiled_dragonfly, and sstmac::hw::cartesian_topology.
Definition at line 258 of file structured_topology.h.
References eject_paths_on_switch(), minimal_route_to_switch(), num_hops_to_node(), and sstmac::hw::structured_routable::path_set::resize().
|
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().
|
protectedvirtual |
Reimplemented in sstmac::hw::dragonfly, and sstmac::hw::hdtorus.
Referenced by nodes_connected_to_ejection_switch().
|
virtual |
Reimplemented in sstmac::hw::simple_fat_tree, sstmac::hw::fat_tree, sstmac::hw::dragonfly, and sstmac::hw::hdtorus.
Referenced by sstmac::hw::fat_tree::default_router(), nodes_connected_to_ejection_switch(), and sstmac::hw::simple_fat_tree::num_switches().
|
virtual |
Referenced by nodes_connected_to_ejection_switch().
|
virtual |
|
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>
nid | The unique index defining a node location |
Reimplemented in sstmac::hw::simple_topology.
Referenced by num_endpoints().
|
inlinevirtual |
Reimplemented in sstmac::hw::butterfly, and sstmac::hw::abstract_fat_tree.
Definition at line 282 of file structured_topology.h.
References bit_complement_partners(), compute_switch_coords(), configure_injection_geometry(), nearest_neighbor_partners(), neighbor_at_port(), node_addr(), nodes_connected_to_switch(), partners(), recv_partners(), send_partners(), structured_topology(), tornado_recv_partners(), and tornado_send_partners().
Referenced by sstmac::hw::butterfly::ndimensions().
|
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().
|
protectedvirtual |
Reimplemented in sstmac::hw::simple_topology, and sstmac::hw::abstract_fat_tree.
Referenced by nodes_connected_to_ejection_switch(), and nodes_connected_to_injection_switch().
|
inlinevirtual |
Reimplemented in sstmac::hw::simple_topology.
Definition at line 178 of file structured_topology.h.
References endpoint_coords(), endpoint_to_ejection_port(), endpoint_to_ejection_switch(), endpoint_to_injection_port(), endpoint_to_injection_switch(), node_coords(), num_leaf_switches(), and switch_coords().
|
virtual |
Reimplemented in sstmac::hw::simple_fat_tree, and sstmac::hw::simple_topology.
Referenced by minimal_routes_to_switch(), and sstmac::hw::simple_fat_tree::num_switches().
|
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.
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().
|
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().
|
protected |
Referenced by sstmac::hw::dragonfly::diameter(), and nodes_connected_to_ejection_switch().
|
pure virtual |
dim | The dimension you want to move in. You might need to traverse other dimensions FIRST before you make progress on this dimension. |
src | The coordinates of the source switch |
dst | The 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 |
Reimplemented in sstmac::hw::butterfly.
Referenced by endpoint_to_switch_port(), and sstmac::hw::butterfly::ndimensions().
|
virtual |
Referenced by nodes_connected_to_ejection_switch().
|
virtual |
Referenced by nodes_connected_to_ejection_switch().
coordinates sstmac::hw::structured_topology::switch_coords | ( | switch_id | swid | ) | const |
Compute coordinates (e.g.
X,Y,Z for 3D torus)
swid | The unique index defining a switch location |
Referenced by num_endpoints().
|
pure virtual |
Implemented in sstmac::hw::simple_fat_tree, sstmac::hw::butterfly, sstmac::hw::fat_tree, sstmac::hw::simple_topology, sstmac::hw::abstract_butterfly, sstmac::hw::dragonfly, sstmac::hw::crossbar, sstmac::hw::xpress_ring, sstmac::hw::flattened_butterfly, sstmac::hw::hdtorus, and sstmac::hw::fake_topology.
Referenced by sstmac::hw::fat_tree::default_router(), minimal_routes_to_coords(), and sstmac::hw::simple_fat_tree::num_switches().
|
protectedvirtual |
Reimplemented in sstmac::hw::dragonfly, and sstmac::hw::hdtorus.
Referenced by nodes_connected_to_ejection_switch().
|
protectedvirtual |
Reimplemented in sstmac::hw::dragonfly, and sstmac::hw::hdtorus.
Referenced by nodes_connected_to_ejection_switch().
|
protected |
Definition at line 358 of file structured_topology.h.
|
protected |
Definition at line 359 of file structured_topology.h.
|
protected |
Definition at line 360 of file structured_topology.h.