@@ -28,7 +28,9 @@ |
||
| 28 | 28 | while (1) { |
| 29 | 29 | $now = time(); |
| 30 | 30 | $wus = BoincWorkunit::enum("transition_time<$now limit 1"); |
| 31 | - if (count($wus) == 0) break; |
|
| 31 | + if (count($wus) == 0) { |
|
| 32 | + break; |
|
| 33 | + } |
|
| 32 | 34 | echo "Some WUs need transition - running transitioner.\n"; |
| 33 | 35 | $ret = system("bin/transitioner --one_pass"); |
| 34 | 36 | echo "ret: $ret\n"; |
@@ -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>." |
@@ -45,17 +45,29 @@ |
||
| 45 | 45 | return "<font size=-2>(no ratings)</font>"; |
| 46 | 46 | } |
| 47 | 47 | $x = $vol->rating_sum/$vol->nratings; |
| 48 | - if ($x > 4.5) $img = "stars-5-0.gif"; |
|
| 49 | - else if ($x > 4.0) $img = "stars-4-5.gif"; |
|
| 50 | - else if ($x > 3.5) $img = "stars-4-0.gif"; |
|
| 51 | - else if ($x > 3.0) $img = "stars-3-5.gif"; |
|
| 52 | - else if ($x > 2.5) $img = "stars-3-0.gif"; |
|
| 53 | - else if ($x > 2.0) $img = "stars-2-5.gif"; |
|
| 54 | - else if ($x > 1.5) $img = "stars-2-0.gif"; |
|
| 55 | - else if ($x > 1.0) $img = "stars-1-5.gif"; |
|
| 56 | - else if ($x > 0.5) $img = "stars-1-0.gif"; |
|
| 57 | - else if ($x > 0.0) $img = "stars-0-5.gif"; |
|
| 58 | - else $img = "stars-0-0.gif"; |
|
| 48 | + if ($x > 4.5) { |
|
| 49 | + $img = "stars-5-0.gif"; |
|
| 50 | + } else if ($x > 4.0) { |
|
| 51 | + $img = "stars-4-5.gif"; |
|
| 52 | + } else if ($x > 3.5) { |
|
| 53 | + $img = "stars-4-0.gif"; |
|
| 54 | + } else if ($x > 3.0) { |
|
| 55 | + $img = "stars-3-5.gif"; |
|
| 56 | + } else if ($x > 2.5) { |
|
| 57 | + $img = "stars-3-0.gif"; |
|
| 58 | + } else if ($x > 2.0) { |
|
| 59 | + $img = "stars-2-5.gif"; |
|
| 60 | + } else if ($x > 1.5) { |
|
| 61 | + $img = "stars-2-0.gif"; |
|
| 62 | + } else if ($x > 1.0) { |
|
| 63 | + $img = "stars-1-5.gif"; |
|
| 64 | + } else if ($x > 0.5) { |
|
| 65 | + $img = "stars-1-0.gif"; |
|
| 66 | + } else if ($x > 0.0) { |
|
| 67 | + $img = "stars-0-5.gif"; |
|
| 68 | + } else { |
|
| 69 | + $img = "stars-0-0.gif"; |
|
| 70 | + } |
|
| 59 | 71 | return " |
| 60 | 72 | <nobr><a href=help_ratings.php?volid=$vol->id> |
| 61 | 73 | <img border=0 src=images/help/$img> |
@@ -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> |
@@ -30,13 +30,21 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | function get_comments($dir) { |
| 32 | 32 | $d = "$dir/comments"; |
| 33 | - if (!is_dir($d)) return null; |
|
| 33 | + if (!is_dir($d)) { |
|
| 34 | + return null; |
|
| 35 | + } |
|
| 34 | 36 | $dd = opendir($d); |
| 35 | 37 | $x = ""; |
| 36 | 38 | while (false !== ($f = readdir($dd))) { |
| 37 | - if ($f == ".") continue; |
|
| 38 | - if ($f == "..") continue; |
|
| 39 | - if (strlen($x)) $x .= "<hr>\n"; |
|
| 39 | + if ($f == ".") { |
|
| 40 | + continue; |
|
| 41 | + } |
|
| 42 | + if ($f == "..") { |
|
| 43 | + continue; |
|
| 44 | + } |
|
| 45 | + if (strlen($x)) { |
|
| 46 | + $x .= "<hr>\n"; |
|
| 47 | + } |
|
| 40 | 48 | $userid = (int)file_get_contents("$d/$f/userid"); |
| 41 | 49 | $user = BoincUser::lookup_id($userid); |
| 42 | 50 | $comment = file_get_contents("$d/$f/comment"); |
@@ -50,8 +58,12 @@ discard block |
||
| 50 | 58 | $d = opendir("scenarios/$scen/simulations"); |
| 51 | 59 | $n = 0; |
| 52 | 60 | while (false !== ($f = readdir($d))) { |
| 53 | - if ($f == ".") continue; |
|
| 54 | - if ($f == "..") continue; |
|
| 61 | + if ($f == ".") { |
|
| 62 | + continue; |
|
| 63 | + } |
|
| 64 | + if ($f == "..") { |
|
| 65 | + continue; |
|
| 66 | + } |
|
| 55 | 67 | $n++; |
| 56 | 68 | } |
| 57 | 69 | return $n; |
@@ -174,8 +186,12 @@ discard block |
||
| 174 | 186 | $d = opendir("scenarios"); |
| 175 | 187 | $dirs = array(); |
| 176 | 188 | while (false !== ($f = readdir($d))) { |
| 177 | - if ($f === ".") continue; |
|
| 178 | - if ($f === "..") continue; |
|
| 189 | + if ($f === ".") { |
|
| 190 | + continue; |
|
| 191 | + } |
|
| 192 | + if ($f === "..") { |
|
| 193 | + continue; |
|
| 194 | + } |
|
| 179 | 195 | $dirs[] = $f; |
| 180 | 196 | } |
| 181 | 197 | rsort($dirs); |
@@ -338,7 +354,9 @@ discard block |
||
| 338 | 354 | $dirs = array(); |
| 339 | 355 | $s = opendir("$d/simulations"); |
| 340 | 356 | while (false !== ($f = readdir($s))) { |
| 341 | - if (!is_numeric($f)) continue; |
|
| 357 | + if (!is_numeric($f)) { |
|
| 358 | + continue; |
|
| 359 | + } |
|
| 342 | 360 | $dirs[] = $f; |
| 343 | 361 | } |
| 344 | 362 | rsort($dirs); |
@@ -515,7 +533,9 @@ discard block |
||
| 515 | 533 | } |
| 516 | 534 | |
| 517 | 535 | $action = get_str("action", true); |
| 518 | -if (!$action) $action = post_str("action", true); |
|
| 536 | +if (!$action) { |
|
| 537 | + $action = post_str("action", true); |
|
| 538 | +} |
|
| 519 | 539 | |
| 520 | 540 | switch ($action) { |
| 521 | 541 | case "create_scenario_form": |
@@ -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 | |
@@ -111,7 +111,9 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | function vol_lookup($id) { |
| 113 | 113 | $result = mysql_query("select * from volunteer where id=$id"); |
| 114 | - if (!$result) return null; |
|
| 114 | + if (!$result) { |
|
| 115 | + return null; |
|
| 116 | + } |
|
| 115 | 117 | $vol = mysql_fetch_object($result); |
| 116 | 118 | mysql_free_result($result); |
| 117 | 119 | return $vol; |
@@ -120,7 +122,9 @@ discard block |
||
| 120 | 122 | function vol_lookup_email($email) { |
| 121 | 123 | $email = mysql_real_escape_string($email); |
| 122 | 124 | $result = mysql_query("select * from volunteer where email_addr='$email'"); |
| 123 | - if (!$result) return null; |
|
| 125 | + if (!$result) { |
|
| 126 | + return null; |
|
| 127 | + } |
|
| 124 | 128 | $vol = mysql_fetch_object($result); |
| 125 | 129 | mysql_free_result($result); |
| 126 | 130 | return $vol; |
@@ -129,7 +133,9 @@ discard block |
||
| 129 | 133 | function vol_lookup_name($name) { |
| 130 | 134 | $name = mysql_real_escape_string($name); |
| 131 | 135 | $result = mysql_query("select * from volunteer where name='$name'"); |
| 132 | - if (!$result) return null; |
|
| 136 | + if (!$result) { |
|
| 137 | + return null; |
|
| 138 | + } |
|
| 133 | 139 | $vol = mysql_fetch_object($result); |
| 134 | 140 | mysql_free_result($result); |
| 135 | 141 | return $vol; |
@@ -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 | } |
@@ -60,7 +60,9 @@ |
||
| 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) { |
|
| 64 | + $title .= $area[2]; |
|
| 65 | + } |
|
| 64 | 66 | list_bar($title); |
| 65 | 67 | $projects = $area[1]; |
| 66 | 68 | shuffle($projects); |