Run many commands enparallel with a colourful overview.
Install from rubygems.org.
gem install enparallel-bin
The binary is called enparallel
.
Standard operation is to read lines from standard input, and execute a command once per entry, in parallel.
The placeholder {}
, if present, is replaced with each entry in turn.
seq 1 10 | enparallel sleep {}
To run a more complex command or to make use of shell functions or constructs
(the argument is run as a program) use a call to bash -c
. Note that
because of the -c
you need to prefix the command with --
to indicate the
end of parameters to enparallel.
seq 1 10 | enparallel -- bash -c "sleep {} && echo Slept for {}"
With --pick sequential
, tasks are picked from the list in order.
With --pick random
, tasks are picked from the list in a random order.
Usage:
enparallel [options] [--] <command>...
Description:
enparallel operates by reading lines from standard input, and executing
<command> once per entry, in parallel.
Options:
-w, --workers <n> Batch into a pool of <n> workers [default: N¹]
-p, --pick <type> Task-picking rule (see "Types") [default: sequential]
-v, --version Show version
Types:
sequential The order in which the tasks were queued
random Random order
¹ The default value for --workers
is what Ruby determines to be the number of CPUs on the current system. The value displayed in the help text is the value that will be used.
Run tests with just test
.
Code coverage is output to coverage/
.
Use just install
to build and install locally for testing.
Task logs are written out in SOML.
See SOML for more details.
Open an issue or send a pull request.