- client: bug fixes to the above

- client: better messages reporting coprocessors
    - manager: bounds checks to avoid wxwidgets asserts
        when job CPU estimates are absurdly large

svn path=/trunk/boinc/; revision=15644
This commit is contained in:
David Anderson 2008-07-21 19:56:01 +00:00
parent 0496591da2
commit 6c0731e82e
6 changed files with 52 additions and 21 deletions

View File

@ -5540,7 +5540,7 @@ Rom 8 July 2008
boinccas.dll
boinccas95.dll
Eric K 8 July 2008
Eric K 8 July 2008
- Fix for unicode compiles in DlgItemProperties.cpp
- Fix for compilers that can't concatenate a normal character string
to a wide character string. For example L"Hi " "There" works in GCC
@ -5568,7 +5568,7 @@ Eric K 8 July 2008
BOINCBaseFrame.cpp
ViewWorkGrid.cpp
sg_DlgMessages.cpp
DlgItemProperties.cpp
DlgItemProperties.cpp
David 8 July 2008
- web: if stop_web file is present, don't allow any DB access
@ -5579,7 +5579,7 @@ David 8 July 2008
file_xfer.C
html/inc/
boinc_db.inc
util.inc
util.inc
Eric K 8 July 2008
- sparc-solaris: detect_platforms()
@ -5895,3 +5895,17 @@ David 21 July 2008
cpu_sched.C
lib/
coproc.h
David 21 July 2008
- client: bug fixes to the above
- client: better messages reporting coprocessors
- manager: bounds checks to avoid wxwidgets asserts
when job CPU estimates are absurdly large
client/
app_start.C
client_state.C
clientgui/
ViewWorkGrid.cpp
lib/
coproc.C,h

View File

@ -364,6 +364,8 @@ int ACTIVE_TASK::start(bool first_time) {
FILE_REF fref;
FILE_INFO* fip;
int retval;
bool coprocs_reserved = false;
#ifdef _WIN32
get_sandbox_account_service_token();
// do this first because it affects how we create shmem seg
@ -495,6 +497,9 @@ int ACTIVE_TASK::start(bool first_time) {
exit(0);
}
reserve_coprocs();
coprocs_reserved = true;
#ifdef _WIN32
PROCESS_INFORMATION process_info;
STARTUPINFO startup_info;
@ -519,10 +524,9 @@ int ACTIVE_TASK::start(bool first_time) {
set_task_state(PROCESS_EXECUTING, "start");
return 0;
}
// NOTE: in Windows, stderr is redirected in boinc_init_diagnostics();
sprintf(cmdline, "%s %s %s",
exec_path, wup->command_line, app_version->cmdline
exec_path, wup->command_line.c_str(), app_version->cmdline
);
cuda_cmdline(this, cmdline);
@ -841,12 +845,15 @@ int ACTIVE_TASK::start(bool first_time) {
#endif
set_task_state(PROCESS_EXECUTING, "start");
reserve_coprocs();
return 0;
// go here on error; "buf" contains error message, "retval" is nonzero
//
error:
if (coprocs_reserved) {
free_coprocs();
}
// if something failed, it's possible that the executable was munged.
// Verify it to trigger another download.
//

View File

@ -235,15 +235,16 @@ int CLIENT_STATE::init() {
for (i=0; i<strs.size(); i++) {
msg_printf(NULL, MSG_INFO, strs[i].c_str());
}
#if 0
fake_cuda(coprocs);
#if 1
fake_cuda(coprocs, 2);
#endif
if (coprocs.coprocs.size() == 0) {
msg_printf(NULL, MSG_INFO, "No coprocessors");
} else {
for (i=0; i<coprocs.coprocs.size(); i++) {
COPROC* c = coprocs.coprocs[i];
msg_printf(NULL, MSG_INFO, "Coprocessor: %s (%d)", c->type, c->count);
c->description(buf);
msg_printf(NULL, MSG_INFO, "Coprocessor: %s", buf);
}
}

View File

@ -714,7 +714,7 @@ wxInt32 CViewWorkGrid::FormatProgress(wxInt32 item, wxString& strBuffer) const {
wxInt32 CViewWorkGrid::FormatTimeToCompletion(wxInt32 item, wxString& strBuffer) const {
float fBuffer = 0;
double est = 0;
wxInt32 iHour = 0;
wxInt32 iMin = 0;
wxInt32 iSec = 0;
@ -722,15 +722,19 @@ wxInt32 CViewWorkGrid::FormatTimeToCompletion(wxInt32 item, wxString& strBuffer)
RESULT* result = wxGetApp().GetDocument()->result(item);
if (result) {
fBuffer = result->estimated_cpu_time_remaining;
est = result->estimated_cpu_time_remaining;
if (est > 86400*365*10) {
est = 86400*365*10; // sanity check
}
}
if (0 >= fBuffer) {
if (est <= 0) {
strBuffer = wxT("---");
} else {
iHour = (wxInt32)(fBuffer / (60 * 60));
iMin = (wxInt32)(fBuffer / 60) % 60;
iSec = (wxInt32)(fBuffer) % 60;
iHour = (wxInt32)(est / (60 * 60));
iMin = (wxInt32)(est / 60) % 60;
iSec = (wxInt32)(est) % 60;
ts = wxTimeSpan(iHour, iMin, iSec);

View File

@ -105,11 +105,8 @@ const char* COPROC_CUDA::get(COPROCS& coprocs) {
int count;
#ifdef _WIN32
int retval;
int (__stdcall* __cudaGetDeviceCount)(int*);
int (__stdcall* __cudaGetDeviceProperties)(cudaDeviceProp*, int);
int bufsize=256;
char buf[256], path[256];
HMODULE cudalib = LoadLibrary("nvcuda.dll");
if (!cudalib) {
return "Can't load library nvcuda.dll";
@ -175,10 +172,10 @@ const char* COPROC_CUDA::get(COPROCS& coprocs) {
// add a non-existent CUDA coproc (for debugging)
//
void fake_cuda(COPROCS& coprocs) {
void fake_cuda(COPROCS& coprocs, int count) {
COPROC_CUDA* cc = new COPROC_CUDA;
strcpy(cc->type, "CUDA");
cc->count = 1;
cc->count = count;
strcpy(cc->prop.name, "CUDA NVIDIA chip");
cc->prop.totalGlobalMem = 1000;
cc->prop.sharedMemPerBlock = 100;
@ -310,6 +307,10 @@ int COPROC_CUDA::parse(FILE* fin) {
return ERR_XML_PARSE;
}
void COPROC_CUDA::description(char* p) {
sprintf(p, "%s (%d)", prop.name, count);
}
const char* COPROC_CELL_SPE::get(COPROCS&) {
return NULL;
}

View File

@ -46,7 +46,9 @@ struct COPROC {
strcpy(type, t);
count = 0;
used = 0;
memset(&owner, 0, sizeof(owner));
}
virtual void description(char*){};
virtual ~COPROC(){}
int parse(MIOFILE&);
};
@ -115,6 +117,7 @@ struct COPROC_CUDA : public COPROC {
COPROC_CUDA(): COPROC("CUDA"){}
virtual ~COPROC_CUDA(){}
static const char* get(COPROCS&);
virtual void description(char*);
void clear();
int parse(FILE*);
};
@ -123,9 +126,10 @@ struct COPROC_CUDA : public COPROC {
struct COPROC_CELL_SPE : public COPROC {
static const char* get(COPROCS&);
COPROC_CELL_SPE() : COPROC("Cell SPE"){}
virtual void description(char*);
virtual ~COPROC_CELL_SPE(){}
};
void fake_cuda(COPROCS&);
void fake_cuda(COPROCS&, int);
#endif