From ee0ca3973c6e46023f518ce033893f7542fb9682 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 27 Mar 2008 21:39:02 +0000 Subject: [PATCH] - scheduler: add "distinct_beta_apps" option; lets users filter out beta apps as well as others (from Nicolas Maire) svn path=/trunk/boinc/; revision=14971 --- checkin_notes | 9 +++++++++ sched/sched_config.C | 1 + sched/sched_config.h | 2 ++ sched/sched_send.C | 12 ++++++------ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/checkin_notes b/checkin_notes index 1f8ca9e171..0ac2c6c0da 100644 --- a/checkin_notes +++ b/checkin_notes @@ -2729,3 +2729,12 @@ David Mar 27 2008 db/ schema.sql + +David Mar 27 2008 + - scheduler: add "distinct_beta_apps" option; + lets users filter out beta apps as well as others + (from Nicolas Maire) + + sched/ + sched_send.C + sched_config.C,h diff --git a/sched/sched_config.C b/sched/sched_config.C index cf031bb35c..ab14c6f16c 100644 --- a/sched/sched_config.C +++ b/sched/sched_config.C @@ -138,6 +138,7 @@ int SCHED_CONFIG::parse(FILE* f) { if (xp.parse_double(tag, "reliable_reduced_delay_bound", reliable_reduced_delay_bound)) continue; if (xp.parse_int(tag, "grace_period_hours", grace_period_hours)) continue; if (xp.parse_int(tag, "delete_delay_hours", delete_delay_hours)) continue; + if (xp.parse_bool(tag, "distinct_beta_apps", distinct_beta_apps)) continue; if (xp.parse_bool(tag, "workload_sim", workload_sim)) continue; if (xp.parse_bool(tag, "ended", ended)) continue; if (xp.parse_int(tag, "shmem_work_items", shmem_work_items)) continue; diff --git a/sched/sched_config.h b/sched/sched_config.h index 3f88d10123..8a2ca05a51 100644 --- a/sched/sched_config.h +++ b/sched/sched_config.h @@ -97,6 +97,8 @@ public: // Reduce the delay bounds for reliable hosts by this percent int granted_credit_ramp_up; double granted_credit_weight; + bool distinct_beta_apps; + // allow users to select beta apps independently bool workload_sim; // Do workload simulation in deciding whether to send a result bool ended; diff --git a/sched/sched_send.C b/sched/sched_send.C index 49bdf00652..ad7cce86e8 100644 --- a/sched/sched_send.C +++ b/sched/sched_send.C @@ -374,10 +374,10 @@ static int get_host_info(SCHEDULER_REPLY& reply) { pos = str.find("", pos) + 1; } - if (parse_bool(buf,"", flag)) { + if (parse_bool(buf,"allow_non_preferred_apps", flag)) { reply.wreq.host_info.allow_non_preferred_apps = flag; } - if (parse_bool(buf,"", flag)) { + if (parse_bool(buf,"allow_beta_work", flag)) { reply.wreq.host_info.allow_beta_work = flag; } @@ -441,9 +441,9 @@ static inline int check_app_filter( break; } } - // TODO: select between the following via config - //if (!app_allowed) { - if (!app_allowed && reply.wreq.user_apps_only && !reply.wreq.beta_only) { + if (!app_allowed && reply.wreq.user_apps_only && + (!reply.wreq.beta_only || config.distinct_beta_apps) + ) { reply.wreq.no_allowed_apps_available = true; log_messages.printf(MSG_DEBUG, "[USER#%d] [WU#%d] user doesn't want work for this application\n", @@ -1045,7 +1045,7 @@ void send_work(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) { get_host_info(reply); // parse project prefs for app details reply.wreq.beta_only = false; - reply.wreq.user_apps_only=true; + reply.wreq.user_apps_only = true; log_messages.printf(MSG_DEBUG, "[HOST#%d] got request for %f seconds of work; available disk %f GB\n",