Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
codes
codes
Commits
793b36de
Commit
793b36de
authored
Apr 16, 2014
by
Jonathan Jenkins
Browse files
stats caveats, cleaning up dbg msgs for simplewan
parent
4a1599b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/models/networks/model-net/README.simplewan.txt
View file @
793b36de
...
@@ -34,3 +34,18 @@ ignored, but linebreaks are not, and delimit rows of the matrix. The relative
...
@@ -34,3 +34,18 @@ ignored, but linebreaks are not, and delimit rows of the matrix. The relative
simplewan identifiers 1..N are assigned to simplewan LPs in the order of
simplewan identifiers 1..N are assigned to simplewan LPs in the order of
their appearance in the codes-configuration file. In the future, a full NxN
their appearance in the codes-configuration file. In the future, a full NxN
matrix may be used to facilitate asymmetric link capacities if the need arises.
matrix may be used to facilitate asymmetric link capacities if the need arises.
Caveats:
--------
The model-net statistics are slightly more complex than in other model-net
implementations because there are in essence multiple queues per simplewan
instance. In particular, the "send time" and "recv time" stats are computed as
ranges of time in which the simplewan LP is actively sending/receiving data
from *any* link. Hence, simple bandwidth calculations (send bytes / send time)
may not be accurate due to skew in message issuance.
Having more than one category in simplewan will cause the times in the
derived "all" category to be off. "all" is currently implemented as the sum of
the various categories, which doesn't work when times in certain categories may
overlap.
src/models/networks/model-net/simplewan.c
View file @
793b36de
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
#define CATEGORY_NAME_MAX 16
#define CATEGORY_NAME_MAX 16
#define CATEGORY_MAX 12
#define CATEGORY_MAX 12
#define SIMPLEWAN_DEBUG 0
/*Define simplewan data types and structs*/
/*Define simplewan data types and structs*/
typedef
struct
sw_message
sw_message
;
typedef
struct
sw_message
sw_message
;
typedef
struct
sw_state
sw_state
;
typedef
struct
sw_state
sw_state
;
...
@@ -533,12 +535,15 @@ static void handle_msg_ready_event(
...
@@ -533,12 +535,15 @@ static void handle_msg_ready_event(
m
->
recv_next_idle_all_saved
=
idles
->
recv_next_idle_all
;
m
->
recv_next_idle_all_saved
=
idles
->
recv_next_idle_all
;
m
->
recv_prev_idle_all_saved
=
idles
->
recv_prev_idle_all
;
m
->
recv_prev_idle_all_saved
=
idles
->
recv_prev_idle_all
;
#if SIMPLEWAN_DEBUG
printf
(
"%d: from_id:%d now: %8.3lf next_idle_recv: %8.3lf
\n
"
,
printf
(
"%d: from_id:%d now: %8.3lf next_idle_recv: %8.3lf
\n
"
,
ns
->
id
,
m
->
src_mn_rel_id
,
ns
->
id
,
m
->
src_mn_rel_id
,
tw_now
(
lp
),
ns
->
recv_next_idle
[
m
->
src_mn_rel_id
]);
tw_now
(
lp
),
ns
->
recv_next_idle
[
m
->
src_mn_rel_id
]);
printf
(
"%d: BEFORE all_idles_recv %8.3lf %8.3lf
\n
"
,
printf
(
"%d: BEFORE all_idles_recv %8.3lf %8.3lf
\n
"
,
ns
->
id
,
ns
->
id
,
idles
->
recv_prev_idle_all
,
idles
->
recv_next_idle_all
);
idles
->
recv_prev_idle_all
,
idles
->
recv_next_idle_all
);
#endif
/* update global idles, recv time */
/* update global idles, recv time */
if
(
tw_now
(
lp
)
>
idles
->
recv_next_idle_all
){
if
(
tw_now
(
lp
)
>
idles
->
recv_next_idle_all
){
...
@@ -552,6 +557,7 @@ static void handle_msg_ready_event(
...
@@ -552,6 +557,7 @@ static void handle_msg_ready_event(
idles
->
recv_next_idle_all
=
ns
->
recv_next_idle
[
m
->
src_mn_rel_id
];
idles
->
recv_next_idle_all
=
ns
->
recv_next_idle
[
m
->
src_mn_rel_id
];
}
}
#if SIMPLEWAN_DEBUG
printf
(
"%d: AFTER all_idles_recv %8.3lf %8.3lf"
,
printf
(
"%d: AFTER all_idles_recv %8.3lf %8.3lf"
,
ns
->
id
,
idles
->
recv_prev_idle_all
,
idles
->
recv_next_idle_all
);
ns
->
id
,
idles
->
recv_prev_idle_all
,
idles
->
recv_next_idle_all
);
if
(
m
->
event_size_bytes
>
0
){
if
(
m
->
event_size_bytes
>
0
){
...
@@ -560,6 +566,7 @@ static void handle_msg_ready_event(
...
@@ -560,6 +566,7 @@ static void handle_msg_ready_event(
else
{
else
{
printf
(
" - without event
\n
"
);
printf
(
" - without event
\n
"
);
}
}
#endif
/* copy only the part of the message used by higher level */
/* copy only the part of the message used by higher level */
if
(
m
->
event_size_bytes
)
if
(
m
->
event_size_bytes
)
...
@@ -665,11 +672,13 @@ static void handle_msg_start_event(
...
@@ -665,11 +672,13 @@ static void handle_msg_start_event(
if
(
stat
->
max_event_size
<
total_event_size
)
if
(
stat
->
max_event_size
<
total_event_size
)
stat
->
max_event_size
=
total_event_size
;
stat
->
max_event_size
=
total_event_size
;
#if SIMPLEWAN_DEBUG
printf
(
"%d: to_id:%d now: %8.3lf next_idle_send: %8.3lf
\n
"
,
printf
(
"%d: to_id:%d now: %8.3lf next_idle_send: %8.3lf
\n
"
,
ns
->
id
,
dest_rel_id
,
ns
->
id
,
dest_rel_id
,
tw_now
(
lp
),
ns
->
send_next_idle
[
dest_rel_id
]);
tw_now
(
lp
),
ns
->
send_next_idle
[
dest_rel_id
]);
printf
(
"%d: BEFORE all_idles_send %8.3lf %8.3lf
\n
"
,
printf
(
"%d: BEFORE all_idles_send %8.3lf %8.3lf
\n
"
,
ns
->
id
,
idles
->
send_prev_idle_all
,
idles
->
send_next_idle_all
);
ns
->
id
,
idles
->
send_prev_idle_all
,
idles
->
send_next_idle_all
);
#endif
/* update global idles, send time */
/* update global idles, send time */
if
(
tw_now
(
lp
)
>
idles
->
send_next_idle_all
){
if
(
tw_now
(
lp
)
>
idles
->
send_next_idle_all
){
...
@@ -682,6 +691,7 @@ static void handle_msg_start_event(
...
@@ -682,6 +691,7 @@ static void handle_msg_start_event(
idles
->
send_next_idle_all
=
ns
->
send_next_idle
[
dest_rel_id
];
idles
->
send_next_idle_all
=
ns
->
send_next_idle
[
dest_rel_id
];
}
}
#if SIMPLEWAN_DEBUG
printf
(
"%d: AFTER all_idles_send %8.3lf %8.3lf"
,
printf
(
"%d: AFTER all_idles_send %8.3lf %8.3lf"
,
ns
->
id
,
idles
->
send_prev_idle_all
,
idles
->
send_next_idle_all
);
ns
->
id
,
idles
->
send_prev_idle_all
,
idles
->
send_next_idle_all
);
if
(
m
->
local_event_size_bytes
>
0
){
if
(
m
->
local_event_size_bytes
>
0
){
...
@@ -690,6 +700,7 @@ static void handle_msg_start_event(
...
@@ -690,6 +700,7 @@ static void handle_msg_start_event(
else
{
else
{
printf
(
" - without local event
\n
"
);
printf
(
" - without local event
\n
"
);
}
}
#endif
/* create new event to send msg to receiving NIC */
/* create new event to send msg to receiving NIC */
// printf("\n msg start sending to %d ", dest_id);
// printf("\n msg start sending to %d ", dest_id);
...
@@ -753,10 +764,12 @@ static tw_stime simplewan_packet_event(
...
@@ -753,10 +764,12 @@ static tw_stime simplewan_packet_event(
xfer_to_nic_time
=
codes_local_latency
(
sender
);
xfer_to_nic_time
=
codes_local_latency
(
sender
);
#if SIMPLEWAN_DEBUG
printf
(
"%lu: final %lu packet sz %d remote sz %d self sz %d is_last_pckt %d latency %lf
\n
"
,
printf
(
"%lu: final %lu packet sz %d remote sz %d self sz %d is_last_pckt %d latency %lf
\n
"
,
(
dest_id
-
1
)
/
2
,
final_dest_lp
,
packet_size
,
(
dest_id
-
1
)
/
2
,
final_dest_lp
,
packet_size
,
remote_event_size
,
self_event_size
,
is_last_pckt
,
remote_event_size
,
self_event_size
,
is_last_pckt
,
xfer_to_nic_time
+
offset
);
xfer_to_nic_time
+
offset
);
#endif
e_new
=
tw_event_new
(
dest_id
,
xfer_to_nic_time
+
offset
,
sender
);
e_new
=
tw_event_new
(
dest_id
,
xfer_to_nic_time
+
offset
,
sender
);
msg
=
tw_event_data
(
e_new
);
msg
=
tw_event_data
(
e_new
);
...
...
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