diff --git a/checkin_notes b/checkin_notes index 48e90dbc24..7cee85e128 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7190,3 +7190,13 @@ David 24 Aug 2009 lib/ coproc.cpp + +David 24 Aug 2009 + - client: in parsing elements in , + 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 diff --git a/client/client_types.cpp b/client/client_types.cpp index c09d2d657f..97df784493 100644 --- a/client/client_types.cpp +++ b/client/client_types.cpp @@ -1128,7 +1128,7 @@ int APP_VERSION::parse(MIOFILE& in) { if (parse_double(buf, "", flops)) continue; if (parse_str(buf, "", cmdline, sizeof(cmdline))) continue; if (match_tag(buf, "")) { - COPROC cp; + COPROC_REQ cp; int retval = cp.parse(in); if (!retval) { if (!strcmp(cp.type, "CUDA")) { diff --git a/lib/coproc.cpp b/lib/coproc.cpp index b27b5bd2e9..2128ffc58e 100644 --- a/lib/coproc.cpp +++ b/lib/coproc.cpp @@ -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, "")) { + if (!strlen(type)) return ERR_XML_PARSE; + return 0; + } + if (parse_str(buf, "", type, sizeof(type))) continue; + if (parse_double(buf, "", count)) continue; + } + return ERR_XML_PARSE; +} + int COPROC::parse(MIOFILE& fin) { char buf[1024]; strcpy(type, ""); diff --git a/lib/coproc.h b/lib/coproc.h index a1515d061e..a193918095 100644 --- a/lib/coproc.h +++ b/lib/coproc.h @@ -75,6 +75,15 @@ #define MAX_COPROC_INSTANCES 64 +// represents a requirement for a coproc. +// This is a parsed version of the elements in an +// +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.