Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
codes
codes
Commits
e7c55e0c
Commit
e7c55e0c
authored
May 09, 2018
by
Misbah Mubarak
Browse files
Adding same router and different router checks
parent
9760caef
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/networks/model-net/dragonfly-plus.C
View file @
e7c55e0c
...
...
@@ -109,7 +109,8 @@ static int router_magic_num = 0;
/* terminal magic number */
static
int
terminal_magic_num
=
0
;
static
long
num_local_packets
=
0
;
static
long
num_local_packets_sr
=
0
;
static
long
num_local_packets_sg
=
0
;
static
long
num_remote_packets
=
0
;
/* Hops within a group */
...
...
@@ -852,7 +853,7 @@ void dragonfly_plus_report_stats()
tw_stime
avg_time
,
max_time
;
int
total_minimal_packets
,
total_nonmin_packets
;
long
total_gen
,
total_fin
;
long
total_local_packets
,
total_remote_packets
;
long
total_local_packets
_sr
,
total_local_packets_sg
,
total_remote_packets
;
MPI_Reduce
(
&
total_hops
,
&
avg_hops
,
1
,
MPI_LONG_LONG
,
MPI_SUM
,
0
,
MPI_COMM_CODES
);
MPI_Reduce
(
&
N_finished_packets
,
&
total_finished_packets
,
1
,
MPI_LONG_LONG
,
MPI_SUM
,
0
,
MPI_COMM_CODES
);
...
...
@@ -864,7 +865,8 @@ void dragonfly_plus_report_stats()
MPI_Reduce
(
&
packet_gen
,
&
total_gen
,
1
,
MPI_LONG
,
MPI_SUM
,
0
,
MPI_COMM_CODES
);
MPI_Reduce
(
&
packet_fin
,
&
total_fin
,
1
,
MPI_LONG
,
MPI_SUM
,
0
,
MPI_COMM_CODES
);
MPI_Reduce
(
&
num_local_packets
,
&
total_local_packets
,
1
,
MPI_LONG
,
MPI_SUM
,
0
,
MPI_COMM_CODES
);
MPI_Reduce
(
&
num_local_packets_sr
,
&
total_local_packets_sr
,
1
,
MPI_LONG
,
MPI_SUM
,
0
,
MPI_COMM_CODES
);
MPI_Reduce
(
&
num_local_packets_sg
,
&
total_local_packets_sg
,
1
,
MPI_LONG
,
MPI_SUM
,
0
,
MPI_COMM_CODES
);
MPI_Reduce
(
&
num_remote_packets
,
&
total_remote_packets
,
1
,
MPI_LONG
,
MPI_SUM
,
0
,
MPI_COMM_CODES
);
if
(
isRoutingAdaptive
(
routing
))
{
MPI_Reduce
(
&
minimal_count
,
&
total_minimal_packets
,
1
,
MPI_INT
,
MPI_SUM
,
0
,
MPI_COMM_CODES
);
...
...
@@ -883,7 +885,7 @@ void dragonfly_plus_report_stats()
printf
(
"
\n
ADAPTIVE ROUTING STATS: %d chunks routed minimally %d chunks routed non-minimally completed packets %lld
\n
"
,
total_minimal_packets
,
total_nonmin_packets
,
total_finished_chunks
);
}
printf
(
"
\n
Total packets generated %ld finished %ld Locally routed %ld Remote (inter-group) %ld
\n
"
,
total_gen
,
total_fin
,
total_local_packets
,
total_remote_packets
);
printf
(
"
\n
Total packets generated %ld finished %ld Locally routed
- same router %ld different-router
%ld Remote (inter-group) %ld
\n
"
,
total_gen
,
total_fin
,
total_local_packets
_sr
,
total_local_packets_sg
,
total_remote_packets
);
}
return
;
}
...
...
@@ -1280,7 +1282,12 @@ static void packet_generate(terminal_state *s, tw_bf *bf, terminal_plus_message
int
src_grp_id
=
s
->
router_id
/
s
->
params
->
num_routers
;
if
(
src_grp_id
==
dest_grp_id
)
num_local_packets
++
;
{
if
(
dest_router_id
==
s
->
router_id
)
num_local_packets_sr
++
;
else
num_local_packets_sg
++
;
}
else
num_remote_packets
++
;
...
...
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