SST/macro
crossbar.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 #ifndef SSTMAC_HARDWARE_NETWORK_TOPOLOGY_CROSSBAR_H_INCLUDED
12 #define SSTMAC_HARDWARE_NETWORK_TOPOLOGY_CROSSBAR_H_INCLUDED
13 
15 
16 namespace sstmac {
17 namespace hw {
18 
19 /**
20  * @class crossbar
21  * The crossbar network generates a network which connects
22  all nodes with only two hops: those to and from the crossbar.
23  */
25 {
26  public:
27  virtual std::string
28  to_string() const {
29  return "crossbar topology";
30  }
31 
32  virtual ~crossbar() {}
33 
34  virtual void
35  init_factory_params(sprockit::sim_parameters* params);
36 
37  int
38  diameter() const {
39  return 1;
40  }
41 
42  int
43  ndimensions() const {
44  return 1;
45  }
46 
47  int
48  ncoords() const {
49  return 1;
50  }
51 
52  int
54  return size_;
55  }
56 
57  virtual void
58  connect_objects(internal_connectable_map& switches);
59 
60  void
61  configure_vc_routing(std::map<routing::algorithm_t, int> &m) const;
62 
63  void
65  switch_id current_sw_addr,
66  switch_id dest_sw_addr,
67  structured_routable::path& path) const;
68 
69  void
71  const coordinates &src_coords,
72  const coordinates &dest_coords,
73  structured_routable::path& path) const;
74 
75  int
77  const coordinates& src_coords,
78  const coordinates& dest_coords
79  ) const;
80 
81  virtual void
83  int dim,
84  const coordinates& src,
85  const coordinates& dst,
86  structured_routable::path& path) const;
87 
88  virtual int
89  convert_to_port(int dim, int dir) const;
90 
91  switch_id
92  switch_number(const coordinates& coords) const {
93  return switch_id(coords[0]);
94  }
95 
96  virtual int
97  num_switches() const {
98  return size_;
99  }
100 
101  protected:
102  virtual void
103  compute_switch_coords(switch_id uid, coordinates& coords) const;
104 
105  private:
106  long size_;
107 
108 };
109 
110 }
111 } //end of namespace sstmac
112 
113 #endif
void configure_vc_routing(std::map< routing::algorithm_t, int > &m) const
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.
virtual void connect_objects(internal_connectable_map &switches)
Given a set of connectables, connect them appropriately.
virtual void init_factory_params(sprockit::sim_parameters *params)
virtual int convert_to_port(int dim, int dir) const
virtual ~crossbar()
Definition: crossbar.h:32
int diameter() const
Definition: crossbar.h:38
virtual std::string to_string() const
Definition: crossbar.h:28
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 int num_switches() const
Definition: crossbar.h:97
int ncoords() const
Definition: crossbar.h:48
virtual void productive_path(int dim, const coordinates &src, const coordinates &dst, structured_routable::path &path) const
The crossbar network generates a network which connects all nodes with only two hops: those to and fr...
Definition: crossbar.h:24
switch_id switch_number(const coordinates &coords) const
Definition: crossbar.h:92
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.
Encapsulates a topology like torus, fat tree, butterfly which has a regular, well-defined structure...
int minimal_distance(const coordinates &src_coords, const coordinates &dest_coords) const
The function accepts either source or node coordinates.
virtual void compute_switch_coords(switch_id uid, coordinates &coords) const
Compute coordinates (e.g.
int ndimensions() const
The number of distinct &#39;dimensions&#39; in the topology.
Definition: crossbar.h:43
int num_leaf_switches() const
Structured topologies can be direct (torus) or indirect (fat tree).
Definition: crossbar.h:53