diff --git a/checkin_notes b/checkin_notes
index c6fb7dfcc1..f5bb869052 100644
--- a/checkin_notes
+++ b/checkin_notes
@@ -2681,8 +2681,23 @@ David 14 Mar 2012
David 15 Mar 2012
- client: when killing a task, don't delete its shmem or change its state.
- These mess up the logic for dealing with exited processes.
+ These mess up the logic for dealing with exited processes,
+ resulting in incorrect log messages.
client/
app.cpp
app_control.cpp
+
+David 15 Mar 2012
+ - scheduler: when HR is being used,
+ make per-HR slot allocation an option rather than the default.
+ Kevin reported that slot allocation wasn't working for WCG.
+ The default is now no slot allocation,
+ and use the regular result enumeration function
+ rather than the once that scans the entire table.
+ The config flag for enabling slot allocation is .
+
+ sched/
+ sched_config.cpp,h
+ feeder.cpp
+ hr_info.cpp
diff --git a/sched/feeder.cpp b/sched/feeder.cpp
index 7e3c141105..61bdbec906 100644
--- a/sched/feeder.cpp
+++ b/sched/feeder.cpp
@@ -252,7 +252,7 @@ static bool get_job_from_db(
int hrt = ssp->apps[app_index].homogeneous_redundancy;
while (1) {
- if (hrt) {
+ if (hrt && config.hr_allocate_slots) {
retval = wi.enumerate_all(enum_size, select_clause);
} else {
retval = wi.enumerate(enum_size, select_clause, order_clause);
@@ -326,7 +326,7 @@ static bool get_job_from_db(
// if using HR, check whether we've exceeded quota for this class
//
- if (hrt) {
+ if (hrt && config.hr_allocate_slots) {
if (!hr_info.accept(hrt, wi.wu.hr_class)) {
log_messages.printf(MSG_DEBUG,
"rejecting [RESULT#%u] because HR class %d/%d over quota\n",
@@ -420,7 +420,7 @@ static bool scan_work_array(vector &work_items) {
}
}
- if (using_hr) {
+ if (using_hr && config.hr_allocate_slots) {
hr_count_slots();
}
@@ -616,34 +616,38 @@ void hr_init() {
}
}
using_hr = true;
- hr_info.init();
- retval = hr_info.read_file();
- if (retval) {
- log_messages.printf(MSG_CRITICAL,
- "Can't read HR info file: %s\n", boincerror(retval)
- );
- exit(1);
- }
+ if (config.hr_allocate_slots) {
+ hr_info.init();
+ retval = hr_info.read_file();
+ if (retval) {
+ log_messages.printf(MSG_CRITICAL,
+ "Can't read HR info file: %s\n", boincerror(retval)
+ );
+ exit(1);
+ }
- // find the weight for each HR type
- //
- for (i=0; inapps; i++) {
- hrt = ssp->apps[i].homogeneous_redundancy;
- hr_info.type_weights[hrt] += ssp->apps[i].weight;
- hr_info.type_being_used[hrt] = true;
- }
+ // find the weight for each HR type
+ //
+ for (i=0; inapps; i++) {
+ hrt = ssp->apps[i].homogeneous_redundancy;
+ hr_info.type_weights[hrt] += ssp->apps[i].weight;
+ hr_info.type_being_used[hrt] = true;
+ }
- // compute the slot allocations for HR classes
- //
- hr_info.allocate(ssp->max_wu_results);
- hr_info.show(stderr);
+ // compute the slot allocations for HR classes
+ //
+ hr_info.allocate(ssp->max_wu_results);
+ hr_info.show(stderr);
+ }
}
// write a summary of feeder state to stderr
//
void show_state(int) {
ssp->show(stderr);
- hr_info.show(stderr);
+ if (config.hr_allocate_slots) {
+ hr_info.show(stderr);
+ }
}
void show_version() {
diff --git a/sched/hr_info.cpp b/sched/hr_info.cpp
index a286f54696..8c27cebafb 100644
--- a/sched/hr_info.cpp
+++ b/sched/hr_info.cpp
@@ -175,7 +175,7 @@ void HR_INFO::allocate(int total_slots) {
}
// Decide if job of the given HR type and class should be added to array,
-// and if to update counts
+// and if so update counts
//
bool HR_INFO::accept(int hrt, int hrc) {
if (cur_slots[hrt][hrc] >= max_slots[hrt][hrc]) {
diff --git a/sched/sched_config.cpp b/sched/sched_config.cpp
index b719ac0632..8ea03eac44 100644
--- a/sched/sched_config.cpp
+++ b/sched/sched_config.cpp
@@ -141,6 +141,7 @@ int SCHED_CONFIG::parse(FILE* f) {
if (xp.parse_bool("non_cpu_intensive", non_cpu_intensive)) continue;
if (xp.parse_bool("verify_files_on_app_start", verify_files_on_app_start)) continue;
if (xp.parse_int("homogeneous_redundancy", homogeneous_redundancy)) continue;
+ if (xp.parse_bool("hr_allocate_slots", hr_allocate_slots)) continue;
if (xp.parse_bool("msg_to_host", msg_to_host)) continue;
if (xp.parse_bool("ignore_upload_certificates", ignore_upload_certificates)) continue;
if (xp.parse_bool("dont_generate_upload_certificates", dont_generate_upload_certificates)) continue;
diff --git a/sched/sched_config.h b/sched/sched_config.h
index 3812683d95..0c70661ad8 100644
--- a/sched/sched_config.h
+++ b/sched/sched_config.h
@@ -66,6 +66,7 @@ struct SCHED_CONFIG {
bool non_cpu_intensive;
bool verify_files_on_app_start;
int homogeneous_redundancy;
+ bool hr_allocate_slots;
bool ignore_upload_certificates;
bool dont_generate_upload_certificates;
int uldl_dir_fanout; // fanout of ul/dl dirs; 0 if none