From 60e45b20eb73129d6e0b7354f9e10bdb846acd7f Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Fri, 27 Apr 2018 18:52:00 +0200 Subject: [PATCH] env_parallel: --session implemented. --- src/env_parallel.ash | 34 +- src/env_parallel.bash | 21 +- src/env_parallel.dash | 36 +- src/env_parallel.ksh | 32 +- src/env_parallel.sh | 22 +- src/env_parallel.zsh | 31 +- src/parallel | 11 +- src/parallel.pod | 13 +- testsuite/tests-to-run/parallel-local-ssh7.sh | 323 ++++++++++++++++-- testsuite/tests-to-run/parallel-local-ssh8.sh | 66 ++++ testsuite/tests-to-run/test32.sh | 34 -- testsuite/wanted-results/parallel-local-ssh7 | 121 +++++-- testsuite/wanted-results/parallel-local-ssh8 | 21 ++ testsuite/wanted-results/parallel-local-ssh9 | 2 +- testsuite/wanted-results/test32 | 21 -- 15 files changed, 632 insertions(+), 156 deletions(-) diff --git a/src/env_parallel.ash b/src/env_parallel.ash index f6228edd..043265ba 100755 --- a/src/env_parallel.ash +++ b/src/env_parallel.ash @@ -7,7 +7,7 @@ # after which 'env_parallel' works # # -# Copyright (C) 2017,2018 +# Copyright (C) 2016,2017,2018 # Ole Tange and Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify @@ -97,10 +97,14 @@ env_parallel() { "Run \"parallel --record-env\" in a clean environment first.\n"; } else { chomp(@ignored_vars = ); - $vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars; - print $vars ? "($vars)" : "(,,nO,,VaRs,,)"; } } + if($ENV{PARALLEL_IGNORED_NAMES}) { + push @ignored_vars, split/\s+/, $ENV{PARALLEL_IGNORED_NAMES}; + chomp @ignored_vars; + } + $vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars; + print $vars ? "($vars)" : "(,,nO,,VaRs,,)"; ' -- "$@" } @@ -129,7 +133,6 @@ env_parallel() { # which is /usr/bin/which # which is hashed (/usr/bin/which) # aliased to `alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' - # parallel is a tracked alias for /usr/local/bin/parallel (ksh) # Return 0 if found, 1 otherwise LANG=C type "$@" | perl -pe '$exit += (s/ is an alias for .*// || @@ -172,6 +175,17 @@ env_parallel() { return 0 fi + # --session + if perl -e 'exit grep { /^--session$/ } @ARGV' -- "$@"; then + true skip + else + PARALLEL_IGNORED_NAMES="`_names_of_ALIASES; + _names_of_FUNCTIONS; + _names_of_VARIABLES`" + export PARALLEL_IGNORED_NAMES + return 0 + fi + # Grep alias names _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES | xargs echo`" _list_alias_BODIES="_bodies_of_ALIASES $_alias_NAMES" @@ -280,16 +294,16 @@ _parset_main() { if perl -e 'exit not grep /,| /, @ARGV' "$_parset_name" ; then # $_parset_name contains , or space # Split on , or space to get the names - eval "$( + eval "` # Compute results into files $_parset_parallel_prg --files -k "$@" | - # var1=`cat tmpfile1; rm tmpfile1` - # var2=`cat tmpfile2; rm tmpfile2` - parallel -q echo {2}='`cat {1}; rm {1}`' :::: - :::+ $( + # var1= cat tmpfile1; rm tmpfile1 + # var2= cat tmpfile2; rm tmpfile2 + parallel -q echo {2}='\`cat {1}; rm {1}\`' :::: - :::+ \` echo "$_parset_name" | perl -pe 's/,/ /g' - ) - )" + \` + `" else # $_parset_name does not contain , or space # => $_parset_name is the name of the array to put data into diff --git a/src/env_parallel.bash b/src/env_parallel.bash index d67bfd94..f3e8941a 100755 --- a/src/env_parallel.bash +++ b/src/env_parallel.bash @@ -119,10 +119,14 @@ env_parallel() { "Run \"parallel --record-env\" in a clean environment first.\n"; } else { chomp(@ignored_vars = ); - $vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars; - print $vars ? "($vars)" : "(,,nO,,VaRs,,)"; } } + if($ENV{PARALLEL_IGNORED_NAMES}) { + push @ignored_vars, split/\s+/, $ENV{PARALLEL_IGNORED_NAMES}; + chomp @ignored_vars; + } + $vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars; + print $vars ? "($vars)" : "(,,nO,,VaRs,,)"; ' -- "$@" } @@ -195,6 +199,19 @@ env_parallel() { return 0 fi + # --session + # Bash is broken in version 3.2.25 and 4.2.39 + # The crazy '[ "`...`" == 0 ]' is needed for the same reason + if [ "`perl -e 'exit grep { /^--session$/ } @ARGV' -- "$@"; echo $?`" == 0 ] ; then + true skip + else + PARALLEL_IGNORED_NAMES="`_names_of_ALIASES; + _names_of_FUNCTIONS; + _names_of_VARIABLES`" + export PARALLEL_IGNORED_NAMES + return 0 + fi + # Grep alias names _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES | xargs echo`" _list_alias_BODIES="_bodies_of_ALIASES $_alias_NAMES" diff --git a/src/env_parallel.dash b/src/env_parallel.dash index baefb34e..1114ecac 100755 --- a/src/env_parallel.dash +++ b/src/env_parallel.dash @@ -7,7 +7,7 @@ # after which 'env_parallel' works # # -# Copyright (C) 2017,2018 +# Copyright (C) 2016,2017,2018 # Ole Tange and Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify @@ -55,7 +55,7 @@ env_parallel() { perl -ne '/^(\S+) is a function$/ and not $seen{$1}++ and print "$1\n"' } _bodies_of_FUNCTIONS() { - LANC=C type "$@" | perl -ne '/^(\S+) is a function$/ or print' + LANG=C type "$@" | perl -ne '/^(\S+) is a function$/ or print' } _names_of_VARIABLES() { # This may screw up if variables contain \n and = @@ -97,10 +97,14 @@ env_parallel() { "Run \"parallel --record-env\" in a clean environment first.\n"; } else { chomp(@ignored_vars = ); - $vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars; - print $vars ? "($vars)" : "(,,nO,,VaRs,,)"; } } + if($ENV{PARALLEL_IGNORED_NAMES}) { + push @ignored_vars, split/\s+/, $ENV{PARALLEL_IGNORED_NAMES}; + chomp @ignored_vars; + } + $vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars; + print $vars ? "($vars)" : "(,,nO,,VaRs,,)"; ' -- "$@" } @@ -129,7 +133,6 @@ env_parallel() { # which is /usr/bin/which # which is hashed (/usr/bin/which) # aliased to `alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' - # parallel is a tracked alias for /usr/local/bin/parallel (ksh) # Return 0 if found, 1 otherwise LANG=C type "$@" | perl -pe '$exit += (s/ is an alias for .*// || @@ -172,6 +175,17 @@ env_parallel() { return 0 fi + # --session + if perl -e 'exit grep { /^--session$/ } @ARGV' -- "$@"; then + true skip + else + PARALLEL_IGNORED_NAMES="`_names_of_ALIASES; + _names_of_FUNCTIONS; + _names_of_VARIABLES`" + export PARALLEL_IGNORED_NAMES + return 0 + fi + # Grep alias names _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES | xargs echo`" _list_alias_BODIES="_bodies_of_ALIASES $_alias_NAMES" @@ -280,16 +294,16 @@ _parset_main() { if perl -e 'exit not grep /,| /, @ARGV' "$_parset_name" ; then # $_parset_name contains , or space # Split on , or space to get the names - eval "$( + eval "` # Compute results into files $_parset_parallel_prg --files -k "$@" | - # var1=`cat tmpfile1; rm tmpfile1` - # var2=`cat tmpfile2; rm tmpfile2` - parallel -q echo {2}='`cat {1}; rm {1}`' :::: - :::+ $( + # var1= cat tmpfile1; rm tmpfile1 + # var2= cat tmpfile2; rm tmpfile2 + parallel -q echo {2}='\`cat {1}; rm {1}\`' :::: - :::+ \` echo "$_parset_name" | perl -pe 's/,/ /g' - ) - )" + \` + `" else # $_parset_name does not contain , or space # => $_parset_name is the name of the array to put data into diff --git a/src/env_parallel.ksh b/src/env_parallel.ksh index 533cf460..6bd28c9c 100755 --- a/src/env_parallel.ksh +++ b/src/env_parallel.ksh @@ -77,10 +77,14 @@ env_parallel() { "Run \"parallel --record-env\" in a clean environment first.\n"; } else { chomp(@ignored_vars = ); - $vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars; - print $vars ? "($vars)" : "(,,nO,,VaRs,,)"; } } + if($ENV{PARALLEL_IGNORED_NAMES}) { + push @ignored_vars, split/\s+/, $ENV{PARALLEL_IGNORED_NAMES}; + chomp @ignored_vars; + } + $vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars; + print $vars ? "($vars)" : "(,,nO,,VaRs,,)"; ' -- "$@" } @@ -109,7 +113,6 @@ env_parallel() { # which is /usr/bin/which # which is hashed (/usr/bin/which) # aliased to `alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' - # parallel is a tracked alias for /usr/local/bin/parallel (ksh) # Return 0 if found, 1 otherwise LANG=C type "$@" | perl -pe '$exit += (s/ is an alias for .*// || @@ -152,6 +155,17 @@ env_parallel() { return 0 fi + # --session + if perl -e 'exit grep { /^--session$/ } @ARGV' -- "$@"; then + true skip + else + PARALLEL_IGNORED_NAMES="`_names_of_ALIASES; + _names_of_FUNCTIONS; + _names_of_VARIABLES`" + export PARALLEL_IGNORED_NAMES + return 0 + fi + # Grep alias names _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES | xargs echo`" _list_alias_BODIES="_bodies_of_ALIASES $_alias_NAMES" @@ -260,16 +274,16 @@ _parset_main() { if perl -e 'exit not grep /,| /, @ARGV' "$_parset_name" ; then # $_parset_name contains , or space # Split on , or space to get the names - eval "$( + eval "` # Compute results into files $_parset_parallel_prg --files -k "$@" | - # var1=`cat tmpfile1; rm tmpfile1` - # var2=`cat tmpfile2; rm tmpfile2` - parallel -q echo {2}='`cat {1}; rm {1}`' :::: - :::+ $( + # var1= cat tmpfile1; rm tmpfile1 + # var2= cat tmpfile2; rm tmpfile2 + parallel -q echo {2}='\`cat {1}; rm {1}\`' :::: - :::+ \` echo "$_parset_name" | perl -pe 's/,/ /g' - ) - )" + \` + `" else # $_parset_name does not contain , or space # => $_parset_name is the name of the array to put data into diff --git a/src/env_parallel.sh b/src/env_parallel.sh index c86661a5..a9bfed54 100755 --- a/src/env_parallel.sh +++ b/src/env_parallel.sh @@ -7,7 +7,7 @@ # after which 'env_parallel' works # # -# Copyright (C) 2017,2018 +# Copyright (C) 2016,2017,2018 # Ole Tange and Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify @@ -98,10 +98,14 @@ env_parallel() { "Run \"parallel --record-env\" in a clean environment first.\n"; } else { chomp(@ignored_vars = ); - $vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars; - print $vars ? "($vars)" : "(,,nO,,VaRs,,)"; } } + if($ENV{PARALLEL_IGNORED_NAMES}) { + push @ignored_vars, split/\s+/, $ENV{PARALLEL_IGNORED_NAMES}; + chomp @ignored_vars; + } + $vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars; + print $vars ? "($vars)" : "(,,nO,,VaRs,,)"; ' -- "$@" } @@ -130,7 +134,6 @@ env_parallel() { # which is /usr/bin/which # which is hashed (/usr/bin/which) # aliased to `alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' - # parallel is a tracked alias for /usr/local/bin/parallel (ksh) # Return 0 if found, 1 otherwise LANG=C type "$@" | perl -pe '$exit += (s/ is an alias for .*// || @@ -173,6 +176,17 @@ env_parallel() { return 0 fi + # --session + if perl -e 'exit grep { /^--session$/ } @ARGV' -- "$@"; then + true skip + else + PARALLEL_IGNORED_NAMES="`_names_of_ALIASES; + _names_of_FUNCTIONS; + _names_of_VARIABLES`" + export PARALLEL_IGNORED_NAMES + return 0 + fi + # Grep alias names _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES | xargs echo`" _list_alias_BODIES="_bodies_of_ALIASES $_alias_NAMES" diff --git a/src/env_parallel.zsh b/src/env_parallel.zsh index 63c13ad3..a353fafe 100755 --- a/src/env_parallel.zsh +++ b/src/env_parallel.zsh @@ -72,10 +72,14 @@ env_parallel() { "Run \"parallel --record-env\" in a clean environment first.\n"; } else { chomp(@ignored_vars = ); - $vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars; - print $vars ? "($vars)" : "(,,nO,,VaRs,,)"; } } + if($ENV{PARALLEL_IGNORED_NAMES}) { + push @ignored_vars, split/\s+/, $ENV{PARALLEL_IGNORED_NAMES}; + chomp @ignored_vars; + } + $vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars; + print $vars ? "($vars)" : "(,,nO,,VaRs,,)"; ' -- "$@" } @@ -150,6 +154,17 @@ env_parallel() { return 0 fi + # --session + if perl -e 'exit grep { /^--session$/ } @ARGV' -- "$@"; then + true skip + else + PARALLEL_IGNORED_NAMES="`_names_of_ALIASES; + _names_of_FUNCTIONS; + _names_of_VARIABLES`" + export PARALLEL_IGNORED_NAMES + return 0 + fi + # Grep alias names _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES | xargs echo`" _list_alias_BODIES="_bodies_of_ALIASES $_alias_NAMES" @@ -258,16 +273,16 @@ _parset_main() { if perl -e 'exit not grep /,| /, @ARGV' "$_parset_name" ; then # $_parset_name contains , or space # Split on , or space to get the names - eval "$( + eval "` # Compute results into files $_parset_parallel_prg --files -k "$@" | - # var1=`cat tmpfile1; rm tmpfile1` - # var2=`cat tmpfile2; rm tmpfile2` - parallel -q echo {2}='`cat {1}; rm {1}`' :::: - :::+ $( + # var1= cat tmpfile1; rm tmpfile1 + # var2= cat tmpfile2; rm tmpfile2 + parallel -q echo {2}='\`cat {1}; rm {1}\`' :::: - :::+ \` echo "$_parset_name" | perl -pe 's/,/ /g' - ) - )" + \` + `" else # $_parset_name does not contain , or space # => $_parset_name is the name of the array to put data into diff --git a/src/parallel b/src/parallel index 49297417..74909f1f 100755 --- a/src/parallel +++ b/src/parallel @@ -1034,6 +1034,7 @@ sub options_hash { "trim=s" => \$opt::trim, "env=s" => \@opt::env, "recordenv|record-env" => \$opt::record_env, + "session" => \$opt::session, "plain" => \$opt::plain, "profile|J=s" => \@opt::profile, "pipe|spreadstdin" => \$opt::pipe, @@ -9131,9 +9132,11 @@ sub print_tag { sub free_ressources() { my $self = shift; - for my $fdno (sort { $a <=> $b } keys %Global::fd) { - close $self->fh($fdno,"w"); - close $self->fh($fdno,"r"); + if(not $opt::ungroup) { + for my $fdno (sort { $a <=> $b } keys %Global::fd) { + close $self->fh($fdno,"w"); + close $self->fh($fdno,"r"); + } } } @@ -11857,4 +11860,4 @@ sub unlock { $opt::x = $Semaphore::timeout = $Semaphore::wait = $Job::file_descriptor_warning_printed = $Global::envdef = @Arg::arg = -$Global::max_slot_number; +$Global::max_slot_number = $opt::session; diff --git a/src/parallel.pod b/src/parallel.pod index 9a55c290..1eda13dd 100644 --- a/src/parallel.pod +++ b/src/parallel.pod @@ -692,7 +692,7 @@ variables except for the ones mentioned in ~/.parallel/ignored_vars. To copy the full environment (both exported and not exported variables, arrays, and functions) use B. -See also: B<--record-env>. +See also: B<--record-env>, B<--session>. =item B<--eta> @@ -1548,7 +1548,7 @@ B<--memfree> may give better results, so try using that first. Record current environment variables in ~/.parallel/ignored_vars. This is useful before using B<--env _>. -See also B<--env>. +See also B<--env>, B<--session>. =item B<--recstart> I @@ -2030,6 +2030,15 @@ Use the replacement string I instead of B<{#}> for job sequence number. +=item B<--session> (alpha testing) + +Record names in current environment in B<$PARALLEL_IGNORED_NAMES> and +exit. Only used with B. Aliases, functions, and +variables with names in B<$PARALLEL_IGNORED_NAMES> will not be copied. + +See also B<--env>, B<--record-env>. + + =item B<--shebang> =item B<--hashbang> diff --git a/testsuite/tests-to-run/parallel-local-ssh7.sh b/testsuite/tests-to-run/parallel-local-ssh7.sh index 918fcc57..5e681351 100755 --- a/testsuite/tests-to-run/parallel-local-ssh7.sh +++ b/testsuite/tests-to-run/parallel-local-ssh7.sh @@ -387,7 +387,7 @@ par_sh_man() { env_parallel --env multivar echo '"$multivar"' ::: work env_parallel --env multivar -S server echo '"$multivar"' ::: work - # Arrays are not supported by sh + # Arrays are not supported env_parallel ::: true false true false echo exit value $? should be 2 @@ -1504,11 +1504,11 @@ par_bash_environment_too_big() { echo Rest should fail - bigvar="$(perl -e 'print "x"x123000')" + bigvar="$(perl -e 'print "x"x127000')" env_parallel echo ::: fail_bigvar env_parallel -S lo echo ::: fail_bigvar_remote - bigvar="$(perl -e 'print "\""x61000')" + bigvar="$(perl -e 'print "\""x64000')" env_parallel echo ::: fail_bigvar_quote env_parallel -S lo echo ::: fail_bigvar_quote_remote @@ -1517,7 +1517,7 @@ par_bash_environment_too_big() { env_parallel echo ::: fail_bigfunc env_parallel -S lo echo ::: fail_bigfunc_remote - eval 'bigfunc() { a="'"$(perl -e 'print "\""x122000')"'"; };' + eval 'bigfunc() { a="'"$(perl -e 'print "\""x127000')"'"; };' env_parallel echo ::: fail_bigfunc_quote env_parallel -S lo echo ::: fail_bigfunc_quote_remote @@ -1544,7 +1544,7 @@ par_dash_environment_too_big() { env_parallel echo ::: OK_bigvar_quote env_parallel -S lo echo ::: OK_bigvar_quote_remote -# Functions not supported in dash +# Functions not supported # bigvar=u # eval 'bigfunc() { a="'"$(perl -e 'print "x"x122000')"'"; };' # env_parallel echo ::: OK_bigfunc @@ -1565,7 +1565,7 @@ par_dash_environment_too_big() { env_parallel echo ::: fail_bigvar_quote env_parallel -S lo echo ::: fail_bigvar_quote_remote -# Functions not supported in dash +# Functions not supported # bigvar=u # eval 'bigfunc() { a="'"$(perl -e 'print "x"x1230000')"'"; };' # env_parallel echo ::: fail_bigfunc @@ -1610,20 +1610,20 @@ par_ksh_environment_too_big() { echo Rest should fail - bigvar="$(perl -e 'print "x"x122000')" + bigvar="$(perl -e 'print "x"x127000')" env_parallel echo ::: fail_bigvar env_parallel -S lo echo ::: fail_bigvar_remote - bigvar="$(perl -e 'print "\""x122000')" + bigvar="$(perl -e 'print "\""x128000')" env_parallel echo ::: fail_bigvar_quote env_parallel -S lo echo ::: fail_bigvar_quote_remote bigvar=u - eval 'bigfunc() { a="'"$(perl -e 'print "x"x122000')"'"; };' + eval 'bigfunc() { a="'"$(perl -e 'print "x"x129000')"'"; };' env_parallel echo ::: fail_bigfunc env_parallel -S lo echo ::: fail_bigfunc_remote - eval 'bigfunc() { a="'"$(perl -e 'print "\""x122000')"'"; };' + eval 'bigfunc() { a="'"$(perl -e 'print "\""x130000')"'"; };' env_parallel echo ::: fail_bigfunc_quote env_parallel -S lo echo ::: fail_bigfunc_quote_remote @@ -1646,7 +1646,7 @@ par_sh_environment_too_big() { env_parallel echo ::: OK_bigvar_quote env_parallel -S lo echo ::: OK_bigvar_quote_remote -# Functions not supported in sh +# Functions not supported # bigvar=u # eval 'bigfunc() { a="'"$(perl -e 'print "x"x122000')"'"; };' # env_parallel echo ::: OK_bigfunc @@ -1667,7 +1667,7 @@ par_sh_environment_too_big() { env_parallel echo ::: fail_bigvar_quote env_parallel -S lo echo ::: fail_bigvar_quote_remote -# Functions not supported in sh +# Functions not supported # bigvar=u # eval 'bigfunc() { a="'"$(perl -e 'print "x"x1230000')"'"; };' # env_parallel echo ::: fail_bigfunc @@ -1712,20 +1712,20 @@ par_zsh_environment_too_big() { echo Rest should fail - bigvar="$(perl -e 'print "x"x121000')" + bigvar="$(perl -e 'print "x"x126000')" env_parallel echo ::: fail_bigvar env_parallel -S lo echo ::: fail_bigvar_remote - bigvar="$(perl -e 'print "\""x121000')" + bigvar="$(perl -e 'print "\""x127000')" env_parallel echo ::: fail_bigvar_quote env_parallel -S lo echo ::: fail_bigvar_quote_remote bigvar=u - eval 'bigfunc() { a="'"$(perl -e 'print "x"x121000')"'"; };' + eval 'bigfunc() { a="'"$(perl -e 'print "x"x128000')"'"; };' env_parallel echo ::: fail_bigfunc env_parallel -S lo echo ::: fail_bigfunc_remote - eval 'bigfunc() { a="'"$(perl -e 'print "\""x121000')"'"; };' + eval 'bigfunc() { a="'"$(perl -e 'print "\""x129000')"'"; };' env_parallel echo ::: fail_bigfunc_quote env_parallel -S lo echo ::: fail_bigfunc_quote_remote @@ -1740,7 +1740,7 @@ par_ash_parset() { echo 'parset' . `which env_parallel.ash` -# Arrays not supported in ash +# Arrays not supported # echo '### parset into array' # parset arr1 echo ::: foo bar baz # echo ${arr1[0]} ${arr1[1]} ${arr1[2]} @@ -1759,7 +1759,7 @@ par_ash_parset() { echo "$newline2" echo "$newline3" -# Arrays not supported in ash +# Arrays not supported # echo '### parset into indexed array vars' # parset 'myarray[6],myarray[5],myarray[4]' echo ::: baz bar foo # echo ${myarray[*]} @@ -1771,10 +1771,10 @@ par_ash_parset() { } alias myecho='echo myecho "$myvar"' myvar="myvar" -# Arrays not supported in ash +# Arrays not supported # myarr=("myarr 0" "myarr 1" "myarr 2") mynewline="`echo newline1;echo newline2;`" -# Arrays not supported in ash +# Arrays not supported # env_parset arr1 myfun ::: foo bar baz # echo "${arr1[0]} ${arr1[1]} ${arr1[2]}" env_parset comma3,comma2,comma1 myecho ::: baz bar foo @@ -1785,7 +1785,7 @@ par_ash_parset() { echo "$newline1" echo "$newline2" echo "$newline3" -# Arrays not supported in ash +# Arrays not supported # env_parset 'myarray[6],myarray[5],myarray[4]' myfun ::: baz bar foo # echo "${myarray[*]}" # echo "${myarray[4]} ${myarray[5]} ${myarray[6]}" @@ -1857,7 +1857,7 @@ par_dash_parset() { echo 'parset' . `which env_parallel.dash` -# Arrays not supported in dash +# Arrays not supported # echo '### parset into array' # parset arr1 echo ::: foo bar baz # echo ${arr1[0]} ${arr1[1]} ${arr1[2]} @@ -1876,7 +1876,7 @@ par_dash_parset() { echo "$newline2" echo "$newline3" -# Arrays not supported in dash +# Arrays not supported # echo '### parset into indexed array vars' # parset 'myarray[6],myarray[5],myarray[4]' echo ::: baz bar foo # echo ${myarray[*]} @@ -1888,10 +1888,10 @@ par_dash_parset() { } alias myecho='echo myecho "$myvar"' myvar="myvar" -# Arrays not supported in dash +# Arrays not supported # myarr=("myarr 0" "myarr 1" "myarr 2") mynewline="`echo newline1;echo newline2;`" -# Arrays not supported in dash +# Arrays not supported # env_parset arr1 myfun ::: foo bar baz # echo "${arr1[0]} ${arr1[1]} ${arr1[2]}" env_parset comma3,comma2,comma1 myecho ::: baz bar foo @@ -1902,7 +1902,7 @@ par_dash_parset() { echo "$newline1" echo "$newline2" echo "$newline3" -# Arrays not supported in dash +# Arrays not supported # env_parset 'myarray[6],myarray[5],myarray[4]' myfun ::: baz bar foo # echo "${myarray[*]}" # echo "${myarray[4]} ${myarray[5]} ${myarray[6]}" @@ -2024,9 +2024,9 @@ par_sh_parset() { echo "$var2" echo "$var3" -# Arrays not supported in sh +# Arrays not supported # myarr=("myarr 0" "myarr 1" "myarr 2") -# Arrays not supported in sh +# Arrays not supported # env_parset arr1 myfun ::: foo bar baz # echo "${arr1[0]} ${arr1[1]} ${arr1[2]}" @@ -2042,7 +2042,7 @@ par_sh_parset() { echo "$newline1" echo "$newline2" echo "$newline3" -# Arrays not supported in sh +# Arrays not supported # env_parset 'myarray[6],myarray[5],myarray[4]' myfun ::: baz bar foo # echo "${myarray[*]}" # echo "${myarray[4]} ${myarray[5]} ${myarray[6]}" @@ -2118,10 +2118,273 @@ _EOF ssh zsh@lo "$myscript" } +### env_parallel_session + +par_ash_env_parallel_session() { + myscript=$(cat <<'_EOF' + . `which env_parallel.ash` + echo '### Test env_parallel --session' + + alias aliasbefore='echo before' +# Functions not supported +# varbefore='before' +# funcbefore() { echo 'before' "$@"; } +# Arrays not supported +# arraybefore=(array before) + env_parallel --session + # stuff defined + env_parallel aliasbefore ::: must_fail + env_parallel -S lo aliasbefore ::: must_fail +# Functions not supported +# env_parallel funcbefore ::: must_fail +# env_parallel -S lo funcbefore ::: must_fail + env_parallel echo '$varbefore' ::: no_before + env_parallel -S lo echo '$varbefore' ::: no_before +# Arrays not supported +# env_parallel echo '${arraybefore[*]}' ::: no_before +# env_parallel -S lo echo '${arraybefore[*]}' ::: no_before + alias aliasafter='echo after' + varafter='after' +# Functions not supported +# funcafter() { echo 'after' "$@"; } +# Arrays not supported +# arrayafter=(array after) + env_parallel aliasafter ::: aliasafter_OK + env_parallel -S lo aliasafter ::: aliasafter_OK +# Functions not supported +# env_parallel funcafter ::: funcafter_OK +# env_parallel -S lo funcafter ::: funcafter_OK + env_parallel echo '$varafter' ::: varafter_OK + env_parallel -S lo echo '$varafter' ::: varafter_OK +# Arrays not supported +# env_parallel echo '${arrayafter[*]}' ::: arrayafter_OK +# env_parallel -S lo echo '${arrayafter[*]}' ::: arrayafter_OK + unset PARALLEL_IGNORED_NAMES +_EOF + ) + ssh ash@lo "$myscript" +} + +par_bash_env_parallel_session() { + myscript=$(cat <<'_EOF' + echo '### Test env_parallel --session' + . `which env_parallel.bash` + + alias aliasbefore='echo before' + varbefore='before' + funcbefore() { echo 'before' "$@"; } + arraybefore=(array before) + env_parallel --session + # stuff defined + env_parallel aliasbefore ::: must_fail + env_parallel -S lo aliasbefore ::: must_fail + env_parallel funcbefore ::: must_fail + env_parallel -S lo funcbefore ::: must_fail + env_parallel echo '$varbefore' ::: no_before + env_parallel -S lo echo '$varbefore' ::: no_before + env_parallel echo '${arraybefore[*]}' ::: no_before + env_parallel -S lo echo '${arraybefore[*]}' ::: no_before + alias aliasafter='echo after' + varafter='after' + funcafter() { echo 'after' "$@"; } + arrayafter=(array after) + env_parallel aliasafter ::: aliasafter_OK + env_parallel -S lo aliasafter ::: aliasafter_OK + env_parallel funcafter ::: funcafter_OK + env_parallel -S lo funcafter ::: funcafter_OK + env_parallel echo '$varafter' ::: varafter_OK + env_parallel -S lo echo '$varafter' ::: varafter_OK + env_parallel echo '${arrayafter[*]}' ::: arrayafter_OK + env_parallel -S lo echo '${arrayafter[*]}' ::: arrayafter_OK + unset PARALLEL_IGNORED_NAMES +_EOF + ) + ssh bash@lo "$myscript" +} + +par_csh_env_parallel_session() { + echo Not implemented +} + +par_dash_env_parallel_session() { + myscript=$(cat <<'_EOF' + . `which env_parallel.dash` + echo '### Test env_parallel --session' + + alias aliasbefore='echo before' + varbefore='before' +# Functions not supported +# funcbefore() { echo 'before' "$@"; } +# Arrays not supported +# arraybefore=(array before) + env_parallel --session + # stuff defined + env_parallel aliasbefore ::: must_fail + env_parallel -S lo aliasbefore ::: must_fail +# Functions not supported +# env_parallel funcbefore ::: must_fail +# env_parallel -S lo funcbefore ::: must_fail + env_parallel echo '$varbefore' ::: no_before + env_parallel -S lo echo '$varbefore' ::: no_before +# Arrays not supported +# env_parallel echo '${arraybefore[*]}' ::: no_before +# env_parallel -S lo echo '${arraybefore[*]}' ::: no_before + alias aliasafter='echo after' + varafter='after' +# Functions not supported +# funcafter() { echo 'after' "$@"; } +# Arrays not supported +# arrayafter=(array after) + env_parallel aliasafter ::: aliasafter_OK + env_parallel -S lo aliasafter ::: aliasafter_OK +# Functions not supported +# env_parallel funcafter ::: funcafter_OK +# env_parallel -S lo funcafter ::: funcafter_OK + env_parallel echo '$varafter' ::: varafter_OK + env_parallel -S lo echo '$varafter' ::: varafter_OK +# Arrays not supported +# env_parallel echo '${arrayafter[*]}' ::: arrayafter_OK +# env_parallel -S lo echo '${arrayafter[*]}' ::: arrayafter_OK + unset PARALLEL_IGNORED_NAMES +_EOF + ) + ssh dash@lo "$myscript" +} + +par_fish_env_parallel_session() { + echo Not implemented +} + +par_ksh_env_parallel_session() { + myscript=$(cat <<'_EOF' + . `which env_parallel.ksh` + echo '### Test env_parallel --session' + + alias aliasbefore='echo before' + varbefore='before' + funcbefore() { echo 'before' "$@"; } + arraybefore=(array before) + env_parallel --session + # stuff defined + env_parallel aliasbefore ::: must_fail + env_parallel -S lo aliasbefore ::: must_fail + env_parallel funcbefore ::: must_fail + env_parallel -S lo funcbefore ::: must_fail + env_parallel echo '$varbefore' ::: no_before + env_parallel -S lo echo '$varbefore' ::: no_before + env_parallel echo '${arraybefore[*]}' ::: no_before + env_parallel -S lo echo '${arraybefore[*]}' ::: no_before + alias aliasafter='echo after' + varafter='after' + funcafter() { echo 'after' "$@"; } + arrayafter=(array after) + env_parallel aliasafter ::: aliasafter_OK + env_parallel -S lo aliasafter ::: aliasafter_OK + env_parallel funcafter ::: funcafter_OK + env_parallel -S lo funcafter ::: funcafter_OK + env_parallel echo '$varafter' ::: varafter_OK + env_parallel -S lo echo '$varafter' ::: varafter_OK + env_parallel echo '${arrayafter[*]}' ::: arrayafter_OK + env_parallel -S lo echo '${arrayafter[*]}' ::: arrayafter_OK + unset PARALLEL_IGNORED_NAMES +_EOF + ) + ssh ksh@lo "$myscript" +} + +par_sh_env_parallel_session() { + myscript=$(cat <<'_EOF' + . `which env_parallel.sh` + echo '### Test env_parallel --session' + + alias aliasbefore='echo before' + varbefore='before' +# Functions not supported +# funcbefore() { echo 'before' "$@"; } +# Arrays not supported +# arraybefore=(array before) + env_parallel --session + # stuff defined + env_parallel aliasbefore ::: must_fail + env_parallel -S lo aliasbefore ::: must_fail +# Functions not supported +# env_parallel funcbefore ::: must_fail +# env_parallel -S lo funcbefore ::: must_fail + env_parallel echo '$varbefore' ::: no_before + env_parallel -S lo echo '$varbefore' ::: no_before +# Arrays not supported +# env_parallel echo '${arraybefore[*]}' ::: no_before +# env_parallel -S lo echo '${arraybefore[*]}' ::: no_before + alias aliasafter='echo after' + varafter='after' + funcafter() { echo 'after' "$@"; } +# Arrays not supported +# arrayafter=(array after) + env_parallel aliasafter ::: aliasafter_OK + env_parallel -S lo aliasafter ::: aliasafter_OK +# Functions not supported +# env_parallel funcafter ::: funcafter_OK +# env_parallel -S lo funcafter ::: funcafter_OK + env_parallel echo '$varafter' ::: varafter_OK + env_parallel -S lo echo '$varafter' ::: varafter_OK +# Arrays not supported +# env_parallel echo '${arrayafter[*]}' ::: arrayafter_OK +# env_parallel -S lo echo '${arrayafter[*]}' ::: arrayafter_OK + unset PARALLEL_IGNORED_NAMES +_EOF + ) + ssh sh@lo "$myscript" +} + +par_tcsh_env_parallel_session() { + echo Not implemented +} + +par_zsh_env_parallel_session() { + myscript=$(cat <<'_EOF' + . `which env_parallel.zsh` + eval "`cat <<"_EOS"; + echo '### Test env_parallel --session' + + alias aliasbefore='echo before' + varbefore='before' + funcbefore() { echo 'before' "$@"; } + arraybefore=(array before) + env_parallel --session + # stuff defined + env_parallel aliasbefore ::: must_fail + env_parallel -S lo aliasbefore ::: must_fail + env_parallel funcbefore ::: must_fail + env_parallel -S lo funcbefore ::: must_fail + env_parallel echo '$varbefore' ::: no_before + env_parallel -S lo echo '$varbefore' ::: no_before + env_parallel echo '${arraybefore[*]}' ::: no_before + env_parallel -S lo echo '${arraybefore[*]}' ::: no_before + alias aliasafter='echo after' + varafter='after' + funcafter() { echo 'after' "$@"; } + arrayafter=(array after) + env_parallel aliasafter ::: aliasafter_OK + env_parallel -S lo aliasafter ::: aliasafter_OK + env_parallel funcafter ::: funcafter_OK + env_parallel -S lo funcafter ::: funcafter_OK + env_parallel echo '$varafter' ::: varafter_OK + env_parallel -S lo echo '$varafter' ::: varafter_OK + env_parallel echo '${arrayafter[*]}' ::: arrayafter_OK + env_parallel -S lo echo '${arrayafter[*]}' ::: arrayafter_OK + unset PARALLEL_IGNORED_NAMES +_EOS`" +_EOF + ) + ssh zsh@lo "$myscript" +} + export -f $(compgen -A function | grep par_) #compgen -A function | grep par_ | sort | parallel --delay $D -j$P --tag -k '{} 2>&1' #compgen -A function | grep par_ | sort | compgen -A function | grep par_ | sort -r | # parallel --joblog /tmp/jl-`basename $0` --delay $D -j$P --tag -k '{} 2>&1' parallel --joblog /tmp/jl-`basename $0` -j200% --tag -k '{} 2>&1' | - perl -pe 's/line \d\d\d:/line XXX:/' + perl -pe 's/line \d\d\d:/line XXX:/; + s/sh:? \d?\d\d:/sh: XXX:/; + s/sh\[\d+\]/sh[XXX]/;' diff --git a/testsuite/tests-to-run/parallel-local-ssh8.sh b/testsuite/tests-to-run/parallel-local-ssh8.sh index fa354d64..1f6bb961 100644 --- a/testsuite/tests-to-run/parallel-local-ssh8.sh +++ b/testsuite/tests-to-run/parallel-local-ssh8.sh @@ -87,6 +87,72 @@ par_bar_m() { uniq } +par_retries_1() { + echo '### Test of --retries - it should run 13 jobs in total'; + export PARALLEL="--retries 1 -S 12/localhost,1/:,parallel@parallel-server1 -uq" + seq 0 12 | + stdout parallel perl -e 'print "job{}\n";exit({})' | wc -l +} + +par_retries_2() { + echo '### Test of --retries - it should run 25 jobs in total'; + export PARALLEL="--retries 2 -S 12/localhost,1/:,parallel@parallel-server1 -uq" + seq 0 12 | + stdout parallel perl -e 'print "job{}\n";exit({})' | wc -l +} + +par_retries_4() { + echo '### Test of --retries - it should run 49 jobs in total'; + export PARALLEL="--retries 4 -S 12/localhost,1/:,parallel@parallel-server1 -uq" + seq 0 12 | + stdout parallel perl -e 'print "job{}\n";exit({})' | wc -l +} + +par_retries_bug_from_2010() { + echo '### Bug with --retries' + seq 1 8 | + parallel --retries 2 --sshlogin 8/localhost,8/: -j+0 "hostname; false" | + wc -l + seq 1 8 | + parallel --retries 2 --sshlogin 8/localhost,8/: -j+1 "hostname; false" | + wc -l + seq 1 2 | + parallel --retries 2 --sshlogin 8/localhost,8/: -j-1 "hostname; false" | + wc -l + seq 1 1 | + parallel --retries 2 --sshlogin 1/localhost,1/: -j1 "hostname; false" | + wc -l + seq 1 1 | + parallel --retries 2 --sshlogin 1/localhost,1/: -j9 "hostname; false" | + wc -l + seq 1 1 | + parallel --retries 2 --sshlogin 1/localhost,1/: -j0 "hostname; false" | + wc -l + + echo '### These were not affected by the bug' + seq 1 8 | + parallel --retries 2 --sshlogin 1/localhost,9/: -j-1 "hostname; false" | + wc -l + seq 1 8 | + parallel --retries 2 --sshlogin 8/localhost,8/: -j-1 "hostname; false" | + wc -l + seq 1 1 | + parallel --retries 2 --sshlogin 1/localhost,1/: "hostname; false" | + wc -l + seq 1 4 | + parallel --retries 2 --sshlogin 2/localhost,2/: -j-1 "hostname; false" | + wc -l + seq 1 4 | + parallel --retries 2 --sshlogin 2/localhost,2/: -j1 "hostname; false" | + wc -l + seq 1 4 | + parallel --retries 2 --sshlogin 1/localhost,1/: -j1 "hostname; false" | + wc -l + seq 1 2 | + parallel --retries 2 --sshlogin 1/localhost,1/: -j1 "hostname; false" | + wc -l +} + export -f $(compgen -A function | grep par_) #compgen -A function | grep par_ | sort | parallel --delay $D -j$P --tag -k '{} 2>&1' compgen -A function | grep par_ | sort | diff --git a/testsuite/tests-to-run/test32.sh b/testsuite/tests-to-run/test32.sh index d873b053..05a7907c 100644 --- a/testsuite/tests-to-run/test32.sh +++ b/testsuite/tests-to-run/test32.sh @@ -1,36 +1,2 @@ #!/bin/bash -#cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | nice timeout -k 1 40 parallel -j0 -k -L1 -echo '### Test of --retries - it should run 13 jobs in total'; - seq 0 12 | stdout parallel --retries 1 -S 12/localhost,1/:,parallel@parallel-server1 -uq \ - perl -e 'print "job{}\n";exit({})' | wc -l - -echo '### Test of --retries - it should run 25 jobs in total'; - seq 0 12 | stdout parallel --retries 2 -S 12/localhost,1/:,parallel@parallel-server1 -uq \ - perl -e 'print "job{}\n";exit({})' | wc -l - - -echo '### Test of --retries - it should run 49 jobs in total'; - seq 0 12 | stdout parallel --retries 4 -S 12/localhost,1/:,parallel@parallel-server1 -uq \ - perl -e 'print "job{}\n";exit({})' | wc -l - -#EOF -echo '### Bug with --retries' -seq 1 8 | parallel --retries 2 --sshlogin 8/localhost,8/: -j+0 "hostname; false" | wc -l -seq 1 8 | parallel --retries 2 --sshlogin 8/localhost,8/: -j+1 "hostname; false" | wc -l -seq 1 2 | parallel --retries 2 --sshlogin 8/localhost,8/: -j-1 "hostname; false" | wc -l -seq 1 1 | parallel --retries 2 --sshlogin 1/localhost,1/: -j1 "hostname; false" | wc -l -seq 1 1 | parallel --retries 2 --sshlogin 1/localhost,1/: -j9 "hostname; false" | wc -l -seq 1 1 | parallel --retries 2 --sshlogin 1/localhost,1/: -j0 "hostname; false" | wc -l -# Fails due to 0 jobslots -# seq 1 1 | parallel --retries 2 --sshlogin 1/localhost,1/: -j-1 "hostname; false" | wc -l - -echo '### These were not affected by the bug' -seq 1 8 | parallel --retries 2 --sshlogin 1/localhost,9/: -j-1 "hostname; false" | wc -l -seq 1 8 | parallel --retries 2 --sshlogin 8/localhost,8/: -j-1 "hostname; false" | wc -l -seq 1 1 | parallel --retries 2 --sshlogin 1/localhost,1/: "hostname; false" | wc -l -seq 1 4 | parallel --retries 2 --sshlogin 2/localhost,2/: -j-1 "hostname; false" | wc -l -seq 1 4 | parallel --retries 2 --sshlogin 2/localhost,2/: -j1 "hostname; false" | wc -l -seq 1 4 | parallel --retries 2 --sshlogin 1/localhost,1/: -j1 "hostname; false" | wc -l -seq 1 2 | parallel --retries 2 --sshlogin 1/localhost,1/: -j1 "hostname; false" | wc -l - diff --git a/testsuite/wanted-results/parallel-local-ssh7 b/testsuite/wanted-results/parallel-local-ssh7 index 968d4580..80186f84 100644 --- a/testsuite/wanted-results/parallel-local-ssh7 +++ b/testsuite/wanted-results/parallel-local-ssh7 @@ -216,6 +216,23 @@ par_zsh_environment_too_big env_parallel: Error: 2. Try running this in a clean par_zsh_environment_too_big env_parallel: Error: env_parallel --record-env par_zsh_environment_too_big env_parallel: Error: And then use '--env _' par_zsh_environment_too_big env_parallel: Error: For details see: man env_parallel +par_zsh_env_parallel_session ### Test env_parallel --session +par_zsh_env_parallel_session (eval):1: command not found: aliasbefore +par_zsh_env_parallel_session (eval):1: command not found: aliasbefore +par_zsh_env_parallel_session (eval):1: command not found: funcbefore +par_zsh_env_parallel_session (eval):1: command not found: funcbefore +par_zsh_env_parallel_session no_before +par_zsh_env_parallel_session no_before +par_zsh_env_parallel_session no_before +par_zsh_env_parallel_session no_before +par_zsh_env_parallel_session after aliasafter_OK +par_zsh_env_parallel_session after aliasafter_OK +par_zsh_env_parallel_session after funcafter_OK +par_zsh_env_parallel_session after funcafter_OK +par_zsh_env_parallel_session after varafter_OK +par_zsh_env_parallel_session after varafter_OK +par_zsh_env_parallel_session array after arrayafter_OK +par_zsh_env_parallel_session array after arrayafter_OK par_zsh_env_parallel OK par_zsh_env_parallel OK par_zsh_env_parallel alias line 1 @@ -338,6 +355,7 @@ par_tcsh_funky myvar works par_tcsh_funky space special chars problem par_tcsh_funky space special chars problem par_tcsh_environment_too_big Not implemented +par_tcsh_env_parallel_session Not implemented par_tcsh_env_parallel OK par_tcsh_env_parallel OK par_tcsh_env_parallel bug #50435: Remote fifo broke in 20150522 @@ -444,7 +462,7 @@ par_sh_environment_too_big OK_bigvar_remote par_sh_environment_too_big OK_bigvar_quote par_sh_environment_too_big OK_bigvar_quote_remote par_sh_environment_too_big Rest should fail -par_sh_environment_too_big sh: 136: perl: Argument list too long +par_sh_environment_too_big sh: XXX: perl: Argument list too long par_sh_environment_too_big env_parallel: Error: Your environment is too big. par_sh_environment_too_big env_parallel: Error: You can try 2 different approaches: par_sh_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -452,7 +470,7 @@ par_sh_environment_too_big env_parallel: Error: 2. Try running this in a clean e par_sh_environment_too_big env_parallel: Error: env_parallel --record-env par_sh_environment_too_big env_parallel: Error: And then use '--env _' par_sh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_sh_environment_too_big sh: 136: perl: Argument list too long +par_sh_environment_too_big sh: XXX: perl: Argument list too long par_sh_environment_too_big env_parallel: Error: Your environment is too big. par_sh_environment_too_big env_parallel: Error: You can try 2 different approaches: par_sh_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -460,7 +478,7 @@ par_sh_environment_too_big env_parallel: Error: 2. Try running this in a clean e par_sh_environment_too_big env_parallel: Error: env_parallel --record-env par_sh_environment_too_big env_parallel: Error: And then use '--env _' par_sh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_sh_environment_too_big sh: 136: perl: Argument list too long +par_sh_environment_too_big sh: XXX: perl: Argument list too long par_sh_environment_too_big env_parallel: Error: Your environment is too big. par_sh_environment_too_big env_parallel: Error: You can try 2 different approaches: par_sh_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -468,7 +486,7 @@ par_sh_environment_too_big env_parallel: Error: 2. Try running this in a clean e par_sh_environment_too_big env_parallel: Error: env_parallel --record-env par_sh_environment_too_big env_parallel: Error: And then use '--env _' par_sh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_sh_environment_too_big sh: 136: perl: Argument list too long +par_sh_environment_too_big sh: XXX: perl: Argument list too long par_sh_environment_too_big env_parallel: Error: Your environment is too big. par_sh_environment_too_big env_parallel: Error: You can try 2 different approaches: par_sh_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -476,6 +494,15 @@ par_sh_environment_too_big env_parallel: Error: 2. Try running this in a clean e par_sh_environment_too_big env_parallel: Error: env_parallel --record-env par_sh_environment_too_big env_parallel: Error: And then use '--env _' par_sh_environment_too_big env_parallel: Error: For details see: man env_parallel +par_sh_env_parallel_session ### Test env_parallel --session +par_sh_env_parallel_session /bin/sh: XXX: aliasbefore: not found +par_sh_env_parallel_session /bin/sh: XXX: aliasbefore: not found +par_sh_env_parallel_session no_before +par_sh_env_parallel_session no_before +par_sh_env_parallel_session after aliasafter_OK +par_sh_env_parallel_session after aliasafter_OK +par_sh_env_parallel_session after varafter_OK +par_sh_env_parallel_session after varafter_OK par_sh_env_parallel OK par_sh_env_parallel OK par_sh_env_parallel alias line 1 @@ -647,7 +674,7 @@ par_ksh_environment_too_big OK_bigfunc_remote par_ksh_environment_too_big OK_bigfunc_quote par_ksh_environment_too_big OK_bigfunc_quote_remote par_ksh_environment_too_big Rest should fail -par_ksh_environment_too_big ksh[115]: perl: /usr/bin/perl: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[XXX]: perl: /usr/bin/perl: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: You can try 2 different approaches: par_ksh_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -655,7 +682,7 @@ par_ksh_environment_too_big env_parallel: Error: 2. Try running this in a clean par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And then use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[115]: perl: /usr/bin/perl: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[XXX]: perl: /usr/bin/perl: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: You can try 2 different approaches: par_ksh_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -663,7 +690,7 @@ par_ksh_environment_too_big env_parallel: Error: 2. Try running this in a clean par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And then use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[115]: perl: /usr/bin/perl: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[XXX]: perl: /usr/bin/perl: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: You can try 2 different approaches: par_ksh_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -671,7 +698,7 @@ par_ksh_environment_too_big env_parallel: Error: 2. Try running this in a clean par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And then use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[115]: perl: /usr/bin/perl: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[XXX]: perl: /usr/bin/perl: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: You can try 2 different approaches: par_ksh_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -679,7 +706,7 @@ par_ksh_environment_too_big env_parallel: Error: 2. Try running this in a clean par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And then use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[115]: perl: /usr/bin/perl: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[XXX]: perl: /usr/bin/perl: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: You can try 2 different approaches: par_ksh_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -687,7 +714,7 @@ par_ksh_environment_too_big env_parallel: Error: 2. Try running this in a clean par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And then use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[115]: perl: /usr/bin/perl: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[XXX]: perl: /usr/bin/perl: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: You can try 2 different approaches: par_ksh_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -695,7 +722,7 @@ par_ksh_environment_too_big env_parallel: Error: 2. Try running this in a clean par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And then use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[115]: perl: /usr/bin/perl: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[XXX]: perl: /usr/bin/perl: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: You can try 2 different approaches: par_ksh_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -703,7 +730,7 @@ par_ksh_environment_too_big env_parallel: Error: 2. Try running this in a clean par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And then use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[115]: perl: /usr/bin/perl: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[XXX]: perl: /usr/bin/perl: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: You can try 2 different approaches: par_ksh_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -711,6 +738,23 @@ par_ksh_environment_too_big env_parallel: Error: 2. Try running this in a clean par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And then use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel +par_ksh_env_parallel_session ### Test env_parallel --session +par_ksh_env_parallel_session /usr/bin/ksh: line 4: aliasbefore: not found +par_ksh_env_parallel_session /usr/bin/ksh: line 5: aliasbefore: not found +par_ksh_env_parallel_session /usr/bin/ksh: line 5: funcbefore: not found +par_ksh_env_parallel_session /usr/bin/ksh: line 5: funcbefore: not found +par_ksh_env_parallel_session no_before +par_ksh_env_parallel_session no_before +par_ksh_env_parallel_session no_before +par_ksh_env_parallel_session no_before +par_ksh_env_parallel_session after aliasafter_OK +par_ksh_env_parallel_session after aliasafter_OK +par_ksh_env_parallel_session after funcafter_OK +par_ksh_env_parallel_session after funcafter_OK +par_ksh_env_parallel_session after varafter_OK +par_ksh_env_parallel_session after varafter_OK +par_ksh_env_parallel_session array after arrayafter_OK +par_ksh_env_parallel_session array after arrayafter_OK par_ksh_env_parallel OK par_ksh_env_parallel OK par_ksh_env_parallel alias line 1 @@ -846,6 +890,7 @@ par_fish_funky par_fish_funky par_fish_funky \\\\\\\\ \ \ \ \ \\\\\\\\\\\\\\ \ \!\"\#\$%\&\'\(\)\*+,-./0123456789:\;\<\=\>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_\`abcdefghijklmnopqrstuvwxyz\{\|\}\~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ par_fish_environment_too_big Not implemented +par_fish_env_parallel_session Not implemented par_fish_env_parallel bug #50435: Remote fifo broke in 20150522 par_fish_env_parallel data from stdin par_fish_env_parallel OK @@ -941,7 +986,7 @@ par_dash_environment_too_big OK_bigvar_remote par_dash_environment_too_big OK_bigvar_quote par_dash_environment_too_big OK_bigvar_quote_remote par_dash_environment_too_big Rest should fail -par_dash_environment_too_big dash: 135: perl: Argument list too long +par_dash_environment_too_big dash: XXX: perl: Argument list too long par_dash_environment_too_big env_parallel: Error: Your environment is too big. par_dash_environment_too_big env_parallel: Error: You can try 2 different approaches: par_dash_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -949,7 +994,7 @@ par_dash_environment_too_big env_parallel: Error: 2. Try running this in a clean par_dash_environment_too_big env_parallel: Error: env_parallel --record-env par_dash_environment_too_big env_parallel: Error: And then use '--env _' par_dash_environment_too_big env_parallel: Error: For details see: man env_parallel -par_dash_environment_too_big dash: 135: perl: Argument list too long +par_dash_environment_too_big dash: XXX: perl: Argument list too long par_dash_environment_too_big env_parallel: Error: Your environment is too big. par_dash_environment_too_big env_parallel: Error: You can try 2 different approaches: par_dash_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -957,7 +1002,7 @@ par_dash_environment_too_big env_parallel: Error: 2. Try running this in a clean par_dash_environment_too_big env_parallel: Error: env_parallel --record-env par_dash_environment_too_big env_parallel: Error: And then use '--env _' par_dash_environment_too_big env_parallel: Error: For details see: man env_parallel -par_dash_environment_too_big dash: 135: perl: Argument list too long +par_dash_environment_too_big dash: XXX: perl: Argument list too long par_dash_environment_too_big env_parallel: Error: Your environment is too big. par_dash_environment_too_big env_parallel: Error: You can try 2 different approaches: par_dash_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -965,7 +1010,7 @@ par_dash_environment_too_big env_parallel: Error: 2. Try running this in a clean par_dash_environment_too_big env_parallel: Error: env_parallel --record-env par_dash_environment_too_big env_parallel: Error: And then use '--env _' par_dash_environment_too_big env_parallel: Error: For details see: man env_parallel -par_dash_environment_too_big dash: 135: perl: Argument list too long +par_dash_environment_too_big dash: XXX: perl: Argument list too long par_dash_environment_too_big env_parallel: Error: Your environment is too big. par_dash_environment_too_big env_parallel: Error: You can try 2 different approaches: par_dash_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -973,6 +1018,15 @@ par_dash_environment_too_big env_parallel: Error: 2. Try running this in a clean par_dash_environment_too_big env_parallel: Error: env_parallel --record-env par_dash_environment_too_big env_parallel: Error: And then use '--env _' par_dash_environment_too_big env_parallel: Error: For details see: man env_parallel +par_dash_env_parallel_session ### Test env_parallel --session +par_dash_env_parallel_session /bin/dash: XXX: aliasbefore: not found +par_dash_env_parallel_session /bin/dash: XXX: aliasbefore: not found +par_dash_env_parallel_session no_before +par_dash_env_parallel_session no_before +par_dash_env_parallel_session after aliasafter_OK +par_dash_env_parallel_session after aliasafter_OK +par_dash_env_parallel_session after varafter_OK +par_dash_env_parallel_session after varafter_OK par_dash_env_parallel OK par_dash_env_parallel OK par_dash_env_parallel alias line 1 @@ -1086,6 +1140,7 @@ par_csh_funky Funky-  !"#$%&'()*+,-./0123456789:;<= par_csh_funky func_echo: Command not found. par_csh_funky \\\\\\\\ \ \ \ \ \\\\\\\\\\\\\\ \!\"\#\$%\&\'\(\)\*+,-./0123456789:\;\<\=\>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_\`abcdefghijklmnopqrstuvwxyz\{\|\}\~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ par_csh_environment_too_big Not implemented +par_csh_env_parallel_session Not implemented par_csh_env_parallel bug #50435: Remote fifo broke in 20150522 par_csh_env_parallel data from stdin par_csh_env_parallel OK @@ -1323,6 +1378,23 @@ par_bash_environment_too_big env_parallel: Error: 2. Try running this in a clean par_bash_environment_too_big env_parallel: Error: env_parallel --record-env par_bash_environment_too_big env_parallel: Error: And then use '--env _' par_bash_environment_too_big env_parallel: Error: For details see: man env_parallel +par_bash_env_parallel_session ### Test env_parallel --session +par_bash_env_parallel_session /bin/bash: line XXX: aliasbefore: command not found +par_bash_env_parallel_session /bin/bash: line XXX: aliasbefore: command not found +par_bash_env_parallel_session /bin/bash: line XXX: funcbefore: command not found +par_bash_env_parallel_session /bin/bash: line XXX: funcbefore: command not found +par_bash_env_parallel_session no_before +par_bash_env_parallel_session no_before +par_bash_env_parallel_session no_before +par_bash_env_parallel_session no_before +par_bash_env_parallel_session after aliasafter_OK +par_bash_env_parallel_session after aliasafter_OK +par_bash_env_parallel_session after funcafter_OK +par_bash_env_parallel_session after funcafter_OK +par_bash_env_parallel_session after varafter_OK +par_bash_env_parallel_session after varafter_OK +par_bash_env_parallel_session array after arrayafter_OK +par_bash_env_parallel_session array after arrayafter_OK par_bash_env_parallel OK par_bash_env_parallel OK par_bash_env_parallel alias line 1 @@ -1430,7 +1502,7 @@ par_ash_environment_too_big OK_bigvar_remote par_ash_environment_too_big OK_bigvar_quote par_ash_environment_too_big OK_bigvar_quote_remote par_ash_environment_too_big Rest should fail -par_ash_environment_too_big ash: 135: perl: Argument list too long +par_ash_environment_too_big ash: XXX: perl: Argument list too long par_ash_environment_too_big env_parallel: Error: Your environment is too big. par_ash_environment_too_big env_parallel: Error: You can try 2 different approaches: par_ash_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -1438,7 +1510,7 @@ par_ash_environment_too_big env_parallel: Error: 2. Try running this in a clean par_ash_environment_too_big env_parallel: Error: env_parallel --record-env par_ash_environment_too_big env_parallel: Error: And then use '--env _' par_ash_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ash_environment_too_big ash: 135: perl: Argument list too long +par_ash_environment_too_big ash: XXX: perl: Argument list too long par_ash_environment_too_big env_parallel: Error: Your environment is too big. par_ash_environment_too_big env_parallel: Error: You can try 2 different approaches: par_ash_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -1446,7 +1518,7 @@ par_ash_environment_too_big env_parallel: Error: 2. Try running this in a clean par_ash_environment_too_big env_parallel: Error: env_parallel --record-env par_ash_environment_too_big env_parallel: Error: And then use '--env _' par_ash_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ash_environment_too_big ash: 135: perl: Argument list too long +par_ash_environment_too_big ash: XXX: perl: Argument list too long par_ash_environment_too_big env_parallel: Error: Your environment is too big. par_ash_environment_too_big env_parallel: Error: You can try 2 different approaches: par_ash_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -1454,7 +1526,7 @@ par_ash_environment_too_big env_parallel: Error: 2. Try running this in a clean par_ash_environment_too_big env_parallel: Error: env_parallel --record-env par_ash_environment_too_big env_parallel: Error: And then use '--env _' par_ash_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ash_environment_too_big ash: 135: perl: Argument list too long +par_ash_environment_too_big ash: XXX: perl: Argument list too long par_ash_environment_too_big env_parallel: Error: Your environment is too big. par_ash_environment_too_big env_parallel: Error: You can try 2 different approaches: par_ash_environment_too_big env_parallel: Error: 1. Use --env and only mention the names to copy. @@ -1462,6 +1534,15 @@ par_ash_environment_too_big env_parallel: Error: 2. Try running this in a clean par_ash_environment_too_big env_parallel: Error: env_parallel --record-env par_ash_environment_too_big env_parallel: Error: And then use '--env _' par_ash_environment_too_big env_parallel: Error: For details see: man env_parallel +par_ash_env_parallel_session ### Test env_parallel --session +par_ash_env_parallel_session /bin/ash: XXX: aliasbefore: not found +par_ash_env_parallel_session /bin/ash: XXX: aliasbefore: not found +par_ash_env_parallel_session no_before +par_ash_env_parallel_session no_before +par_ash_env_parallel_session after aliasafter_OK +par_ash_env_parallel_session after aliasafter_OK +par_ash_env_parallel_session after varafter_OK +par_ash_env_parallel_session after varafter_OK par_ash_env_parallel OK par_ash_env_parallel OK par_ash_env_parallel alias line 1 diff --git a/testsuite/wanted-results/parallel-local-ssh8 b/testsuite/wanted-results/parallel-local-ssh8 index c29c8769..ac571ea8 100644 --- a/testsuite/wanted-results/parallel-local-ssh8 +++ b/testsuite/wanted-results/parallel-local-ssh8 @@ -30,3 +30,24 @@ par_path_remote_csh parallel: Warning: Removed lo. par_path_remote_csh parallel: Error: There are no hosts left to run on. par_path_remote_csh Right now it seems csh does not respect /bin:/usr/bin:/tmp if set from Perl par_path_remote_csh Done +par_retries_1 ### Test of --retries - it should run 13 jobs in total +par_retries_1 13 +par_retries_2 ### Test of --retries - it should run 25 jobs in total +par_retries_2 25 +par_retries_4 ### Test of --retries - it should run 49 jobs in total +par_retries_4 49 +par_retries_bug_from_2010 ### Bug with --retries +par_retries_bug_from_2010 8 +par_retries_bug_from_2010 8 +par_retries_bug_from_2010 2 +par_retries_bug_from_2010 1 +par_retries_bug_from_2010 1 +par_retries_bug_from_2010 1 +par_retries_bug_from_2010 ### These were not affected by the bug +par_retries_bug_from_2010 8 +par_retries_bug_from_2010 8 +par_retries_bug_from_2010 1 +par_retries_bug_from_2010 4 +par_retries_bug_from_2010 4 +par_retries_bug_from_2010 4 +par_retries_bug_from_2010 2 diff --git a/testsuite/wanted-results/parallel-local-ssh9 b/testsuite/wanted-results/parallel-local-ssh9 index 590713f3..47060bb0 100644 --- a/testsuite/wanted-results/parallel-local-ssh9 +++ b/testsuite/wanted-results/parallel-local-ssh9 @@ -40,7 +40,7 @@ par_ksh_embed code par_ksh_embed here par_ksh_embed parallel_OK par_ksh_embed env_parallel --env OK -par_ksh_embed ./parallel-embed[115]: perl: /usr/bin/perl: cannot execute [Argument list too long] +par_ksh_embed ./parallel-embed[118]: perl: /usr/bin/perl: cannot execute [Argument list too long] par_ksh_embed env_parallel: Error: Your environment is too big. par_ksh_embed env_parallel: Error: You can try 2 different approaches: par_ksh_embed env_parallel: Error: 1. Use --env and only mention the names to copy. diff --git a/testsuite/wanted-results/test32 b/testsuite/wanted-results/test32 index f841e195..e69de29b 100644 --- a/testsuite/wanted-results/test32 +++ b/testsuite/wanted-results/test32 @@ -1,21 +0,0 @@ -### Test of --retries - it should run 13 jobs in total -13 -### Test of --retries - it should run 25 jobs in total -25 -### Test of --retries - it should run 49 jobs in total -49 -### Bug with --retries -8 -8 -2 -1 -1 -1 -### These were not affected by the bug -8 -8 -1 -4 -4 -4 -2