From e3a730c334a74c2234c17a73b9e3247551bc3633 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 27 Apr 2009 23:51:46 +0000 Subject: [PATCH] - client: add config option. If set, use GPUs even if they're not equivalent to the most capable one. - Validator: fix one_pass_N_WU option. svn path=/trunk/boinc/; revision=17896 --- checkin_notes | 13 +++++++++++++ client/client_state.cpp | 2 +- client/log_flags.cpp | 5 +++++ client/log_flags.h | 1 + lib/coproc.cpp | 16 +++++++--------- lib/coproc.h | 11 ++--------- sched/validator.cpp | 7 +++---- 7 files changed, 32 insertions(+), 23 deletions(-) diff --git a/checkin_notes b/checkin_notes index 161aa0721a..74d283b17b 100644 --- a/checkin_notes +++ b/checkin_notes @@ -4199,3 +4199,16 @@ David 27 Apr 2009 client/ gui_rpc_server_ops.cpp + +David 27 Apr 2009 + - client: add config option. If set, use GPUs + even if they're not equivalent to the most capable one. + - Validator: fix one_pass_N_WU option. + + client/ + client_state.cpp + log_flags.cpp,h + lib/ + coproc.cpp,h + sched/ + validator.cpp diff --git a/client/client_state.cpp b/client/client_state.cpp index eef142c793..523134579e 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -254,7 +254,7 @@ int CLIENT_STATE::init() { set_ncpus(); show_host_info(); if (!config.no_gpus) { - vector strs = coprocs.get(); + vector strs = coprocs.get(config.use_all_gpus); for (i=0; i COPROCS::get() { +vector COPROCS::get(bool use_all) { vector strings; - COPROC_CUDA::get(*this, strings); - COPROC_CELL_SPE::get(*this, strings); + COPROC_CUDA::get(*this, strings, use_all); return strings; } @@ -161,7 +160,10 @@ int cuda_compare(COPROC_CUDA& c1, COPROC_CUDA& c2, bool ignore_flops) { return 0; } -void COPROC_CUDA::get(COPROCS& coprocs, vector& strings) { +void COPROC_CUDA::get( + COPROCS& coprocs, vector& strings, + bool use_all // if false, use only those equivalent to most capable +) { int count; #ifdef _WIN32 @@ -282,7 +284,7 @@ void COPROC_CUDA::get(COPROCS& coprocs, vector& strings) { for (i=0; i&) { - return; -} diff --git a/lib/coproc.h b/lib/coproc.h index c8a381d0b3..37611a40a3 100644 --- a/lib/coproc.h +++ b/lib/coproc.h @@ -140,7 +140,7 @@ struct COPROCS { } } #endif - std::vector get(); + std::vector get(bool use_all); int parse(FILE*); void summary_string(char*, int); COPROC* lookup(const char*); @@ -204,7 +204,7 @@ struct COPROC_CUDA : public COPROC { #endif COPROC_CUDA(): COPROC("CUDA"){} virtual ~COPROC_CUDA(){} - static void get(COPROCS&, std::vector&); + static void get(COPROCS&, std::vector&, bool use_all); void description(char*); void clear(); int parse(FILE*); @@ -220,13 +220,6 @@ struct COPROC_CUDA : public COPROC { } }; - -struct COPROC_CELL_SPE : public COPROC { - static void get(COPROCS&, std::vector&); - COPROC_CELL_SPE() : COPROC("Cell SPE"){} - virtual ~COPROC_CELL_SPE(){} -}; - void fake_cuda(COPROCS&, int); #endif diff --git a/sched/validator.cpp b/sched/validator.cpp index 4ede0878bd..e182854459 100644 --- a/sched/validator.cpp +++ b/sched/validator.cpp @@ -608,15 +608,13 @@ bool do_validate_scan() { DB_VALIDATOR_ITEM_SET validator; std::vector items; bool found=false; - int retval; + int retval, i=0; // loop over entries that need to be checked // while (1) { retval = validator.enumerate( - app.id, one_pass_N_WU?one_pass_N_WU:SELECT_LIMIT, - wu_id_modulus, wu_id_remainder, - items + app.id, SELECT_LIMIT, wu_id_modulus, wu_id_remainder, items ); if (retval) { if (retval != ERR_DB_NOT_FOUND) { @@ -629,6 +627,7 @@ bool do_validate_scan() { } retval = handle_wu(validator, items); if (!retval) found = true; + if (++i == one_pass_N_WU) break; } return found; }