@@ -108,6 +108,10 @@ discard block |
||
108 | 108 | // If you include any links, prepend URL with $prefix |
109 | 109 | // if you need to open divs here close them in project_footer() |
110 | 110 | // |
111 | +/** |
|
112 | + * @param string $prefix |
|
113 | + * @param boolean $is_main |
|
114 | + */ |
|
111 | 115 | function project_banner($title, $prefix, $is_main) { |
112 | 116 | if ($is_main) { |
113 | 117 | echo '<img class="img-responsive" src="img/water.jpg">'; |
@@ -119,6 +123,11 @@ discard block |
||
119 | 123 | } |
120 | 124 | //$fixed_navbar = true; |
121 | 125 | |
126 | +/** |
|
127 | + * @param boolean $show_return |
|
128 | + * @param boolean $show_date |
|
129 | + * @param string $prefix |
|
130 | + */ |
|
122 | 131 | function project_footer($show_return, $show_date, $prefix) { |
123 | 132 | // If you include any links, prepend URL with $prefix |
124 | 133 | // |
@@ -32,6 +32,9 @@ discard block |
||
32 | 32 | // Parse form variables into XML, and return it. |
33 | 33 | // Also error-check values, and return errors in $errors->* |
34 | 34 | |
35 | +/** |
|
36 | + * @param string $name |
|
37 | + */ |
|
35 | 38 | function option($name, $val) { |
36 | 39 | $x = ($name == $val) ? "selected" : ""; |
37 | 40 | return "<option name='$name' $x>$name\n"; |
@@ -90,6 +93,10 @@ discard block |
||
90 | 93 | return $x; |
91 | 94 | } |
92 | 95 | |
96 | +/** |
|
97 | + * @param string $name |
|
98 | + * @param integer $max |
|
99 | + */ |
|
93 | 100 | function number_select($name, $max, $n) { |
94 | 101 | $sel = ($n == 0) ? "selected":""; |
95 | 102 | $x = "<select class=\"form-control input-sm\" name=$name> <option value=0 $sel>".tra("No limit")."</option>"; |
@@ -106,6 +113,9 @@ discard block |
||
106 | 113 | return tra("No limit"); |
107 | 114 | } |
108 | 115 | |
116 | +/** |
|
117 | + * @param stdClass $prefs |
|
118 | + */ |
|
109 | 119 | function project_specific_prefs_edit($prefs, $error=false) { |
110 | 120 | global $app_array; |
111 | 121 | if (COLOR_PREFS) { |
@@ -162,6 +172,9 @@ discard block |
||
162 | 172 | } |
163 | 173 | } |
164 | 174 | |
175 | +/** |
|
176 | + * @param boolean $error |
|
177 | + */ |
|
165 | 178 | function project_specific_prefs_parse_form(&$error) { |
166 | 179 | global $app_array; |
167 | 180 | $x = ""; |
@@ -216,6 +229,9 @@ discard block |
||
216 | 229 | return $x; |
217 | 230 | } |
218 | 231 | |
232 | +/** |
|
233 | + * @param stdClass $prefs |
|
234 | + */ |
|
219 | 235 | function project_specific_prefs_show($prefs, $columns=false) { |
220 | 236 | global $app_array; |
221 | 237 | if ($columns) { |
@@ -28,6 +28,9 @@ discard block |
||
28 | 28 | require_once("../inc/bolt_util.inc"); |
29 | 29 | require_once("../inc/util.inc"); |
30 | 30 | |
31 | +/** |
|
32 | + * @param string $tag |
|
33 | + */ |
|
31 | 34 | function debug_show_state($state, $tag) { |
32 | 35 | global $user; |
33 | 36 | global $refresh; |
@@ -82,6 +85,9 @@ discard block |
||
82 | 85 | |
83 | 86 | // A page is being shown to the user; make a record of it |
84 | 87 | // |
88 | +/** |
|
89 | + * @param integer $mode |
|
90 | + */ |
|
85 | 91 | function create_view($iter, $mode, $prev_view_id) { |
86 | 92 | global $user; |
87 | 93 | global $course; |
@@ -31,6 +31,10 @@ discard block |
||
31 | 31 | // If $selection is provided, and if it matches one of the entries in the file, |
32 | 32 | // it will be selected by default. |
33 | 33 | // |
34 | +/** |
|
35 | + * @param string $name |
|
36 | + * @param string $filename |
|
37 | + */ |
|
34 | 38 | function show_combo_box($name, $filename, $selection=null) { |
35 | 39 | echo "<select name=\"$name\" class=\"form-control\">\n"; |
36 | 40 | |
@@ -185,6 +189,9 @@ discard block |
||
185 | 189 | show_language_selection($profile); |
186 | 190 | } |
187 | 191 | |
192 | +/** |
|
193 | + * @param string $name |
|
194 | + */ |
|
188 | 195 | function show_textarea($name, $text) { |
189 | 196 | rowify("<textarea name=\"$name\" class=\"form-control\" rows=\"10\">" . $text . "</textarea>"); |
190 | 197 | } |
@@ -311,6 +318,9 @@ discard block |
||
311 | 318 | page_tail(); |
312 | 319 | } |
313 | 320 | |
321 | +/** |
|
322 | + * @param string $warning |
|
323 | + */ |
|
314 | 324 | function show_profile_form($profile, $warning=null) { |
315 | 325 | if ($profile) { |
316 | 326 | page_head(tra("Edit your profile"), null, null, null, boinc_recaptcha_get_head_extra()); |
@@ -178,6 +178,9 @@ |
||
178 | 178 | row2($x1, $x2, false, "20%"); |
179 | 179 | } |
180 | 180 | |
181 | +/** |
|
182 | + * @param string $text |
|
183 | + */ |
|
181 | 184 | function quote_text($text) { |
182 | 185 | $text = "[quote]" . $text . "[/quote]"; |
183 | 186 | return $text; |
@@ -29,6 +29,9 @@ discard block |
||
29 | 29 | // take a host.serialnum field (which may encode several GPUs) |
30 | 30 | // and extract the model name for the given vendor |
31 | 31 | // |
32 | +/** |
|
33 | + * @param string $vendor |
|
34 | + */ |
|
32 | 35 | function get_gpu_model($x, $vendor) { |
33 | 36 | $descs = explode("]", $x); |
34 | 37 | array_pop($descs); |
@@ -60,6 +63,10 @@ discard block |
||
60 | 63 | // $x->linux |
61 | 64 | // $x->mac |
62 | 65 | // |
66 | +/** |
|
67 | + * @param string $vendor |
|
68 | + * @param string $alt_vendor |
|
69 | + */ |
|
63 | 70 | function get_gpu_list($vendor, $alt_vendor=null) { |
64 | 71 | $clause = "plan_class like '%$vendor%'"; |
65 | 72 | if ($alt_vendor) { |
@@ -144,6 +151,9 @@ discard block |
||
144 | 151 | return $x1->avg_time > $x2->avg_time; |
145 | 152 | } |
146 | 153 | |
154 | +/** |
|
155 | + * @param string $name |
|
156 | + */ |
|
147 | 157 | function show_list($models, $name) { |
148 | 158 | echo "<td><h2>$name</h2>\n"; |
149 | 159 | if (!count($models)) { |
@@ -18,6 +18,9 @@ |
||
18 | 18 | |
19 | 19 | require_once("../inc/util.inc"); |
20 | 20 | |
21 | +/** |
|
22 | + * @param integer $t |
|
23 | + */ |
|
21 | 24 | function rsc_name($t) { |
22 | 25 | switch ($t) { |
23 | 26 | case 2: return tra("CPU"); |
@@ -20,6 +20,9 @@ |
||
20 | 20 | require_once("../inc/util.inc"); |
21 | 21 | require_once("../inc/host.inc"); |
22 | 22 | |
23 | +/** |
|
24 | + * @param string $msg |
|
25 | + */ |
|
23 | 26 | function fail($msg) { |
24 | 27 | echo "Error: $msg"; |
25 | 28 | page_tail(); |
@@ -30,6 +30,9 @@ discard block |
||
30 | 30 | // |
31 | 31 | // output: success flag, CPU time per step, est. disk usage per job |
32 | 32 | // |
33 | +/** |
|
34 | + * @param resource $p |
|
35 | + */ |
|
33 | 36 | function terminate_job($p) { |
34 | 37 | $pstatus=proc_get_status($p); |
35 | 38 | $ppid=$pstatus['pid']; |
@@ -86,6 +89,9 @@ discard block |
||
86 | 89 | return array($test_result, $total_cpu, $disk_space); |
87 | 90 | } |
88 | 91 | |
92 | +/** |
|
93 | + * @param string $cmd_file |
|
94 | + */ |
|
89 | 95 | function get_total_steps($cmd_file) { |
90 | 96 | $fd = fopen($cmd_file,"r"); |
91 | 97 | if (!$fd) { |
@@ -116,6 +122,9 @@ discard block |
||
116 | 122 | return $total_steps; |
117 | 123 | } |
118 | 124 | |
125 | +/** |
|
126 | + * @param string $filename |
|
127 | + */ |
|
119 | 128 | function calc_step_cpu($filename) { |
120 | 129 | $fd = fopen("$filename", "r"); |
121 | 130 | $start_line = "Step CPU "; |
@@ -169,6 +178,11 @@ discard block |
||
169 | 178 | return array($avg_cpu,$test_steps); |
170 | 179 | } |
171 | 180 | |
181 | +/** |
|
182 | + * @param string $lammps_script |
|
183 | + * @param string $structure_file |
|
184 | + * @param string $cmd_file |
|
185 | + */ |
|
172 | 186 | function calc_est_size($lammps_script, $structure_file, $cmd_file,$test_steps){ |
173 | 187 | $dump_types = 0; |
174 | 188 | $fd = fopen($lammps_script,"r"); |
@@ -280,6 +294,11 @@ discard block |
||
280 | 294 | |
281 | 295 | // verify that an input file exists in sandbox, and return its physical path |
282 | 296 | // |
297 | +/** |
|
298 | + * @param string $name |
|
299 | + * |
|
300 | + * @return string |
|
301 | + */ |
|
283 | 302 | function get_file_path($user, $name) { |
284 | 303 | $fname = get_str($name); |
285 | 304 | |
@@ -308,6 +327,10 @@ discard block |
||
308 | 327 | // |
309 | 328 | // Note: these are both extremely optimistic estimates |
310 | 329 | // |
330 | +/** |
|
331 | + * @param integer $njobs |
|
332 | + * @param double $flops_per_job |
|
333 | + */ |
|
311 | 334 | function estimated_makespan($njobs, $flops_per_job) { |
312 | 335 | $nhosts = BoincHost::count("expavg_credit > 1"); |
313 | 336 | if ($nhosts < 10) { |
@@ -416,6 +439,9 @@ discard block |
||
416 | 439 | page_tail(); |
417 | 440 | } |
418 | 441 | |
442 | +/** |
|
443 | + * @param integer $i |
|
444 | + */ |
|
419 | 445 | function submit_job($app, $batch_id, $info, $cmdline, $i) { |
420 | 446 | $client_disk=$info->rsc_disk_bound*2; |
421 | 447 | if($client_disk<500000000) $client_disk=500000000; |