parallel: $PARALLEL_JOBSLOT = {%} unless the job is being retried.

parallel: $PARALLEL_SSHLOGIN = sshlogin with number of cores removed.
parallel: $PARALLEL_SSHHOST = the host part of an sshlogin.
parallel: {slot} {sshlogin} {host} added to --plus.
This commit is contained in:
Ole Tange 2020-05-23 18:44:42 +02:00
parent 4430ee5f49
commit 5bba5c922d
9 changed files with 135 additions and 61 deletions

View file

@ -2150,7 +2150,7 @@ sub check_invalid_option_combinations() {
sub init_globals() { sub init_globals() {
# Defaults: # Defaults:
$Global::version = 20200423; $Global::version = 20200522;
$Global::progname = 'parallel'; $Global::progname = 'parallel';
$::name = "GNU Parallel"; $::name = "GNU Parallel";
$Global::infinity = 2**31; $Global::infinity = 2**31;
@ -2212,10 +2212,12 @@ sub init_globals() {
'{,([^}]+?)}' => 's/^($$1)/lc($1)/e;', '{,([^}]+?)}' => 's/^($$1)/lc($1)/e;',
# Bash ${a,,A} # Bash ${a,,A}
'{,,([^}]+?)}' => 's/($$1)/lc($1)/eg;', '{,,([^}]+?)}' => 's/($$1)/lc($1)/eg;',
# {slot} = $PARALLEL_JOBSLOT
'{slot}' => '1 $_="\${PARALLEL_JOBSLOT}";uq()',
# {host} = ssh host # {host} = ssh host
'{host}' => '$_="\${PARALLEL_SSHHOST}";uq()', '{host}' => '1 $_="\${PARALLEL_SSHHOST}";uq()',
# {sshlogin} = sshlogin # {sshlogin} = sshlogin
'{sshlogin}' => '$_="\${PARALLEL_SSHLOGIN}";uq()', '{sshlogin}' => '1 $_="\${PARALLEL_SSHLOGIN}";uq()',
); );
# Modifiable copy of %Global::replace # Modifiable copy of %Global::replace
%Global::rpl = %Global::replace; %Global::rpl = %Global::replace;
@ -4894,10 +4896,10 @@ sub usage() {
"If you use programs that use GNU Parallel to process data for an article in a", "If you use programs that use GNU Parallel to process data for an article in a",
"scientific publication, please cite:", "scientific publication, please cite:",
"", "",
" O. Tange (2018): GNU Parallel 2018, Mar 2018, ISBN 9781387509881,", " Tange, O. (2020, May 22). GNU Parallel 20200522 ('Kraftwerk').",
" DOI https://doi.org/10.5281/zenodo.1146014", " Zenodo. https://doi.org/10.5281/zenodo.3840974",
"", "",
# Before changing this line, please read # Before changing this line, please read
# https://www.gnu.org/software/parallel/parallel_design.html#Citation-notice # https://www.gnu.org/software/parallel/parallel_design.html#Citation-notice
# https://git.savannah.gnu.org/cgit/parallel.git/tree/doc/citation-notice-faq.txt # https://git.savannah.gnu.org/cgit/parallel.git/tree/doc/citation-notice-faq.txt
"This helps funding further development; AND IT WON'T COST YOU A CENT.", "This helps funding further development; AND IT WON'T COST YOU A CENT.",
@ -4925,10 +4927,10 @@ sub citation_notice() {
"If you use programs that use GNU Parallel to process data for an article in a", "If you use programs that use GNU Parallel to process data for an article in a",
"scientific publication, please cite:", "scientific publication, please cite:",
"", "",
" O. Tange (2018): GNU Parallel 2018, Mar 2018, ISBN 9781387509881,", " Tange, O. (2020, May 22). GNU Parallel 20200522 ('Kraftwerk').",
" DOI https://doi.org/10.5281/zenodo.1146014", " Zenodo. https://doi.org/10.5281/zenodo.3840974",
"", "",
# Before changing this line, please read # Before changing this line, please read
# https://www.gnu.org/software/parallel/parallel_design.html#Citation-notice and # https://www.gnu.org/software/parallel/parallel_design.html#Citation-notice and
# https://git.savannah.gnu.org/cgit/parallel.git/tree/doc/citation-notice-faq.txt # https://git.savannah.gnu.org/cgit/parallel.git/tree/doc/citation-notice-faq.txt
"This helps funding further development; AND IT WON'T COST YOU A CENT.", "This helps funding further development; AND IT WON'T COST YOU A CENT.",
@ -5039,18 +5041,20 @@ sub citation() {
"If you use programs that use GNU Parallel to process data for an article in a", "If you use programs that use GNU Parallel to process data for an article in a",
"scientific publication, please cite:", "scientific publication, please cite:",
"", "",
"\@book{tange_ole_2018_1146014,", "\@software{tange_2020_3840974,",
" author = {Tange, Ole},", " author = {Tange, Ole},",
" title = {GNU Parallel 2018},", " title = {GNU Parallel 20200522 ('Kraftwerk')},",
" publisher = {Ole Tange},", " month = May,",
" month = Mar,", " year = 2020,",
" year = 2018,", " note = {{GNU Parallel is a general parallelizer to run",
" ISBN = {9781387509881},", " multiple serial command line programs in parallel",
" doi = {10.5281/zenodo.1146014},", " without changing them.}},",
" url = {https://doi.org/10.5281/zenodo.1146014}", " publisher = {Zenodo},",
" doi = {10.5281/zenodo.3840974},",
" url = {https://doi.org/10.5281/zenodo.3840974}",
"}", "}",
"", "",
"(Feel free to use \\nocite{tange_ole_2018_1146014})", "(Feel free to use \\nocite{tange_2020_3840974})",
"", "",
# Before changing this line, please read # Before changing this line, please read
# https://www.gnu.org/software/parallel/parallel_design.html#Citation-notice and # https://www.gnu.org/software/parallel/parallel_design.html#Citation-notice and
@ -8977,7 +8981,9 @@ sub sshlogin_wrap($) {
} }
# Duplicate vars as BASH functions to include post-shellshock functions (v1+v2) # Duplicate vars as BASH functions to include post-shellshock functions (v1+v2)
# So --env myfunc should look for BASH_FUNC_myfunc() and BASH_FUNC_myfunc%% # So --env myfunc should look for BASH_FUNC_myfunc() and BASH_FUNC_myfunc%%
push(@vars, "PARALLEL_PID", "PARALLEL_SEQ", "PARALLEL_SSHLOGIN", "PARALLEL_SSHHOST",
push(@vars, "PARALLEL_PID", "PARALLEL_SEQ",
"PARALLEL_SSHLOGIN", "PARALLEL_SSHHOST", "PARALLEL_JOBSLOT",
map { ("BASH_FUNC_$_()", "BASH_FUNC_$_%%") } @vars); map { ("BASH_FUNC_$_()", "BASH_FUNC_$_%%") } @vars);
# Keep only defined variables # Keep only defined variables
return grep { defined($ENV{$_}) } @vars; return grep { defined($ENV{$_}) } @vars;
@ -9036,6 +9042,7 @@ sub sshlogin_wrap($) {
my $serverlogin = $sshlogin->serverlogin(); my $serverlogin = $sshlogin->serverlogin();
my $quoted_remote_command; my $quoted_remote_command;
$ENV{'PARALLEL_SEQ'} = $self->seq(); $ENV{'PARALLEL_SEQ'} = $self->seq();
$ENV{'PARALLEL_JOBSLOT'} = $self->slot();
$ENV{'PARALLEL_SSHLOGIN'} = $sshlogin->string(); $ENV{'PARALLEL_SSHLOGIN'} = $sshlogin->string();
$ENV{'PARALLEL_SSHHOST'} = $sshlogin->serverlogin(); $ENV{'PARALLEL_SSHHOST'} = $sshlogin->serverlogin();
$ENV{'PARALLEL_PID'} = $$; $ENV{'PARALLEL_PID'} = $$;
@ -9509,12 +9516,11 @@ sub start($) {
} }
$job->openoutputfiles(); $job->openoutputfiles();
$job->print_verbose_dryrun(); $job->print_verbose_dryrun();
# Call slot to store the slot value
$job->slot();
my($stdout_fh,$stderr_fh) = ($job->fh(1,"w"),$job->fh(2,"w")); my($stdout_fh,$stderr_fh) = ($job->fh(1,"w"),$job->fh(2,"w"));
if($opt::dryrun or $opt::sqlmaster) { $command = "true"; } if($opt::dryrun or $opt::sqlmaster) { $command = "true"; }
$ENV{'PARALLEL_SEQ'} = $job->seq(); $ENV{'PARALLEL_SEQ'} = $job->seq();
$ENV{'PARALLEL_PID'} = $$; $ENV{'PARALLEL_PID'} = $$;
$ENV{'PARALLEL_JOBSLOT'} = $job->slot();
$ENV{'PARALLEL_TMP'} = ::tmpname("par"); $ENV{'PARALLEL_TMP'} = ::tmpname("par");
$job->add_rm($ENV{'PARALLEL_TMP'}); $job->add_rm($ENV{'PARALLEL_TMP'});
::debug("run", $Global::total_running, " processes . Starting (", ::debug("run", $Global::total_running, " processes . Starting (",

View file

@ -209,6 +209,30 @@ number.
The replacement string B<{%}> can be changed with B<--slotreplace>. The replacement string B<{%}> can be changed with B<--slotreplace>.
If the job needs to be retried (e.g using B<--retries> or
B<--retry-failed>) the job slot is not automatically updated. You
should then instead use B<$PARALLEL_JOBSLOT>:
$ do_test() {
id="$3 {%}=$1 PARALLEL_JOBSLOT=$2"
echo run "$id";
sleep 1
# fail if {%} is odd
return `echo $1%2 | bc`
}
$ export -f do_test
$ parallel -j3 --jl mylog do_test {%} \$PARALLEL_JOBSLOT {} ::: A B C D
run A {%}=1 PARALLEL_JOBSLOT=1
run B {%}=2 PARALLEL_JOBSLOT=2
run C {%}=3 PARALLEL_JOBSLOT=3
run D {%}=1 PARALLEL_JOBSLOT=1
$ parallel --retry-failed -j3 --jl mylog do_test {%} \$PARALLEL_JOBSLOT {} ::: A B C D
run A {%}=1 PARALLEL_JOBSLOT=1
run C {%}=3 PARALLEL_JOBSLOT=2
run D {%}=1 PARALLEL_JOBSLOT=3
Notice how {%} and $PARALLEL_JOBSLOT differ in the retry run of C and D.
To understand replacement strings see B<{}>. To understand replacement strings see B<{}>.
@ -1538,7 +1562,7 @@ Activate additional replacement strings: {+/} {+.} {+..} {+...} {..}
'{foo}' and {} = {+/}/{/} = {.}.{+.} = {+/}/{/.}.{+.} = {..}.{+..} = '{foo}' and {} = {+/}/{/} = {.}.{+.} = {+/}/{/.}.{+.} = {..}.{+..} =
{+/}/{/..}.{+..} = {...}.{+...} = {+/}/{/...}.{+...} {+/}/{/..}.{+..} = {...}.{+...} = {+/}/{/...}.{+...}
B<{##}> is the number of jobs to be run. It is incompatible with B<{##}> is the total number of jobs to be run. It is incompatible with
B<-X>/B<-m>/B<--xargs>. B<-X>/B<-m>/B<--xargs>.
B<{choose_k}> is inspired by n choose k: Given a list of n elements, B<{choose_k}> is inspired by n choose k: Given a list of n elements,
@ -1546,10 +1570,11 @@ choose k. k is the number of input sources and n is the number of
arguments in an input source. The content of the input sources must arguments in an input source. The content of the input sources must
be the same and the arguments must be unique. be the same and the arguments must be unique.
For remote jobs these are also activated: Shorthands for variables:
{sshlogin} sshlogin {slot} $PARALLEL_JOBSLOT (see {%})
{host} hostname of sshlogin {sshlogin} $PARALLEL_SSHLOGIN
{host} $PARALLEL_SSHHOST
The following dynamic replacement strings are also activated. They are The following dynamic replacement strings are also activated. They are
inspired by bash's parameter expansion: inspired by bash's parameter expansion:
@ -4793,13 +4818,23 @@ the currently running jobs are finished before exiting.
Dir where GNU B<parallel> stores config files, semaphores, and caches Dir where GNU B<parallel> stores config files, semaphores, and caches
information between invocations. Default: $HOME/.parallel. information between invocations. Default: $HOME/.parallel.
=item $PARALLEL_JOBSLOT
Set by GNU B<parallel> and can be used in jobs run by GNU B<parallel>.
Remember to quote the $, so it gets evaluated by the correct shell. Or
use B<--plus> and {slot}.
$PARALLEL_JOBSLOT is the jobslot of the job. It is equal to {%} unless
the job is being retried. See {%} for details.
=item $PARALLEL_PID =item $PARALLEL_PID
The environment variable $PARALLEL_PID is set by GNU B<parallel> and Set by GNU B<parallel> and can be used in jobs run by GNU B<parallel>.
is visible to the jobs started from GNU B<parallel>. This makes it Remember to quote the $, so it gets evaluated by the correct shell.
possible for the jobs to communicate directly to GNU B<parallel>.
Remember to quote the $, so it gets evaluated by the correct This makes it possible for the jobs to communicate directly to GNU
shell. B<parallel>.
B<Example:> If each of the jobs tests a solution and one of jobs finds B<Example:> If each of the jobs tests a solution and one of jobs finds
the solution the job can tell GNU B<parallel> not to start more jobs the solution the job can tell GNU B<parallel> not to start more jobs
@ -4839,17 +4874,36 @@ $SHELL. If undefined use:
=item $PARALLEL_SSH =item $PARALLEL_SSH
GNU B<parallel> defaults to using B<ssh> for remote access. This can GNU B<parallel> defaults to using the B<ssh> command for remote
be overridden with $PARALLEL_SSH, which again can be overridden with access. This can be overridden with $PARALLEL_SSH, which again can be
B<--ssh>. It can also be set on a per server basis (see overridden with B<--ssh>. It can also be set on a per server basis
B<--sshlogin>). (see B<--sshlogin>).
=item $PARALLEL_SSHHOST
Set by GNU B<parallel> and can be used in jobs run by GNU B<parallel>.
Remember to quote the $, so it gets evaluated by the correct shell. Or
use B<--plus> and {host}.
$PARALLEL_SSHHOST is the host part of an sshlogin line. E.g.
4//usr/bin/specialssh user@host
becomes:
host
=item $PARALLEL_SSHLOGIN =item $PARALLEL_SSHLOGIN
The environment variable $PARALLEL_SSHLOGIN is set by GNU B<parallel> Set by GNU B<parallel> and can be used in jobs run by GNU B<parallel>.
and is visible to the jobs started from GNU B<parallel>. The value is Remember to quote the $, so it gets evaluated by the correct shell. Or
the sshlogin line with number of cores removed. E.g. use B<--plus> and {sshlogin}.
The value is the sshlogin line with number of cores removed. E.g.
4//usr/bin/specialssh user@host 4//usr/bin/specialssh user@host
@ -4860,15 +4914,18 @@ becomes:
=item $PARALLEL_SEQ =item $PARALLEL_SEQ
$PARALLEL_SEQ will be set to the sequence number of the job Set by GNU B<parallel> and can be used in jobs run by GNU B<parallel>.
running. Remember to quote the $, so it gets evaluated by the correct Remember to quote the $, so it gets evaluated by the correct shell.
shell.
$PARALLEL_SEQ is the sequence number of the job running.
B<Example:> B<Example:>
seq 10 | parallel -N2 \ seq 10 | parallel -N2 \
echo seq:'$'PARALLEL_SEQ arg1:{1} arg2:{2} echo seq:'$'PARALLEL_SEQ arg1:{1} arg2:{2}
{#} is a shorthand for $PARALLEL_SEQ.
=item $PARALLEL_TMUX =item $PARALLEL_TMUX
@ -4897,7 +4954,7 @@ can be written as:
cat list | PARALLEL='-kvj1 -S myssh\ user@server' \ cat list | PARALLEL='-kvj1 -S myssh\ user@server' \
parallel echo parallel echo
Notice the \ in the middle is needed because 'myssh' and 'user@server' Notice the \ after 'myssh' is needed because 'myssh' and 'user@server'
must be one argument. must be one argument.
=back =back

View file

@ -776,6 +776,11 @@ par_cr_newline_header() {
parallel --colsep , --header : echo {foo} parallel --colsep , --header : echo {foo}
} }
par_plus_slot_replacement() {
echo '### show {slot}'
parallel -k --plus echo '{slot}=$PARALLEL_JOBSLOT={%}' ::: A B C
}
export -f $(compgen -A function | grep par_) export -f $(compgen -A function | grep par_)
compgen -A function | grep par_ | LC_ALL=C sort | compgen -A function | grep par_ | LC_ALL=C sort |
parallel --timeout 1000% -j6 --tag -k --joblog /tmp/jl-`basename $0` '{} 2>&1' parallel --timeout 1000% -j6 --tag -k --joblog /tmp/jl-`basename $0` '{} 2>&1'

View file

@ -197,11 +197,11 @@ par_no_route_to_host() {
) | perl -pe 's/(\d+\.\d+\.\d+\.\d+)/i.p.n.r/' | puniq ) | perl -pe 's/(\d+\.\d+\.\d+\.\d+)/i.p.n.r/' | puniq
} }
par_PARALLEL_SSHLOGIN() { par_PARALLEL_SSHLOGIN_SSHHOST() {
echo '### bug #56554: Introduce $PARALLEL_SSHLOGIN' echo '### bug #56554: Introduce $PARALLEL_SSHLOGIN $PARALLEL_SSHHOST'
(echo lo; echo zsh@lo; echo /usr/bin/ssh csh@lo; echo 1/sh@lo; (echo lo; echo zsh@lo; echo /usr/bin/ssh csh@lo; echo 1/sh@lo;
echo 1//usr/bin/ssh tcsh@lo) | echo 1//usr/bin/ssh tcsh@lo) |
parallel -k --tag --nonall -S - 'whoami;echo $PARALLEL_SSHLOGIN' | parallel -k --tag --nonall -S - 'whoami;echo $PARALLEL_SSHLOGIN $PARALLEL_SSHHOST' |
LANG=C sort LANG=C sort
} }

View file

@ -618,6 +618,10 @@ par_pipepart_recend_recstart 9
par_pipepart_recend_recstart 10 par_pipepart_recend_recstart 10
par_pipepart_roundrobin ### bug #45769: --round-robin --pipepart gives wrong results par_pipepart_roundrobin ### bug #45769: --round-robin --pipepart gives wrong results
par_pipepart_roundrobin 2 par_pipepart_roundrobin 2
par_plus_slot_replacement ### show {slot}
par_plus_slot_replacement 1=1=1
par_plus_slot_replacement 2=2=2
par_plus_slot_replacement 3=3=3
par_profile ### Test -J profile, -J /dir/profile, -J ./profile par_profile ### Test -J profile, -J /dir/profile, -J ./profile
par_profile local local par_profile local local
par_profile abs abs par_profile abs abs

View file

@ -72,7 +72,7 @@ par_remote_load parallel: Warning: This job was killed because it timed out:
par_remote_load parallel: Warning: perl -e 'while(1){ }' par_remote_load parallel: Warning: perl -e 'while(1){ }'
par_remote_load OK par_remote_load OK
par_remote_nice ### Test --nice remote par_remote_nice ### Test --nice remote
par_remote_nice ssh lo -- exec 'perl -e '"'"'$ENV{"PARALLEL_PID"}="XXXXX";$ENV{"PARALLEL_SEQ"}="1";$ENV{"PARALLEL_SSHLOGIN"}="lo";$ENV{"PARALLEL_SSHHOST"}="lo";$bashfunc = "";@ARGV="PAR=a bash -c \"echo \\\$PAR b\"";$shell="$ENV{SHELL}";$tmpdir="/tmp/parallel-local-ssh1-tmpdir";$nice=1;do{$ENV{PARALLEL_TMP}=$tmpdir."/par".join"",map{(0..9,"a".."z","A".."Z")[rand(62)]}(1..5);}while(-e$ENV{PARALLEL_TMP});$SIG{CHLD}=sub{$done=1;};$pid=fork;unless($pid){eval{setpgrp};eval{setpriority(0,0,$nice)};exec$shell,"-c",($bashfunc."@ARGV");die"exec:$!\n";}do{$s=$s<1?0.001+$s*1.03:$s;select(undef,undef,undef,$s);}until($done||getppid==1);kill(SIGHUP,-${pid})unless$done;wait;exit($?&127?128+($?&127):1+$?>>8)'"'"; par_remote_nice ssh lo -- exec 'perl -e '"'"'$ENV{"PARALLEL_PID"}="XXXXX";$ENV{"PARALLEL_SEQ"}="1";$ENV{"PARALLEL_SSHLOGIN"}="lo";$ENV{"PARALLEL_SSHHOST"}="lo";$ENV{"PARALLEL_JOBSLOT"}="1";$bashfunc = "";@ARGV="PAR=a bash -c \"echo \\\$PAR b\"";$shell="$ENV{SHELL}";$tmpdir="/tmp/parallel-local-ssh1-tmpdir";$nice=1;do{$ENV{PARALLEL_TMP}=$tmpdir."/par".join"",map{(0..9,"a".."z","A".."Z")[rand(62)]}(1..5);}while(-e$ENV{PARALLEL_TMP});$SIG{CHLD}=sub{$done=1;};$pid=fork;unless($pid){eval{setpgrp};eval{setpriority(0,0,$nice)};exec$shell,"-c",($bashfunc."@ARGV");die"exec:$!\n";}do{$s=$s<1?0.001+$s*1.03:$s;select(undef,undef,undef,$s);}until($done||getppid==1);kill(SIGHUP,-${pid})unless$done;wait;exit($?&127?128+($?&127):1+$?>>8)'"'";
par_remote_nice a b par_remote_nice a b
par_ssh ### use --ssh par_ssh ### use --ssh
par_ssh Run through BARSSH? par_ssh Run through BARSSH?

View file

@ -136,14 +136,14 @@ par_ash_embed your
par_ash_embed code par_ash_embed code
par_ash_embed here par_ash_embed here
par_ash_embed Put your code here par_ash_embed Put your code here
par_PARALLEL_SSHLOGIN ### bug #56554: Introduce $PARALLEL_SSHLOGIN par_PARALLEL_SSHLOGIN_SSHHOST ### bug #56554: Introduce $PARALLEL_SSHLOGIN $PARALLEL_SSHHOST
par_PARALLEL_SSHLOGIN /usr/bin/ssh csh@lo /usr/bin/ssh csh@lo par_PARALLEL_SSHLOGIN_SSHHOST /usr/bin/ssh csh@lo /usr/bin/ssh csh@lo lo
par_PARALLEL_SSHLOGIN /usr/bin/ssh csh@lo csh par_PARALLEL_SSHLOGIN_SSHHOST /usr/bin/ssh csh@lo csh
par_PARALLEL_SSHLOGIN /usr/bin/ssh tcsh@lo /usr/bin/ssh tcsh@lo par_PARALLEL_SSHLOGIN_SSHHOST /usr/bin/ssh tcsh@lo /usr/bin/ssh tcsh@lo lo
par_PARALLEL_SSHLOGIN /usr/bin/ssh tcsh@lo tcsh par_PARALLEL_SSHLOGIN_SSHHOST /usr/bin/ssh tcsh@lo tcsh
par_PARALLEL_SSHLOGIN lo lo par_PARALLEL_SSHLOGIN_SSHHOST lo lo lo
par_PARALLEL_SSHLOGIN lo tange par_PARALLEL_SSHLOGIN_SSHHOST lo tange
par_PARALLEL_SSHLOGIN sh@lo sh par_PARALLEL_SSHLOGIN_SSHHOST sh@lo sh
par_PARALLEL_SSHLOGIN sh@lo sh@lo par_PARALLEL_SSHLOGIN_SSHHOST sh@lo sh@lo lo
par_PARALLEL_SSHLOGIN zsh@lo zsh par_PARALLEL_SSHLOGIN_SSHHOST zsh@lo zsh
par_PARALLEL_SSHLOGIN zsh@lo zsh@lo par_PARALLEL_SSHLOGIN_SSHHOST zsh@lo zsh@lo lo

View file

@ -844,9 +844,11 @@ ORACLE_HOME
ORACLE_SID ORACLE_SID
PARALLEL PARALLEL
PARALLEL_HOME PARALLEL_HOME
PARALLEL_JOBSLOT
PARALLEL_PID PARALLEL_PID
PARALLEL_RSYNC_OPTS PARALLEL_RSYNC_OPTS
PARALLEL_SEQ PARALLEL_SEQ
PARALLEL_SSHHOST
PARALLEL_SSHLOGIN PARALLEL_SSHLOGIN
PARALLEL_TMP PARALLEL_TMP
PATH PATH
@ -1425,4 +1427,4 @@ C
echo A echo A
echo B echo B
echo C echo C
7 8

View file

@ -1,13 +1,13 @@
echo '### Test --return of weirdly named file' echo '### Test --return of weirdly named file'
### Test --return of weirdly named file ### Test --return of weirdly named file
stdout parallel --return {} -vv -S parallel\@parallel-server1 echo '>'{} ::: 'aa<${#}" b' | perl -pe 's/\S*parallel-server\S*/one-server/;s:[a-z+=/\\0-9]{500,}:base64:i;'; rm 'aa<${#}" b' stdout parallel --return {} -vv -S parallel\@parallel-server1 echo '>'{} ::: 'aa<${#}" b' | perl -pe 's/\S*parallel-server\S*/one-server/;s:[a-z+=/\\0-9]{500,}:base64:i;'; rm 'aa<${#}" b'
ssh -l parallel one-server -- exec 'perl -e '"'"'$ENV{"PARALLEL_PID"}="XXXXX";$ENV{"PARALLEL_SEQ"}="1";$ENV{"PARALLEL_SSHLOGIN"}="parallel\@parallel-server1";$bashfunc = "";@ARGV="echo >'"'"'"'"'"'"'"'"'aa<\${#}\" b'"'"'"'"'"'"'"'"'";$shell="$ENV{SHELL}";$tmpdir="/tmp/test61-tmpdir";$nice=0;do{$ENV{PARALLEL_TMP}=$tmpdir."/par".join"",map{(0..9,"a".."z","A".."Z")[rand(62)]}(1..5);}while(-e$ENV{PARALLEL_TMP});$SIG{CHLD}=sub{$done=1;};$pid=fork;unless($pid){eval{setpgrp};eval{setpriority(0,0,$nice)};exec$shell,"-c",($bashfunc."@ARGV");die"exec:$!\n";}do{$s=$s<1?0.001+$s*1.03:$s;select(undef,undef,undef,$s);}until($done||getppid==1);kill(SIGHUP,-${pid})unless$done;wait;exit($?&127?128+($?&127):1+$?>>8)'"'";_EXIT_status=$?; mkdir -p ./. && rsync --protocol 30 --rsync-path='cd ././.; rsync' -rlDzR -e'ssh -l parallel' parallel-server1:"'"'./aa<${#}" b'"'" ./.;exit $_EXIT_status; ssh -l parallel one-server -- exec 'perl -e '"'"'$ENV{"PARALLEL_PID"}="XXXXX";$ENV{"PARALLEL_SEQ"}="1";$ENV{"PARALLEL_SSHLOGIN"}="parallel\@parallel-server1";$ENV{"PARALLEL_SSHHOST"}="parallel-server1";$ENV{"PARALLEL_JOBSLOT"}="1";$bashfunc = "";@ARGV="echo >'"'"'"'"'"'"'"'"'aa<\${#}\" b'"'"'"'"'"'"'"'"'";$shell="$ENV{SHELL}";$tmpdir="/tmp/test61-tmpdir";$nice=0;do{$ENV{PARALLEL_TMP}=$tmpdir."/par".join"",map{(0..9,"a".."z","A".."Z")[rand(62)]}(1..5);}while(-e$ENV{PARALLEL_TMP});$SIG{CHLD}=sub{$done=1;};$pid=fork;unless($pid){eval{setpgrp};eval{setpriority(0,0,$nice)};exec$shell,"-c",($bashfunc."@ARGV");die"exec:$!\n";}do{$s=$s<1?0.001+$s*1.03:$s;select(undef,undef,undef,$s);}until($done||getppid==1);kill(SIGHUP,-${pid})unless$done;wait;exit($?&127?128+($?&127):1+$?>>8)'"'";_EXIT_status=$?; mkdir -p ./. && rsync --protocol 30 --rsync-path='cd ././.; rsync' -rlDzR -e'ssh -l parallel' parallel-server1:"'"'./aa<${#}" b'"'" ./.;exit $_EXIT_status;
echo '### Test if remote login shell is csh' echo '### Test if remote login shell is csh'
### Test if remote login shell is csh ### Test if remote login shell is csh
stdout parallel -k -vv -S csh@localhost 'echo $PARALLEL_PID $PARALLEL_SEQ {}| wc -w' ::: a b c | perl -pe 's/\S*parallel-server\S*/one-server/;s:[a-z+=/\\0-9]{500,}:base64:i;' stdout parallel -k -vv -S csh@localhost 'echo $PARALLEL_PID $PARALLEL_SEQ {}| wc -w' ::: a b c | perl -pe 's/\S*parallel-server\S*/one-server/;s:[a-z+=/\\0-9]{500,}:base64:i;'
ssh -l csh localhost -- exec 'perl -e '"'"'$ENV{"PARALLEL_PID"}="XXXXX";$ENV{"PARALLEL_SEQ"}="1";$ENV{"PARALLEL_SSHLOGIN"}="csh\@localhost";$bashfunc = "";@ARGV="echo \$PARALLEL_PID \$PARALLEL_SEQ a| wc -w";$shell="$ENV{SHELL}";$tmpdir="/tmp/test61-tmpdir";$nice=0;do{$ENV{PARALLEL_TMP}=$tmpdir."/par".join"",map{(0..9,"a".."z","A".."Z")[rand(62)]}(1..5);}while(-e$ENV{PARALLEL_TMP});$SIG{CHLD}=sub{$done=1;};$pid=fork;unless($pid){eval{setpgrp};eval{setpriority(0,0,$nice)};exec$shell,"-c",($bashfunc."@ARGV");die"exec:$!\n";}do{$s=$s<1?0.001+$s*1.03:$s;select(undef,undef,undef,$s);}until($done||getppid==1);kill(SIGHUP,-${pid})unless$done;wait;exit($?&127?128+($?&127):1+$?>>8)'"'"; ssh -l csh localhost -- exec 'perl -e '"'"'$ENV{"PARALLEL_PID"}="XXXXX";$ENV{"PARALLEL_SEQ"}="1";$ENV{"PARALLEL_SSHLOGIN"}="csh\@localhost";$ENV{"PARALLEL_SSHHOST"}="localhost";$ENV{"PARALLEL_JOBSLOT"}="1";$bashfunc = "";@ARGV="echo \$PARALLEL_PID \$PARALLEL_SEQ a| wc -w";$shell="$ENV{SHELL}";$tmpdir="/tmp/test61-tmpdir";$nice=0;do{$ENV{PARALLEL_TMP}=$tmpdir."/par".join"",map{(0..9,"a".."z","A".."Z")[rand(62)]}(1..5);}while(-e$ENV{PARALLEL_TMP});$SIG{CHLD}=sub{$done=1;};$pid=fork;unless($pid){eval{setpgrp};eval{setpriority(0,0,$nice)};exec$shell,"-c",($bashfunc."@ARGV");die"exec:$!\n";}do{$s=$s<1?0.001+$s*1.03:$s;select(undef,undef,undef,$s);}until($done||getppid==1);kill(SIGHUP,-${pid})unless$done;wait;exit($?&127?128+($?&127):1+$?>>8)'"'";
3 3
ssh -l csh localhost -- exec 'perl -e '"'"'$ENV{"PARALLEL_PID"}="XXXXX";$ENV{"PARALLEL_SEQ"}="2";$ENV{"PARALLEL_SSHLOGIN"}="csh\@localhost";$bashfunc = "";@ARGV="echo \$PARALLEL_PID \$PARALLEL_SEQ b| wc -w";$shell="$ENV{SHELL}";$tmpdir="/tmp/test61-tmpdir";$nice=0;do{$ENV{PARALLEL_TMP}=$tmpdir."/par".join"",map{(0..9,"a".."z","A".."Z")[rand(62)]}(1..5);}while(-e$ENV{PARALLEL_TMP});$SIG{CHLD}=sub{$done=1;};$pid=fork;unless($pid){eval{setpgrp};eval{setpriority(0,0,$nice)};exec$shell,"-c",($bashfunc."@ARGV");die"exec:$!\n";}do{$s=$s<1?0.001+$s*1.03:$s;select(undef,undef,undef,$s);}until($done||getppid==1);kill(SIGHUP,-${pid})unless$done;wait;exit($?&127?128+($?&127):1+$?>>8)'"'"; ssh -l csh localhost -- exec 'perl -e '"'"'$ENV{"PARALLEL_PID"}="XXXXX";$ENV{"PARALLEL_SEQ"}="2";$ENV{"PARALLEL_SSHLOGIN"}="csh\@localhost";$ENV{"PARALLEL_SSHHOST"}="localhost";$ENV{"PARALLEL_JOBSLOT"}="2";$bashfunc = "";@ARGV="echo \$PARALLEL_PID \$PARALLEL_SEQ b| wc -w";$shell="$ENV{SHELL}";$tmpdir="/tmp/test61-tmpdir";$nice=0;do{$ENV{PARALLEL_TMP}=$tmpdir."/par".join"",map{(0..9,"a".."z","A".."Z")[rand(62)]}(1..5);}while(-e$ENV{PARALLEL_TMP});$SIG{CHLD}=sub{$done=1;};$pid=fork;unless($pid){eval{setpgrp};eval{setpriority(0,0,$nice)};exec$shell,"-c",($bashfunc."@ARGV");die"exec:$!\n";}do{$s=$s<1?0.001+$s*1.03:$s;select(undef,undef,undef,$s);}until($done||getppid==1);kill(SIGHUP,-${pid})unless$done;wait;exit($?&127?128+($?&127):1+$?>>8)'"'";
3 3
ssh -l csh localhost -- exec 'perl -e '"'"'$ENV{"PARALLEL_PID"}="XXXXX";$ENV{"PARALLEL_SEQ"}="3";$ENV{"PARALLEL_SSHLOGIN"}="csh\@localhost";$bashfunc = "";@ARGV="echo \$PARALLEL_PID \$PARALLEL_SEQ c| wc -w";$shell="$ENV{SHELL}";$tmpdir="/tmp/test61-tmpdir";$nice=0;do{$ENV{PARALLEL_TMP}=$tmpdir."/par".join"",map{(0..9,"a".."z","A".."Z")[rand(62)]}(1..5);}while(-e$ENV{PARALLEL_TMP});$SIG{CHLD}=sub{$done=1;};$pid=fork;unless($pid){eval{setpgrp};eval{setpriority(0,0,$nice)};exec$shell,"-c",($bashfunc."@ARGV");die"exec:$!\n";}do{$s=$s<1?0.001+$s*1.03:$s;select(undef,undef,undef,$s);}until($done||getppid==1);kill(SIGHUP,-${pid})unless$done;wait;exit($?&127?128+($?&127):1+$?>>8)'"'"; ssh -l csh localhost -- exec 'perl -e '"'"'$ENV{"PARALLEL_PID"}="XXXXX";$ENV{"PARALLEL_SEQ"}="3";$ENV{"PARALLEL_SSHLOGIN"}="csh\@localhost";$ENV{"PARALLEL_SSHHOST"}="localhost";$ENV{"PARALLEL_JOBSLOT"}="3";$bashfunc = "";@ARGV="echo \$PARALLEL_PID \$PARALLEL_SEQ c| wc -w";$shell="$ENV{SHELL}";$tmpdir="/tmp/test61-tmpdir";$nice=0;do{$ENV{PARALLEL_TMP}=$tmpdir."/par".join"",map{(0..9,"a".."z","A".."Z")[rand(62)]}(1..5);}while(-e$ENV{PARALLEL_TMP});$SIG{CHLD}=sub{$done=1;};$pid=fork;unless($pid){eval{setpgrp};eval{setpriority(0,0,$nice)};exec$shell,"-c",($bashfunc."@ARGV");die"exec:$!\n";}do{$s=$s<1?0.001+$s*1.03:$s;select(undef,undef,undef,$s);}until($done||getppid==1);kill(SIGHUP,-${pid})unless$done;wait;exit($?&127?128+($?&127):1+$?>>8)'"'";
3 3