This commit is contained in:
2020-01-27 03:32:56 -08:00
parent 743ee4be1f
commit fbe2b8a7e8
10 changed files with 58 additions and 16 deletions

View File

@@ -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);