diff --git a/checkin_notes b/checkin_notes index a67cef9d8f..8db192bbc5 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6763,3 +6763,16 @@ Rom 23 Sept 2010 BOINCTaskBar.cpp clientscr/ screensaver_win.cpp, .h + +David 23 Sept 2010 + - client: write GPU info to client_state.xml, + so that it can be input file to the client simulator. + + client/ + cs_scheduler.cpp + cs_statefile.cpp + gui_rpc_server_ops.cpp + lib/ + app_ipc.cpp + coproc.cpp,h + hostinfo.cpp,h diff --git a/client/cs_scheduler.cpp b/client/cs_scheduler.cpp index 97c13fdc59..5a202a44e1 100644 --- a/client/cs_scheduler.cpp +++ b/client/cs_scheduler.cpp @@ -205,7 +205,7 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { // host_info.get_host_info(); set_ncpus(); - retval = host_info.write(mf, config.suppress_net_info, false); + retval = host_info.write(mf, !config.suppress_net_info, false); //if (retval) return retval; // get and write disk usage @@ -234,7 +234,7 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { } if (!host_info.coprocs.none()) { - host_info.coprocs.write_xml(mf); + host_info.coprocs.write_xml(mf, true); } // report results diff --git a/client/cs_statefile.cpp b/client/cs_statefile.cpp index e7bc364b6f..727685df86 100644 --- a/client/cs_statefile.cpp +++ b/client/cs_statefile.cpp @@ -641,7 +641,7 @@ int CLIENT_STATE::write_state(MIOFILE& f) { int retval; f.printf("\n"); - retval = host_info.write(f, false, false); + retval = host_info.write(f, true, true); if (retval) return retval; retval = time_stats.write(f, false); if (retval) return retval; @@ -864,7 +864,7 @@ int CLIENT_STATE::write_state_gui(MIOFILE& f) { // However, BoincView (which does its own parsing) expects it // to be in the get_state() reply, so leave it in for now // - retval = host_info.write(f, false, false); + retval = host_info.write(f, true, false); if (retval) return retval; retval = time_stats.write(f, false); if (retval) return retval; diff --git a/client/gui_rpc_server_ops.cpp b/client/gui_rpc_server_ops.cpp index b099a4fd4a..25e890c698 100644 --- a/client/gui_rpc_server_ops.cpp +++ b/client/gui_rpc_server_ops.cpp @@ -495,7 +495,7 @@ static void handle_result_op(char* buf, MIOFILE& fout, const char* op) { } static void handle_get_host_info(char*, MIOFILE& fout) { - gstate.host_info.write(fout, false, true); + gstate.host_info.write(fout, true, true); } static void handle_get_screensaver_tasks(MIOFILE& fout) { diff --git a/lib/app_ipc.cpp b/lib/app_ipc.cpp index a9781f7542..88ff6e58f6 100644 --- a/lib/app_ipc.cpp +++ b/lib/app_ipc.cpp @@ -216,7 +216,7 @@ int write_init_data_file(FILE* f, APP_INIT_DATA& ai) { ); MIOFILE mf; mf.init_file(f); - ai.host_info.write(mf, false, true); + ai.host_info.write(mf, true, true); ai.proxy_info.write(mf); ai.global_prefs.write(mf); fprintf(f, "\n"); diff --git a/lib/coproc.cpp b/lib/coproc.cpp index 19f2873726..df64e27f07 100644 --- a/lib/coproc.cpp +++ b/lib/coproc.cpp @@ -93,6 +93,17 @@ int COPROC::parse(MIOFILE& fin) { return ERR_XML_PARSE; } +void COPROC::write_request(MIOFILE& f) { + f.printf( + " %f\n" + " %f\n" + " %f\n", + req_secs, + req_instances, + estimated_delay + ); +} + void COPROCS::summary_string(char* buf, int len) { char bigbuf[8192], buf2[1024]; @@ -138,14 +149,14 @@ int COPROCS::parse(MIOFILE& fin) { return ERR_XML_PARSE; } -void COPROCS::write_xml(MIOFILE& mf) { +void COPROCS::write_xml(MIOFILE& mf, bool include_request) { #ifndef _USING_FCGI_ mf.printf(" \n"); if (cuda.count) { - cuda.write_xml(mf); + cuda.write_xml(mf, include_request); } if (ati.count) { - ati.write_xml(mf); + ati.write_xml(mf, include_request); } mf.printf(" \n"); #endif @@ -165,14 +176,18 @@ void COPROC_CUDA::description(char* buf) { } #ifndef _USING_FCGI_ -void COPROC_CUDA::write_xml(MIOFILE& f) { +void COPROC_CUDA::write_xml(MIOFILE& f, bool include_request) { f.printf( "\n" " %d\n" - " %s\n" - " %f\n" - " %f\n" - " %f\n" + " %s\n", + count, + prop.name + ); + if (include_request) { + write_request(f); + } + f.printf( " %d\n" " %d\n" " %u\n" @@ -191,11 +206,6 @@ void COPROC_CUDA::write_xml(MIOFILE& f) { " %d\n" " %d\n" "\n", - count, - prop.name, - req_secs, - req_instances, - estimated_delay, display_driver_version, cuda_version, (unsigned int)prop.totalGlobalMem, @@ -312,14 +322,18 @@ int COPROC_CUDA::parse(MIOFILE& fin) { ////////////////// ATI STARTS HERE ///////////////// #ifndef _USING_FCGI_ -void COPROC_ATI::write_xml(MIOFILE& f) { +void COPROC_ATI::write_xml(MIOFILE& f, bool include_request) { f.printf( "\n" - ); - - f.printf( " %d\n" - " %s\n" + " %s\n", + count, + name + ); + if (include_request) { + write_request(f); + } + f.printf( " %f\n" " %f\n" " %f\n" @@ -338,11 +352,6 @@ void COPROC_ATI::write_xml(MIOFILE& f) { " %d\n" " %d\n" " %s\n", - count, - name, - req_secs, - req_instances, - estimated_delay, attribs.target, attribs.localRAM, attribs.uncachedRemoteRAM, diff --git a/lib/coproc.h b/lib/coproc.h index 3dcf6fa1a0..4806abc341 100644 --- a/lib/coproc.h +++ b/lib/coproc.h @@ -127,6 +127,7 @@ struct COPROC { #ifndef _USING_FCGI_ virtual void write_xml(MIOFILE&); + void write_request(MIOFILE&); #endif inline void clear() { // can't just memcpy() - trashes vtable @@ -193,7 +194,7 @@ struct COPROC_CUDA : public COPROC { CUDA_DEVICE_PROP prop; #ifndef _USING_FCGI_ - virtual void write_xml(MIOFILE&); + virtual void write_xml(MIOFILE&, bool include_request); #endif COPROC_CUDA(): COPROC("CUDA"){} virtual ~COPROC_CUDA(){} @@ -258,7 +259,7 @@ struct COPROC_ATI : public COPROC { CALdeviceattribs attribs; CALdeviceinfo info; #ifndef _USING_FCGI_ - virtual void write_xml(MIOFILE&); + virtual void write_xml(MIOFILE&, bool include_request); #endif COPROC_ATI(): COPROC("ATI"){} virtual ~COPROC_ATI(){} @@ -285,7 +286,7 @@ struct COPROCS { COPROCS(){} ~COPROCS(){} // don't delete coprocs; else crash in APP_INIT_DATA logic - void write_xml(MIOFILE& out); + void write_xml(MIOFILE& out, bool include_request); void get( bool use_all, std::vector &descs, std::vector &warnings, diff --git a/lib/hostinfo.cpp b/lib/hostinfo.cpp index 9785b86214..67e6cdbfe2 100644 --- a/lib/hostinfo.cpp +++ b/lib/hostinfo.cpp @@ -15,6 +15,9 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . +// Write and parse HOST_INFO structures. +// Used by client and GUI + #if defined(_WIN32) && !defined(__STDWX_H__) #include "boinc_win.h" #elif defined(_WIN32) && defined(__STDWX_H__) @@ -113,11 +116,15 @@ int HOST_INFO::parse(MIOFILE& in, bool benchmarks_only) { return ERR_XML_PARSE; } -// Write the host information, to the client state XML file -// or in a scheduler request message +// Write the host information to either: +// - client state XML file (net info, coprocs) +// - a GUI RPC reply (net info, coprocs) +// - a scheduler request message +// (net info unless config says otherwise, no coprocs) +// - app init file (net info, coprocs) // int HOST_INFO::write( - MIOFILE& out, bool suppress_net_info, bool include_coprocs + MIOFILE& out, bool include_net_info, bool include_coprocs ) { char pv[265], pm[256], pf[256], osn[256], osv[256]; out.printf( @@ -125,7 +132,7 @@ int HOST_INFO::write( " %d\n", timezone ); - if (!suppress_net_info) { + if (include_net_info) { out.printf( " %s\n" " %s\n", @@ -173,7 +180,7 @@ int HOST_INFO::write( osv ); if (include_coprocs) { - coprocs.write_xml(out); + coprocs.write_xml(out, false); } out.printf( "\n" diff --git a/lib/hostinfo.h b/lib/hostinfo.h index c676a5b74c..44bbad4a57 100644 --- a/lib/hostinfo.h +++ b/lib/hostinfo.h @@ -62,7 +62,7 @@ public: HOST_INFO(); int parse(MIOFILE&, bool benchmarks_only = false); - int write(MIOFILE&, bool suppress_net_info, bool include_coprocs); + int write(MIOFILE&, bool include_net_info, bool include_coprocs); int parse_cpu_benchmarks(FILE*); int write_cpu_benchmarks(FILE*); void print();