@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | function art_list_show($logos) { |
| 14 | 14 | shuffle($logos); |
| 15 | - foreach($logos as $logo) { |
|
| 15 | + foreach ($logos as $logo) { |
|
| 16 | 16 | $x0 = $logo[0]; |
| 17 | 17 | $x1 = $logo[1]; |
| 18 | 18 | echo "<tr> |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | " |
| 687 | 687 | ), |
| 688 | 688 | array("July 6, 2007", |
| 689 | - "Welcome to a new web site with cross-project BOINC statistics: |
|
| 689 | + "Welcome to a new web site with cross-project BOINC statistics: |
|
| 690 | 690 | <a href=http://statsnstones.tswb.org/>Team Starfire World BOINC Stats 'N Stones</a>." |
| 691 | 691 | ), |
| 692 | 692 | array("July 5, 2007", |
@@ -1430,7 +1430,7 @@ discard block |
||
| 1430 | 1430 | for announcements of new versions of BOINC client software." |
| 1431 | 1431 | ), |
| 1432 | 1432 | array("November 27, 2005", |
| 1433 | - "Check out <a href=https://uimon.cern.ch/twiki/pub/LHCAtHome/LinksAndDocs/boincciemat06.pdf>A BOINC seminar by Juan Antonio Lopez Perez of CERN</a>, |
|
| 1433 | + "Check out <a href=https://uimon.cern.ch/twiki/pub/LHCAtHome/LinksAndDocs/boincciemat06.pdf>A BOINC seminar by Juan Antonio Lopez Perez of CERN</a>, |
|
| 1434 | 1434 | presented at CIEMAT in Madrid, November 2005. |
| 1435 | 1435 | Also available in a |
| 1436 | 1436 | <a href=https://uimon.cern.ch/twiki/pub/LHCAtHome/LinksAndDocs/boincciematprint06.pdf>print version</a>." |
@@ -4,11 +4,11 @@ discard block |
||
| 4 | 4 | class PROJECT { |
| 5 | 5 | public $name; |
| 6 | 6 | public $resource_share; |
| 7 | - public $has_cpu; // whether it has a CPU app |
|
| 8 | - public $cpu_ncpus; // # CPUS used by CPU app |
|
| 9 | - public $cpu_flops; // speed of CPU app |
|
| 10 | - public $cpu_job_size; // size of jobs |
|
| 11 | - public $cpu_latency; // latency of CPU jobs |
|
| 7 | + public $has_cpu; // whether it has a CPU app |
|
| 8 | + public $cpu_ncpus; // # CPUS used by CPU app |
|
| 9 | + public $cpu_flops; // speed of CPU app |
|
| 10 | + public $cpu_job_size; // size of jobs |
|
| 11 | + public $cpu_latency; // latency of CPU jobs |
|
| 12 | 12 | |
| 13 | 13 | public $has_gpu; |
| 14 | 14 | public $gpu_ncpus; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | function big_scenario() { |
| 114 | 114 | $pp = array(); |
| 115 | - for ($i=0; $i<1; $i++) { |
|
| 115 | + for ($i = 0; $i < 1; $i++) { |
|
| 116 | 116 | $p = new PROJECT; |
| 117 | 117 | $p->name = "C_$i"; |
| 118 | 118 | $p->resource_share = 100; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $p->cpu_latency = 864000; |
| 124 | 124 | $pp[] = $p; |
| 125 | 125 | } |
| 126 | - for ($i=0; $i<1; $i++) { |
|
| 126 | + for ($i = 0; $i < 1; $i++) { |
|
| 127 | 127 | $p = new PROJECT; |
| 128 | 128 | $p->name = "G_$i"; |
| 129 | 129 | $p->resource_share = 100; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $p->gpu_latency = 864000; |
| 135 | 135 | $pp[] = $p; |
| 136 | 136 | } |
| 137 | - for ($i=0; $i<1; $i++) { |
|
| 137 | + for ($i = 0; $i < 1; $i++) { |
|
| 138 | 138 | $p = new PROJECT; |
| 139 | 139 | $p->name = "CG_$i"; |
| 140 | 140 | $p->resource_share = 100; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | require_once("../inc/util.inc"); |
| 26 | 26 | require_once("../inc/sim_util.inc"); |
| 27 | 27 | |
| 28 | -ini_set ("memory_limit", "1G"); |
|
| 28 | +ini_set("memory_limit", "1G"); |
|
| 29 | 29 | set_time_limit(0); |
| 30 | 30 | |
| 31 | 31 | function get_comments($dir) { |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $user = BoincUser::lookup_id($userid); |
| 64 | 64 | $date = date_str(filemtime("scenarios/$f")); |
| 65 | 65 | $nsims = nsims($f); |
| 66 | - $name = $user?$user->name:"???"; |
|
| 66 | + $name = $user ? $user->name : "???"; |
|
| 67 | 67 | echo "<tr> |
| 68 | 68 | <td><a href=sim_web.php?action=show_scenario&name=$f>$f</a></td> |
| 69 | 69 | <td>$name</td> |
@@ -185,10 +185,10 @@ |
||
| 185 | 185 | function graph_n_results2( |
| 186 | 186 | $title, $xlabel, $lab1, $lab2, $dir, $results1, $results2, $col |
| 187 | 187 | ) { |
| 188 | - for ($i=0; $i<2; $i++) { |
|
| 188 | + for ($i = 0; $i < 2; $i++) { |
|
| 189 | 189 | $data_fname = "$dir/cr_$i.dat"; |
| 190 | 190 | $f = fopen($data_fname, "w"); |
| 191 | - $rr = $i?$results2:$results1; |
|
| 191 | + $rr = $i ? $results2 : $results1; |
|
| 192 | 192 | foreach ($rr as $r) { |
| 193 | 193 | $r->write($f); |
| 194 | 194 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | if (0) { |
| 143 | - $duration = 50* 86400; |
|
| 143 | + $duration = 50*86400; |
|
| 144 | 144 | $p1 = new POLICY("JS_LOCAL"); |
| 145 | 145 | $p2 = new POLICY("JS_GLOBAL"); |
| 146 | 146 | $p2->use_rec = true; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $lo = 5*86400; |
| 171 | 171 | $hi = 40*86400; |
| 172 | 172 | $inc = 5*86400; |
| 173 | - $duration = 50* 86400; |
|
| 173 | + $duration = 50*86400; |
|
| 174 | 174 | compare_policy_params("Resource share violation", "REC half-life", "JS_LOCAL", "JS_GLOBAL", array("scen3"), $p1, $p2, $lo, $hi, $inc, "test7"); |
| 175 | 175 | } |
| 176 | 176 | |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | function canonical_plan_class($pc) { |
| 129 | - if (strstr($pc, "atiOpenCL")) return "opencl_ati"; |
|
| 130 | - if (strstr($pc, "nvidiaOpenCL")) return "opencl_nvidia"; |
|
| 131 | - if (strstr($pc, "intelOpenCL")) return "opencl_intel_gpu"; |
|
| 129 | + if (strstr($pc, "atiOpenCL")) return "opencl_ati"; |
|
| 130 | + if (strstr($pc, "nvidiaOpenCL")) return "opencl_nvidia"; |
|
| 131 | + if (strstr($pc, "intelOpenCL")) return "opencl_intel_gpu"; |
|
| 132 | 132 | return $pc; |
| 133 | 133 | } |
| 134 | 134 | |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | $u = urlencode($url); |
| 282 | 282 | $fname = "/home/boincadm/boinc/doc/platforms/$u"; |
| 283 | 283 | $t = @filemtime($fname); |
| 284 | - if (strstr($url, "gpugrid") || ($t && $t > time() - 604800)) { |
|
| 284 | + if (strstr($url, "gpugrid") || ($t && $t > time() - 604800)) { |
|
| 285 | 285 | return json_decode(file_get_contents($fname)); |
| 286 | 286 | } |
| 287 | 287 | $l = get_platforms($url); |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | libxml_use_internal_errors(true); |
| 229 | 229 | $s = simplexml_load_string($x); |
| 230 | 230 | $list = null; |
| 231 | - foreach($s->application as $a) { |
|
| 231 | + foreach ($s->application as $a) { |
|
| 232 | 232 | foreach ($a->version as $v) { |
| 233 | 233 | if (!array_key_exists('platform_short', $v)) continue; |
| 234 | 234 | $p = $v->platform_short[0]; |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | function make_friendly_string($l, $comma) { |
| 253 | 253 | if (!count($l)) return "Unknown"; |
| 254 | 254 | $fn = array(); |
| 255 | - foreach($l as $p) { |
|
| 255 | + foreach ($l as $p) { |
|
| 256 | 256 | $p = friendly_name($p); |
| 257 | 257 | if (!$p) continue; |
| 258 | 258 | $fn[] = $p; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $fn = array_unique($fn); |
| 261 | 261 | $x = ""; |
| 262 | 262 | $first = true; |
| 263 | - foreach($fn as $p) { |
|
| 263 | + foreach ($fn as $p) { |
|
| 264 | 264 | if ($first) { |
| 265 | 265 | $x .= "$p"; |
| 266 | 266 | $first = false; |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | |
| 304 | 304 | // return platforms as a human-readable string |
| 305 | 305 | // |
| 306 | -function get_platforms_string($url, $comma=true) { |
|
| 306 | +function get_platforms_string($url, $comma = true) { |
|
| 307 | 307 | $l = get_platforms_cached($url); |
| 308 | 308 | return make_friendly_string($l, $comma); |
| 309 | 309 | } |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | // |
| 335 | 335 | function wfPlatforms() { |
| 336 | 336 | global $wgParser; |
| 337 | - $wgParser->setHook( "platforms", "get_platforms_string" ); |
|
| 337 | + $wgParser->setHook("platforms", "get_platforms_string"); |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | $wgExtensionFunctions[] = "wfPlatforms"; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | shuffle($areas); |
| 61 | 61 | foreach ($areas as $area) { |
| 62 | 62 | $title = $area[0]; |
| 63 | - if (sizeof($area)==3) $title .= $area[2]; |
|
| 63 | + if (sizeof($area) == 3) $title .= $area[2]; |
|
| 64 | 64 | list_bar($title); |
| 65 | 65 | $projects = $area[1]; |
| 66 | 66 | shuffle($projects); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | foreach ($projects as $p) { |
| 69 | 69 | $img = ""; |
| 70 | 70 | if (array_key_exists(5, $p) && $p[5]) { |
| 71 | - $img= "<img align=right vspace=4 hspace=4 src=images/$p[5]>"; |
|
| 71 | + $img = "<img align=right vspace=4 hspace=4 src=images/$p[5]>"; |
|
| 72 | 72 | } |
| 73 | 73 | $desc = addslashes($p[4]); |
| 74 | 74 | $x = "<a href=$p[1] onmouseover=\"popup('$img <b>Sponsor:</b> $p[2]<hr><b>Area:</b> $p[3]<hr><b>Goal:</b> $desc')\">$p[0]</a>"; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | <td width=30% valign=top>$p</td> |
| 87 | 87 | </tr> |
| 88 | 88 | "; |
| 89 | - $n = 1-$n; |
|
| 89 | + $n = 1 - $n; |
|
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | list_end(); |
@@ -114,12 +114,12 @@ discard block |
||
| 114 | 114 | $projects[] = $p; |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | - usort($projects, $sort=="area"?'comp_area':'comp_name'); |
|
| 117 | + usort($projects, $sort == "area" ? 'comp_area' : 'comp_name'); |
|
| 118 | 118 | list_start("cellpadding=2 width=100%"); |
| 119 | 119 | list_heading_array(array( |
| 120 | - (($sort=="area")?"<a title='Sort by name' href=projects.php>Name</a>":"Name") |
|
| 120 | + (($sort == "area") ? "<a title='Sort by name' href=projects.php>Name</a>" : "Name") |
|
| 121 | 121 | ."<br><span class=note>Mouse over for details; click to visit web site</span>", |
| 122 | - ($sort!="area")?"<a title='Sort by category' href=projects.php?sort=area>Category</a>":"Category", |
|
| 122 | + ($sort != "area") ? "<a title='Sort by category' href=projects.php?sort=area>Category</a>" : "Category", |
|
| 123 | 123 | "Area", |
| 124 | 124 | "Sponsor", |
| 125 | 125 | "Supported platforms" |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | foreach ($projects as $p) { |
| 130 | 130 | $img = ""; |
| 131 | 131 | if (array_key_exists(5, $p) && $p[5]) { |
| 132 | - $img= "<img align=right vspace=4 hspace=4 src=images/$p[5]>"; |
|
| 132 | + $img = "<img align=right vspace=4 hspace=4 src=images/$p[5]>"; |
|
| 133 | 133 | } |
| 134 | 134 | $arg = "$img <b>Sponsor:</b> $p[2]<hr><b>Area:</b> $p[3]<hr><b>Goal:</b> $p[4]"; |
| 135 | 135 | $arg = addslashes($arg); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | <td width=30% valign=top>$p</td> |
| 157 | 157 | </tr> |
| 158 | 158 | "; |
| 159 | - $n = 1-$n; |
|
| 159 | + $n = 1 - $n; |
|
| 160 | 160 | } |
| 161 | 161 | list_end(); |
| 162 | 162 | } |
@@ -100,9 +100,9 @@ |
||
| 100 | 100 | if (strstr($vol->projects, "<")) boinc_error_page("No < allowed"); |
| 101 | 101 | $vol->availability = stripslashes($_GET['availability']); |
| 102 | 102 | if (strstr($vol->availability, "<")) boinc_error_page("No < allowed"); |
| 103 | - $vol->voice_ok = $_GET['voice_ok']?1:0; |
|
| 104 | - $vol->text_ok = $_GET['text_ok']?1:0; |
|
| 105 | - $vol->hide = $_GET['hide']?1:0; |
|
| 103 | + $vol->voice_ok = $_GET['voice_ok'] ? 1 : 0; |
|
| 104 | + $vol->text_ok = $_GET['text_ok'] ? 1 : 0; |
|
| 105 | + $vol->hide = $_GET['hide'] ? 1 : 0; |
|
| 106 | 106 | return $vol; |
| 107 | 107 | } |
| 108 | 108 | |