bug-parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

parallel: Error: Command line too long (19320 >= 15995)


From: Xingtian Yang
Subject: parallel: Error: Command line too long (19320 >= 15995)
Date: Mon, 18 Jan 2021 12:36:24 +0800

Dear All, 

Thank you for taking your time watching this. I’ve ran into an error regarding the limit of command line. I thought this might relevant with execve but the command “parallel —max-line-length-allowed” returned 131049. However, as shown in the subject the threshold I got is 15995.

I wrote my bash_script like this: 
‘''
#!/bin/bash
. <another_script>.sh # Import function defined in other script files. 

func main(){
A


func A(){
module load parallel;
source $(which env_parallel.bash)

env_parallel —env xxx —env xxx B {} ::: <args>
module unload parallel
}

func B(){ 
local input=$1
# Do something
}

If [[ ${#BASH_SOURCE[@]} -eq 1 ]]; then
main
fi
‘''

I also used a small script to recursively find out which shell/env variables are used in function B and use —env to only import variable names required. With all these operations, I still hit this command line too long error. The version of parallel is:
‘''
GNU parallel 20181222
Copyright (C) 2007-2018 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.

Web site: http://www.gnu.org/software/parallel

When using programs that use GNU Parallel to process data for publication
please cite as described in 'parallel --citation'.
‘''
Sorry I cannot offer you a minimal example to reproduce the issue. The function I called contains nested variables and self-defined functions from many other scripts. 

Pls enlighten me why the threshold I got is 15995 rather than 131049? And what could be a solution to this issue? 
THanks!

Best Regards!
Henry

reply via email to

[Prev in Thread] Current Thread [Next in Thread]