SST/macro
xpressring.h
Go to the documentation of this file.
2 
3 namespace sstmac {
4 namespace hw {
5 
6 class xpress_ring :
8 {
9  public:
10  typedef enum {
11  up_port = 0,
12  down_port = 1,
15  } port_t;
16 
17  typedef enum {
18  jump = 0, step = 1
19  } stride_t;
20 
21  public:
22  virtual ~xpress_ring() {}
23 
24  virtual std::string
25  to_string() const {
26  return "xpress ring topology";
27  }
28 
29  virtual void
30  init_factory_params(sprockit::sim_parameters* params);
31 
32  /**
33  * @brief Given a set of connectables, connect them appropriately
34  * @param objects The set of objects to connect
35  * @param cloner If in parallel mode, not all objects may exist.
36  * The factory creates missing objects.
37  * @throws value_error If invalid switchid is passed to cloner
38  */
39  virtual void
40  connect_objects(internal_connectable_map& objects);
41 
42  /**
43  Structured topologies can be direct (torus) or indirect (fat tree).
44  We therefore need to distinguish the total number of switches and
45  the number of leaf switches - i.e. those directly connected to nodes.
46  For direct topologies, num_switches and num_leaf_switches are the same.
47  For indirect, num_leaf_switches < num_switches.
48  @return The number of leaf switches directly connected to compute nodes
49  */
50  virtual long
51  num_leaf_switches() const;
52 
53  /**
54  Workhorse function for implementing #minimal_route_to_switch
55  and #minimal_route_to_node.
56  Given source/dest coordinates, find the minimal path.
57  @param current_sw_addr The addr of the current switch
58  @param dest_sw_addr The addr of the destination switch
59  @param path [inout] A complete path descriptor to the destination switch
60  */
61  virtual void
63  const coordinates& src_coords,
64  const coordinates& dest_coords,
65  structured_routable::path& path) const;
66 
67  /**
68  The function accepts either source or node coordinates.
69  This gives the minimal distance counting the number of hops between switches.
70  If node coordinates are given, the last coordinate is just ignored.
71  @param src_coords. The source coordinates. This can be either switch or node coordinates.
72  @param dest_coords. The destination coordinates. This can be either switch or node coordinates.
73  @return The number of hops to final destination
74  */
75  virtual int
77  const coordinates& src_coords,
78  const coordinates& dest_coords) const;
79 
80  /**
81  The number of distinct 'dimensions'
82  in the topology. This can correspond directly to standard
83  X,Y,Z dimensions or the the number of levels in a fat tree.
84  The keyword topology_redundant vector should have this many
85  entries.
86  */
87  virtual int
88  ndimensions() const;
89 
90  virtual switch_id
91  switch_number(const coordinates& coords) const;
92 
93  /**
94  @param dim The dimension you want to move in.
95  You might need to traverse other dimensions FIRST
96  before you make progress on this dimension.
97  @param src The coordinates of the source switch
98  @param dst The coordinates of the dest switch
99  @param path [inout] The path configuration for making progress on dim
100  */
101  virtual void
103  int dim,
104  const coordinates& src,
105  const coordinates& dst,
106  structured_routable::path& path) const;
107 
108  virtual int
109  radix() const {
110  return 4;
111  }
112 
113  virtual long
114  num_switches() const {
115  return ring_size_;
116  }
117 
118  int
119  diameter() const;
120 
121  virtual int
122  convert_to_port(int dim, int dir) const;
123 
124  protected:
125  /**
126  Compute coordinates (e.g. X,Y,Z for 3D torus)
127  @param swid The unique index defining a switch location
128  @param coords [inout] The unique coordinates of the switch
129  */
130  virtual void
131  compute_switch_coords(switch_id swid, coordinates& coords) const;
132 
133  int
134  num_hops(int total_distance) const;
135 
136  protected:
138 
140 
141 };
142 
143 }
144 }
145 
virtual long num_switches() const
Definition: xpressring.h:114
virtual std::string to_string() const
Definition: xpressring.h:25
virtual switch_id switch_number(const coordinates &coords) const
virtual long num_leaf_switches() const
Structured topologies can be direct (torus) or indirect (fat tree).
virtual int radix() const
Definition: xpressring.h:109
int num_hops(int total_distance) const
virtual void productive_path(int dim, const coordinates &src, const coordinates &dst, structured_routable::path &path) const
topology_id switch_id
Definition: node_address.h:23
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
virtual void init_factory_params(sprockit::sim_parameters *params)
virtual int ndimensions() const
The number of distinct &#39;dimensions&#39; in the topology.
virtual void compute_switch_coords(switch_id swid, coordinates &coords) const
Compute coordinates (e.g.
virtual int minimal_distance(const coordinates &src_coords, const coordinates &dest_coords) const
The function accepts either source or node coordinates.
Encapsulates a topology like torus, fat tree, butterfly which has a regular, well-defined structure...
virtual 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.
virtual void connect_objects(internal_connectable_map &objects)
Given a set of connectables, connect them appropriately.
virtual int convert_to_port(int dim, int dir) const