SST/macro
simple_topology.h
Go to the documentation of this file.
1 #ifndef SIMPLE_TOPOLOGY_H
2 #define SIMPLE_TOPOLOGY_H
3 
4 /*
5  * This file is part of SST/macroscale:
6  * The macroscale architecture simulator from the SST suite.
7  * Copyright (c) 2009 Sandia Corporation.
8  * This software is distributed under the BSD License.
9  * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
10  * the U.S. Government retains certain rights in this software.
11  * For more information, see the LICENSE file in the top
12  * SST/macroscale directory.
13  */
14 
15 // hdtorus.h: Interface for torus networks.
16 //
17 // Author: Jeremiah Wilke <jjwilke@sandia.gov>
18 
19 #ifndef SSTMAC_HARDWARE_NETWORK_TOPOLOGY_HDTORUS_H_INCLUDED
20 #define SSTMAC_HARDWARE_NETWORK_TOPOLOGY_HDTORUS_H_INCLUDED
21 
23 
24 namespace sstmac {
25 namespace hw {
26 
27 /**
28  * @class hdtorus
29  * Implements a high dimensional torus network.
30  */
31 
33  public structured_topology
34 {
35 
36  public:
37  virtual std::string
38  to_string() const {
39  return "simple topology";
40  }
41 
42  virtual ~simple_topology();
43 
45  actual_topology_(nullptr)
46  {
47  }
48 
49  void
50  init_factory_params(sprockit::sim_parameters* params);
51 
52  virtual void
53  finalize_init();
54 
55  int
57  return num_switches_;
58  }
59 
60  int
61  num_switches() const {
62  return num_switches_;
63  }
64 
65  int
66  num_endpoints() const {
67  return num_nodes_;
68  }
69 
70  int
71  num_nodes() const {
72  return num_nodes_;
73  }
74 
75  void
76  compute_switch_coords(switch_id swid, coordinates &coords) const;
77 
78  int
79  convert_to_port(int dim, int dir) const;
80 
81  void
82  connect_objects(internal_connectable_map& objects);
83 
85  node_coords(node_id uid) const;
86 
87  void
89  const coordinates& src_coords,
90  const coordinates& dest_coords,
91  structured_routable::path& path) const;
92 
93  int
95  const coordinates& src_coords,
96  const coordinates& dest_coords) const;
97 
98  virtual int
99  num_hops_to_node(node_id src, node_id dst) const;
100 
101  virtual int
102  ndimensions() const;
103 
104  virtual int
105  diameter() const;
106 
107  virtual int
108  radix() const {
109  return num_switches_ - 1;
110  }
111 
112  void
113  configure_vc_routing(std::map<routing::algorithm_t, int> &m) const {
114  topology::configure_vc_routing(m);
115  }
116 
117  switch_id
118  switch_number(const coordinates& coords) const;
119 
120  virtual std::vector<node_id>
121  nodes_connected_to_switch(switch_id swaddr) const;
122 
123  virtual switch_id
124  endpoint_to_ejection_switch(node_id nodeaddr, int &switch_port) const;
125 
126  virtual switch_id
127  endpoint_to_injection_switch(node_id nodeaddr, int &switch_port) const;
128 
129  virtual void
131  int dim,
132  const coordinates& src,
133  const coordinates& dst,
134  structured_routable::path& path) const;
135 
136  protected:
140  hw::topology* actual_topology_;
141 
142 };
143 
144 }
145 } //end of namespace sstmac
146 
147 #endif
148 
149 
150 
151 #endif // SIMPLE_TOPOLOGY_H
virtual switch_id endpoint_to_injection_switch(node_id nodeaddr, int &switch_port) const
virtual int diameter() const
switch_id switch_number(const coordinates &coords) const
int num_leaf_switches() const
Structured topologies can be direct (torus) or indirect (fat tree).
virtual std::vector< node_id > nodes_connected_to_switch(switch_id swaddr) const
void compute_switch_coords(switch_id swid, coordinates &coords) const
Compute coordinates (e.g.
int minimal_distance(const coordinates &src_coords, const coordinates &dest_coords) const
The function accepts either source or node coordinates.
void connect_objects(internal_connectable_map &objects)
Given a set of connectables, connect them appropriately.
virtual std::string to_string() 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 switch_id endpoint_to_ejection_switch(node_id nodeaddr, int &switch_port) const
virtual void finalize_init()
coordinates node_coords(node_id uid) const
Compute coordinates (e.g.
virtual int radix() const
void init_factory_params(sprockit::sim_parameters *params)
virtual int ndimensions() const
The number of distinct &#39;dimensions&#39; in the topology.
int convert_to_port(int dim, int dir) const
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.
void configure_vc_routing(std::map< routing::algorithm_t, int > &m) const
Encapsulates a topology like torus, fat tree, butterfly which has a regular, well-defined structure...
virtual int num_hops_to_node(node_id src, node_id dst) const
endpoint_id node_id
Definition: node_address.h:20
virtual void productive_path(int dim, const coordinates &src, const coordinates &dst, structured_routable::path &path) const