@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | // |
| 102 | 102 | function unzip_batch_file($user, $batch_file) { |
| 103 | 103 | @mkdir("../../buda_batches"); |
| 104 | - for ($i=0; $i<1000; $i++) { |
|
| 104 | + for ($i = 0; $i < 1000; $i++) { |
|
| 105 | 105 | $batch_dir = "../../buda_batches/$i"; |
| 106 | 106 | $batch_dir_name = $i; |
| 107 | 107 | $ret = @mkdir($batch_dir); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | $job_files = []; |
| 154 | 154 | $cmdline = ''; |
| 155 | - foreach(scandir("$batch_dir/$fname") as $f2) { |
|
| 155 | + foreach (scandir("$batch_dir/$fname") as $f2) { |
|
| 156 | 156 | if ($f2[0] == '.') continue; |
| 157 | 157 | if ($f2 == 'cmdline') { |
| 158 | 158 | $cmdline = trim(file_get_contents("$batch_dir/$fname/cmdline")); |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | function stage_input_files($batch_dir, $batch_desc, $batch_id) { |
| 207 | 207 | $n = count($batch_desc->shared_files); |
| 208 | 208 | $batch_desc->shared_files_phys_names = []; |
| 209 | - for ($i=0; $i<$n; $i++) { |
|
| 209 | + for ($i = 0; $i < $n; $i++) { |
|
| 210 | 210 | $path = sprintf('%s/%s', $batch_dir, $batch_desc->shared_files[$i]); |
| 211 | 211 | [$md5, $size] = $batch_desc->shared_file_infos[$i]; |
| 212 | 212 | $phys_name = sprintf('batch_%d_%s', $batch_id, $md5); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | foreach ($batch_desc->jobs as $job) { |
| 217 | 217 | $n = count($batch_desc->unshared_files); |
| 218 | 218 | $job->phys_names = []; |
| 219 | - for ($i=0; $i<$n; $i++) { |
|
| 219 | + for ($i = 0; $i < $n; $i++) { |
|
| 220 | 220 | $path = sprintf('%s/%s/%s', |
| 221 | 221 | $batch_dir, $job->dir, $batch_desc->unshared_files[$i] |
| 222 | 222 | ); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $job_cmds .= "$job_cmd\n"; |
| 256 | 256 | } |
| 257 | 257 | $wrapper_cmdline = sprintf('"%s %s"', |
| 258 | - $wrapper_verbose?'--verbose':'', |
|
| 258 | + $wrapper_verbose ? '--verbose' : '', |
|
| 259 | 259 | $cmdline |
| 260 | 260 | ); |
| 261 | 261 | $cmd = sprintf( |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | if ($max_runtime_days <= 0) error_page('bad runtime limit'); |
| 312 | 312 | if ($max_runtime_days > 100) error_page('bad runtime limit'); |
| 313 | 313 | |
| 314 | - $max_fpops = $max_runtime_days * AVG_CPU_FPOPS * 86400; |
|
| 314 | + $max_fpops = $max_runtime_days*AVG_CPU_FPOPS*86400; |
|
| 315 | 315 | |
| 316 | 316 | $exp_runtime_days = get_str('exp_runtime_days'); |
| 317 | 317 | if (!is_numeric($exp_runtime_days)) error_page('bad expected runtime'); |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | if ($exp_runtime_days > $max_runtime_days) { |
| 322 | 322 | error_page('exp must be < max runtime'); |
| 323 | 323 | } |
| 324 | - $exp_fpops = $exp_runtime_days * AVG_CPU_FPOPS * 86400; |
|
| 324 | + $exp_fpops = $exp_runtime_days*AVG_CPU_FPOPS*86400; |
|
| 325 | 325 | |
| 326 | 326 | // unzip batch file into temp dir |
| 327 | 327 | $batch_dir_name = unzip_batch_file($user, $batch_file); |