- scheduler: compute no_jobs_available correctly

in the presence of multiple scheduling types
    (e.g., locality and job array)
    From Nils Brause

svn path=/trunk/boinc/; revision=19559
This commit is contained in:
David Anderson 2009-11-12 21:30:33 +00:00
parent 41f8561fb0
commit 56a8296b5b
5 changed files with 33 additions and 12 deletions

View File

@ -9145,3 +9145,15 @@ David 12 Nov 2009
- Mac compile fix
lib/
coproc.cpp
David 12 Nov 2009
- scheduler: compute no_jobs_available correctly
in the presence of multiple scheduling types
(e.g., locality and job array)
From Nils Brause
sched/
handle_request.cpp
sched_array.cpp
sched_score.cpp
sched_send.cpp

View File

@ -1113,14 +1113,19 @@ void process_request(char* code_sign_key) {
}
}
// if there's no work, and client isn't returning results,
// this isn't an initial RPC,
// and client is requesting work, return without accessing DB
// If:
// - there's no work,
// - a config flag is set,
// - client isn't returning results,
// - this isn't an initial RPC,
// - client is requesting work
// then return without accessing the DB.
// This is an efficiency hack for when servers are overloaded
//
if (
config.nowork_skip
have_no_work
&& config.nowork_skip
&& requesting_work()
&& have_no_work
&& (g_request->results.size() == 0)
&& (g_request->hostid != 0)
) {
@ -1132,11 +1137,10 @@ void process_request(char* code_sign_key) {
}
}
// FROM HERE ON DON'T RETURN; goto leave instead
// because we've tagged an entry in the work array with our process ID
// FROM HERE ON DON'T RETURN; "goto leave" instead
// (because ssp->no_work() may have tagged an entry in the work array
// with our process ID)
// now open the database
//
retval = open_database();
if (retval) {
send_error_message("Server can't open database", 3600);

View File

@ -325,7 +325,6 @@ done:
//
void send_work_old() {
if (!work_needed(false)) return;
g_wreq->no_jobs_available = true;
g_wreq->beta_only = false;
g_wreq->user_apps_only = true;
g_wreq->infeasible_only = false;

View File

@ -294,11 +294,12 @@ void send_work_matchmaker() {
if (jobs.request_satisfied() && slots_scanned>=min_slots) break;
}
if (!slots_nonempty) {
if (slots_nonempty) {
g_wreq->no_jobs_available = false;
} else {
log_messages.printf(MSG_CRITICAL,
"Job cache is empty - check feeder\n"
);
g_wreq->no_jobs_available = true;
}
// TODO: trim jobs from tail of list until we pass the EDF check

View File

@ -1580,6 +1580,11 @@ void send_work() {
);
}
// assume no jobs are available to send;
// if this turns out not to be the case, clear this flag
//
g_wreq->no_jobs_available = true;
if (config.locality_scheduler_fraction > 0) {
if (drand() < config.locality_scheduler_fraction) {
if (config.debug_locality)