diff --git a/client/client_state.cpp b/client/client_state.cpp index 5c97be13fd..2ea2b51e3e 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -242,28 +242,7 @@ int CLIENT_STATE::init() { set_ncpus(); show_host_info(); - // 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) - // - this is being done before CPU speed has been read, - // so we'll need to patch up avp->flops later; - // - check_anonymous(); - - cpu_benchmarks_set_defaults(); // for first time, make sure p_fpops nonzero - - // Parse the client state file, - // ignoring any tags (and associated stuff) - // for projects with no account file - // - parse_state_file(); - - // parse account files again, - // now that we know the host's venue on each project - // - parse_account_files_venue(); - - // check for GPUs. This must go after parse_state_file() + // check for GPUs. // if (!config.no_gpus) { vector descs; @@ -295,6 +274,28 @@ int CLIENT_STATE::init() { coproc_ati = (COPROC_ATI*)host_info.coprocs.lookup("ATI"); } + // 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) + // - this is being done before CPU speed has been read, + // so we'll need to patch up avp->flops later; + // + check_anonymous(); + + cpu_benchmarks_set_defaults(); // for first time, make sure p_fpops nonzero + + // Parse the client state file, + // ignoring any tags (and associated stuff) + // for projects with no account file + // + parse_state_file(); + + // parse account files again, + // now that we know the host's venue on each project + // + parse_account_files_venue(); + + // fill in avp->flops for anonymous project // for (i=0; i")) { - retval = host_info.parse(mf); + retval = host_info.parse(mf, true); if (retval) { msg_printf(NULL, MSG_INTERNAL_ERROR, "Can't parse host info in state file" diff --git a/lib/hostinfo.cpp b/lib/hostinfo.cpp index 05e1f0cf3c..5b3178551d 100644 --- a/lib/hostinfo.cpp +++ b/lib/hostinfo.cpp @@ -67,20 +67,11 @@ void HOST_INFO::clear_host_info() { strcpy(os_version, ""); } -int HOST_INFO::parse(MIOFILE& in) { +int HOST_INFO::parse(MIOFILE& in, bool benchmarks_only) { char buf[1024]; - memset(this, 0, sizeof(HOST_INFO)); while (in.fgets(buf, sizeof(buf))) { if (match_tag(buf, "")) return 0; - else if (parse_int(buf, "", timezone)) continue; - else if (parse_str(buf, "", domain_name, sizeof(domain_name))) continue; - else if (parse_str(buf, "", ip_addr, sizeof(ip_addr))) continue; - else if (parse_str(buf, "", host_cpid, sizeof(host_cpid))) continue; - else if (parse_int(buf, "", p_ncpus)) continue; - else if (parse_str(buf, "", p_vendor, sizeof(p_vendor))) continue; - else if (parse_str(buf, "", p_model, sizeof(p_model))) continue; - else if (parse_str(buf, "", p_features, sizeof(p_features))) continue; else if (parse_double(buf, "", p_fpops)) { // fix foolishness that could result in negative value here // @@ -96,6 +87,17 @@ int HOST_INFO::parse(MIOFILE& in) { continue; } else if (parse_double(buf, "", p_calculated)) continue; + + if (benchmarks_only) continue; + + if (parse_int(buf, "", timezone)) continue; + else if (parse_str(buf, "", domain_name, sizeof(domain_name))) continue; + else if (parse_str(buf, "", ip_addr, sizeof(ip_addr))) continue; + else if (parse_str(buf, "", host_cpid, sizeof(host_cpid))) continue; + else if (parse_int(buf, "", p_ncpus)) continue; + else if (parse_str(buf, "", p_vendor, sizeof(p_vendor))) continue; + else if (parse_str(buf, "", p_model, sizeof(p_model))) continue; + else if (parse_str(buf, "", p_features, sizeof(p_features))) continue; else if (parse_double(buf, "", m_nbytes)) continue; else if (parse_double(buf, "", m_cache)) continue; else if (parse_double(buf, "", m_swap)) continue; diff --git a/lib/hostinfo.h b/lib/hostinfo.h index ef591217df..810d6f83d4 100644 --- a/lib/hostinfo.h +++ b/lib/hostinfo.h @@ -61,7 +61,7 @@ public: COPROCS coprocs; HOST_INFO(); - int parse(MIOFILE&); + int parse(MIOFILE&, bool benchmarks_only = false); int write(MIOFILE&, bool suppress_net_info, bool include_coprocs); int parse_cpu_benchmarks(FILE*); int write_cpu_benchmarks(FILE*);