From f31e46f13bc6df855a149489054e9f8e8041cf11 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 17 Nov 2009 21:38:44 +0000 Subject: [PATCH] - change project_list.php so that it shows platform[plan_class]. That way the client can know which projects have GPU and multithread apps. - client: message tweak svn path=/trunk/boinc/; revision=19589 --- checkin_notes | 9 ++++ client/log_flags.cpp | 2 +- doc/get_platforms.inc | 121 ++++++++++++++++++++++++++---------------- doc/project_list.php | 8 +-- 4 files changed, 89 insertions(+), 51 deletions(-) diff --git a/checkin_notes b/checkin_notes index bad1fd28ab..8ad76e7273 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9277,3 +9277,12 @@ Rom 17 Nov 2009 wizardex.cpp, .h win_build/ boincmgr.vcproj + +David 17 Nov 2009 + - change project_list.php so that it shows platform[plan_class]. + That way the client can know which projects have GPU + and multithread apps. + + doc/ + get_platforms.inc + project_list.php diff --git a/client/log_flags.cpp b/client/log_flags.cpp index c0da02e046..163f15ec26 100644 --- a/client/log_flags.cpp +++ b/client/log_flags.cpp @@ -174,7 +174,7 @@ static void show_gpu_ignore(vector& devs, const char* name) { void CONFIG::show() { unsigned int i; if (config.ncpus>=0) { - msg_printf(NULL, MSG_INFO, "Config: use at most %d CPUs", config.ncpus); + msg_printf(NULL, MSG_INFO, "Config: simulate %d CPUs", config.ncpus); } if (config.no_gpus) { msg_printf(NULL, MSG_INFO, "Config: don't use coprocessors"); diff --git a/doc/get_platforms.inc b/doc/get_platforms.inc index 4b09558418..375eb8bd40 100644 --- a/doc/get_platforms.inc +++ b/doc/get_platforms.inc @@ -1,72 +1,98 @@ ")) return $tag; - $y = substr($x, strlen($tag)); - $n = strpos($y, $closetag); - if ($n) { - $element = substr($y, 0, $n); - } - $cursor = (strlen($xml) - strlen($x)) + strlen($tag) + strlen($closetag) + strlen($element); - } - return trim($element); -} function friendly_name($p) { - switch ($p) { - case 'i686-pc-linux-gnu': return 'Linux/x86'; - case 'windows_intelx86': return 'Windows'; - case 'x86_64-pc-linux-gnu': return 'Linux/x64'; - case 'i686-apple-darwin': return 'Mac OS X'; - case 'x86_64-apple-darwin': return 'Mac OS X 64-bit'; - case 'powerpc-apple-darwin': return 'Mac OS X (PowerPC)'; - case 'sparc-sun-solaris2.7': return 'SPARC Solaris 2.7'; - case 'sparc-sun-solaris': return 'SPARC Solaris'; - case 'powerpc64-unknown-linux-gnu': return 'Linux/PowerPC64'; - case 'windows_x86_64': return 'Windows/x64'; - case 'powerpc64-ps3-linux-gnu': return 'Playstation3/Linux'; - case 'x86_64-unknown-linux-gnu': return null; + $x = explode('[', $p); + $pc = ""; + if (sizeof($x) > 1) { + $p = $x[0]; + $pc = substr($x[1], 0, -1); } + if (strstr($p, "fubar")) return null; - return $p; + if ($p == 'x86_64-unknown-linux-gnu') return null; + $q = $p; + switch ($p) { + case 'i686-pc-linux-gnu': $q = 'Linux/x86'; break; + case 'windows_intelx86': $q = 'Windows'; break; + case 'x86_64-pc-linux-gnu': $q = 'Linux/x64'; break; + case 'i686-apple-darwin': $q = 'Mac OS X'; break; + case 'x86_64-apple-darwin': $q = 'Mac OS X 64-bit'; break; + case 'powerpc-apple-darwin': $q = 'Mac OS X (PowerPC)'; break; + case 'sparc-sun-solaris2.7': $q = 'SPARC Solaris 2.7'; break; + case 'sparc-sun-solaris': $q = 'SPARC Solaris'; break; + case 'powerpc64-unknown-linux-gnu': $q = 'Linux/PowerPC64'; break; + case 'windows_x86_64': $q = 'Windows/x64'; break; + case 'powerpc64-ps3-linux-gnu': $q = 'Playstation3/Linux'; break; + } + if (strlen($pc)) { + if (strstr($pc, 'cuda')) $q .= " (NVIDIA GPU)"; + else if (strstr($pc, 'ati')) $q .= " (ATI GPU)"; + else if (strstr($pc, 'mt')) $q .= " (multicore)"; + } + return $q; } -// -function get_platforms($url) { +// get platforms from get_project_config.php (preferred method) +// +function get_platforms(&$url) { $url .= 'get_project_config.php'; $x = file_get_contents($url); if (!$x) return null; - $cursor = 0; - $list = null; - $tag = ''; - if (!strstr($x, "")) $tag = ''; - while (1) { - $p = parse_next_element($x, $tag, $cursor); - if (!$p) break; - $list[] = $p; + $s = new SimpleXMLElement($x); + if (array_key_exists('rpc_prefix', $s)) { + $url = $s->rpc_prefix; + } + if (!array_key_exists('platforms', $s)) return null; + $p = $s->platforms; + if (!array_key_exists('platform', $p)) return null; + if (sizeof($p->platform) == 0) return null; + if (array_key_exists(0, $p->platform[0])) { + foreach ($p->platform as $r) { + $list[] = (string)$r->platform_name; + } + } else { + $list = array(); + foreach ($p->platform as $r) { + print_r($r); + if (array_key_exists('plan_class', $r)) { + $list[] = (string)$r->platform_name.'['.(string)$r->plan_class.']'; + } else { + $list[] = (string)$r->platform_name; + } + } } return array_unique($list); } +// get platforms from app.php?xml=1 (deprecated) +// function get_platforms2($url) { $url .= 'apps.php?xml=1'; $x = file_get_contents($url); if (!$x) return null; - $cursor = 0; + $s = new SimpleXMLElement($x); $list = null; - $tag = ''; - while (1) { - $p = parse_next_element($x, $tag, $cursor); - if (!$p) break; - $list[] = $p; + foreach($s->application as $a) { + foreach ($a->version as $v) { + if (!array_key_exists('platform_short', $v)) continue; + $p = $v->platform_short[0]; + $pc = ""; + if (array_key_exists('plan_class', $v)) { + $pc = $v->plan_class[0]; + } + if (strlen($pc)) { + $list[] = $p.'['.$pc.']'; + } else { + $list[] = $p; + } + } } return array_unique($list); } @@ -126,6 +152,9 @@ function get_platforms_string($url) { } //echo get_platforms_string("http://www.worldcommunitygrid.org/"); +//echo get_platforms_string("http://setiathome.berkeley.edu/"); +//echo get_platforms_string("http://dist.ist.tugraz.at/cape5/"); +//print_r(get_platforms2("http://www.primegrid.com/")); function wfPlatforms() { global $wgParser; diff --git a/doc/project_list.php b/doc/project_list.php index 7db40bd197..174ef07e2e 100644 --- a/doc/project_list.php +++ b/doc/project_list.php @@ -52,13 +52,13 @@ foreach($proj_list as $p) { $platforms = get_platforms_cached($p->web_url); if ($platforms) { echo " \n"; - foreach ($platforms as $p) { - if ($p == 'Unknown') continue; - echo " $p\n"; + foreach ($platforms as $platform) { + if ($platform == 'Unknown') continue; + echo " $platform\n"; } echo " \n"; } - if ($p->image) { + if (isset($p->image)) { echo " http://boinc.berkeley.edu/images/$p->image "; }