double RESULT::estimated_time_remaining() {
    if (computing_done()) return 0;
    ACTIVE_TASK* atp = gstate.lookup_active_task_by_result(this);
    if (atp) {
        return atp->est_dur() - atp->elapsed_time;
    }
    return estimated_duration();
}
// compute a per-app-version "temporary DCF" based on the elapsed time
// and fraction done of running jobs
//
void compute_temp_dcf() {
    unsigned int i;
    for (i=0; i<gstate.app_versions.size(); i++) {
        gstate.app_versions[i]->temp_dcf = 1;
    }
    for (i=0; i<gstate.active_tasks.active_tasks.size(); i++) {
        ACTIVE_TASK* atp = gstate.active_tasks.active_tasks[i];
        double x = atp->est_dur(false) / atp->result->estimated_duration(false);
        APP_VERSION* avp = atp->result->avp;
        if (x < avp->temp_dcf) {
            avp->temp_dcf = x;
        }
    }
}
示例#3
0
文件: result.cpp 项目: botaosun/boinc
double RESULT::estimated_runtime_remaining() {
    if (computing_done()) return 0;
    ACTIVE_TASK* atp = gstate.lookup_active_task_by_result(this);
    if (app->non_cpu_intensive) {
        if (atp && atp->fraction_done>0) {
            double est_dur = atp->fraction_done_elapsed_time / atp->fraction_done;
            double x = est_dur - atp->elapsed_time;
            if (x <= 0) x = 1;
            return x;
        }
        return 0;
    }

    if (atp) {
#ifdef SIM
        return sim_flops_left/avp->flops;
#else
        return atp->est_dur() - atp->elapsed_time;
#endif
    }
    return estimated_runtime();
}