- client: write GPU info to client_state.xml,

so that it can be input file to the client simulator.

svn path=/trunk/boinc/; revision=22405
This commit is contained in:
David Anderson 2010-09-23 20:54:49 +00:00
parent 16a237231f
commit c7e13eafb3
9 changed files with 68 additions and 38 deletions

View File

@ -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

View File

@ -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

View File

@ -641,7 +641,7 @@ int CLIENT_STATE::write_state(MIOFILE& f) {
int retval;
f.printf("<client_state>\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;

View File

@ -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) {

View File

@ -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, "</app_init_data>\n");

View File

@ -93,6 +93,17 @@ int COPROC::parse(MIOFILE& fin) {
return ERR_XML_PARSE;
}
void COPROC::write_request(MIOFILE& f) {
f.printf(
" <req_secs>%f</req_secs>\n"
" <req_instances>%f</req_instances>\n"
" <estimated_delay>%f</estimated_delay>\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(" <coprocs>\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(" </coprocs>\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(
"<coproc_cuda>\n"
" <count>%d</count>\n"
" <name>%s</name>\n"
" <req_secs>%f</req_secs>\n"
" <req_instances>%f</req_instances>\n"
" <estimated_delay>%f</estimated_delay>\n"
" <name>%s</name>\n",
count,
prop.name
);
if (include_request) {
write_request(f);
}
f.printf(
" <drvVersion>%d</drvVersion>\n"
" <cudaVersion>%d</cudaVersion>\n"
" <totalGlobalMem>%u</totalGlobalMem>\n"
@ -191,11 +206,6 @@ void COPROC_CUDA::write_xml(MIOFILE& f) {
" <deviceOverlap>%d</deviceOverlap>\n"
" <multiProcessorCount>%d</multiProcessorCount>\n"
"</coproc_cuda>\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(
"<coproc_ati>\n"
);
f.printf(
" <count>%d</count>\n"
" <name>%s</name>\n"
" <name>%s</name>\n",
count,
name
);
if (include_request) {
write_request(f);
}
f.printf(
" <req_secs>%f</req_secs>\n"
" <req_instances>%f</req_instances>\n"
" <estimated_delay>%f</estimated_delay>\n"
@ -338,11 +352,6 @@ void COPROC_ATI::write_xml(MIOFILE& f) {
" <maxResource2DWidth>%d</maxResource2DWidth>\n"
" <maxResource2DHeight>%d</maxResource2DHeight>\n"
" <CALVersion>%s</CALVersion>\n",
count,
name,
req_secs,
req_instances,
estimated_delay,
attribs.target,
attribs.localRAM,
attribs.uncachedRemoteRAM,

View File

@ -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<std::string> &descs,
std::vector<std::string> &warnings,

View File

@ -15,6 +15,9 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// 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(
" <timezone>%d</timezone>\n",
timezone
);
if (!suppress_net_info) {
if (include_net_info) {
out.printf(
" <domain_name>%s</domain_name>\n"
" <ip_addr>%s</ip_addr>\n",
@ -173,7 +180,7 @@ int HOST_INFO::write(
osv
);
if (include_coprocs) {
coprocs.write_xml(out);
coprocs.write_xml(out, false);
}
out.printf(
"</host_info>\n"

View File

@ -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();