From 506c3b6e419e5b524ad72fcd16e363cd0e296814 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 14 Jan 2014 23:56:20 -0800 Subject: [PATCH] client: if app doesn't report fraction done, estimate it --- client/app.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/client/app.cpp b/client/app.cpp index 54e033e852..16439a2f83 100644 --- a/client/app.cpp +++ b/client/app.cpp @@ -586,6 +586,15 @@ int ACTIVE_TASK::write(MIOFILE& fout) { #ifndef SIM int ACTIVE_TASK::write_gui(MIOFILE& fout) { + // if the app hasn't reported fraction done, and time has elapsed, + // estimate fraction done + // + double fd = fraction_done; + if (fd == 0 && elapsed_time > 0) { + double est_time = wup->rsc_fpops_est/app_version->flops; + fd = elapsed_time/est_time; + if (fd > .99) fd = .99; + } fout.printf( "\n" " %d\n" @@ -609,7 +618,7 @@ int ACTIVE_TASK::write_gui(MIOFILE& fout) { pid, scheduler_state, checkpoint_cpu_time, - fraction_done, + fd, current_cpu_time, elapsed_time, procinfo.swap_size,