- client: fix divide-by-zero bug in calculation of priority

of projects with zero resource share

svn path=/trunk/boinc/; revision=25127
This commit is contained in:
David Anderson 2012-01-23 07:34:16 +00:00
parent 7f7d734718
commit f4b8f357bb
2 changed files with 27 additions and 19 deletions

View File

@ -883,3 +883,10 @@ David 22 Jan 2012
makefile makefile
client/ client/
net_stats.cpp net_stats.cpp
David 22 Jan 2012
- client: fix divide-by-zero bug in calculation of priority
of projects with zero resource share
client/
cpu_sched.cpp

View File

@ -653,10 +653,11 @@ void PROJECT::compute_sched_priority() {
// than those with positive resource share // than those with positive resource share
// //
if (resource_share == 0) { if (resource_share == 0) {
sched_priority = -1e6 - rec_frac; sched_priority = -1e3 - rec_frac;
} } else {
sched_priority = - rec_frac/resource_share_frac; sched_priority = - rec_frac/resource_share_frac;
} }
}
// called from the scheduler's job-selection loop; // called from the scheduler's job-selection loop;
// we plan to run this job; // we plan to run this job;