diff --git a/checkin_notes b/checkin_notes
index e876066011..25e2d05a94 100755
--- a/checkin_notes
+++ b/checkin_notes
@@ -2315,3 +2315,12 @@ David 10 Mar 2007
sched/
server_types.C
+
+David 10 Mar 2007
+ - scheduler: add one_result_per_host_per_wu option.
+ This is useful if you use homogeneous redundancy
+ and most hosts of a particular class belong to a single user.
+
+ sched/
+ sched_array.C
+ sched_config.C,h
diff --git a/doc/files.php b/doc/files.php
index 299745c9a2..b3e621d663 100644
--- a/doc/files.php
+++ b/doc/files.php
@@ -100,6 +100,8 @@ Use the Apache 2.0 mod_deflate module to automatically
compress files on the fly.
This method will work with all BOINC clients,
but it will do compression only for 5.4+ clients.
+Here is a cookbook
+on how to configure this.
Compress files and give them a filename suffix such as '.gz'.
diff --git a/doc/project_options.php b/doc/project_options.php
index 892d477472..eab4f614d1 100644
--- a/doc/project_options.php
+++ b/doc/project_options.php
@@ -208,6 +208,7 @@ echo html_text("
[ X ]
[ X ]
[ X ]
+[ ]
");
list_start();
list_option("one_result_per_user_per_wu",
@@ -374,6 +375,12 @@ list_item("reliable_time
reliable_min_avg_credit
(typically 0.5 or so).
"
);
+list_option("one_result_per_host_per_wu",
+ "If present, send at most one result of a given workunit to a given host.
+ This is weaker than one_result_per_user_per_wu;
+ it is useful if you're using homogeneous redundancy and
+ most of the hosts of a particular class belong to a single user."
+);
list_end();
echo "
diff --git a/sched/sched_array.C b/sched/sched_array.C
index 55ed0c7741..f5572aa5f8 100644
--- a/sched/sched_array.C
+++ b/sched/sched_array.C
@@ -110,8 +110,8 @@ void scan_work_array(
}
}
- // If we are looking for infeasible results and the result is not infeasiable
- // then move on
+ // don't send if we are looking for infeasible results
+ // and the result is not infeasible
//
if (reply.wreq.infeasible_only && (wu_result.infeasible_count==0)) {
continue;
@@ -119,7 +119,7 @@ void scan_work_array(
// don't send if we're already sending a result for same WU
//
- if (config.one_result_per_user_per_wu) {
+ if (config.one_result_per_user_per_wu || config.one_result_per_host_per_wu) {
if (wu_already_in_reply(wu_result.workunit, reply)) {
continue;
}
@@ -194,6 +194,33 @@ void scan_work_array(
goto dont_send;
}
}
+ } else if (config.one_result_per_host_per_wu) {
+ // Don't send if we've already sent a result
+ // of this WU to this host.
+ // We only have to check this
+ // if we don't send one result per user.
+ //
+ sprintf(buf,
+ "where workunitid=%d and hostid=%d",
+ wu_result.workunit.id, reply.host.id
+ );
+ retval = result.count(n, buf);
+ if (retval) {
+ log_messages.printf(
+ SCHED_MSG_LOG::MSG_CRITICAL,
+ "send_work: can't get result count (%d)\n", retval
+ );
+ goto dont_send;
+ } else {
+ if (n>0) {
+ log_messages.printf(
+ SCHED_MSG_LOG::MSG_DEBUG,
+ "send_work: host %d already has %d result(s) for WU %d\n",
+ reply.host.id, n, wu_result.workunit.id
+ );
+ goto dont_send;
+ }
+ }
}
// if desired, make sure redundancy is homogeneous
diff --git a/sched/sched_config.C b/sched/sched_config.C
index 445dffb266..ea56c2a7aa 100644
--- a/sched/sched_config.C
+++ b/sched/sched_config.C
@@ -79,6 +79,7 @@ int SCHED_CONFIG::parse(FILE* f) {
else if (xp.parse_str(tag, "upload_dir", upload_dir, sizeof(upload_dir))) continue;
else if (xp.parse_str(tag, "sched_lockfile_dir", sched_lockfile_dir, sizeof(sched_lockfile_dir))) continue;
else if (xp.parse_bool(tag, "one_result_per_user_per_wu", one_result_per_user_per_wu)) continue;
+ else if (xp.parse_bool(tag, "one_result_per_host_per_wu", one_result_per_host_per_wu)) continue;
else if (xp.parse_bool(tag, "non_cpu_intensive", non_cpu_intensive)) continue;
else if (xp.parse_bool(tag, "verify_files_on_app_start", verify_files_on_app_start)) continue;
else if (xp.parse_bool(tag, "homogeneous_redundancy", homogeneous_redundancy)) continue;
diff --git a/sched/sched_config.h b/sched/sched_config.h
index 1caccecb45..f68785db99 100644
--- a/sched/sched_config.h
+++ b/sched/sched_config.h
@@ -41,6 +41,7 @@ public:
char upload_dir[256];
char sched_lockfile_dir[256];
bool one_result_per_user_per_wu;
+ bool one_result_per_host_per_wu;
bool msg_to_host;
int min_sendwork_interval;
int max_wus_to_send;