- client part of the above

svn path=/trunk/boinc/; revision=15169
This commit is contained in:
David Anderson 2008-05-09 21:07:15 +00:00
parent d2a02a5184
commit 6ab203081d
5 changed files with 20 additions and 9 deletions

View File

@ -3811,3 +3811,13 @@ David May 9 2008
sched_plan.C
sched_send.C
server_types.C
David May 9 2008
- client part of the above
client/
client_state.C
client_types.C
cpu_sched.C
lib/
coproc.h

View File

@ -254,7 +254,7 @@ int CLIENT_STATE::init() {
} else {
for (i=0; i<coprocs.coprocs.size(); i++) {
COPROC* c = coprocs.coprocs[i];
msg_printf(NULL, MSG_INFO, "Coprocessor: %s (%d)", c->name, c->count);
msg_printf(NULL, MSG_INFO, "Coprocessor: %s (%d)", c->type, c->count);
}
}

View File

@ -1108,7 +1108,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 = new COPROC;
COPROC* cp = new COPROC("");
int retval = cp->parse(in);
if (!retval) {
coprocs.coprocs.push_back(cp);

View File

@ -73,10 +73,10 @@ using std::vector;
bool CLIENT_STATE::sufficient_coprocs(APP_VERSION& av) {
for (unsigned int i=0; i<av.coprocs.coprocs.size(); i++) {
COPROC* cp = av.coprocs.coprocs[i];
COPROC* cp2 = coprocs.lookup(cp->name);
COPROC* cp2 = coprocs.lookup(cp->type);
if (!cp2) {
msg_printf(av.project, MSG_INFO,
"Missing a %s coprocessor", cp->name
"Missing a %s coprocessor", cp->type
);
return false;
}
@ -84,7 +84,7 @@ bool CLIENT_STATE::sufficient_coprocs(APP_VERSION& av) {
if (log_flags.cpu_sched_debug) {
msg_printf(NULL, MSG_INFO,
"[cpu_sched_debug] insufficient coproc %s (%d + %d > %d)",
cp2->name, cp2->used, cp->count, cp2->count
cp2->type, cp2->used, cp->count, cp2->count
);
}
return false;
@ -96,12 +96,12 @@ bool CLIENT_STATE::sufficient_coprocs(APP_VERSION& av) {
void CLIENT_STATE::reserve_coprocs(APP_VERSION& av) {
for (unsigned int i=0; i<av.coprocs.coprocs.size(); i++) {
COPROC* cp = av.coprocs.coprocs[i];
COPROC* cp2 = coprocs.lookup(cp->name);
COPROC* cp2 = coprocs.lookup(cp->type);
if (!cp2) continue;
if (log_flags.cpu_sched_debug) {
msg_printf(NULL, MSG_INFO,
"[cpu_sched_debug] reserving %d of coproc %s",
cp->count, cp2->name
cp->count, cp2->type
);
}
cp2->used += cp->count;
@ -111,12 +111,12 @@ void CLIENT_STATE::reserve_coprocs(APP_VERSION& av) {
void CLIENT_STATE::free_coprocs(APP_VERSION& av) {
for (unsigned int i=0; i<av.coprocs.coprocs.size(); i++) {
COPROC* cp = av.coprocs.coprocs[i];
COPROC* cp2 = coprocs.lookup(cp->name);
COPROC* cp2 = coprocs.lookup(cp->type);
if (!cp2) continue;
if (log_flags.cpu_sched_debug) {
msg_printf(NULL, MSG_INFO,
"[cpu_sched_debug] freeing %d of coproc %s",
cp->count, cp2->name
cp->count, cp2->type
);
}
cp2->used -= cp->count;

View File

@ -104,6 +104,7 @@ struct COPROC_CUDA : public COPROC {
struct COPROC_CELL_SPE : public COPROC {
static void get(COPROCS&);
COPROC_CELL_SPE() : COPROC("Cell SPE"){}
virtual ~COPROC_CELL_SPE(){}
};