SST/macro
valiant_routing.h
Go to the documentation of this file.
1 #ifndef sstmac_hardware_network_topology_routing_VALIANT_ROUTER_H
2 #define sstmac_hardware_network_topology_routing_VALIANT_ROUTER_H
3 
5 
6 namespace sstmac {
7 namespace hw {
8 
9 /**
10  * @brief The valiant_router class
11  * Enacpsulates a router that performs oblivious, global routing according to
12  * "A Scheme for Fast Parallel Computation" by Valiant.
13  */
15 {
16  public:
18  minimal_router(routing::valiant){}
19 
20  virtual
22 
23  virtual void
24  route(packet* pkt);
25 
26  virtual void
28 
29  virtual std::string
30  to_string() const {
31  return "valiant";
32  }
33 
34  virtual void
35  finalize_init();
36 
37  /**
38  The topology object specifies a virtual channel based purely on geometry.
39  However, the final virtual channel depends on both geometry and
40  routing algorithm. In this case, we need a separate set of
41  virtual channels depending on whether we are in the first
42  stage (routing to the intermediate switch) or the second stage
43  (routing to the final switch).
44  @param topology_vc The geometry-specific virtual channel
45  @return The first stage virtual channel
46  */
47  virtual int
48  first_stage_vc(int topology_vc) {
49  return 2*topology_vc;
50  }
51 
52  /**
53  The topology object specifies a virtual channel based purely on geometry.
54  However, the final virtual channel depends on both geometry and
55  routing algorithm. In this case, we need a separate set of
56  virtual channels depending on whether we are in the first
57  stage (routing to the intermediate switch) or the second stage
58  (routing to the final switch).
59  @param topology_vc The geometry-specific virtual channel
60  @return The second stage virtual channel
61  */
62  virtual int
63  second_stage_vc(int topology_vc) {
64  return 2*topology_vc + 1;
65  }
66 
67  protected:
69  minimal_router(algo){}
70 
71  typedef enum {
75  } next_action_t;
76 
77  /**
78  * @brief intermediate_step
79  * @param rtbl The routing interface with path information
80  * @param pkt The packet corresponding to the structured_routable
81  * @return The next action to take. It may be intermediate_switch or
82  * final_node depending on whether the intermediate switch has been
83  * reached or not.
84  */
85  next_action_t
87  packet* pkt);
88 
89  /**
90  Different for pure valiant and UGAL.
91  */
92  virtual next_action_t
94  packet* pkt);
95 
96  /**
97  * @brief next_routing_stage
98  * Figure out which action is required for the packet
99  * @param pkt The packet being routed
100  * @return It may be intermediate_switch or
101  * final_node depending on whether the intermediate switch has been
102  * reached or not. Or it may be minimal if the packet is still on
103  * the minimal path and has not switched to Valiant.
104  */
105  next_action_t
107 
108  /**
109  * @brief configure_intermediate_path
110  * Once the packet has switched to Valiant, compute a path to the
111  * chosen intermediate switch
112  * @param path
113  */
114  void
116 
117  /**
118  * @brief configure_final_path
119  * Once the packet has switched to Valiant and reached the intermediate switch,
120  * compute a path to the final ejection switch
121  * @param path
122  */
123  void
125 
126  /**
127  * @brief route_valiant
128  * Figure out if in intermediate or final stage and make appropriate routing computation
129  * @param pkt
130  */
131  void route_valiant(packet* pkt);
132 
133 };
134 
135 }
136 }
137 
138 #endif // VALIANT_ROUTER_H
139 
virtual std::string to_string() const
virtual void route(packet *pkt)
next_action_t next_routing_stage(packet *pkt)
next_routing_stage Figure out which action is required for the packet
virtual void finalize_init()
valiant_router(routing::algorithm_t algo)
void configure_final_path(structured_routable::path &path)
configure_final_path Once the packet has switched to Valiant and reached the intermediate switch...
The minimal_router class Router that performs.
The valiant_router class Enacpsulates a router that performs oblivious, global routing according to "...
void configure_intermediate_path(structured_routable::path &path)
configure_intermediate_path Once the packet has switched to Valiant, compute a path to the chosen int...
virtual int second_stage_vc(int topology_vc)
The topology object specifies a virtual channel based purely on geometry.
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
virtual int first_stage_vc(int topology_vc)
The topology object specifies a virtual channel based purely on geometry.
virtual next_action_t initial_step(structured_routable *rtbl, packet *pkt)
Different for pure valiant and UGAL.
void route_valiant(packet *pkt)
route_valiant Figure out if in intermediate or final stage and make appropriate routing computation ...
next_action_t intermediate_step(structured_routable *rtbl, packet *pkt)
intermediate_step