- client: ignore case in names of "exclusive apps"

and exclusive GPU apps
	- client: fix bug that caused GPU apps to not be
		suspended or resumed immediately after
		exclusive GPU app transition
	- client: in log message, instead of saying
		"fetching tasks for GPU", say which kind of GPU

svn path=/trunk/boinc/; revision=22298
This commit is contained in:
David Anderson 2010-08-27 18:22:59 +00:00
parent 378eda517a
commit f9adad65b6
5 changed files with 57 additions and 17 deletions

View File

@ -6235,3 +6235,19 @@ David 26 Aug 2010
cs_notice.cpp
lib/
common_defs.h
David 27 Aug 2010
- client: ignore case in names of "exclusive apps"
and exclusive GPU apps
- client: fix bug that caused GPU apps to not be
suspended or resumed immediately after
exclusive GPU app transition
- client: in log message, instead of saying
"fetching tasks for GPU", say which kind of GPU
client/
app.cpp
cs_prefs.cpp
scheduler_op.cpp
lib/
str_replace.h

View File

@ -52,7 +52,6 @@
#include <cstdlib>
#endif
#include "client_state.h"
#include "error_numbers.h"
#include "filesys.h"
@ -60,6 +59,9 @@
#include "parse.h"
#include "shmem.h"
#include "str_util.h"
#include "str_replace.h"
#include "client_state.h"
#include "client_msgs.h"
#include "procinfo.h"
#include "sandbox.h"
@ -292,7 +294,7 @@ bool app_running(vector<PROCINFO>& piv, const char* p) {
for (unsigned int i=0; i<piv.size(); i++) {
PROCINFO& pi = piv[i];
//msg_printf(0, MSG_INFO, "running: [%s]", pi.command);
if (!strcmp(pi.command, p)) {
if (!strcasecmp(pi.command, p)) {
return true;
}
}

View File

@ -169,8 +169,10 @@ int CLIENT_STATE::check_suspend_processing() {
if (log_flags.cpu_sched) {
if (old_gpu_suspend_reason && !gpu_suspend_reason) {
msg_printf(NULL, MSG_INFO, "[cpu_sched] resuming GPU activity");
request_schedule_cpus("GPU resumption");
} else if (!old_gpu_suspend_reason && gpu_suspend_reason) {
msg_printf(NULL, MSG_INFO, "[cpu_sched] suspending GPU activity");
request_schedule_cpus("GPU suspension");
}
}

View File

@ -204,6 +204,25 @@ void SCHEDULER_OP::rpc_failed(const char* msg) {
cur_proj = 0;
}
static void request_string(char* buf) {
bool first = true;
strcpy(buf, "");
if (cpu_work_fetch.req_secs) {
strcpy(buf, "CPU");
first = false;
}
if (cuda_work_fetch.req_secs) {
if (!first) strcat(buf, " and ");
strcat(buf, "NVIDIA GPU");
first = false;
}
if (ati_work_fetch.req_secs) {
if (!first) strcat(buf, " and ");
strcat(buf, "ATI GPU");
first = false;
}
}
// low-level routine to initiate an RPC
// If successful, creates an HTTP_OP that must be polled
// PRECONDITION: the request file has been created
@ -217,26 +236,15 @@ int SCHEDULER_OP::start_rpc(PROJECT* p) {
msg_printf(p, MSG_INFO,
"Sending scheduler request: %s.", rpc_reason_string(reason)
);
double gpu_req = cuda_work_fetch.req_secs + ati_work_fetch.req_secs;
if (cpu_work_fetch.req_secs || gpu_req) {
if (gstate.host_info.have_cuda()||gstate.host_info.have_ati()) {
if (cpu_work_fetch.req_secs && gpu_req) {
sprintf(buf, " for CPU and GPU");
} else if (cpu_work_fetch.req_secs) {
sprintf(buf, " for CPU");
} else {
sprintf(buf, " for GPU");
}
} else {
strcpy(buf, "");
}
request_string(buf);
if (strlen(buf)) {
if (p->nresults_returned) {
msg_printf(p, MSG_INFO,
"Reporting %d completed tasks, requesting new tasks%s",
"Reporting %d completed tasks, requesting new tasks for %s",
p->nresults_returned, buf
);
} else {
msg_printf(p, MSG_INFO, "Requesting new tasks%s", buf);
msg_printf(p, MSG_INFO, "Requesting new tasks for %s", buf);
}
} else {
if (p->nresults_returned) {

View File

@ -36,4 +36,16 @@ extern size_t strlcat(char *dst, const char *src, size_t size);
extern const char *strcasestr(const char *s1, const char *s2);
#endif
#if !defined(HAVE_STRCASECMP)
inline int strcasecmp(const char* s1, const char* s2) {
while (*s1 && *s2) {
char c1 = tolower(*s1++);
char c2 = tolower(*s2++);
if (c1 != c2) return 1; // don't worry about +/-
}
if (*s1 || *s2) return 1;
return 0;
}
#endif
#endif