GNU parameter doesn't work at all

I have been trying to use the GNU parallel for some time, but I could never get it to function at all!

For example, launch (in a non-empty directory!):

ls | parallel echo # Outputs single new line ls | parallel echo echo echo # Outputs three new lines. ls | parallel echo {} # /bin/bash: {}: command not found ls | parallel echo '{}' # /bin/bash: {}: command not found ls | parallel 'echo {}' # Outputs: {} ls | parallel -IMM 'echo MM' # Outputs: MM 

It seems that it simply executes each argument as a command, which makes no sense.

I tried bash, zsh, tcsh, csh and sh, to no avail.

+52
parallel-processing gnu xargs gnu-parallel
May 08 '13 at 19:39
source share
4 answers

Since I was about to complete this question, I ran parallel --version to report the version, only to find:

WARNING: YOU ARE USING --tollef. IF THINGS ARE PROBABLY USING --gnu.

I don’t understand why this flag is set by default. Needless to say, using --gnu works!

Thought I'd post this to save an hour of frustration and confusion.

EDIT: To fix this permanently (at least in Ubuntu), remove the --tollef flag in /etc/parallel/config

+85
May 08 '13 at 19:39
source share

Depending on your operating system, you should check if you are actually using the GNU version.

 $ parallel --version parallel: invalid option -- '-' parallel [OPTIONS] command -- arguments for each argument, run command with argument, in parallel parallel [OPTIONS] -- commands run specified commands in parallel 

If so, you are not using the GNU version. Ubuntu 12.04 is like that, and you need to manually set the GNU parallel to get the expected functionality.

+8
Oct 21 '13 at 19:48
source share

If problems are executed in parallel as an external command from FREEMAT (MATLAB lookalike); the File argument was not issued to the command correctly resolved by it:

  • Adding --gnu to options
  • Do not use cmdString syntax involving ["]

the code:

 cmdString = 'parallel --gnu command ::: '; while j<=jLength cmdString = [cmdString argumentFilePath(j,:) ' ']; j=j+1; end system(cmdString) 

Thanks for that :) Im on Ubuntu 12.04 as well.

+1
Mar 17 '14 at 7:26
source share

For me it was the same problem, but a different problem. Just executing the parallel command ended silently. parallel --version talking about the parallel --version invalid option error. There was only one parallel executable in my Path, but it still did not detect.

I was able to fix this as shown below :

  1. Run, whereis parallel . This gives all paths where executable files with a name in parallel are present. For my case, there was only one path /usr/local/bin/parallel . Running along this path works just fine.
  2. You can add an alias for this in the ~/.bashrc or ~/.zshrc e.g. alias parallel='/usr/local/bin/parallel'

And now parallel works like a charm.

 dev-dsk % parallel --version GNU parallel 20190322 Copyright (C) 2007-2019 Ole Tange and Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. GNU parallel comes with no warranty. 
0
Apr 14 '19 at 2:52
source share



All Articles