From 17a83ada30b8c07c3033ea4345d528f80ef7dcbd Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 22 May 2007 02:58:01 +0000 Subject: [PATCH] - feeder: fixed SQL query again sched/ feeder.C svn path=/trunk/boinc/; revision=12707 --- checkin_notes | 6 ++++++ client/cs_benchmark.C | 28 ++++++++++++++++------------ client/sim.C | 2 +- sched/feeder.C | 6 +++--- sched/start | 7 ++++++- 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/checkin_notes b/checkin_notes index 1bc7e1e4e8..9c960acf16 100755 --- a/checkin_notes +++ b/checkin_notes @@ -5135,3 +5135,9 @@ David 21 May 2007 graphics_impl.C texture.C tgalib.C + +David 21 May 2007 + - feeder: fixed SQL query again + + sched/ + feeder.C diff --git a/client/cs_benchmark.C b/client/cs_benchmark.C index 343a2731fc..6c0b935253 100644 --- a/client/cs_benchmark.C +++ b/client/cs_benchmark.C @@ -111,6 +111,9 @@ struct BENCHMARK_DESC { static BENCHMARK_DESC* benchmark_descs=0; static bool benchmarks_running=false; // at least 1 benchmark thread running static double cpu_benchmarks_start; +static int bm_ncpus; + // user might change ncpus during benchmarks. + // store starting value here. const char *file_names[2] = {"do_fp", "do_int"}; @@ -204,10 +207,11 @@ void CLIENT_STATE::start_cpu_benchmarks() { if (benchmark_descs) { free(benchmark_descs); } - benchmark_descs = (BENCHMARK_DESC*)calloc(ncpus, sizeof(BENCHMARK_DESC)); + bm_ncpus = ncpus; + benchmark_descs = (BENCHMARK_DESC*)calloc(bm_ncpus, sizeof(BENCHMARK_DESC)); benchmarks_running = true; - for (i=0; i 0) { host_info.p_fpops = p_fpops; } else { @@ -484,7 +488,7 @@ bool CLIENT_STATE::cpu_benchmarks_poll() { void CLIENT_STATE::print_benchmark_results() { msg_printf(NULL, MSG_INFO, "Benchmark results:"); - msg_printf(NULL, MSG_INFO, " Number of CPUs: %d", ncpus); + msg_printf(NULL, MSG_INFO, " Number of CPUs: %d", bm_ncpus); msg_printf( NULL, MSG_INFO, " %.0f floating point MIPS (Whetstone) per CPU", host_info.p_fpops/1e6 diff --git a/client/sim.C b/client/sim.C index b09fa01c24..0cadcb2a39 100644 --- a/client/sim.C +++ b/client/sim.C @@ -70,7 +70,7 @@ void SIM_PROJECT::update_dcf_stats(RESULT* rp) { completions_ratio_mean += delta / completed_task_count; completions_ratio_s += delta * ( raw_ratio - completions_ratio_mean); if (completed_task_count > 1) { - completions_ratio_stdev = completions_ratio_s / (completed_task_count - 1); + completions_ratio_stdev = sqrt(completions_ratio_s / (completed_task_count - 1)); double required_stdev = (raw_ratio - completions_ratio_mean) / completions_ratio_stdev; if (required_stdev > completions_required_stdevs) { completions_required_stdevs = std::min(required_stdev, 7.0); diff --git a/sched/feeder.C b/sched/feeder.C index 9ca690cd14..34ad6f974e 100644 --- a/sched/feeder.C +++ b/sched/feeder.C @@ -528,15 +528,15 @@ int main(int argc, char** argv) { } else if (!strcmp(argv[i], "-allapps")) { all_apps = true; } else if (!strcmp(argv[i], "-priority_order")) { - order_clause = "order by r1.result.priority desc "; + order_clause = "order by r1.priority desc "; } else if (!strcmp(argv[i], "-priority_order_create_time")) { - order_clause = "order by r1.result.priority desc, workunit.create_time "; + order_clause = "order by r1.priority desc, workunit.create_time "; } else if (!strcmp(argv[i], "-purge_stale")) { purge_stale_time = atoi(argv[++i])*60; } else if (!strcmp(argv[i], "-mod")) { int n = atoi(argv[++i]); int j = atoi(argv[++i]); - sprintf(select_clause, "and r1.result.id %% %d = %d ", n, j); + sprintf(select_clause, "and r1.id %% %d = %d ", n, j); } else if (!strcmp(argv[i], "-sleep_interval")) { sleep_interval = atof(argv[++i]); } else { diff --git a/sched/start b/sched/start index 846a424644..7bc0e2f6e7 100755 --- a/sched/start +++ b/sched/start @@ -408,15 +408,18 @@ def run_daemon(task): exec_command_string(task.cmd) def run_daemons(): + found_any = False if verbose: print "Starting daemons" if is_main_host: remove_stop_daemons() for task in config.daemons: if task.host != local_hostname: continue + found_any = True if task.disabled: continue run_daemon(task) + return found_any def run_tasks(): if verbose: print "Running tasks" @@ -503,7 +506,9 @@ def command_enable_start(): print "Entering ENABLED mode" # NOTE: must use '1', not '0' here run_state.enabled = 1 - run_daemons() + found_any = run_daemons() + if not found_any: + print "No daemons for this host found - check host name in config.xml" time.sleep(10) # give feeder time to start up and create shmem remove_stop_sched() remove_cached_home_page()