SST/macro
fat_tree_router.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_SWTICHES_ROUTING_FATTREEROUTER_H_INCLUDED
13 #define SSTMAC_HARDWARE_NETWORK_SWTICHES_ROUTING_FATTREEROUTER_H_INCLUDED
14 
16 #include <sstmac/common/rng.h>
17 
18 namespace sstmac {
19 namespace hw {
20 
21 /**
22  * @brief The fat_tree_router class
23  * Router encapsulating the special routing computations that must occur on
24  * a fat tree topology.
25  */
27  public structured_router
28 {
29  public:
30  virtual ~fat_tree_router();
31 
33  structured_router(routing::minimal),
34  rng_(nullptr)
35  {
36  }
37 
38  virtual void
39  finalize_init();
40 
41  virtual void
43  switch_id dst,
45 
46  void
47  init_factory_params(sprockit::sim_parameters *params);
48 
49  void
50  set_topology(topology *top);
51 
52  virtual std::string
53  to_string() const {
54  return "fattreerouter";
55  }
56 
57  virtual void
58  route(packet* pkt);
59 
60  protected:
61  /**
62  * @brief build_rng
63  * Build the random number generator for selecting paths
64  */
65  void
66  build_rng();
67 
68  virtual void
70  switch_id sw_addr,
72 
73  /**
74  * @brief choose_up_path
75  * @return The selected path from the redundant (equivalent) set of minimal paths
76  */
77  int
79 
80  /**
81  * @brief number_paths
82  * @param pkt The packet being routed by the fat-tree
83  * @return The number of equivalent paths the packet can traverse
84  * on a minimal path to its destination switch.
85  */
86  int
87  number_minimal_paths(packet* pkt) const;
88 
89  protected:
90  int l_;
91  int k_;
92 
93  int myL_;
95 
96  std::map<long, int> inports_;
98 
104  long seed_;
105 
108 
111 };
112 
113 }
114 }
115 #endif
virtual void minimal_route_to_switch(switch_id sw_addr, structured_routable::path &path)
int choose_up_minimal_path()
choose_up_path
int number_minimal_paths(packet *pkt) const
number_paths
void init_factory_params(sprockit::sim_parameters *params)
virtual void route(packet *pkt)
The structured_router class Implements a router that computes path on-the-fly using the geometry of t...
void set_topology(topology *top)
set_topology Set the topology to be used for route computations.
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...
void build_rng()
build_rng Build the random number generator for selecting paths
The fat_tree_router class Router encapsulating the special routing computations that must occur on a ...
virtual void finalize_init()
std::map< long, int > inports_
virtual void productive_paths_to_switch(switch_id dst, structured_routable::path_set &paths)
A random number generator combining several techniques by George Marsaglia (1999; internet posting)...
Definition: rng.h:494