From 5b159c673595936e55d8256c5f009d3e5a0804cc Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 29 Jul 2011 00:07:20 +0000 Subject: [PATCH] - remote job submission: bug fix and tweaks - client: cc_config.xml: if is omitted from a , it means exclude all instances of that GPU type - client: if all instances of a GPU type are excluded for a project, don't ask the project for jobs of that type svn path=/trunk/boinc/; revision=23898 --- checkin_notes | 23 ++++++++++++++++ client/client_state.cpp | 15 ++--------- client/client_types.cpp | 2 +- client/client_types.h | 5 ++-- client/cpu_sched.cpp | 7 ++--- client/gui_rpc_server_ops.cpp | 1 + client/work_fetch.cpp | 47 ++++++++++++++++++++++++++++++--- client/work_fetch.h | 2 ++ html/inc/util.inc | 2 +- html/ops/submit_permissions.php | 3 ++- html/user/submit_example.php | 34 +++++++++++++++++------- lib/cc_config.cpp | 10 +++---- lib/cc_config.h | 2 +- 13 files changed, 112 insertions(+), 41 deletions(-) diff --git a/checkin_notes b/checkin_notes index cc7cc5b8a4..79f6f11622 100644 --- a/checkin_notes +++ b/checkin_notes @@ -4421,3 +4421,26 @@ Charlie 28 July 11 clientscr/ Mac_Saver_ModuleView.m + +David 28 July 2011 + - remote job submission: bug fix and tweaks + - client: cc_config.xml: if is omitted from a , + it means exclude all instances of that GPU type + - client: if all instances of a GPU type are excluded for a project, + don't ask the project for jobs of that type + + html/ + ops/ + submit_permissions.php + inc/ + util.h + user/ + submit_example.php + lib/ + cc_config.cpp,h + client/ + work_fetch.cpp,h + client_types.cpp,h + client_state.cpp + gui_rpc_server_ops.cpp + cpu_sched.cpp diff --git a/client/client_state.cpp b/client/client_state.cpp index f765fbee6a..2d3936113d 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -210,15 +210,6 @@ const char* rsc_name(int i) { return coprocs.coprocs[i].type; } -void init_exclude_gpu() { - for (unsigned int i=0; iexclude_gpus.push_back(eg); - } -} - // set no_X_apps for anonymous platform project // static void check_no_apps(PROJECT* p) { @@ -417,6 +408,8 @@ int CLIENT_STATE::init() { } } + set_no_rsc_config(); + // check for app_info.xml file in project dirs. // If find, read app info from there, set project.anonymous_platform // - this must follow coproc.get() (need to know if GPUs are present) @@ -628,10 +621,6 @@ int CLIENT_STATE::init() { // check_too_large_jobs(); - // fill in exclude-GPU flags - // - init_exclude_gpu(); - project_priority_init(); initialized = true; diff --git a/client/client_types.cpp b/client/client_types.cpp index 62ad72ed99..599e618580 100644 --- a/client/client_types.cpp +++ b/client/client_types.cpp @@ -67,11 +67,11 @@ void PROJECT::init() { resource_share = 100; for (int i=0; i exclude_gpus; + bool no_rsc_config[MAX_RSC]; // the following are from the project itself // (or derived from app version list if anonymous platform) diff --git a/client/cpu_sched.cpp b/client/cpu_sched.cpp index 203ce76ba5..c8981e3226 100644 --- a/client/cpu_sched.cpp +++ b/client/cpu_sched.cpp @@ -1123,11 +1123,12 @@ void CLIENT_STATE::append_unfinished_time_slice(vector &run_list) { static inline bool excluded(RESULT* rp, COPROC* cp, int ind) { PROJECT* p = rp->project; - for (unsigned int i=0; iexclude_gpus.size(); i++) { - EXCLUDE_GPU& eg = p->exclude_gpus[i]; + for (unsigned int i=0; imaster_url)) continue; if (!eg.type.empty() && (eg.type != cp->type)) continue; if (!eg.appname.empty() && (eg.appname != rp->app->name)) continue; - if (eg.devnum != cp->device_nums[ind]) continue; + if (eg.devnum >= 0 && eg.devnum != cp->device_nums[ind]) continue; return true; } return false; diff --git a/client/gui_rpc_server_ops.cpp b/client/gui_rpc_server_ops.cpp index 12e4fd6241..5e6d640a02 100644 --- a/client/gui_rpc_server_ops.cpp +++ b/client/gui_rpc_server_ops.cpp @@ -1217,6 +1217,7 @@ int GUI_RPC_CONN::handle_rpc() { gstate.set_ncpus(); gstate.request_schedule_cpus("Core client configuration"); gstate.request_work_fetch("Core client configuration"); + set_no_rsc_config(); } else if (match_req(request_msg, "get_notices")) { handle_get_notices(request_msg, *this, mf, false); clear_notice_refresh(); diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index 7b054e1d10..17fea09b2e 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -67,11 +67,47 @@ static const char* criterion_name(int criterion) { inline bool dont_fetch(PROJECT* p, int rsc_type) { if (p->no_rsc_pref[rsc_type]) return true; + if (p->no_rsc_config[rsc_type]) return true; if (p->no_rsc_apps[rsc_type]) return true; if (p->no_rsc_ams[rsc_type]) return true; return false; } +// if the configuration file disallows the use of a GPU type +// for a project, set a flag to that effect +// +void set_no_rsc_config() { + for (unsigned int i=0; inon_cpu_intensive) continue; RSC_PROJECT_WORK_FETCH& pwf = project_state(p); bool no_rsc_pref = p->no_rsc_pref[rsc_type]; + bool no_rsc_config = p->no_rsc_config[rsc_type]; bool no_rsc_apps = p->no_rsc_apps[rsc_type]; bool no_rsc_ams = p->no_rsc_ams[rsc_type]; double bt = pwf.backoff_time>gstate.now?pwf.backoff_time-gstate.now:0; if (use_rec) { msg_printf(p, MSG_INFO, - "[work_fetch] %s: fetch share %.2f rec %.5f prio %.5f backoff dt %.2f int %.2f%s%s%s%s%s%s%s%s", + "[work_fetch] %s: fetch share %.2f rec %.5f prio %.5f backoff dt %.2f int %.2f%s%s%s%s%s%s%s%s%s", name, pwf.fetchable_share, p->pwf.rec, project_priority(p), bt, pwf.backoff_interval, p->suspended_via_gui?" (susp via GUI)":"", @@ -451,11 +488,12 @@ if (use_rec) { p->too_many_uploading_results?" (too many uploads)":"", no_rsc_pref?" (blocked by prefs)":"", no_rsc_apps?" (no apps)":"", - no_rsc_ams?" (blocked by account manager)":"" + no_rsc_ams?" (blocked by account manager)":"", + no_rsc_config?" (blocked by configuration file)":"" ); } else { msg_printf(p, MSG_INFO, - "[work_fetch] %s: fetch share %.2f LTD %.2f backoff dt %.2f int %.2f%s%s%s%s%s%s%s", + "[work_fetch] %s: fetch share %.2f LTD %.2f backoff dt %.2f int %.2f%s%s%s%s%s%s%s%s", name, pwf.fetchable_share, pwf.long_term_debt, bt, pwf.backoff_interval, p->suspended_via_gui?" (susp via GUI)":"", @@ -464,7 +502,8 @@ if (use_rec) { p->dont_request_more_work?" (no new tasks)":"", pwf.overworked()?" (overworked)":"", p->too_many_uploading_results?" (too many uploads)":"", - no_rsc_pref?" (blocked by prefs)":"" + no_rsc_pref?" (blocked by prefs)":"", + no_rsc_config?" (blocked by configuration file)":"" ); } } diff --git a/client/work_fetch.h b/client/work_fetch.h index ba3db9bc88..de4e6bd250 100644 --- a/client/work_fetch.h +++ b/client/work_fetch.h @@ -303,6 +303,8 @@ struct WORK_FETCH { extern RSC_WORK_FETCH rsc_work_fetch[MAX_RSC]; extern WORK_FETCH work_fetch; +extern void set_no_rsc_config(); + //#ifdef USE_REC void project_priority_init(); double project_priority(PROJECT*); diff --git a/html/inc/util.inc b/html/inc/util.inc index 4f480f950b..2792548179 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -261,7 +261,7 @@ function time_str($x) { function local_time_str($x) { if ($x == 0) return "---"; - return date('j M Y | H:i:s', $x); + return date('j M Y, H:i T', $x); } function pretty_time_str($x) { diff --git a/html/ops/submit_permissions.php b/html/ops/submit_permissions.php index 1417e3b71b..763851bb3c 100644 --- a/html/ops/submit_permissions.php +++ b/html/ops/submit_permissions.php @@ -127,7 +127,8 @@ function handle_edit_action() { function handle_add_form() { admin_page_head("Add user"); echo " -
+ + User ID:
diff --git a/html/user/submit_example.php b/html/user/submit_example.php index aa7f7212c2..e7d3a952bc 100644 --- a/html/user/submit_example.php +++ b/html/user/submit_example.php @@ -51,7 +51,6 @@ function handle_main() { page_head("Job submission and control"); - echo date("F j, Y, g:i a"); show_button("submit_example.php?action=create_form", "Create new batch"); $first = true; @@ -73,7 +72,9 @@ function handle_main() { local_time_str($batch->create_time) ); } - if (!$first) { + if ($first) { + echo "

You have no in-progress batches.\n"; + } else { end_table(); } @@ -82,7 +83,7 @@ function handle_main() { if ($batch->state != BATCH_STATE_COMPLETE) continue; if ($first) { $first = false; - echo "

Completed

\n"; + echo "

Completed batches

\n"; start_table(); table_header("name", "ID", "# jobs", "submitted"); } @@ -93,7 +94,9 @@ function handle_main() { local_time_str($batch->create_time) ); } - if (!$first) { + if ($first) { + echo "

You have no completed batches.\n"; + } else { end_table(); } @@ -102,7 +105,7 @@ function handle_main() { if ($batch->state != BATCH_STATE_ABORTED) continue; if ($first) { $first = false; - echo "

Aborted

\n"; + echo "

Aborted batches

\n"; start_table(); table_header("name", "ID", "# jobs", "submitted"); } @@ -243,8 +246,6 @@ function handle_query_batch() { if ($errmsg) error_page($errmsg); page_head("Batch $req->batch_id"); - $url = boinc_get_output_files($req); - show_button($url, "Get zipped output files"); start_table(); row2("name", $batch->name); row2("application", $batch->app_name); @@ -259,6 +260,8 @@ function handle_query_batch() { row2("Credit, canonical instances", $batch->credit_canonical); row2("Credit, total", $batch->credit_total); end_table(); + $url = boinc_get_output_files($req); + show_button($url, "Get zipped output files"); switch ($batch->state) { case BATCH_STATE_IN_PROGRESS: echo "
"; @@ -279,17 +282,25 @@ function handle_query_batch() { echo "

Jobs

\n"; start_table(); - table_header("Job ID", "Canonical instance"); + table_header( + "Job ID
click for details or to get output files", + "status", + "Canonical instance
click to see result page on BOINC server" + ); foreach($batch->jobs as $job) { $id = (int)$job->id; $resultid = (int)$job->canonical_instance_id; if ($resultid) { $x = "$resultid"; + $y = "completed"; } else { $x = "---"; + $y = "in progress"; } + echo " $id + $y $x "; @@ -307,8 +318,13 @@ function handle_query_job() { if ($errmsg) error_page($errmsg); page_head("Job $req->job_id"); + echo "job_id>View workunit page on BOINC server\n"; + echo "

Instances

\n"; start_table(); - table_header("Instance ID", "State", "Output files"); + table_header( + "Instance ID
click for result page on BOINC server", + "State", "Output files" + ); foreach($reply->instances as $inst) { echo " id>$inst->id diff --git a/lib/cc_config.cpp b/lib/cc_config.cpp index 4268447163..eebff8f0c5 100644 --- a/lib/cc_config.cpp +++ b/lib/cc_config.cpp @@ -238,24 +238,21 @@ void CONFIG::defaults() { static bool parse_exclude_gpu(XML_PARSER& xp, EXCLUDE_GPU& eg) { char tag[1024]; bool is_tag; - bool found_devnum = false; bool found_url = false; eg.type = ""; eg.appname = ""; + eg.devnum = -1; while (!xp.get(tag, sizeof(tag), is_tag)) { if (!is_tag) continue; if (!strcmp(tag, "/exclude_gpu")) { - return (found_devnum && found_url); - } - if (xp.parse_int(tag, "devnum", eg.devnum)) { - found_devnum = true; - continue; + return found_url; } if (xp.parse_string(tag, "url", eg.url)) { canonicalize_master_url(eg.url); found_url = true; continue; } + if (xp.parse_int(tag, "devnum", eg.devnum)) continue; if (xp.parse_string(tag, "type", eg.type)) continue; if (xp.parse_string(tag, "app", eg.appname)) continue; } @@ -278,6 +275,7 @@ int CONFIG::parse_options(XML_PARSER& xp) { exclusive_gpu_apps.clear(); ignore_nvidia_dev.clear(); ignore_ati_dev.clear(); + exclude_gpus.clear(); while (!xp.get(tag, sizeof(tag), is_tag)) { if (!is_tag) { diff --git a/lib/cc_config.h b/lib/cc_config.h index 68439c25a7..4c309a27f4 100644 --- a/lib/cc_config.h +++ b/lib/cc_config.h @@ -116,7 +116,7 @@ struct EXCLUDE_GPU { std::string url; std::string type; std::string appname; - int devnum; + int devnum; // -1 means all }; // if you add anything, you must add it to