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
96ced58e
Commit
96ced58e
authored
May 31, 2018
by
Neil McGlohon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minimal Routing use random global and RC update
parent
8b38cc46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
35 deletions
+36
-35
src/networks/model-net/dragonfly-plus.C
src/networks/model-net/dragonfly-plus.C
+36
-35
No files found.
src/networks/model-net/dragonfly-plus.C
View file @
96ced58e
...
...
@@ -2986,14 +2986,17 @@ static Connection do_dfp_routing(router_state *s,
vector
<
Connection
>
poss_next_stops
=
get_legal_minimal_stops
(
s
,
bf
,
msg
,
lp
,
fdest_router_id
);
if
(
poss_next_stops
.
size
()
<
1
)
tw_error
(
TW_LOC
,
"MINIMAL DEAD END
\n
"
);
int
rand_sel
=
tw_rand_integer
(
lp
->
rng
,
0
,
poss_next_stops
.
size
()
-
1
);
return
poss_next_stops
[
rand_sel
];
ConnectionType
conn_type
=
poss_next_stops
[
0
].
conn_type
;
Connection
best_min_conn
;
if
(
conn_type
==
CONN_GLOBAL
)
best_min_conn
=
get_best_connection_from_conns
(
s
,
bf
,
msg
,
lp
,
poss_next_stops
);
//does the pick 2 and compare
else
best_min_conn
=
get_absolute_best_connection_from_conns
(
s
,
bf
,
msg
,
lp
,
poss_next_stops
);
//gets absolute best
return
best_min_conn
;
//
ConnectionType conn_type = poss_next_stops[0].conn_type;
//
Connection best_min_conn;
//
if (conn_type == CONN_GLOBAL)
//
best_min_conn = get_best_connection_from_conns(s, bf, msg, lp, poss_next_stops); //does the pick 2 and compare
//
else
//
best_min_conn = get_absolute_best_connection_from_conns(s, bf, msg, lp, poss_next_stops); //gets absolute best
//
return best_min_conn;
}
else
{
//routing algorithm is specified in routing
...
...
@@ -3047,6 +3050,31 @@ static Connection do_dfp_routing(router_state *s,
tw_error
(
TW_LOC
,
"do_dfp_routing(): No route chosen!
\n
"
);
}
static
void
do_dfp_routing_rc
(
router_state
*
s
,
tw_bf
*
bf
,
terminal_plus_message
*
msg
,
tw_lp
*
lp
,
int
fdest_router_id
)
{
int
my_group_id
=
s
->
router_id
/
s
->
params
->
num_routers
;
int
fdest_group_id
=
fdest_router_id
/
s
->
params
->
num_routers
;
if
(
my_group_id
==
fdest_group_id
)
{
tw_rand_reverse_unif
(
lp
->
rng
);
tw_rand_reverse_unif
(
lp
->
rng
);
}
else
if
(
isRoutingAdaptive
(
routing
))
{
tw_rand_reverse_unif
(
lp
->
rng
);
tw_rand_reverse_unif
(
lp
->
rng
);
tw_rand_reverse_unif
(
lp
->
rng
);
tw_rand_reverse_unif
(
lp
->
rng
);
}
else
if
(
isRoutingMinimal
(
routing
))
{
tw_rand_reverse_unif
(
lp
->
rng
);
}
else
{
tw_rand_reverse_unif
(
lp
->
rng
);
tw_rand_reverse_unif
(
lp
->
rng
);
}
}
static
void
router_verify_valid_receipt
(
router_state
*
s
,
tw_bf
*
bf
,
terminal_plus_message
*
msg
,
tw_lp
*
lp
)
{
if
(
msg
->
my_N_hop
>
s
->
params
->
max_hops_notify
)
...
...
@@ -3114,35 +3142,8 @@ static void router_packet_receive_rc(router_state *s, tw_bf *bf, terminal_plus_m
int
output_chan
=
msg
->
saved_channel
;
//do dfp routing reverse
int
my_group_id
=
s
->
router_id
/
s
->
params
->
num_routers
;
int
dest_router_id
=
dragonfly_plus_get_assigned_router_id
(
msg
->
dfp_dest_terminal_id
,
s
->
params
);
int
fdest_group_id
=
dest_router_id
/
s
->
params
->
num_routers
;
if
(
s
->
router_id
==
msg
->
origin_router_id
)
{
tw_rand_reverse_unif
(
lp
->
rng
);
//choose group
tw_rand_reverse_unif
(
lp
->
rng
);
//choose router
}
if
(
bf
->
c30
==
1
)
{
tw_rand_reverse_unif
(
lp
->
rng
);
tw_rand_reverse_unif
(
lp
->
rng
);
tw_rand_reverse_unif
(
lp
->
rng
);
}
if
(
my_group_id
==
fdest_group_id
)
{
tw_rand_reverse_unif
(
lp
->
rng
);
tw_rand_reverse_unif
(
lp
->
rng
);
}
else
if
(
isRoutingAdaptive
(
routing
)
)
{
//we need to reverse 4
for
(
int
i
=
0
;
i
<
4
;
i
++
)
tw_rand_reverse_unif
(
lp
->
rng
);
}
else
{
tw_rand_reverse_unif
(
lp
->
rng
);
tw_rand_reverse_unif
(
lp
->
rng
);
}
//end do dfp routing reverse
do_dfp_routing_rc
(
s
,
bf
,
msg
,
lp
,
dest_router_id
);
// tw_rand_reverse_unif(lp->rng); nm may14-2018, i think this was wrongly still here
if
(
bf
->
c2
)
{
...
...
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