コード例 #1
0
ファイル: cs_prefs.cpp プロジェクト: FpgaAtHome/seti_fpga
void CLIENT_STATE::show_global_prefs_source(bool found_venue) {
    PROJECT* pp = global_prefs_source_project();
    if (pp) {
        msg_printf(pp, MSG_INFO,
            "General prefs: from %s (last modified %s)",
            pp->get_project_name(), time_to_string(global_prefs.mod_time)
        );
    } else {
        msg_printf(NULL, MSG_INFO,
            "General prefs: from %s (last modified %s)",
            global_prefs.source_project,
            time_to_string(global_prefs.mod_time)
        );
    }
    if (strlen(main_host_venue)) {
        msg_printf(pp, MSG_INFO, "Computer location: %s", main_host_venue);
        if (found_venue) {
            msg_printf(NULL, MSG_INFO,
                "General prefs: using separate prefs for %s", main_host_venue
            );
        } else {
            msg_printf(pp, MSG_INFO,
                "General prefs: no separate prefs for %s; using your defaults",
                main_host_venue
            );
        }
    } else {
        msg_printf(pp, MSG_INFO, "Host location: none");
        msg_printf(pp, MSG_INFO, "General prefs: using your defaults");
    }
}
コード例 #2
0
ファイル: cs_scheduler.cpp プロジェクト: khandesh/boinc
void CLIENT_STATE::check_project_timeout() {
    unsigned int i;
    for (i=0; i<projects.size(); i++) {
        PROJECT* p = projects[i];
        if (p->possibly_backed_off && now > p->min_rpc_time) {
            p->possibly_backed_off = false;
            char buf[256];
            sprintf(buf, "Backoff ended for %s", p->get_project_name());
            request_work_fetch(buf);
        }
    }
}
コード例 #3
0
ファイル: work_fetch.cpp プロジェクト: AltroCoin/altrocoin
// if the given project is highest-priority among the projects
// eligible for the resource, set request fields
//
void RSC_WORK_FETCH::supplement(PROJECT* pp) {
    double x = pp->sched_priority;
    for (unsigned i=0; i<gstate.projects.size(); i++) {
        PROJECT* p = gstate.projects[i];
        if (p == pp) continue;
        if (p->pwf.cant_fetch_work_reason) continue;
        if (!project_state(p).may_have_work) continue;
        RSC_PROJECT_WORK_FETCH& rpwf = project_state(p);
        if (rpwf.anon_skip) continue;
        if (p->sched_priority > x) {
            if (log_flags.work_fetch_debug) {
                msg_printf(pp, MSG_INFO,
                    "[work_fetch]: not requesting work for %s: %s has higher priority",
                    rsc_name(rsc_type), p->get_project_name()
                );
            }
            return;
        }
    }
    // didn't find a better project; ask for work
    //
    set_request(pp);
}
コード例 #4
0
ファイル: work_fetch.cpp プロジェクト: FpgaAtHome/seti_fpga
// we're going to contact this project for reasons other than work fetch;
// decide if we should piggy-back a work fetch request.
//
void WORK_FETCH::piggyback_work_request(PROJECT* p) {
    clear_request();
    if (config.fetch_minimal_work && gstate.had_or_requested_work) return;
    if (p->dont_request_more_work) return;
    if (p->non_cpu_intensive) {
        if (!has_a_job(p)) {
            rsc_work_fetch[0].req_secs = 1;
        }
        return;
    }

    // if project was updated from manager and config says so,
    // always fetch work if needed
    //
    if (p->sched_rpc_pending && config.fetch_on_update) {
        set_all_requests_hyst(p, -1);
        return;
    }
    compute_cant_fetch_work_reason();
    PROJECT* bestp = choose_project(false, p);
    if (p != bestp) {
        if (p->pwf.cant_fetch_work_reason == 0) {
            if (bestp) {
                p->pwf.cant_fetch_work_reason = CANT_FETCH_WORK_NOT_HIGHEST_PRIORITY;
                if (log_flags.work_fetch_debug) {
                    msg_printf(0, MSG_INFO,
                        "[work_fetch] not piggybacking work req: %s has higher priority",
                        bestp->get_project_name()
                    );
                }
            } else {
                p->pwf.cant_fetch_work_reason = CANT_FETCH_WORK_DONT_NEED;
            }
        }
        clear_request();
    }
}