Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Elsa Gonsiorowski
codes
Commits
0d807b5f
Commit
0d807b5f
authored
Jul 31, 2015
by
Jonathan Jenkins
Browse files
modify elapsed time to end upon CODES_WK_END
parent
281e4a95
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/models/network-workloads/model-net-mpi-wrklds.c
View file @
0d807b5f
...
...
@@ -93,6 +93,7 @@ struct nw_state
unsigned
long
num_waitsome
;
/* time spent by the LP in executing the app trace*/
double
start_time
;
double
elapsed_time
;
/* time spent in compute operations */
...
...
@@ -1084,8 +1085,8 @@ void nw_test_init(nw_state* s, tw_lp* lp)
s
->
arrival_queue
=
queue_init
();
s
->
pending_recvs_queue
=
queue_init
();
/* clock starts
ticking
*/
s
->
elapsed
_time
=
tw_now
(
lp
);
/* clock starts
when the first event is processed
*/
s
->
start
_time
=
tw_now
(
lp
);
codes_issue_next_event
(
lp
);
return
;
...
...
@@ -1192,6 +1193,7 @@ static void get_next_mpi_operation(nw_state* s, tw_bf * bf, nw_message * m, tw_l
if
(
mpi_op
.
op_type
==
CODES_WK_END
)
{
s
->
elapsed_time
=
tw_now
(
lp
)
-
s
->
start_time
;
return
;
}
switch
(
mpi_op
.
op_type
)
...
...
@@ -1265,14 +1267,11 @@ void nw_test_finalize(nw_state* s, tw_lp* lp)
printQueue
(
lp
->
gid
,
s
->
arrival_queue
,
"isend"
);
}
double
total_time
=
tw_now
(
lp
)
-
s
->
elapsed_time
;
//assert(total_time >= s->compute_time);
if
(
total_time
-
s
->
compute_time
>
max_comm_time
)
max_comm_time
=
total_time
-
s
->
compute_time
;
if
(
s
->
elapsed_time
-
s
->
compute_time
>
max_comm_time
)
max_comm_time
=
s
->
elapsed_time
-
s
->
compute_time
;
if
(
total
_time
>
max_time
)
max_time
=
total
_time
;
if
(
s
->
elapsed
_time
>
max_time
)
max_time
=
s
->
elapsed
_time
;
if
(
s
->
wait_time
>
max_wait_time
)
max_wait_time
=
s
->
wait_time
;
...
...
@@ -1283,8 +1282,8 @@ void nw_test_finalize(nw_state* s, tw_lp* lp)
if
(
s
->
recv_time
>
max_recv_time
)
max_recv_time
=
s
->
recv_time
;
avg_time
+=
total
_time
;
avg_comm_time
+=
(
total
_time
-
s
->
compute_time
);
avg_time
+=
s
->
elapsed
_time
;
avg_comm_time
+=
(
s
->
elapsed
_time
-
s
->
compute_time
);
avg_wait_time
+=
s
->
wait_time
;
avg_send_time
+=
s
->
send_time
;
avg_recv_time
+=
s
->
recv_time
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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