diff --git a/checkin_notes b/checkin_notes index de5d1ea2b9..ca870d7c99 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5138,3 +5138,14 @@ Rom 25 June 2008 clientgui/ BOINCTaskBar.cpp + +David 25 June 2008 + - client: improve error messages when can't copy files + - client: change CUDA detection on Linux and Mac. + Look for libcuda.so in /usr/lib/nvidia and /usr/lib64/nvidia. + If we find it, assume that libcudart is in the library path. + + client/ + app_start.C + lib/ + coproc.C diff --git a/client/app_start.C b/client/app_start.C index b151920517..a9f0717828 100644 --- a/client/app_start.C +++ b/client/app_start.C @@ -265,7 +265,8 @@ static int setup_file( retval = boinc_copy(file_path, link_path); if (retval) { msg_printf(project, MSG_INTERNAL_ERROR, - "Can't copy %s to %s", file_path, link_path + "Can't copy %s to %s: %s", file_path, link_path, + boincerror(retval) ); return retval; } @@ -319,7 +320,8 @@ int ACTIVE_TASK::copy_output_files() { int retval = boinc_rename(slotfile, projfile); if (retval) { msg_printf(wup->project, MSG_INTERNAL_ERROR, - "Can't rename output file %s", fip->name + "Can't rename output file %s to %s: %s", + fip->name, projfile, boincerror(retval) ); } } @@ -737,7 +739,7 @@ int ACTIVE_TASK::start(bool first_time) { dup2(fd, STDOUT_FILENO); close(fd); - // add project dir to library path + // add project dir and slot dir to library path // char libpath[8192]; get_project_dir(wup->project, buf, sizeof(buf)); diff --git a/html/inc/bolt_cat.inc b/html/inc/bolt_cat.inc index b83a0b0742..d6fc2f287d 100644 --- a/html/inc/bolt_cat.inc +++ b/html/inc/bolt_cat.inc @@ -59,4 +59,47 @@ function lookup_categorization($name) { return null; } +function filter_form($sel_name, $sel_cat) { + global $categorizations; + $checked = (!$sel_name || $sel_name == "none")?"checked":""; + echo " + Filter by: + "; +} + +function breakdown_form($sel_name) { + global $categorizations; + echo " + Break down by: + "; +} + ?> diff --git a/html/inc/bolt_util.inc b/html/inc/bolt_util.inc index 46d5368a5e..8b8aacec5c 100644 --- a/html/inc/bolt_util.inc +++ b/html/inc/bolt_util.inc @@ -240,4 +240,38 @@ function test_stats() { echo "lo $lo hi $hi\n"; } +//////////// graph drawing + +function bar($title, $n, $width, $lo, $hi) { + $x1 = $width*$lo; + $x2 = $width*($hi-$lo); + $a1 = number_format($lo*100); + $a2 = number_format($hi*100); + return " + + $title
($n students) + + + + + +
$a1$a2
+ + + "; +} + +function bar_insuff($title, $width) { + return " + + $title + + + +
Insufficient data
+ + + "; +} + ?> diff --git a/html/user/bolt_compare.php b/html/user/bolt_compare.php index b6831d2c9d..bb9412f561 100644 --- a/html/user/bolt_compare.php +++ b/html/user/bolt_compare.php @@ -17,51 +17,8 @@ require_once("../inc/bolt_db.inc"); require_once("../inc/bolt_util.inc"); require_once("../inc/bolt_cat.inc"); -function filter_form($sel_name, $sel_cat) { - global $categorizations; - $checked = (!$sel_name || $sel_name == "none")?"checked":""; - echo " - Filter by: - "; -} - -function breakdown_form($sel_name) { - global $categorizations; - echo " - Break down by: - "; -} - function compare_case( - $select_unit, $snap, $filter, $filter_cat, $breakdown, $breakdown_cat + $title, $select_unit, $snap, $filter, $filter_cat, $breakdown, $breakdown_cat ) { // for each select alternative, build an array of xset scores @@ -77,27 +34,30 @@ function compare_case( continue; } $z = $x->sf->selected_unit; - echo "
unit: $z "; $u = $x->sf->selected_unit; $a[$u][] = $x->xr->score; } + if ($title) { + echo " + $title + "; + } foreach ($select_unit->units as $child) { if (array_key_exists($child->name, $a)) { $scores = $a[$child->name]; $n = count($scores); if ($n < 2) { - $x = "insufficient data"; + $x = bar_insuff($child->name, 600); } else { conf_int_90($scores, $lo, $hi); - $x = "($lo, $hi) ($n results)"; + //$x = "($lo, $hi) ($n results)"; + $x = bar($child->name, $n, 600, $lo, $hi); } } else { - $x = "insufficient data"; + $x = bar_insuff($child->name, 600); } - echo " -

$child->name: $x - "; + echo $x; } } @@ -130,18 +90,24 @@ function compare_aux($select_name, $xset_name, $snap) { page_head("Unit comparison"); echo " - The following compares the alternatives of the - $select_name select unit - with respect to the $xset_name exercise set unit. + + The following compares the alternatives of + $select_name with respect to $xset_name. +

"; - compare_case($select_unit, $snap, $filter, $filter_cat, null, null); + echo ""; + if ($breakdown) echo ""; + + compare_case(null, $select_unit, $snap, $filter, $filter_cat, null, null); if ($breakdown) { + echo ""; foreach ($breakdown->categories() as $c) { - echo "

$c

"; - compare_case($select_unit, $snap, $filter, $filter_cat, $breakdown, $c); + compare_case($c, $select_unit, $snap, $filter, $filter_cat, $breakdown, $c); + echo "

"; } } + echo "

Total
Breakdown by $breakdown_name
"; echo "

@@ -149,7 +115,7 @@ function compare_aux($select_name, $xset_name, $snap) { -
+
"; filter_form($filter_name, $filter_cat); echo ""; diff --git a/lib/coproc.C b/lib/coproc.C index 41a0bfcf3b..e258471de4 100644 --- a/lib/coproc.C +++ b/lib/coproc.C @@ -30,6 +30,7 @@ #endif #include "error_numbers.h" +#include "filesys.h" #include "parse.h" #include "coproc.h" @@ -100,36 +101,17 @@ char* COPROC_CUDA::get(COPROCS& coprocs) { #ifdef _WIN32 int retval; - int (__stdcall* __cudaGetDeviceCount)( int * ); - int (__stdcall* __cudaGetDeviceProperties) ( cudaDeviceProp*, int ); + int (__stdcall* __cudaGetDeviceCount)(int*); + int (__stdcall* __cudaGetDeviceProperties)(cudaDeviceProp*, int); int bufsize=256; char buf[256], path[256]; -#if 0 - HKEY key; - retval = RegOpenKeyEx( - HKEY_LOCAL_MACHINE, - _T("SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA CUDA"), - NULL, - KEY_READ, - &key - ); - if (retval != ERROR_SUCCESS) { - return "Can't find registry key";; - } - retval = RegQueryValueEx(key, "InstallDir", NULL, NULL, (LPBYTE)buf, (LPDWORD)&bufsize); - RegCloseKey(key); - if (retval != ERROR_SUCCESS) { - return "Can't get registry value"; - } - sprintf(path, "%s\\bin\\cudart.dll", buf); - HMODULE cudalib = LoadLibrary(path); -#else HMODULE cudalib = LoadLibrary("nvcuda.dll"); -#endif if (!cudalib) { return "Can't load library nvcuda.dll"; } - __cudaGetDeviceCount = (int(__stdcall*)(int*)) GetProcAddress(cudalib, "cudaGetDeviceCount"); + __cudaGetDeviceCount = (int(__stdcall*)(int*)) GetProcAddress( + cudalib, "cudaGetDeviceCount" + ); if(!__cudaGetDeviceCount) { return "Library doesn't have cudaGetDeviceCount()"; } @@ -139,16 +121,18 @@ char* COPROC_CUDA::get(COPROCS& coprocs) { } #else void* cudalib; - void (*__cudaGetDeviceCount)( int * ); - void (*__cudaGetDeviceProperties) ( cudaDeviceProp*, int ); + void (*__cudaGetDeviceCount)(int*); + void (*__cudaGetDeviceProperties)(cudaDeviceProp*, int); -#ifdef __APPLE__ - cudalib = dlopen ("/usr/local/cuda/lib/libcudart.dylib", RTLD_NOW ); -#else - cudalib = dlopen ("/usr/local/cuda/lib/libcudart.so", RTLD_NOW ); - if (!cudalib) { - cudalib = dlopen ("libcudart.so", RTLD_NOW ); + if (!boinc_file_exists("/usr/lib64/nvidia/libcuda.so") + && !boinc_file_exists("/usr/lib/nvidia/libcuda.so") + ){ + return "No CUDA driver found"; } +#ifdef __APPLE__ + cudalib = dlopen ("libcudart.dylib", RTLD_NOW ); +#else + cudalib = dlopen ("libcudart.so", RTLD_NOW ); #endif if (!cudalib) { return "Can't load library libcudart";