Parallel
β’ 209 words β’ 1 min β’ updated
Apparently there are two Unix-y ways to run commands in parallel:
- GNU parallel: https://www.gnu.org/software/parallel/
- moreutils parallel: https://www.gnu.org/software/parallel/
A simple example with wc -l:
GNU receives input from stdin:
find . -type f | parallel wc -lMoreutils receives input from command-line arguments:
parallel wc -l -- $(find . -type f)Style aside, the annoyance is that they are not compatible in Debian, Ubuntu and
macOS (homebrew), due to both having the parallel executable:
- https://superuser.com/questions/917577/how-can-i-install-gnu-parallel-alongside-moreutils-on-ubuntu-debian
- https://askubuntu.com/questions/1191516/what-happens-to-usr-bin-parallel-if-i-install-the-moreutils-on-top-of-the-paral
Debian thread wherein no consensus is achieved: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597050
I will stick to moreutils due to its simplicity and richer suite.
Nonetheless, it would be better if we didn’t have binary clashes like this. It
is really annoying and developer-unfriendly.
Of course, my favorite Linux distributions do not have this issue:
% apk info -L moreutils | grep parallel
usr/bin/parallel-moreutils…Alpine just installs parallel from moreutils with another name.
Arch Linux does the same:
mv "$pkgdir"/usr/bin/parallel "$pkgdir"/usr/bin/parallel-moreutilsMoreover, GNU Parallel has an annoying citation notice, which the Arch Linux package helpfully removes1.
-
Some context. Not everyone works in academia. Also it’s quite weird that the program is called “GNU parallel”, is published under the GPL, and yet does not seemingly follow the GPL guidelines. This is the official FAQ of the program. ↩︎