Commit 4d47e2f1 authored by David Anderson's avatar David Anderson
Browse files

client: don't request work from a project w/ > 1000 runnable jobs

Because of O(N^2) algorithms, the client becomes CPU-intensive
when there are lots of jobs.
This limit could be somewhat lower.
parent 4cb34a12
......@@ -664,6 +664,16 @@ void WORK_FETCH::setup() {
PROJECT* p = rp->project;
p->sched_priority -= rp->estimated_flops_remaining()/max_queued_flops;
}
// don't request work from projects w/ > 1000 runnable jobs
//
for (unsigned int i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i];
if (p->pwf.n_runnable_jobs > 1000 && !p->pwf.cant_fetch_work_reason) {
p->pwf.cant_fetch_work_reason = CANT_FETCH_WORK_TOO_MANY_RUNNABLE;
}
}
std::sort(
gstate.projects.begin(),
gstate.projects.end(),
......
......@@ -39,6 +39,7 @@
#define CANT_FETCH_WORK_TOO_MANY_UPLOADS 8
#define CANT_FETCH_WORK_NOT_HIGHEST_PRIORITY 9
#define CANT_FETCH_WORK_DONT_NEED 10
#define CANT_FETCH_WORK_TOO_MANY_RUNNABLE 11
inline const char* cant_fetch_work_string(int reason) {
switch (reason) {
......@@ -62,6 +63,8 @@ inline const char* cant_fetch_work_string(int reason) {
return "project is not highest priority";
case CANT_FETCH_WORK_DONT_NEED:
return "don't need";
case CANT_FETCH_WORK_TOO_MANY_RUNNABLE:
return "too many runnable tasks";
}
return "";
}
......
......@@ -218,7 +218,7 @@ void CCompletionErrorPage::OnPageChanged( wxWizardExEvent& event ) {
if (m_pServerMessagesCtrl->GetLabel().IsEmpty()) {
m_pDirectionsStaticCtrl->SetLabel(
_("An error has occurred;\ncheck the Event Log for details.\n\nClick Finish to close.")
_("Please try again later.\n\nClick Finish to close.")
);
} else {
m_pDirectionsStaticCtrl->SetLabel(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment