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

Implements a high dimensional torus network. More...

#include <hdtorus.h>

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

Public Types

enum  direction_t { pos = 0, neg = 1 }
 

Public Member Functions

virtual std::string to_string () const
 
virtual ~hdtorus ()
 
void init_factory_params (sprockit::sim_parameters *params)
 
virtual void productive_path (int dim, const coordinates &src, const coordinates &dst, structured_routable::path &path) const
 
switch_id switch_number (const coordinates &v) const
 
int diameter () const
 
const std::vector< int > & dimensions () const
 Returns the vector giving each dimension of the torus. More...
 
coordinates neighbor_at_port (switch_id sid, int port) const
 
virtual int num_switches () const
 
virtual int num_leaf_switches () const
 Structured topologies can be direct (torus) or indirect (fat tree). More...
 
void configure_geometric_paths (std::vector< int > &redundancies)
 configure_geometric_paths For all possible geometric or structure paths, compute their redundances in terms of number of ports that go in the same geometric or structural direction, e.g. More...
 
virtual int ndimensions () const
 The number of distinct 'dimensions' in the topology. 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...
 
virtual void connect_objects (internal_connectable_map &switches)
 Given a set of connectables, connect them appropriately. More...
 
virtual int convert_to_port (int dim, int dir) const
 
int minimal_distance (const coordinates &src_coords, const coordinates &dest_coords) const
 The function accepts either source or node coordinates. More...
 
void partners (traffic_pattern::type_t ty, const coordinates &src_sw_coords, std::list< node_id > &partners) const
 
void configure_vc_routing (std::map< routing::algorithm_t, int > &m) const
 
- Public Member Functions inherited from sstmac::hw::cartesian_topology
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
 
- 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...
 
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 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 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 diameter_
 
long num_switches_
 
std::vector< int > dimensions_
 
- Protected Attributes inherited from sstmac::hw::cartesian_topology
std::vector< int > red_
 The number of redundant links (ports) comprising a geometric or structure direction in the topology. More...
 
- Protected Attributes inherited from sstmac::hw::structured_topology
int eject_geometric_id_
 
int injection_redundancy_
 
bool outputgraph_
 

Private Member Functions

virtual void compute_switch_coords (switch_id uid, coordinates &coords) const
 Compute coordinates (e.g. More...
 
void nearest_neighbor_partners (const coordinates &src_sw_coords, int port, std::vector< node_id > &partners) const
 
void bit_complement_partners (const coordinates &src_sw_coords, int port, std::vector< node_id > &partners) const
 
void tornado_send_partners (const coordinates &src_sw_coords, int port, std::vector< node_id > &partners) const
 
void tornado_recv_partners (const coordinates &src_sw_coords, int port, std::vector< node_id > &partners) const
 
void pick_vc (structured_routable::path &path) const
 
void down_path (int dim, const coordinates &src, const coordinates &dst, structured_routable::path &path) const
 
void up_path (int dim, const coordinates &src, const coordinates &dst, structured_routable::path &path) const
 
int shortest_distance (int dim, int src, int dst) const
 
int distance (int dim, int dir, int src, int dst) const
 
bool shortest_path_positive (int dim, const coordinates &src, const coordinates &dst) const
 
virtual void connect_dim (int dim, connectable *center, connectable *plus, connectable *minus)
 

Additional Inherited Members

- Protected Member Functions inherited from sstmac::hw::structured_topology
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
 

Detailed Description

Implements a high dimensional torus network.

Definition at line 29 of file hdtorus.h.

Member Enumeration Documentation

Enumerator
pos 
neg 

Definition at line 34 of file hdtorus.h.

Constructor & Destructor Documentation

virtual sstmac::hw::hdtorus::~hdtorus ( )
inlinevirtual

Definition at line 44 of file hdtorus.h.

References init_factory_params(), productive_path(), and switch_number().

Here is the call graph for this function:

Member Function Documentation

void sstmac::hw::hdtorus::bit_complement_partners ( const coordinates src_sw_coords,
int  port,
std::vector< node_id > &  partners 
) const
privatevirtual

Reimplemented from sstmac::hw::structured_topology.

Referenced by ndimensions().

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

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 ndimensions().

void sstmac::hw::hdtorus::configure_geometric_paths ( std::vector< int > &  redundancies)
virtual

configure_geometric_paths For all possible geometric or structure paths, compute their redundances in terms of number of ports that go in the same geometric or structural direction, e.g.

might be 3 ports that all go +X on a router

Parameters
[in,out]redundancies

Implements sstmac::hw::cartesian_topology.

Referenced by num_leaf_switches().

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

Referenced by ndimensions().

virtual void sstmac::hw::hdtorus::connect_dim ( int  dim,
connectable center,
connectable plus,
connectable minus 
)
privatevirtual

Reimplemented in sstmac::hw::tiled_torus.

Referenced by ndimensions().

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

Reimplemented in sstmac::hw::hypercube.

Referenced by ndimensions().

virtual int sstmac::hw::hdtorus::convert_to_port ( int  dim,
int  dir 
) const
virtual

Reimplemented in sstmac::hw::hypercube.

Referenced by ndimensions().

int sstmac::hw::hdtorus::diameter ( ) const
inlinevirtual

Implements sstmac::hw::structured_topology.

Definition at line 60 of file hdtorus.h.

References diameter_.

const std::vector<int>& sstmac::hw::hdtorus::dimensions ( ) const
inline

Returns the vector giving each dimension of the torus.

Definition at line 66 of file hdtorus.h.

References dimensions_, and neighbor_at_port().

Here is the call graph for this function:

int sstmac::hw::hdtorus::distance ( int  dim,
int  dir,
int  src,
int  dst 
) const
private

Referenced by ndimensions().

void sstmac::hw::hdtorus::down_path ( int  dim,
const coordinates src,
const coordinates dst,
structured_routable::path path 
) const
private

Referenced by ndimensions().

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

Reimplemented from sstmac::hw::cartesian_topology.

Reimplemented in sstmac::hw::hypercube, and sstmac::hw::tiled_torus.

Referenced by ~hdtorus().

int sstmac::hw::hdtorus::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.

Reimplemented in sstmac::hw::hypercube.

Referenced by ndimensions().

void sstmac::hw::hdtorus::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.

Reimplemented in sstmac::hw::hypercube.

Referenced by ndimensions().

virtual int sstmac::hw::hdtorus::ndimensions ( ) const
inlinevirtual

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.

Definition at line 87 of file hdtorus.h.

References bit_complement_partners(), compute_switch_coords(), configure_vc_routing(), connect_dim(), connect_objects(), convert_to_port(), dimensions_, distance(), down_path(), minimal_distance(), minimal_route_to_coords(), nearest_neighbor_partners(), partners(), pick_vc(), shortest_distance(), shortest_path_positive(), tornado_recv_partners(), tornado_send_partners(), and up_path().

Here is the call graph for this function:

void sstmac::hw::hdtorus::nearest_neighbor_partners ( const coordinates src_sw_coords,
int  port,
std::vector< node_id > &  partners 
) const
privatevirtual

Reimplemented from sstmac::hw::structured_topology.

Referenced by ndimensions().

coordinates sstmac::hw::hdtorus::neighbor_at_port ( switch_id  sid,
int  port 
) const
virtual

Reimplemented from sstmac::hw::structured_topology.

Referenced by dimensions().

virtual int sstmac::hw::hdtorus::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 79 of file hdtorus.h.

References configure_geometric_paths(), and num_switches().

Here is the call graph for this function:

virtual int sstmac::hw::hdtorus::num_switches ( ) const
inlinevirtual

Definition at line 74 of file hdtorus.h.

References num_switches_.

Referenced by num_leaf_switches().

void sstmac::hw::hdtorus::partners ( traffic_pattern::type_t  ty,
const coordinates src_sw_coords,
std::list< node_id > &  partners 
) const

Referenced by ndimensions().

void sstmac::hw::hdtorus::pick_vc ( structured_routable::path path) const
private

Referenced by ndimensions().

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

Reimplemented in sstmac::hw::hypercube.

Referenced by ~hdtorus().

int sstmac::hw::hdtorus::shortest_distance ( int  dim,
int  src,
int  dst 
) const
private

Referenced by ndimensions().

bool sstmac::hw::hdtorus::shortest_path_positive ( int  dim,
const coordinates src,
const coordinates dst 
) const
private

Referenced by ndimensions().

switch_id sstmac::hw::hdtorus::switch_number ( const coordinates v) const
virtual

Implements sstmac::hw::structured_topology.

Referenced by ~hdtorus().

virtual std::string sstmac::hw::hdtorus::to_string ( ) const
inlinevirtual

Reimplemented in sstmac::hw::hypercube.

Definition at line 40 of file hdtorus.h.

void sstmac::hw::hdtorus::tornado_recv_partners ( const coordinates src_sw_coords,
int  port,
std::vector< node_id > &  partners 
) const
privatevirtual

Reimplemented from sstmac::hw::structured_topology.

Referenced by ndimensions().

void sstmac::hw::hdtorus::tornado_send_partners ( const coordinates src_sw_coords,
int  port,
std::vector< node_id > &  partners 
) const
privatevirtual

Reimplemented from sstmac::hw::structured_topology.

Referenced by ndimensions().

void sstmac::hw::hdtorus::up_path ( int  dim,
const coordinates src,
const coordinates dst,
structured_routable::path path 
) const
private

Referenced by ndimensions().

Member Data Documentation

int sstmac::hw::hdtorus::diameter_
protected

Definition at line 182 of file hdtorus.h.

Referenced by diameter().

std::vector<int> sstmac::hw::hdtorus::dimensions_
protected

Definition at line 184 of file hdtorus.h.

Referenced by dimensions(), and ndimensions().

long sstmac::hw::hdtorus::num_switches_
protected

Definition at line 183 of file hdtorus.h.

Referenced by num_switches().


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