*** empty log message ***

svn path=/trunk/boinc/; revision=3903
This commit is contained in:
Daniel Hsu 2004-07-19 23:05:46 +00:00
parent b937c3a84b
commit 7f0aa986d2
1 changed files with 64 additions and 25 deletions

View File

@ -70,20 +70,27 @@ resource share.
<p> <p>
For example, consider a system participating in two projects, A and B, For example, consider a system participating in two projects, A and B,
with resource shares 75% and 25%, respectively. with resource shares 75% and 25%, respectively.
Suppose in some time period, the system devotes 25 minutes of CPU time to project A Suppose in some time period, the system devotes 25 minutes of CPU time to
and 15 minutes of CPU time to project B. project A and 15 minutes of CPU time to project B.
We decrease the debt to A by 25 minutes and increase it by 30 minutes (75% of 25 + 15). We decrease the debt to A by 25 minutes and increase it by 30 minutes (75%
of 25 + 15).
So the debt increases overall. So the debt increases overall.
This makes sense because we expected to devote a This makes sense because we expected to devote a larger percentage of the
larger percentage of the system resources to project A than it system resources to project A than it actually got.
actually got.
<p> <p>
The choice of projects for which to start result computations The choice of projects for which to start result computations can simply
can simply follow the debt ordering of the projects. follow the debt ordering of the projects.
The algorithm computes the 'anticipated debt' to a project The algorithm computes the 'anticipated debt' to a project (the debt we
(the debt we expect to owe after the time period expires) expect to owe after the time period expires) as it chooses result
as it chooses result computations to run. computations to run.
<p>
If a project has no runnable results, its resource share should not be
considered when determining the debts for other projects.
Furthermore, such a project should not be allowed to build-up debt while it
has no work.
Thus, its debt should be reset to zero.
<h3>A sketch of the CPU scheduling algorithm</h3> <h3>A sketch of the CPU scheduling algorithm</h3>
@ -109,26 +116,46 @@ property, but we hope it will be close to achieving it.
<ol> <ol>
<li>Decrease debts to projects according to the amount of work done for <li>
If a project has no runnable results:
<ol>
<li>
Reset its debt to 0, and do not consider its resource share to
determine relative resource shares.
</ol>
<li>
Else:
<ol>
<li>
Decrease debts to projects according to the amount of work done for
the projects in the last period. the projects in the last period.
<li>
Increase debts to projects according to the projects' relative resource
shares.
</ol>
<li>Increase debts to projects according to the projects' resource shares. <li>
Let the anticipated debt for each project be initialized to its current
debt.
<li>Let the anticipated debt for each project be initialized to <li>
its current debt. Repeat until we decide on a result to compute for each processor:
<li>Repeat until we decide on a result to compute for each processor:
<ol> <ol>
<li>Choose the project that has the largest anticipated debt and a <li>
Choose the project that has the largest anticipated debt and a
ready-to-compute result. ready-to-compute result.
<li>Decrease the anticipated debt of the project by the expected amount of CPU time. <li>
Decrease the anticipated debt of the project by the expected amount of CPU
time.
</ol> </ol>
<li>Preempt current result computations, and start new ones. <li>
Preempt current result computations, and start new ones.
</ol> </ol>
@ -161,7 +188,15 @@ foreach task T that is RUNNING:
total_work_done_this_period += x total_work_done_this_period += x
foreach P in projects: foreach P in projects:
P.debt += P.resource_share * total_work_done_this_period if P has a runnable result:
adjusted_total_resource_share += P.resource_share
foreach P in projects:
if P has no runnable result:
P.debt = 0
else:
P.debt += (P.resource_share / adjusted_total_resource_share)
* total_work_done_this_period
- P.work_done_this_period - P.work_done_this_period
expected_pay_off = total_work_done_this_period / num_cpus expected_pay_off = total_work_done_this_period / num_cpus
@ -235,7 +270,7 @@ between T and 2T days from now.
At a given time, the CPU scheduler may need as many as At a given time, the CPU scheduler may need as many as
<blockquote> <blockquote>
min_results(P) = ceil(ncpus * P.resource_share) min_results(P) = ceil(ncpus * P.resource_share / total_resource_share)
</blockquote> </blockquote>
<p> <p>
@ -296,7 +331,8 @@ estimated_cpu_time(R_1, R_2, ..., R_N-k) / avg_proc_rate(P)
where avg_proc_rate(P) is the average number of CPU seconds completed by where avg_proc_rate(P) is the average number of CPU seconds completed by
the client for project P in a second of (wall-clock) time: the client for project P in a second of (wall-clock) time:
<blockquote> <blockquote>
avg_proc_rate(P) = P.resource_share * ncpus * 'active fraction'. avg_proc_rate(P) = P.resource_share / total_resource_share * ncpus *
'active fraction'.
</blockquote> </blockquote>
<h3>How much work to get</h3> <h3>How much work to get</h3>
@ -379,8 +415,11 @@ data structures:
PROJECT: PROJECT:
double work_request double work_request
total_resource_share = sum of all projects' resource_share
avg_proc_rate(P): avg_proc_rate(P):
return P.resource_share * ncpus * time_stats.active_frac return P.resource_share / total_resource_share
* ncpus * time_stats.active_frac
ettprc(P, k): ettprc(P, k):
results_to_skip = k results_to_skip = k