mirror of https://github.com/BOINC/boinc.git
parent
392c578044
commit
54e7c50b48
|
@ -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 <project> 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<string> 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 <project> 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<app_versions.size(); i++) {
|
||||
|
|
|
@ -377,7 +377,7 @@ int CLIENT_STATE::parse_state_file() {
|
|||
continue;
|
||||
}
|
||||
if (match_tag(buf, "<host_info>")) {
|
||||
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"
|
||||
|
|
|
@ -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, "</host_info>")) return 0;
|
||||
else if (parse_int(buf, "<timezone>", timezone)) continue;
|
||||
else if (parse_str(buf, "<domain_name>", domain_name, sizeof(domain_name))) continue;
|
||||
else if (parse_str(buf, "<ip_addr>", ip_addr, sizeof(ip_addr))) continue;
|
||||
else if (parse_str(buf, "<host_cpid>", host_cpid, sizeof(host_cpid))) continue;
|
||||
else if (parse_int(buf, "<p_ncpus>", p_ncpus)) continue;
|
||||
else if (parse_str(buf, "<p_vendor>", p_vendor, sizeof(p_vendor))) continue;
|
||||
else if (parse_str(buf, "<p_model>", p_model, sizeof(p_model))) continue;
|
||||
else if (parse_str(buf, "<p_features>", p_features, sizeof(p_features))) continue;
|
||||
else if (parse_double(buf, "<p_fpops>", 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>", p_calculated)) continue;
|
||||
|
||||
if (benchmarks_only) continue;
|
||||
|
||||
if (parse_int(buf, "<timezone>", timezone)) continue;
|
||||
else if (parse_str(buf, "<domain_name>", domain_name, sizeof(domain_name))) continue;
|
||||
else if (parse_str(buf, "<ip_addr>", ip_addr, sizeof(ip_addr))) continue;
|
||||
else if (parse_str(buf, "<host_cpid>", host_cpid, sizeof(host_cpid))) continue;
|
||||
else if (parse_int(buf, "<p_ncpus>", p_ncpus)) continue;
|
||||
else if (parse_str(buf, "<p_vendor>", p_vendor, sizeof(p_vendor))) continue;
|
||||
else if (parse_str(buf, "<p_model>", p_model, sizeof(p_model))) continue;
|
||||
else if (parse_str(buf, "<p_features>", p_features, sizeof(p_features))) continue;
|
||||
else if (parse_double(buf, "<m_nbytes>", m_nbytes)) continue;
|
||||
else if (parse_double(buf, "<m_cache>", m_cache)) continue;
|
||||
else if (parse_double(buf, "<m_swap>", m_swap)) continue;
|
||||
|
|
|
@ -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*);
|
||||
|
|
Loading…
Reference in New Issue