Skip to content

Commit

Permalink
cores
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Feb 22, 2024
1 parent 3ebc461 commit 430f6be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions help/parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ jobs=$1
x=$2
if [ -z "${x}" ]; then x=1; fi

cores=$(echo "$(nproc) * ${x}" | bc)
args=(
'--halt-on-error=now,fail=1'
'--halt=now,fail=1'
'--retries=3'
'--load=8'
"--max-procs=$(echo "$(nproc) * ${x}" | bc)"
"--load="${cores}"
"--max-procs=${cores}"
)
uniq "${jobs}" | parallel "${args[@]}" "${SHELL}" -c

0 comments on commit 430f6be

Please sign in to comment.