Commit c5d0b5a1 authored by Neil McGlohon's avatar Neil McGlohon
Browse files

Dragonfly Plus: Intermediate and Rerouting confs

This commit adds functionality to the dragonfly plus model. The
functionality is to make whether source group rerouting and
intermediate router choice a configurable option that is set
in the config file.

To use said configurables, use these config variables in your
config file:

	source_group_rerouting= {"off" | "on"} default="on";
	intermediate_choice= {"leaf" | "spine" | "both"} default="leaf";

If source group rerouting is on, then if a packet is currently being
routed by a spine router in the source group, but the spine router
does not have a connection to the intermediate group, then the spine
will route the packet to another spine router within the source
group who does have said connection to the intermediate group.

If source group rerouting if off, then if a packet being currently routed
by a spine router in the source group cannot be directly routed to the
pre specified intermediate group in the message, then a new intermediate
router/group will be chosen from the list of possible intermediate
groups/routers that the source spine has connections to. It is not
rerouted within the source group.

Intermediate choice determines what type of routers can be chosen
as an intermediate router. If "leaf" is set, then intermediate routers
will only be of type leafs. Similar for "spine". If "both" is selected
then it could be either.

Additional features added in this commit:

New configurable:
	notification_on_hops_greater_than={"<int>"} default = MAX_INT

This new configurable sets the maximum number of hops allowed before a
printed notification of the number of hops that a current packet
is at is output to stdout. This is to help debug and know when routing
decisions are producing unexpected results.
parent 5f62907b
......@@ -9,6 +9,7 @@
#include <map>
#include <vector>
#include <set>
#include "codes/codes.h"
#include "codes/model-net.h"
......@@ -69,6 +70,8 @@ class ConnectionManager {
map< int, Connection > _portMap; //Mapper for ports to connections
set< int > _other_groups_i_connect_to;
// map< int, vector< Connection > > intermediateRouterToGroupMap; //maps group id to list of routers that connect to it.
// //ex: intermediateRouterToGroupMap[3] returns a vector
// //of connections from this router to routers that have
......@@ -191,6 +194,12 @@ public:
vector< Connection > get_connections_by_type(ConnectionType type);
* @brief returns a vector of all group IDs that the router has a global connection to
* @note this does not include the router's own group as that is a given
vector< int > get_connected_group_ids();
* @brief prints out the state of the connection manager
......@@ -255,6 +264,9 @@ void ConnectionManager::add_connection(int dest_gid, ConnectionType type)
// TW_ERROR(TW_LOC, "add_connection(dest_id, type): Undefined connection type\n");
if(conn.dest_group_id != conn.src_group_id)
_portMap[conn.port] = conn;
......@@ -435,6 +447,16 @@ vector< Connection > ConnectionManager::get_connections_by_type(ConnectionType t
return retVec;
vector< int > ConnectionManager::get_connected_group_ids()
vector< int > retVec;
set< int >::iterator it;
for(it = _other_groups_i_connect_to.begin(); it != _other_groups_i_connect_to.end(); it++)
return retVec;
void ConnectionManager::print_connections()
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment