Usage: ./coordinate
--commands-file file1 --commands-file file2
--directory /dir/ect/ory - create one output file per tag in /dir/ect/ory
--erase-on-success - remove tag files when subcommand succeeds
--use-threads
--use-processes
--concurrency n
--verbose
--help
The goal of this program is to run n commands, m at a time, without any distorted output lines;
the output is carefully unified line by line and tagged by a parent thread/process.
You can use --use-threads for (all) I/O heavy workloads, and --use-processes for CPU heavy
workloads, or for a mix of I/O and CPU heavy workloads you should use --use-processes for that too.
--use-processes takes a little longer to start up, because it is forking, not just starting threads.
Although not intended for binary files (this program is mostly about text output), you can use a shell
command with a redirect to handle binary outputs.
Each commands file is of the form:
tag1:command1
tag2:command2
Tags are just used to keep track of which command output is from.
Commands are just *ix processes.
If you need timeouts, try any of the various "maxtime" commands available.
EG: /usr/bin/timeout or https://stromberg.dnsalias.org/~strombrg/maxtime.html
If you need line buffering (a pty), try stdbuf.
If you need a shell, try bash -c "shell-command".
You can place any of these in your commands file(s).
The default concurrency is the number of CPU cores (including hyperthreading) you have.
To run your commands serially, say, for debugging, use --concurrency 1
If you use --concurrency *4, that will multiple the concurrency by 4.
stderr (*ix file descriptor 2) is always merged into stdout (*ix file descriptor 1) in the outputs.
--verbose can be repeated for greater verbosity.
You can e-mail the author with questions or comments: