mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=11042
This commit is contained in:
parent
e9f11fa673
commit
1684e71c98
|
@ -9512,3 +9512,9 @@ David 29 Aug
|
||||||
|
|
||||||
client/
|
client/
|
||||||
cpu_sched.C
|
cpu_sched.C
|
||||||
|
|
||||||
|
David 30 Aug
|
||||||
|
- core client: work fetch bug fix from JM7
|
||||||
|
|
||||||
|
client/
|
||||||
|
cs_scheduler.C
|
||||||
|
|
|
@ -631,84 +631,85 @@ bool CLIENT_STATE::compute_work_requests() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// loop over projects, and pick one to get work from
|
||||||
|
//
|
||||||
double prrs = potentially_runnable_resource_share();
|
double prrs = potentially_runnable_resource_share();
|
||||||
|
|
||||||
PROJECT *pbest = NULL;
|
PROJECT *pbest = NULL;
|
||||||
double best_work = 0;
|
double best_work = 0;
|
||||||
for (i=0; i<projects.size(); i++) {
|
for (i=0; i<projects.size(); i++) {
|
||||||
PROJECT *prospect = projects[i];
|
PROJECT *p = projects[i];
|
||||||
double prospect_work = time_until_work_done(prospect, 0, prrs);
|
|
||||||
if (!prospect->contactable()) {
|
// see if this project can be ruled out completely
|
||||||
|
//
|
||||||
|
if (!p->contactable()) {
|
||||||
if (log_flags.work_fetch_debug) {
|
if (log_flags.work_fetch_debug) {
|
||||||
msg_printf(0, MSG_INFO,
|
msg_printf(p, MSG_INFO, "work fetch: project not contactable");
|
||||||
"compute_work_requests(): project %s not contactable\n",
|
}
|
||||||
prospect->get_project_name()
|
continue;
|
||||||
|
}
|
||||||
|
if (p->deadlines_missed
|
||||||
|
&& overall_work_fetch_urgency != WORK_FETCH_NEED_IMMEDIATELY
|
||||||
|
) {
|
||||||
|
if (log_flags.work_fetch_debug) {
|
||||||
|
msg_printf(p, MSG_INFO,
|
||||||
|
"work fetch: project has %d deadline misses",
|
||||||
|
p->deadlines_missed
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (prospect->deadlines_missed) {
|
if (p->overworked() && overall_work_fetch_urgency < WORK_FETCH_NEED) {
|
||||||
if (log_flags.work_fetch_debug) {
|
if (log_flags.work_fetch_debug) {
|
||||||
msg_printf(0, MSG_INFO,
|
msg_printf(p, MSG_INFO, "work fetch: project is overworked");
|
||||||
"compute_work_requests(): project %s has %d deadline misses\n",
|
|
||||||
prospect->get_project_name(), prospect->deadlines_missed
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (prospect->overworked() && overall_work_fetch_urgency < WORK_FETCH_NEED) {
|
if (p->cpu_shortfall == 0.0 && overall_work_fetch_urgency < WORK_FETCH_NEED) {
|
||||||
if (log_flags.work_fetch_debug) {
|
if (log_flags.work_fetch_debug) {
|
||||||
msg_printf(0, MSG_INFO,
|
msg_printf(p, MSG_INFO, "work fetch: project has no shortfall");
|
||||||
"compute_work_requests(): project %s is overworked\n",
|
|
||||||
prospect->get_project_name()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (prospect->cpu_shortfall == 0.0 && overall_work_fetch_urgency < WORK_FETCH_NEED) {
|
|
||||||
if (log_flags.work_fetch_debug) {
|
|
||||||
msg_printf(0, MSG_INFO,
|
|
||||||
"compute_work_requests(): project %s has no shortfall\n",
|
|
||||||
prospect->get_project_name()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// see if this project is better than our current best
|
||||||
|
//
|
||||||
|
double prospect_work = time_until_work_done(p, 0, prrs);
|
||||||
if (pbest) {
|
if (pbest) {
|
||||||
if (!pbest->overworked() && projects[i]->overworked()) {
|
if (!pbest->overworked() && p->overworked()) {
|
||||||
if (log_flags.work_fetch_debug) {
|
if (log_flags.work_fetch_debug) {
|
||||||
msg_printf(0, MSG_INFO,
|
msg_printf(p, MSG_INFO,
|
||||||
"compute_work_requests(): project %s is overworked\n",
|
"work_fetch: project is overworked, %s isn't",
|
||||||
prospect->get_project_name()
|
pbest->get_project_name()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (pbest->long_term_debt - best_work > prospect->long_term_debt - prospect_work) {
|
if (pbest->long_term_debt - best_work > p->long_term_debt - prospect_work) {
|
||||||
if (log_flags.work_fetch_debug) {
|
if (log_flags.work_fetch_debug) {
|
||||||
msg_printf(0, MSG_INFO,
|
msg_printf(p, MSG_INFO,
|
||||||
"compute_work_requests(): project %s has a higher debt load than %s\n",
|
"work_fetch: project has less LTD than %s",
|
||||||
pbest->get_project_name(), prospect->get_project_name()
|
pbest->get_project_name()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pbest = prospect;
|
pbest = p;
|
||||||
best_work = prospect_work;
|
best_work = prospect_work;
|
||||||
if (log_flags.work_fetch_debug) {
|
if (log_flags.work_fetch_debug) {
|
||||||
msg_printf(0, MSG_INFO,
|
msg_printf(pbest, MSG_INFO, "work_fetch: best project so far");
|
||||||
"compute_work_requests(): best project so far %s",
|
|
||||||
pbest->get_project_name()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pbest) {
|
if (pbest) {
|
||||||
pbest->work_request = max(
|
if (pbest->deadlines_missed) {
|
||||||
pbest->cpu_shortfall,
|
pbest->work_request = 1;
|
||||||
cpu_shortfall * (prrs ? pbest->resource_share/prrs : 1)
|
} else {
|
||||||
);
|
pbest->work_request = max(
|
||||||
|
pbest->cpu_shortfall,
|
||||||
|
cpu_shortfall * (prrs ? pbest->resource_share/prrs : 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!best_work) {
|
if (!best_work) {
|
||||||
pbest->work_request_urgency = WORK_FETCH_NEED_IMMEDIATELY;
|
pbest->work_request_urgency = WORK_FETCH_NEED_IMMEDIATELY;
|
||||||
|
|
Loading…
Reference in New Issue