Parallelize workers.

This commit is contained in:
2026-03-04 15:00:17 +01:00
parent b96a0a80d2
commit d264e49f4b
5 changed files with 169 additions and 32 deletions

View File

@@ -16,7 +16,7 @@ then
exit 1
fi
while getopts "t:s:" opt
while getopts "t:s:j:" opt
do
case "$opt" in
s)
@@ -26,6 +26,10 @@ do
t)
TRIALS="$OPTARG"
;;
j)
OPTIONS=("${OPTIONS[@]}" -j "$OPTARG")
JOBS=$OPTARG
;;
*)
>&2 echo "Uknown option $opt"
exit 1
@@ -36,6 +40,7 @@ done
echo "Calculating primes up to 1,000,000,000"
echo "Trials: $TRIALS"
echo "Sieve segment size: ${SIEVE:-"default"}"
echo "Number of jobs: ${JOBS:-"default"}"
TOTAL="0"
for _ in $(seq "$TRIALS")
do