client: if app reports frac done outside [0,1] write message

... conditioned on task_debug; write at most one msg per minute
This commit is contained in:
David Anderson 2015-08-16 12:11:27 -07:00
parent 1431a21d99
commit 72f53a6918
2 changed files with 10 additions and 1 deletions

View File

@ -673,7 +673,7 @@ int ACTIVE_TASK::write_gui(MIOFILE& fout) {
// way that constantly increases and approaches 1.
//
double fd = fraction_done;
if (((fd==0)||(fd>1)) && elapsed_time > 0) {
if (((fd<=0)||(fd>1)) && elapsed_time > 0) {
double est_time = wup->rsc_fpops_est/app_version->flops;
double x = elapsed_time/est_time;
fd = 1 - exp(-x);

View File

@ -1352,6 +1352,7 @@ bool ACTIVE_TASK::get_app_status_msg() {
double fd;
int other_pid;
double dtemp;
static double last_msg_time=0;
if (!app_client_shm.shm) {
msg_printf(result->project, MSG_INFO,
@ -1381,6 +1382,14 @@ bool ACTIVE_TASK::get_app_status_msg() {
first_fraction_done = fd;
first_fraction_done_elapsed_time = elapsed_time;
}
if (log_flags.task_debug && (fd<0 || fd>1)) {
if (gstate.now > last_msg_time + 60) {
msg_printf(this->wup->project, MSG_INFO,
"[task_debug] app reported bad fraction done: %f", fd
);
last_msg_time = gstate.now;
}
}
}
}
parse_double(msg_buf, "<current_cpu_time>", current_cpu_time);