From 02717af2f3323619e5e146b2ffe5f08da805afc9 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 15 Apr 2010 21:58:44 +0000 Subject: [PATCH] - bug fixes svn path=/trunk/boinc/; revision=21187 --- client/coproc_detect.cpp | 21 +++++++++++++++------ db/boinc_db.cpp | 2 ++ lib/coproc.h | 4 ++-- sched/credit.cpp | 3 ++- sched/sched_send.cpp | 2 ++ 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/client/coproc_detect.cpp b/client/coproc_detect.cpp index 813a2e3dda..6e14564c54 100644 --- a/client/coproc_detect.cpp +++ b/client/coproc_detect.cpp @@ -395,7 +395,7 @@ void COPROC_CUDA::get( // fake a NVIDIA GPU (for debugging) // -void fake_cuda(COPROCS& coprocs, int count) { +void fake_cuda(COPROCS& coprocs, double ram, int count) { COPROC_CUDA* cc = new COPROC_CUDA; strcpy(cc->type, "CUDA"); cc->count = count; @@ -405,7 +405,7 @@ void fake_cuda(COPROCS& coprocs, int count) { cc->display_driver_version = 18000; cc->cuda_version = 2020; strcpy(cc->prop.name, "Fake NVIDIA GPU"); - cc->prop.totalGlobalMem = 256*1024*1024; + cc->prop.totalGlobalMem = ram; cc->prop.sharedMemPerBlock = 100; cc->prop.regsPerBlock = 8; cc->prop.warpSize = 10; @@ -431,7 +431,12 @@ int COPROC_CUDA::available_ram(int devnum, double& ar) { unsigned int memfree, memtotal; unsigned int ctx; - if (!__cuDeviceGet) return 0; // avoid crash if faked GPU + // avoid crash if faked GPU + // + if (!__cuDeviceGet) { + ar = prop.totalGlobalMem; + return 0; + } int retval = (*__cuDeviceGet)(&device, devnum); if (retval) return retval; retval = (*__cuCtxCreate)(&ctx, 0, device); @@ -750,7 +755,7 @@ void COPROC_ATI::get(COPROCS& coprocs, retval = (*__calShutdown)(); } -void fake_ati(COPROCS& coprocs, int count) { +void fake_ati(COPROCS& coprocs, double ram, int count) { COPROC_ATI* cc = new COPROC_ATI; strcpy(cc->type, "ATI"); strcpy(cc->version, "1.4.3"); @@ -758,7 +763,7 @@ void fake_ati(COPROCS& coprocs, int count) { cc->count = count; memset(&cc->attribs, 0, sizeof(cc->attribs)); memset(&cc->info, 0, sizeof(cc->info)); - cc->attribs.localRAM = 1024; + cc->attribs.localRAM = (int)(ram/MEGA); cc->attribs.numberOfSIMD = 32; cc->attribs.wavefrontSize = 32; cc->attribs.engineClock = 50; @@ -775,7 +780,11 @@ int COPROC_ATI::available_ram(int devnum, double& ar) { st.struct_size = sizeof(CALdevicestatus); - if (!__calInit) return 0; // avoid crash if faked GPU + // avoid crash if faked GPU + if (!__calInit) { + r = attribs.localRAM; + return 0; + } retval = (*__calInit)(); if (retval) return retval; retval = (*__calDeviceOpen)(&dev, devnum); diff --git a/db/boinc_db.cpp b/db/boinc_db.cpp index 7b40168f3a..0429eda210 100644 --- a/db/boinc_db.cpp +++ b/db/boinc_db.cpp @@ -1132,6 +1132,7 @@ int DB_HOST_APP_VERSION::update_validator(DB_HOST_APP_VERSION& orig) { "turnaround_avg=%.15e, " "turnaround_q=%.15e, " "turnaround_var=%.15e, " + "error_rate=%.15e, " "host_scale_time=%.15e, " "scale_probation=%d", pfc.n, @@ -1144,6 +1145,7 @@ int DB_HOST_APP_VERSION::update_validator(DB_HOST_APP_VERSION& orig) { turnaround.avg, turnaround.q, turnaround.var, + error_rate, host_scale_time, scale_probation ); diff --git a/lib/coproc.h b/lib/coproc.h index 27de8dd967..a1d4931ad7 100644 --- a/lib/coproc.h +++ b/lib/coproc.h @@ -260,8 +260,8 @@ struct COPROC_CUDA : public COPROC { bool check_running_graphics_app(); }; -void fake_cuda(COPROCS&, int); -void fake_ati(COPROCS&, int); +void fake_cuda(COPROCS&, double, int); +void fake_ati(COPROCS&, double, int); enum CUdevice_attribute_enum { CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1, diff --git a/sched/credit.cpp b/sched/credit.cpp index fc34f8568a..6478241177 100644 --- a/sched/credit.cpp +++ b/sched/credit.cpp @@ -545,6 +545,7 @@ int hav_lookup(DB_HOST_APP_VERSION& hav, int hostid, int avid) { hav.clear(); hav.host_id = hostid; hav.app_version_id = avid; + hav.error_rate = ERROR_RATE_INIT; retval = hav.insert(); if (retval) return retval; } @@ -967,7 +968,7 @@ int write_modified_app_versions(vector& app_versions) { unsigned int i, j; int retval = 0; - if (config.debug_credit) { + if (config.debug_credit && app_versions.size()) { log_messages.printf(MSG_NORMAL, "[credit] start write_modified_app_versions()\n" ); diff --git a/sched/sched_send.cpp b/sched/sched_send.cpp index 822b876479..19732f00d0 100644 --- a/sched/sched_send.cpp +++ b/sched/sched_send.cpp @@ -1585,6 +1585,7 @@ int update_host_app_versions(vector& results, int hostid) { } if (!found) { DB_HOST_APP_VERSION hav; + hav.clear(); hav.host_id = hostid; hav.app_version_id = gavid; hav.host_scale_time = r.report_deadline; @@ -1601,6 +1602,7 @@ int update_host_app_versions(vector& results, int hostid) { DB_HOST_APP_VERSION& hav = new_havs[i]; hav.scale_probation = true; + hav.error_rate = ERROR_RATE_INIT; retval = hav.insert(); if (retval) { log_messages.printf(MSG_CRITICAL,