- scheduler/feeder: add <locality_scheduler_fraction> option;

lets you intermix locality and job-cache scheduling
    From Bernd M.

svn path=/trunk/boinc/; revision=17429
This commit is contained in:
David Anderson 2009-03-03 00:12:55 +00:00
parent 5f5e56885b
commit aadf813336
6 changed files with 34 additions and 7 deletions

View File

@ -2473,6 +2473,7 @@ Rom 2 Mar 2009
David 2 Mar 2009
- scheduler: replace choose_download_url_by_timezone with
replace_download_url_by_timezone.
From Bernd M.
sched/
sched_timezone.cpp
@ -2484,3 +2485,15 @@ Rom 2 Mar 2009
curl/
<Various Files>
David 2 Mar 2009
- scheduler/feeder: add <locality_scheduler_fraction> option;
lets you intermix locality and job-cache scheduling
From Bernd M.
sched/
feeder.cpp
handle_request.cpp
sched_config.cpp,h
sched_send.cpp

View File

@ -68,7 +68,7 @@
#define DEFAULT_SLEEP_INTERVAL 5
#define RESULTS_PER_WU 4 // an estimate of redundancy
int id_modulus=0, id_remainder=0;
int id_modulus=0, id_remainder=0, appid=0;
bool dont_retry_errors = false;
bool dont_delete_antiques = false;
bool dont_delete_batches = false;
@ -277,7 +277,10 @@ bool do_pass(bool retry_error) {
if (dont_delete_batches) {
strcat(clause, " and batch <= 0 ");
}
if (appid) {
sprintf(buf, " and appid = %d ", appid);
strcat(clause, buf);
}
sprintf(buf,
"where file_delete_state=%d %s limit %d",
retry_error?FILE_DELETE_ERROR:FILE_DELETE_READY,
@ -592,6 +595,8 @@ int main(int argc, char** argv) {
preserve_wu_files = true;
} else if (!strcmp(argv[i], "-preserve_result_files")) {
preserve_result_files = true;
} else if (!strcmp(argv[i], "-appid")) {
appid = atoi(argv[++i]);
} else if (!strcmp(argv[i], "-d")) {
log_messages.set_debug_level(atoi(argv[++i]));
} else if (!strcmp(argv[i], "-mod")) {

View File

@ -1212,7 +1212,7 @@ void process_request(char* code_sign_key) {
}
if (requesting_work()) {
if (config.locality_scheduling || config.enable_assignment) {
if (config.locality_scheduling || config.locality_scheduler_fraction || config.enable_assignment) {
have_no_work = false;
} else {
lock_sema();
@ -1475,7 +1475,7 @@ void handle_request(FILE* fin, FILE* fout, char* code_sign_key) {
sreply.insert_message(USER_MESSAGE(buf, "low"));
}
if (config.locality_scheduling && !sreply.nucleus_only) {
if ((config.locality_scheduling || config.locality_scheduler_fraction) && !sreply.nucleus_only) {
send_file_deletes();
}

View File

@ -108,6 +108,7 @@ int SCHED_CONFIG::parse(FILE* f) {
if (xp.parse_int(tag, "uldl_dir_fanout", uldl_dir_fanout)) continue;
if (xp.parse_int(tag, "locality_scheduling_wait_period", locality_scheduling_wait_period)) continue;
if (xp.parse_int(tag, "locality_scheduling_send_timeout", locality_scheduling_send_timeout)) continue;
if (xp.parse_double(tag, "locality_scheduler_fraction", locality_scheduler_fraction)) continue;
if (xp.parse_int(tag, "min_core_client_version", min_core_client_version)) continue;
if (xp.parse_int(tag, "min_core_client_version_announced", min_core_client_version_announced)) continue;
if (xp.parse_int(tag, "min_core_client_upgrade_deadline", min_core_client_upgrade_deadline)) continue;

View File

@ -64,6 +64,7 @@ public:
int uldl_dir_levels;
int locality_scheduling_wait_period;
int locality_scheduling_send_timeout;
double locality_scheduler_fraction;
int min_core_client_version;
int min_core_client_version_announced;
int min_core_client_upgrade_deadline;

View File

@ -25,8 +25,7 @@
#include <cstdio>
#include <cstring>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
#include "error_numbers.h"
@ -1665,7 +1664,15 @@ void send_work() {
);
}
if (config.locality_scheduling) {
if (config.locality_scheduler_fraction > 0) {
if (drand() < config.locality_scheduler_fraction) {
send_work_locality();
send_work_old();
} else {
send_work_old();
send_work_locality();
}
} else if (config.locality_scheduling) {
g_wreq->infeasible_only = false;
send_work_locality();
} else if (config.matchmaker) {