diff --git a/checkin_notes b/checkin_notes index a95a50e358..28ec4f6180 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6828,3 +6828,23 @@ David 24 Sept 2010 work_fetch.cpp,h client_state.cpp,h app.cpp + +David 27 Sept 2010 + - client: add config option and --no_info_fetch + cmdline arg. + Suppresses the fetch of project list and of current client version #. + Use when running on grid nodes. + - debugging on client simulator. Not done yet. + + client/ + work_fetch.cpp,h + client_types.cpp,h + client_state.cpp + sim.cpp + work_fetch.cpp + sim_util.cpp + cs_cmdline.cpp + log_flags.cpp,h + cs_statefile.cpp + scheduler_op.cpp + time_stats.cpp diff --git a/client/client_state.cpp b/client/client_state.cpp index f4a6282e4b..c9e05c2244 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -483,7 +483,9 @@ int CLIENT_STATE::init() { if (!boinc_file_exists(ALL_PROJECTS_LIST_FILENAME)) { all_projects_list_check_time = 0; } - all_projects_list_check(); + if (!config.no_info_fetch) { + all_projects_list_check(); + } auto_update.init(); diff --git a/client/client_types.cpp b/client/client_types.cpp index 42c0e98dd0..138cc9b329 100644 --- a/client/client_types.cpp +++ b/client/client_types.cpp @@ -836,15 +836,17 @@ int FILE_INFO::parse(MIOFILE& in, bool from_server) { if (parse_bool(buf, "is_project_file", is_project_file)) continue; if (match_tag(buf, "")) { -#ifndef SIM pfxp = new PERS_FILE_XFER; retval = pfxp->parse(in); +#ifdef SIM + delete pfxp; + continue; +#endif if (!retval) { pers_file_xfer = pfxp; } else { delete pfxp; } -#endif continue; } if (!from_server && match_tag(buf, "")) { diff --git a/client/client_types.h b/client/client_types.h index cad7767bbb..b42dd44487 100644 --- a/client/client_types.h +++ b/client/client_types.h @@ -467,6 +467,8 @@ struct APP { NORMAL_DIST checkpoint_period; double working_set; double weight; + bool has_version; + APP() {memset(this, 0, sizeof(APP));} #endif int parse(MIOFILE&); diff --git a/client/cs_cmdline.cpp b/client/cs_cmdline.cpp index 8edbc952c1..f78198e525 100644 --- a/client/cs_cmdline.cpp +++ b/client/cs_cmdline.cpp @@ -74,6 +74,7 @@ static void print_options(char* prog) { " --master_fetch_period N reload master URL after N RPC failures\n" " --master_fetch_retry_cap N exponential backoff limit\n" " --no_gui_rpc don't allow GUI RPC, don't make socket\n" + " --no_info_fetch don't fetch project list or client version info\n" " --no_priority_change run apps at same priority as client\n" " --pers_giveup N giveup time for persistent file xfer\n" " --pers_retry_delay_max N max for file xfer exponential backoff\n" @@ -189,8 +190,9 @@ void CLIENT_STATE::parse_cmdline(int argc, char** argv) { config.no_gpus = true; } else if (ARG(no_gui_rpc)) { no_gui_rpc = true; + } else if (ARG(no_info_fetch)) { + config.no_info_fetch = true; } else if (ARG(no_priority_change)) { - fprintf(stderr, "NO PRIO CHANGE\n"); config.no_priority_change = true; } else if (ARG(pers_giveup)) { if (i == argc-1) show_options = true; diff --git a/client/cs_statefile.cpp b/client/cs_statefile.cpp index c8e1150ad5..80d19abfa5 100644 --- a/client/cs_statefile.cpp +++ b/client/cs_statefile.cpp @@ -129,9 +129,9 @@ int CLIENT_STATE::parse_state_file() { msg_printf(NULL, MSG_INTERNAL_ERROR, "Can't parse project in state file"); } else { #ifdef SIM - PROJECT* p = new PROJECT; - *p = temp_project; - projects.push_back(p); + project = new PROJECT; + *project = temp_project; + projects.push_back(project); #else project = lookup_project(temp_project.master_url); if (project) { @@ -669,6 +669,10 @@ int CLIENT_STATE::write_state(MIOFILE& f) { unsigned int i, j; int retval; +#ifdef SIM + fprintf(stderr, "simulator shouldn't write state file\n"); + exit(1); +#endif f.printf("\n"); retval = host_info.write(f, true, true); if (retval) return retval; diff --git a/client/log_flags.cpp b/client/log_flags.cpp index 7af7a1210b..0036c0569e 100644 --- a/client/log_flags.cpp +++ b/client/log_flags.cpp @@ -191,6 +191,9 @@ void CONFIG::show() { if (no_gpus) { msg_printf(NULL, MSG_INFO, "Config: don't use coprocessors"); } + if (no_info_fetch) { + msg_printf(NULL, MSG_INFO, "Config: don't fetch project list or client version info"); + } if (no_priority_change) { msg_printf(NULL, MSG_INFO, "Config: run apps at regular priority"); } @@ -276,6 +279,7 @@ void CONFIG::clear() { network_test_url = "http://www.google.com/"; no_alt_platform = false; no_gpus = false; + no_info_fetch = false; no_priority_change = false; os_random_only = false; report_results_immediately = false; @@ -386,6 +390,7 @@ int CONFIG::parse_options(XML_PARSER& xp) { } if (xp.parse_bool(tag, "no_alt_platform", no_alt_platform)) continue; if (xp.parse_bool(tag, "no_gpus", no_gpus)) continue; + if (xp.parse_bool(tag, "no_info_fetch", no_info_fetch)) continue; if (xp.parse_bool(tag, "no_priority_change", no_priority_change)) continue; if (xp.parse_bool(tag, "os_random_only", os_random_only)) continue; #ifndef SIM diff --git a/client/log_flags.h b/client/log_flags.h index fe93b5bc0e..657adebce0 100644 --- a/client/log_flags.h +++ b/client/log_flags.h @@ -135,6 +135,7 @@ struct CONFIG { std::string network_test_url; bool no_alt_platform; bool no_gpus; + bool no_info_fetch; bool no_priority_change; bool os_random_only; bool report_results_immediately; diff --git a/client/scheduler_op.cpp b/client/scheduler_op.cpp index cea59ad9d8..2f57bc93d3 100644 --- a/client/scheduler_op.cpp +++ b/client/scheduler_op.cpp @@ -126,8 +126,10 @@ int SCHEDULER_OP::init_op_project(PROJECT* p, int r) { // Now's a good time to check for new BOINC versions // and project list // - gstate.new_version_check(); - gstate.all_projects_list_check(); + if (!config.no_info_fetch) { + gstate.new_version_check(); + gstate.all_projects_list_check(); + } } return retval; } diff --git a/client/sim.cpp b/client/sim.cpp index 92332b5a7c..30766b11fd 100644 --- a/client/sim.cpp +++ b/client/sim.cpp @@ -88,7 +88,7 @@ void PROJECT::update_dcf_stats(RESULT* rp) { return; } -// generate a job; pick a random app, +// generate a job; pick a random app for this project, // and pick a FLOP count from its distribution // void CLIENT_STATE::make_job(PROJECT* p, WORKUNIT* wup, RESULT* rp) { @@ -107,7 +107,7 @@ void CLIENT_STATE::make_job(PROJECT* p, WORKUNIT* wup, RESULT* rp) { } } if (!ap) { - printf("ERROR-NO APP\n"); + printf("ERROR - NO APP\n"); exit(1); } rp->clear(); @@ -185,11 +185,11 @@ void CLIENT_STATE::get_workload(vector& ip_results) { init_ip_results(work_buf_min(), ncpus, ip_results); } -// simulate trying to do an RPC -// return false if we didn't actually do one +// simulate trying to do an RPC; +// return true if we actually did one // bool CLIENT_STATE::simulate_rpc(PROJECT* p) { - char buf[256]; + char buf[256], buf2[256]; static double last_time=-1e9; vector ip_results; int infeasible_count = 0; @@ -204,9 +204,8 @@ bool CLIENT_STATE::simulate_rpc(PROJECT* p) { } last_time = now; - sprintf(buf, "RPC to %s; asking for %f/%.2f
", - p->project_name, cpu_work_fetch.req_secs, cpu_work_fetch.req_instances - ); + work_fetch.request_string(buf); + sprintf(buf, "RPC to %s: %s
", p->project_name, buf2); html_msg += buf; msg_printf(0, MSG_INFO, buf); @@ -738,6 +737,77 @@ char* next_arg(int argc, char** argv, int& i) { return argv[i++]; } +// get application FLOPS params. +// These can be specified manually in the . +// If not they are taken from a WU if one exists for the app. +// If not they default to 1 GFLOPS/hour +// +void get_app_params() { + unsigned int i, j; + for (i=0; ifpops_est) { + for (j=0; japp != app) continue; + app->fpops_est = wup->rsc_fpops_est; + break; + } + if (!app->fpops_est) { + app->fpops_est = 3600 * 1e9; + } + } + if (!app->fpops.mean) { + app->fpops.mean = app->fpops_est; + } + if (!app->weight) { + app->weight = 1; + } + fprintf(stderr, "app %s: fpops_est %f fpops mean %f\n", + app->name, app->fpops_est, app->fpops.mean + ); + } +} + +// zero backoffs and debts. +// +void clear_backoff() { + unsigned int i; + for (i=0; icpu_pwf.reset(); + p->cuda_pwf.reset(); + p->ati_pwf.reset(); + p->min_rpc_time = 0; + } +} + +// remove apps with no app versions, +// then projects with no apps +// +void cull_projects() { + unsigned int i; + + for (i=0; ihas_version = false; + } + for (i=0; iapp->has_version = true; + } + for (i=0; idont_request_more_work = true; + } + for (i=0; ihas_version) { + app->project->dont_request_more_work = false; + } + } +} + #define SUMMARY_FILE "sim_summary.txt" #define LOG_FILE "sim_log.txt" @@ -746,8 +816,19 @@ void CLIENT_STATE::do_client_simulation() { read_config_file(true); config.show(); + add_platform("client simulator"); parse_state_file(); read_global_prefs(); + for (unsigned int i=0; iindex = i; + } + + gstate.now = 86400; + get_app_params(); + clear_backoff(); + + gstate.workunits.clear(); + gstate.results.clear(); gstate.set_ncpus(); work_fetch.init(); diff --git a/client/sim_util.cpp b/client/sim_util.cpp index 185760db0c..fe21ff64de 100644 --- a/client/sim_util.cpp +++ b/client/sim_util.cpp @@ -99,8 +99,8 @@ int ACTIVE_TASK::request_exit() { int ACTIVE_TASK::resume_or_start(bool first_time) { if (log_flags.task) { msg_printf(result->project, MSG_INFO, - "[task] %s task %s", - first_time?"Starting":"Resuming", result->name + "[task] %s task %s: time left %f", + first_time?"Starting":"Resuming", result->name, cpu_time_left ); } set_task_state(PROCESS_EXECUTING, "start"); diff --git a/client/time_stats.cpp b/client/time_stats.cpp index 993ed7a46e..27fd1a7adf 100644 --- a/client/time_stats.cpp +++ b/client/time_stats.cpp @@ -292,9 +292,11 @@ int TIME_STATS::parse(MIOFILE& in) { if (match_tag(buf, "")) return 0; else if (parse_double(buf, "", x)) { if (x < 0 || x > gstate.now) { +#ifndef SIM msg_printf(0, MSG_INTERNAL_ERROR, "bad value %f of time stats last update; ignoring", x ); +#endif } else { last_update = x; } diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index fd8d597c07..f651fb2118 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -970,6 +970,27 @@ void WORK_FETCH::compute_shares() { } } +void WORK_FETCH::request_string(char* buf) { + char buf2[256]; + sprintf(buf, + "[work_fetch] request: %.2f sec CPU (%.2f sec, %.2f)", + cpu_work_fetch.req_secs, + cpu_work_fetch.req_secs, cpu_work_fetch.req_instances + ); + if (gstate.host_info.have_cuda()) { + sprintf(buf2, " NVIDIA GPU (%.2f sec, %.2f)", + cuda_work_fetch.req_secs, cuda_work_fetch.req_instances + ); + strcat(buf, buf2); + } + if (gstate.host_info.have_ati()) { + sprintf(buf2, " ATI GPU (%.2f sec, %.2f)", + ati_work_fetch.req_secs, ati_work_fetch.req_instances + ); + strcat(buf, buf2); + } +} + void WORK_FETCH::write_request(FILE* f, PROJECT* p) { double work_req = cpu_work_fetch.req_secs; @@ -1001,24 +1022,8 @@ void WORK_FETCH::write_request(FILE* f, PROJECT* p) { cpu_work_fetch.req_secs?cpu_work_fetch.busy_time_estimator.get_busy_time():0 ); if (log_flags.work_fetch_debug) { - char buf[256], buf2[256]; - sprintf(buf, - "[work_fetch] request: %.2f sec CPU (%.2f sec, %.2f)", - work_req, - cpu_work_fetch.req_secs, cpu_work_fetch.req_instances - ); - if (gstate.host_info.have_cuda()) { - sprintf(buf2, " NVIDIA GPU (%.2f sec, %.2f)", - cuda_work_fetch.req_secs, cuda_work_fetch.req_instances - ); - strcat(buf, buf2); - } - if (gstate.host_info.have_ati()) { - sprintf(buf2, " ATI GPU (%.2f sec, %.2f)", - ati_work_fetch.req_secs, ati_work_fetch.req_instances - ); - strcat(buf, buf2); - } + char buf[256]; + request_string(buf); msg_printf(p, MSG_INFO, buf); } } diff --git a/client/work_fetch.h b/client/work_fetch.h index 7289fe4cf5..f210e5a672 100644 --- a/client/work_fetch.h +++ b/client/work_fetch.h @@ -267,6 +267,7 @@ struct WORK_FETCH { void compute_shares(); void zero_debts(); void clear_backoffs(APP_VERSION&); + void request_string(char*); }; extern RSC_WORK_FETCH cuda_work_fetch; diff --git a/doc/docutil.php b/doc/docutil.php index 8ef51564c7..5f9f353dfc 100644 --- a/doc/docutil.php +++ b/doc/docutil.php @@ -219,4 +219,11 @@ function show_link($url) { echo "
$url"; } +function get_str2($x) { + if (array_key_exists($x, $_GET)) { + return $_GET[$x]; + } + return null; +} + ?> diff --git a/doc/download.php b/doc/download.php index 1c59824c53..0a052878c5 100644 --- a/doc/download.php +++ b/doc/download.php @@ -91,7 +91,6 @@ function show_download($pname) { .tra("You may run this software on a computer only if you own the computer or have the permission of its owner."). "

" ; - if ($_GET['foo']) $pname = null; if ($pname) { download_link($pname, true); } else { @@ -134,7 +133,7 @@ function show_download($pname) { "; } -if ($_GET['xml']) { +if (get_str2('xml')) { $args = strstr($_SERVER['REQUEST_URI'], '?'); Header("Location: download_all.php$args"); exit(); @@ -142,7 +141,7 @@ if ($_GET['xml']) { page_head(tra("BOINC: compute for science")); -if ($_GET['all_platforms']) { +if (get_str2('all_platforms')) { show_download(null); } else if (strstr($client_info, 'Windows')) { if (strstr($client_info, 'Win64')||strstr($client_info, 'WOW64')) { diff --git a/doc/download_all.php b/doc/download_all.php index 942d68c0e0..891403422d 100644 --- a/doc/download_all.php +++ b/doc/download_all.php @@ -13,13 +13,13 @@ require_once("docutil.php"); require_once("versions.inc"); -$xml = $_GET["xml"]; -$dev = $_GET["dev"]; -$pname = $_GET["platform"]; -$min_version = $_GET["min_version"]; -$max_version = $_GET["max_version"]; -$version = $_GET["version"]; -$type_name = $_GET["type"]; +$xml = get_str2("xml"); +$dev = get_str2("dev"); +$pname = get_str2("platform"); +$min_version = get_str2("min_version"); +$max_version = get_str2("max_version"); +$version = get_str2("version"); +$type_name = get_str2("type"); $client_info = $_SERVER['HTTP_USER_AGENT']; if (!$xml) $dev=1; diff --git a/html/inc/forum_rss.inc b/html/inc/forum_rss.inc index b262d252c7..5e633cf1a6 100644 --- a/html/inc/forum_rss.inc +++ b/html/inc/forum_rss.inc @@ -88,7 +88,7 @@ function forum_rss($forumid, $userid, $truncate, $threads_only, $ndays) { // Create channel header and open XML content // $description = PROJECT.": $forum->title"; - if ($user) { + if ($userid) { $description .= " (posts by $user->name)"; } $channel_image = URL_BASE . "rss_image.gif"; diff --git a/html/inc/stats_sites.inc b/html/inc/stats_sites.inc index 2d31b9e1e0..4921b8e889 100644 --- a/html/inc/stats_sites.inc +++ b/html/inc/stats_sites.inc @@ -199,7 +199,7 @@ function site_list($sites) { $s = $sites[$i]; $url = $s[0]; $name = $s[1]; - $comment = $s[2]; + $comment = array_key_exists(2, $s)?$s[2]:""; echo "

  • $name $comment\n"; } echo "\n";