GNU Parallel
![]() For people who live life in the parallel lane. |
If you use xargs and tee today you will find GNU parallel very easy to use as GNU parallel is written to have the same options as xargs. If you write loops in shell, you will find GNU parallel may be able to replace most of the loops and make them run faster by running several jobs in parallel.
GNU parallel makes sure output from the commands is the same output as you would get had you run the commands sequentially. This makes it possible to use output from GNU parallel as input for other programs.
For each line of input GNU parallel will execute command with the line as arguments. If no command is given, the line of input is executed. Several lines will be run in parallel. GNU parallel can often be used as a substitute for xargs or cat | bash.
Downloading GNU Parallel
GNU parallel can be found on the main GNU ftp server: http://ftp.gnu.org/gnu/parallel/ (via HTTP) and ftp://ftp.gnu.org/gnu/parallel/ (via FTP). It can also be found on the GNU mirrors; please use a mirror if possible.
Official packages exist for:
- GNU Guix (https://www.gnu.org/software/guix/packages/P/).
- Ubuntu Quantal (https://launchpad.net/ubuntu/quantal/i386/parallel/20120422-1).
- Debian Jessie (https://packages.debian.org/jessie/parallel), Wheezy (http://packages.debian.org/wheezy/parallel), and Sid (http://packages.debian.org/sid/parallel).
- Gentoo (http://packages.gentoo.org/package/sys-process/parallel).
- FreeBSD (http://www.freshports.org/sysutils/parallel/).
- Fedora (https://apps.fedoraproject.org/packages/parallel).
- CERN Centos 7 (http://linuxsoft.cern.ch/cern/centos/7/cern/x86_64/repoview/parallel.html).
- Arch Linux (http://www.archlinux.org/packages/community/any/parallel/).
- Alpine Linux (http://pkgs.alpinelinux.org/package/edge/main/x86_64/parallel).
- OpenBSD (https://ftp.eu.openbsd.org/pub/OpenBSD/6.2/packages/amd64/parallel-20170222.tgz).
- NetBSD (http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/parallel/parallel/README.html).
- DragonFlyBSD (http://ftp.dragonflybsd.org/dports/dragonfly:5.2:x86:64/LATEST/All/).
- OpenSUSE (https://build.opensuse.org/package/show/home:tange/parallel).
- Mandriva (http://rpm.pbone.net/index.php3/stat/4/idpl/14460936/dir/mandriva_2009/com/parallel-20100822-1mdv2009.1.i586.rpm.html).
- Alt Linux (http://sisyphus.ru/ru/srpm/parallel).
- Mageia Linux (http://mageia.madb.org/package/show/application/0/name/parallel).
- Amazon Linux (https://aws.amazon.com/amazon-linux-ami/2017.09-packages/).
- MacOS FINK (http://pdb.finkproject.org/pdb/package.php/parallel).
- Zero install (http://git.savannah.gnu.org/cgit/parallel.git/tree/packager/0install).
- Solaris 11.2 (http://www.oracle.com/technetwork/server-storage/solaris11/documentation/solaris11-2-whatsnew-2191087.pdf).
Community maintained packages:
- Untested .rpm packages for CentOS, Fedora, Mandriva, RedHat, and SUSE and .debs for Debian, xUbuntu (https://build.opensuse.org/package/show/home:tange/parallel).
- Sun OpenCSW (https://www.opencsw.org/packages/CSWparallel/).
- AIX (http://www.perzl.org/aix/index.php?n=Main.Parallel).
Documentation
A lot of work has been put into making documentation for GNU parallel.
Start by watching the intro videos for a quick introduction: http://www.youtube.com/playlist?list=PL284C9FF2488BC6D1.
Then look at the EXAMPLEs in the man page. That will give you an idea of what GNU parallel is capable of.
Spend a few minute reading the output from parallel --help.
Then spend a few hours walking through the tutorial (man parallel_tutorial). Your command line will love you for it. Or you can read the book GNU parallel 2018 (source), which covers more or less the same.
Finally you may want to look at the rest of man parallel if you have special needs not already covered.
If you want to know the design decisions behind GNU parallel, try: man parallel_design. This is also a good intro if you intend to change GNU parallel.
The history of GNU parallel can be found at http://www.gnu.org/software/parallel/history.html.
For alternatives to GNU parallel see man parallel_alternatives.
There are separate man pages for man env_parallel, man sem, man parset, man parcat, GNU sql man sql, and GNU niceload man niceload.
Over the years GNU parallel has gotten more safety features (e.g. no silent data loss if the disk runs full in the middle of a job). These features cost performance. This graph shows the relative performance between each version.
Citation
When using GNU parallel for a publication please cite as per parallel --citation.
Mailing lists
GNU parallel has two mailing lists: <[email protected]> and <[email protected]>
The main discussion list is <[email protected]>, and is used to discuss uses of GNU parallel. Subscribe at http://lists.gnu.org/mailman/listinfo/parallel.
The discussion list <[email protected]>, is used to discuss development and enhancement requests, as well as bug reports. Your bug report should always include:
- The output of parallel --version. If you are not running the latest released version you should specify why you believe the problem is not fixed in that version.
- A complete example that others can run that shows the problem. A combination of seq, cat, echo, and sleep can reproduce most errors. If you example requires large files, see if you can use make them by something like seq 1000000 > file.
Announcements about GNU parallel and most other GNU software are made on <[email protected]>. Subscribe at http://lists.gnu.org/mailman/listinfo/info-gnu.
Getting involved
Development of GNU parallel, and GNU in general, is a volunteer effort, and you can contribute. For information, please read How to help GNU. If you'd like to get involved, it's a good idea to join the discussion mailing list (see above).
- Test releases
- Trying the latest test release (when available) is always appreciated. Test releases of GNU parallel can be found at http://alpha.gnu.org/gnu/parallel/ (via HTTP) and ftp://alpha.gnu.org/gnu/parallel/ (via FTP).
- Development
- For development sources, bug and patch trackers, and other information, please see the GNU parallel project page at savannah.gnu.org.
- Maintainer
- GNU parallel is currently being maintained by Ole Tange (http://ole.tange.dk). Please use the mailing lists for contact.
Merchandise
You can show your support for GNU parallel using our merchandise.
Licensing
GNU parallel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
When using GNU parallel for a publication please cite:
O. Tange (2018): GNU Parallel 2018, March 2018, https://doi.org/10.5281/zenodo.1146014.
GNU Operating System
![[FSF logo]](/National_Library/20181105034639im_/https://gnu.org/graphics/fsf-logo-notext-small.png)