Commit efcb4c34 authored by David Gauchard's avatar David Gauchard
Browse files

+ option -c

parent 89bbe630
#!/bin/bash
time_limit=3600s
ncpu=$(nproc)
set -e
......@@ -10,11 +11,12 @@ help ()
Syntax: $1 [-t timelimit]
Start local executables concurrently,
limited by the number of cores reported by 'nproc' ($(nproc) on this host).
Start local executables concurrently, limited by default by the number of cores.
Logfiles are created for each executable (<execname>-log.txt).
Options:
-t timelimit (default: ${time_limit})
-t time-limit (default: ${time_limit})
-c concurrent number of executables (default: $(nproc) on this host)
EOF
exit 1
......@@ -23,13 +25,13 @@ EOF
while [ ! -z "$1" ]; do
case "$1" in
-t) time_limit="$2"; shift;;
-h) help "$0";;
-c) ncpu="$2"; shift;;
-h) help "$0";;
*) echo "argument $1 not understood"; help "$0"; exit 1;;
esac
shift
done
ncpu=$(nproc)
pids=.pid
mkdir -p ${pids}
......@@ -39,7 +41,7 @@ for exec in *; do
# must be executable
[ -x ${exec} ] || continue
# log file must not already exist
[ -r ${exec}-log.txt ] && { echo "${exec}: logfile already exists"; continue; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment