- client: in parsing <coproc> elements in <app_version>,

use a new type COPROC_REQ for which the count field is a double.
    Otherwise fractional GPU jobs don't work.

svn path=/trunk/boinc/; revision=18906
This commit is contained in:
David Anderson 2009-08-24 23:16:17 +00:00
parent b3d0249ade
commit 9a8f91fb1e
4 changed files with 35 additions and 1 deletions

View File

@ -7190,3 +7190,13 @@ David 24 Aug 2009
lib/
coproc.cpp
David 24 Aug 2009
- client: in parsing <coproc> elements in <app_version>,
use a new type COPROC_REQ for which the count field is a double.
Otherwise fractional GPU jobs don't work.
client/
client_types.cpp
lib/
coproc.cpp,h

View File

@ -1128,7 +1128,7 @@ int APP_VERSION::parse(MIOFILE& in) {
if (parse_double(buf, "<flops>", flops)) continue;
if (parse_str(buf, "<cmdline>", cmdline, sizeof(cmdline))) continue;
if (match_tag(buf, "<coproc>")) {
COPROC cp;
COPROC_REQ cp;
int retval = cp.parse(in);
if (!retval) {
if (!strcmp(cp.type, "CUDA")) {

View File

@ -61,6 +61,21 @@ void COPROC::write_xml(MIOFILE& f) {
}
#endif
int COPROC_REQ::parse(MIOFILE& fin) {
char buf[1024];
strcpy(type, "");
count = 0;
while (fin.fgets(buf, sizeof(buf))) {
if (match_tag(buf, "</coproc>")) {
if (!strlen(type)) return ERR_XML_PARSE;
return 0;
}
if (parse_str(buf, "<type>", type, sizeof(type))) continue;
if (parse_double(buf, "<count>", count)) continue;
}
return ERR_XML_PARSE;
}
int COPROC::parse(MIOFILE& fin) {
char buf[1024];
strcpy(type, "");

View File

@ -75,6 +75,15 @@
#define MAX_COPROC_INSTANCES 64
// represents a requirement for a coproc.
// This is a parsed version of the <coproc> elements in an <app_version>
//
struct COPROC_REQ {
char type[256]; // must be unique
double count;
int parse(MIOFILE&);
};
// represents a coproc on a particular computer.
// The object will always be a derived class (COPROC_CUDA, COPROC_ATI)
// Used in both client and server.