Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
codes
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
38
Issues
38
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
codes
codes
Commits
902c7938
Commit
902c7938
authored
Apr 06, 2018
by
Neil McGlohon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dragonfly Plus Model: Local Adaptive Routing Now Considers All Min Paths
parent
bc38768f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
14 deletions
+38
-14
src/networks/model-net/dragonfly-plus.C
src/networks/model-net/dragonfly-plus.C
+38
-14
No files found.
src/networks/model-net/dragonfly-plus.C
View file @
902c7938
...
...
@@ -2287,7 +2287,7 @@ static int get_min_hops_to_dest_from_conn(router_state *s, tw_bf *bf, terminal_p
}
}
else
{
//next is not in final destination group
if
(
next_hops_type
==
SPINE
)
if
(
next_hops_type
==
SPINE
)
return
3
;
//Next Spine -> Spine -> Leaf -> dest_term
else
{
assert
(
next_hops_type
==
LEAF
);
...
...
@@ -2406,25 +2406,38 @@ static Connection do_dfp_routing(router_state *s,
if
(
msg
->
dfp_upward_channel_flag
==
1
||
(
my_group_id
==
fdest_group_id
))
choose_minimal
=
true
;
//in both of these cases minimal should always be chosen
vector
<
Connection
>
selected_minimal_conns
;
if
(
my_group_id
==
fdest_group_id
)
{
//if we are in the final destination group
selected_minimal_conns
=
poss_min_next_stops
;
//then we want to find the least congested out of all of the possible minimum paths
//two garbage random numbers to keep things even since we're not randomly selecting two connections.
//TODO This will need to be changed if select_two is made configurable
tw_rand_integer
(
lp
->
rng
,
0
,
1
);
tw_rand_integer
(
lp
->
rng
,
0
,
1
);
}
else
//then we do the typical randomly select two connections
{
selected_minimal_conns
=
dfp_select_two_connections
(
s
,
bf
,
msg
,
lp
,
poss_min_next_stops
);
}
vector
<
Connection
>
two_minimal_conns
=
dfp_select_two_connections
(
s
,
bf
,
msg
,
lp
,
poss
_min_next_stops
);
vector
<
Connection
>
two_nonminimal_conns
=
dfp_select_two_connections
(
s
,
bf
,
msg
,
lp
,
poss_non_min_next_stops
);
int
num_conns
=
two_minimal_conns
.
size
()
+
two
_nonminimal_conns
.
size
();
//we selected two from each //TODO maybe make this configurable
vector
<
Connection
>
selected_nonminimal_conns
=
dfp_select_two_connections
(
s
,
bf
,
msg
,
lp
,
poss_non
_min_next_stops
);
int
num_conns
=
selected_minimal_conns
.
size
()
+
selected
_nonminimal_conns
.
size
();
//we selected two from each //TODO maybe make this configurable
//calculate the best connections for minimal and nonminimal
int
scores
[
num_conns
];
for
(
int
i
=
0
;
i
<
num_conns
;
i
++
)
{
if
(
i
<
(
two
_minimal_conns
.
size
())
)
scores
[
i
]
=
dfp_score_connection
(
s
,
bf
,
msg
,
lp
,
two
_minimal_conns
[
i
]);
if
(
i
<
(
selected
_minimal_conns
.
size
())
)
scores
[
i
]
=
dfp_score_connection
(
s
,
bf
,
msg
,
lp
,
selected
_minimal_conns
[
i
]);
else
scores
[
i
]
=
dfp_score_connection
(
s
,
bf
,
msg
,
lp
,
two_nonminimal_conns
[
i
-
two
_minimal_conns
.
size
()]);
scores
[
i
]
=
dfp_score_connection
(
s
,
bf
,
msg
,
lp
,
selected_nonminimal_conns
[
i
-
selected
_minimal_conns
.
size
()]);
}
int
best_min_score
=
INT_MAX
;
int
best_min_score_index
=
0
;
for
(
int
i
=
0
;
i
<
two
_minimal_conns
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
selected
_minimal_conns
.
size
();
i
++
)
{
if
(
scores
[
i
]
<
best_min_score
)
{
best_min_score
=
scores
[
i
];
...
...
@@ -2434,11 +2447,11 @@ static Connection do_dfp_routing(router_state *s,
int
best_non_min_score
=
INT_MAX
;
int
best_non_min_score_index
=
0
;
for
(
int
i
=
two
_minimal_conns
.
size
();
i
<
num_conns
;
i
++
)
for
(
int
i
=
selected
_minimal_conns
.
size
();
i
<
num_conns
;
i
++
)
{
if
(
scores
[
i
]
<
best_non_min_score
)
{
best_non_min_score
=
scores
[
i
];
best_non_min_score_index
=
i
-
two
_minimal_conns
.
size
();
best_non_min_score_index
=
i
-
selected
_minimal_conns
.
size
();
}
}
//end score calculation
...
...
@@ -2461,11 +2474,11 @@ static Connection do_dfp_routing(router_state *s,
}
if
(
choose_minimal
)
{
theConn
=
two
_minimal_conns
[
best_min_score_index
];
theConn
=
selected
_minimal_conns
[
best_min_score_index
];
}
else
{
msg
->
path_type
=
NON_MINIMAL
;
//We chose a nonminimal stop - we will never reset the path type back to minimal!!!!
theConn
=
two
_nonminimal_conns
[
best_non_min_score_index
];
theConn
=
selected
_nonminimal_conns
[
best_non_min_score_index
];
}
}
...
...
@@ -2604,8 +2617,6 @@ static void router_packet_receive(router_state *s, tw_bf *bf, terminal_plus_mess
cur_chunk
->
msg
.
vc_index
=
output_port
;
cur_chunk
->
msg
.
next_stop
=
next_stop
;
int
max_vc_size
=
s
->
params
->
cn_vc_size
;
output_chan
=
0
;
if
(
cur_chunk
->
msg
.
dfp_upward_channel_flag
)
{
...
...
@@ -2615,6 +2626,19 @@ static void router_packet_receive(router_state *s, tw_bf *bf, terminal_plus_mess
output_chan
=
0
;
}
ConnectionType
port_type
=
s
->
connMan
->
get_port_type
(
output_port
);
int
max_vc_size
=
0
;
if
(
port_type
==
CONN_GLOBAL
)
{
max_vc_size
=
s
->
params
->
global_vc_size
;
}
else
if
(
port_type
==
CONN_LOCAL
)
{
max_vc_size
=
s
->
params
->
local_vc_size
;
}
else
{
assert
(
port_type
==
CONN_TERMINAL
);
max_vc_size
=
s
->
params
->
cn_vc_size
;
}
cur_chunk
->
msg
.
output_chan
=
output_chan
;
cur_chunk
->
msg
.
my_N_hop
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment