Demonstrate how to use parallel
TODO:
- Logs and controlling running processes.
- Exit codes and summarisation.
brew install parallel
man parallel
man parallel_tutorial
# suppress the citation request.
parallel --citation
# get the number of processors parallel can see
nproc
parallel --number-of-cpus
parallel --number-of-cores
# invoke commands
parallel --verbose echo {} ::: A B C
# tagging process outputs
parallel --tag echo foo-{} ::: A B C
# call an external process
parallel --tag --verbose ./workload.sh ::: A B C
# call an external process (throttle concurrency)
parallel -j 2 --tag --verbose ./workload.sh ::: A B C D E F G
parallel -j 5 --tag --verbose ./workload.sh ::: A B C D E F G