SST/macro
fake_topology.h
Go to the documentation of this file.
1 /*
2  * This file is part of SST/macroscale:
3  * The macroscale architecture simulator from the SST suite.
4  * Copyright (c) 2009 Sandia Corporation.
5  * This software is distributed under the BSD License.
6  * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
7  * the U.S. Government retains certain rights in this software.
8  * For more information, see the LICENSE file in the top
9  * SST/macroscale directory.
10  */
11 
12 #ifndef SSTMAC_HARDWARE_NETWORK_TOPOLOGY_FAKE_TOPOLOGY_H_INCLUDED
13 #define SSTMAC_HARDWARE_NETWORK_TOPOLOGY_FAKE_TOPOLOGY_H_INCLUDED
14 
16 
17 namespace sstmac {
18 namespace hw {
19 
21  public structured_topology
22 {
23  public:
24  virtual std::string
25  to_string() const {
26  return "fake topology";
27  }
28 
29  virtual ~fake_topology() {}
30 
31  switch_id
32  switch_number(const coordinates& coords) const {
33  return switch_id();
34  }
35 
36  virtual void
38  int dim,
39  const coordinates& src,
40  const coordinates& dst,
41  structured_routable::path& path) const {
42  }
43 
44  int
45  num_hops(node_id src, node_id dst) const {
46  return 1;
47  }
48 
49  void
50  connect_objects(internal_connectable_map& objects) {
51  //do nothing
52  }
53 
54  void
56  const coordinates &current_coords,
57  const coordinates &dest_coords,
58  structured_routable::path& path) const {
59  //do nothing
60  }
61 
62  int
64  const coordinates &current_coords,
65  const coordinates &dest_coords) const {
66  return 0;
67  }
68 
69  int
70  radix() const {
71  return 0;
72  }
73 
74  int
75  ndimensions() const {
76  return 0;
77  }
78 
79  virtual int
80  diameter() const {
82  "switchinterconnect::fake_topology::diameter: don't call this");
83  }
84 
85  switch_id
86  switch_number(const std::vector<int>& coords) const {
87  return switch_id();
88  }
89 
90  node_id
91  node_addr(const std::vector<int>& coords) const {
92  return node_id();
93  }
94 
95  int
96  num_switches() const {
97  return 0;
98  }
99 
100  int
102  return 0;
103  }
104 
105  int
106  num_nodes() const {
107  return 0;
108  }
109 
110  int
111  convert_to_port(int dim, int dir) const {
112  return 0;
113  }
114 
115  void
116  convert_to_dimdir(int outport, int &dim, int&dir) const {
117  dim = 0;
118  dir = 0;
119  }
120 
121 
122  protected:
123  void
125  //do nothing
126  }
127 
128 
129 };
130 }
131 }
132 
133 #endif
virtual int diameter() const
Definition: fake_topology.h:80
void minimal_route_to_coords(const coordinates &current_coords, const coordinates &dest_coords, structured_routable::path &path) const
Workhorse function for implementing minimal_route_to_switch and #minimal_route_to_node.
Definition: fake_topology.h:55
int num_hops(node_id src, node_id dst) const
Definition: fake_topology.h:45
void convert_to_dimdir(int outport, int &dim, int &dir) const
int convert_to_port(int dim, int dir) const
void connect_objects(internal_connectable_map &objects)
Given a set of connectables, connect them appropriately.
Definition: fake_topology.h:50
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...
switch_id switch_number(const coordinates &coords) const
Definition: fake_topology.h:32
int ndimensions() const
The number of distinct &#39;dimensions&#39; in the topology.
Definition: fake_topology.h:75
virtual void productive_path(int dim, const coordinates &src, const coordinates &dst, structured_routable::path &path) const
Definition: fake_topology.h:37
#define spkt_throw(exc,...)
Definition: errors.h:44
int minimal_distance(const coordinates &current_coords, const coordinates &dest_coords) const
The function accepts either source or node coordinates.
Definition: fake_topology.h:63
Encapsulates a topology like torus, fat tree, butterfly which has a regular, well-defined structure...
int num_leaf_switches() const
Structured topologies can be direct (torus) or indirect (fat tree).
A function was intentionally unimplemented because it doesn&#39;t make sense, or it is ongoing work...
Definition: errors.h:181
endpoint_id node_id
Definition: node_address.h:20
node_id node_addr(const std::vector< int > &coords) const
Definition: fake_topology.h:91
virtual std::string to_string() const
Definition: fake_topology.h:25
void compute_switch_coords(switch_id swid, coordinates &coords) const
Compute coordinates (e.g.
switch_id switch_number(const std::vector< int > &coords) const
Definition: fake_topology.h:86