From 61663b48f97a082045c26092021340417e3f50da Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 28 Mar 2008 21:22:48 +0000 Subject: [PATCH] - client: debug coprocessor code svn path=/trunk/boinc/; revision=14981 --- checkin_notes | 17 +++++++++---- client/client_state.C | 4 ++-- client/cs_scheduler.C | 4 ++-- lib/coproc.C | 55 ++++++++++++++++++++++--------------------- lib/coproc.h | 2 +- 5 files changed, 46 insertions(+), 36 deletions(-) diff --git a/checkin_notes b/checkin_notes index d4ed000081..5b4a9aff01 100644 --- a/checkin_notes +++ b/checkin_notes @@ -2577,11 +2577,11 @@ Charlie Mar 20 2008 buildWxMac.sh David Mar 20 2008 - - updated GeoIP stuff + - updated GeoIP stuff - html/inc/ - GeoIP.dat - geoip.inc + html/inc/ + GeoIP.dat + geoip.inc Charlie Mar 20 2008 - Mac: Update sandbox security for symlinks replacing xml soft links. @@ -2797,3 +2797,12 @@ David Mar 28 2008 client_state.C lib/ coproc.C,h + +David Mar 28 2008 + - client: debug coprocessor code + + client/ + client_state.C + cs_scheduler.C + lib/ + coproc.C,h diff --git a/client/client_state.C b/client/client_state.C index e5e1a1ced9..4ab85dacce 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -243,8 +243,8 @@ int CLIENT_STATE::init() { fake_cuda(coprocs); #endif for (i=0; iname, c->count); } // Check to see if we can write the state file. diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 5f898b36e2..965dfa4406 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -223,8 +223,8 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { if (coprocs.coprocs.size()) { fprintf(f, " \n"); for (i=0; iwrite_xml(f); } fprintf(f, " \n"); } diff --git a/lib/coproc.C b/lib/coproc.C index cd70bef0b8..bf23bef9ad 100644 --- a/lib/coproc.C +++ b/lib/coproc.C @@ -45,8 +45,8 @@ int COPROCS::parse(FILE* fin) { while (fgets(buf, sizeof(buf), fin)) { if (strstr(buf, "")) return 0; if (strstr(buf, "")) { - COPROC_CUDA cc; - int retval = cc.parse(fin); + COPROC_CUDA* cc = new COPROC_CUDA; + int retval = cc->parse(fin); if (!retval) { coprocs.push_back(cc); } @@ -82,10 +82,10 @@ void COPROC_CUDA::get(COPROCS& coprocs) { if (count < 1) return; for (int i=0; iprop, i); + cc->count = 1; + strcpy(cc->name, "CUDA"); coprocs.coprocs.push_back(cc); } } @@ -93,26 +93,27 @@ void COPROC_CUDA::get(COPROCS& coprocs) { // add a non-existent CUDA coproc (for debugging) // void fake_cuda(COPROCS& coprocs) { - COPROC_CUDA cc; - strcpy(cc.name, "cuda 0"); - cc.count = 1; - cc.prop.totalGlobalMem = 1000; - cc.prop.sharedMemPerBlock = 100; - cc.prop.regsPerBlock = 8; - cc.prop.warpSize = 10; - cc.prop.memPitch = 10; - cc.prop.maxThreadsPerBlock = 20; - cc.prop.maxThreadsDim[0] = 2; - cc.prop.maxThreadsDim[1] = 2; - cc.prop.maxThreadsDim[2] = 2; - cc.prop.maxGridSize[0] = 10; - cc.prop.maxGridSize[1] = 10; - cc.prop.maxGridSize[2] = 10; - cc.prop.totalConstMem = 10; - cc.prop.major = 1; - cc.prop.minor = 1; - cc.prop.clockRate = 10000; - cc.prop.textureAlignment = 1000; + COPROC_CUDA* cc = new COPROC_CUDA; + strcpy(cc->name, "CUDA"); + cc->count = 1; + strcpy(cc->prop.name, cc->name); + cc->prop.totalGlobalMem = 1000; + cc->prop.sharedMemPerBlock = 100; + cc->prop.regsPerBlock = 8; + cc->prop.warpSize = 10; + cc->prop.memPitch = 10; + cc->prop.maxThreadsPerBlock = 20; + cc->prop.maxThreadsDim[0] = 2; + cc->prop.maxThreadsDim[1] = 2; + cc->prop.maxThreadsDim[2] = 2; + cc->prop.maxGridSize[0] = 10; + cc->prop.maxGridSize[1] = 10; + cc->prop.maxGridSize[2] = 10; + cc->prop.totalConstMem = 10; + cc->prop.major = 1; + cc->prop.minor = 1; + cc->prop.clockRate = 10000; + cc->prop.textureAlignment = 1000; coprocs.coprocs.push_back(cc); } @@ -136,7 +137,7 @@ void COPROC_CUDA::write_xml(FILE* f) { " %u\n" "\n", count, - prop.name, + name, (unsigned int)prop.totalGlobalMem, (unsigned int)prop.sharedMemPerBlock, prop.regsPerBlock, diff --git a/lib/coproc.h b/lib/coproc.h index d240e7667e..8ed4eb503d 100644 --- a/lib/coproc.h +++ b/lib/coproc.h @@ -31,7 +31,7 @@ struct COPROC { }; struct COPROCS { - std::vector coprocs; + std::vector coprocs; COPROCS(){} void get();