0.8.1.0
This commit is contained in:
22
Yuba.php
22
Yuba.php
@@ -127,6 +127,21 @@ if (!empty($generators)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Parallel check
|
||||
//////////////////////////////////////////
|
||||
|
||||
$physicalcpu = trim(shell_exec("sysctl -n hw.physicalcpu"));
|
||||
|
||||
if ($p['parallel'] > $physicalcpu) {
|
||||
alert("Parallel hardware mismatch");
|
||||
echo "QUITAPP\n";
|
||||
}
|
||||
if ($p['parallel'] == 1) {
|
||||
$wopt_parallelmsg = "max";
|
||||
} else {
|
||||
$wopt_parallelmsg = $p['parallel'];
|
||||
}
|
||||
|
||||
// Banner
|
||||
//////////////////////////////////////////
|
||||
|
||||
@@ -138,6 +153,7 @@ echo msg($banner."\n".str_repeat("-", strlen($banner)));
|
||||
// System Info
|
||||
//////////////////////////////////////////
|
||||
|
||||
echo msg("Using ".$wopt_parallelmsg." cores");
|
||||
echo msg("Gathering system info...");
|
||||
|
||||
// Disks
|
||||
@@ -606,10 +622,12 @@ $dbp->exec("CREATE TABLE IF NOT EXISTS contents (fid TEXT, created INTEGER, rela
|
||||
if (file_exists($batchfile)) {
|
||||
|
||||
echo ProgressBar::start($passed_file,"Running batch (".stepString().")");
|
||||
if ($p['parallel']) {
|
||||
if ($p['parallel'] === 0) {
|
||||
passthru("bash ".$batchfile);
|
||||
} elseif ($p['parallel'] === 1) {
|
||||
passthru($bin_parallel." < ".$batchfile);
|
||||
} else {
|
||||
passthru("bash ".$batchfile);
|
||||
passthru($bin_parallel." -j ".$p['parallel']." < ".$batchfile);
|
||||
}
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user