--wd . implemented. Passes testsuite.

This commit is contained in:
Ole Tange 2012-02-20 00:48:28 +00:00
parent d0509d0120
commit 3e996c9a57
17 changed files with 152 additions and 113 deletions

View file

@ -108,18 +108,9 @@ colsep = [sepchars]{no_of_sepchars}
# TODO max_line_length on remote # TODO max_line_length on remote
# TODO compute how many can be transferred within max_line_length # TODO compute how many can be transferred within max_line_length
Postkort:
- Forside kun figur
- Bagside:
- Logo med figur - evt gnu.org/s/parallel
- kort grå tekst, der forklarer hvad det er.
- Eet eksempel: parallel gzip ::: *
- Link til video. http://nd.gd/0s
Til inspiration. Til inspiration.
Hvis du stadig er ved at lave post- eller visitkort ting, så kunne du evt tilføje en QR code. Med MECARD tagget kan flere tags gemmes i en og samme fil: Hvis du stadig er ved at lave post- eller visitkort ting, så kunne du evt tilføje en QR code under frimærket. Med MECARD tagget kan flere tags gemmes i en og samme fil:
qrencode -l L -o x.png "MECARD:N:GNU Parallel;EMAIL:parallel@gnu.org;URL:gnu.org/software/parallel;" qrencode -l L -o x.png "MECARD:N:GNU Parallel;EMAIL:parallel@gnu.org;URL:gnu.org/software/parallel;"
@ -131,8 +122,8 @@ Husk at skrive indholdet under billedet, det er irreterende at skulle gætte.
GNU parallel is a UNIX-tool for running commands in parallel. GNU parallel is a UNIX-tool for running commands in parallel.
To gzip all files running one job per CPU write: To gzip all files running one job per CPU write:
parallel gzip ::: * parallel gzip ::: *
Watch the intro video to learn more: www.pi.dk/1 Watch the intro video to learn more: http://pi.dk/1
Or read more about GNU parallel: www.gnu.org/s/parallel Or read more about GNU parallel: http://gnu.org/s/parallel
job->start(): job->start():
$jobslot = Global::jobslot->$sshlogin $jobslot = Global::jobslot->$sshlogin
@ -198,6 +189,31 @@ src/sem src/niceload src/sql to a dir in your path.
wget http://git.savannah.gnu.org/cgit/parallel.git/plain/src/parallel wget http://git.savannah.gnu.org/cgit/parallel.git/plain/src/parallel
--record measured in lines (useful for fastq)
parallel --tag traceroute ::: pi.dk debian.org
# Thank you for watching
#
# If you like GNU Parallel:
# * Post this video on Reddit/Diaspora*/forums/blogs/
# Identi.ca/Google+/Twitter/Facebook/Linkedin/mailing lists
# * Join the mailing list https://lists.gnu.org/mailman/listinfo/parallel
# * Get the merchandise https://www.gnu.org/s/parallel/merchandise.html
# * Give a demo at your local user group
# * Request or write a review for your favourite blog or magazine
# * Request or build a package for your favourite distribution
# * Invite me for your next conference (Contact http://ole.tange.dk)
#
# If GNU Parallel saves you money:
# * (Have your company) donate to FSF https://my.fsf.org/donate/
#
# If you use GNU Parallel for a publication please cite:
# O. Tange (2011): GNU Parallel - The Command-Line Power Tool, ;login:
# The USENIX Magazine, February 2011:42-47.
#
# Find GNU Parallel at https://www.gnu.org/s/parallel/

View file

@ -172,53 +172,32 @@ cc:Sandro Cazzaniga <kharec@mandriva.org>,
Ryoichiro Suzuki <ryoichiro.suzuki@gmail.com>, Ryoichiro Suzuki <ryoichiro.suzuki@gmail.com>,
Jesse Alama <jesse.alama@gmail.com> Jesse Alama <jesse.alama@gmail.com>
Subject: GNU Parallel 20120122 ('Dead SOPA') released Subject: GNU Parallel 20120222 ('Whitney') released
GNU Parallel 20120122 ('Dead SOPA') has been released. It is GNU Parallel 20120222 ('Whitney') has been released. It is
available for download at: http://ftp.gnu.org/gnu/parallel/ available for download at: http://ftp.gnu.org/gnu/parallel/
New in this release: New in this release:
* --header : uses the first input line as column names and you can * --workdir . will use the current working dir. If the current working
then use {colname} as a replacement string in the command. This also dir is beneath your home dir, the value . is treated as the relative
works with multiple :::'s. path to your home dir. This means that if your home dir is different
on remote computers (e.g. if your login is different) the relative
path will still be relative to your home dir.
* --header <regexp> matches a header as a regular expression and * A texinfo file is now generated from the POD file using pod2texi.
repeats the header for each block with --pipe.
* --resume resumes from the last unfinished job. Useful if you stop * The bioinformatics article "Fast large-scale clustering of protein
GNU Parallel and restart it later with the same arguments. structures using Gauss integrals" mentions GNU Parallel. They forgot
to add the reference. Please remember --bibtex if you use GNU
Parallel in an article.
http://bioinformatics.oxfordjournals.org/content/28/4/510.short
* niceload now propagates exit status correctly. * First supporter received his merchandise. Did you order yours?
* Show your support for GNU Parallel. For a limited time you can get a
GNU Parallel T-shirt+mug+pen+100 postcards at 20 EUR. See
https://www.gnu.org/software/parallel/merchandise.html https://www.gnu.org/software/parallel/merchandise.html
* Options -g -B -T -U -W -Y are retired as warned 6 months ago. * How to use GNU Parallel for vacuuming PostgreSQL tables.
http://blog.timmattison.com/archives/2012/01/24/mini-hack-parallel-vacuuming-in-postgresql/
* GNU Parallel referenced in article on Holographic Grid Cloud. Thanks
to Stefano Gallozzi. http://arxiv.org/pdf/1112.6128
* Article in IEEE Software on GNU Parallel. Thanks to Diomidis
Spinellis. http://www.spinellis.gr/blog/20110911/
* An article on Narwhal which uses GNU Parallel. They forgot to add
the reference. Please remember --bibtex if you use GNU Parallel in
an article.
http://bioinformatics.oxfordjournals.org/content/early/2011/11/08/bioinformatics.btr613.full.pdf
* Blog post on using GNU Parallel to speed up BLAST queries:
http://blog.mckuhn.de/2012/01/embarrassingly-parallel-blast-search.html
* Video showing Wake-on-LAN with GNU Parallel.
https://www.youtube.com/watch?v=0mB-yIyKFLQ
* Using GNU Parallel with Solr.
http://sujitpal.blogspot.com/2011/12/solr-report-generation-with-python.html
* First job ad including GNU Parallel:
http://seeker.dice.com/jobsearch/servlet/JobSearch?op=101&dockey=xml/7/6/76f858de083a094f74b1a5d3ba53ffc5@endecaindex
* Bug fixes and man page updates. * Bug fixes and man page updates.

View file

@ -543,7 +543,7 @@ sub get_options_from_array {
sub parse_options { sub parse_options {
# Returns: N/A # Returns: N/A
# Defaults: # Defaults:
$Global::version = 20120124; $Global::version = 20120215;
$Global::progname = 'parallel'; $Global::progname = 'parallel';
$Global::infinity = 2**31; $Global::infinity = 2**31;
$Global::debug = 0; $Global::debug = 0;
@ -3446,15 +3446,41 @@ sub workdir {
if(not defined $self->{'workdir'}) { if(not defined $self->{'workdir'}) {
my $workdir; my $workdir;
if(defined $::opt_workdir) { if(defined $::opt_workdir) {
if($::opt_workdir ne "...") { if($::opt_workdir eq ".") {
# . means current dir
my $home = $ENV{'HOME'};
eval 'use Cwd';
my $cwd = cwd();
$::opt_workdir = $cwd;
if($home) {
# If homedir exists: remove the homedir from
# workdir if cwd starts with homedir
# E.g. /home/foo/my/dir => my/dir
# E.g. /tmp/my/dir => /tmp/my/dir
my ($home_dev, $home_ino) = (stat($home))[0,1];
my $parent = "";
my @dir_parts = split(m:/:,$cwd);
my $part;
while(defined ($part = shift @dir_parts)) {
$part eq "" and next;
$parent .= "/".$part;
my ($parent_dev, $parent_ino) = (stat($parent))[0,1];
if($parent_dev == $home_dev and $parent_ino == $home_ino) {
# dev and ino is the same: We found the homedir.
$::opt_workdir = join("/",@dir_parts);
last;
}
}
}
} elsif($::opt_workdir eq "...") {
$workdir = ".parallel/tmp/" . ::hostname() . "-" . $$
. "-" . $self->seq();
} else {
$workdir = $::opt_workdir; $workdir = $::opt_workdir;
# Rsync treats /./ special. We dont want that # Rsync treats /./ special. We dont want that
$workdir =~ s:/\./:/:g; # Remove /./ $workdir =~ s:/\./:/:g; # Remove /./
$workdir =~ s:/+$::; # Remove ending / if any $workdir =~ s:/+$::; # Remove ending / if any
$workdir =~ s:^\./::g; # Remove starting ./ if any $workdir =~ s:^\./::g; # Remove starting ./ if any
} else {
$workdir = ".parallel/tmp/" . ::hostname() . "-" . $$
. "-" . $self->seq();
} }
} else { } else {
$workdir = "."; $workdir = ".";

View file

@ -66,8 +66,9 @@ with the input.
If I<command> is given, GNU B<parallel> will behave similar to B<xargs>. If If I<command> is given, GNU B<parallel> will behave similar to B<xargs>. If
I<command> is not given GNU B<parallel> will behave similar to B<cat | sh>. I<command> is not given GNU B<parallel> will behave similar to B<cat | sh>.
The I<command> must be an executable, a script or a composed command: an The I<command> must be an executable, a script, a composed command, or
alias or a function will not work (see why a function. If it is a function you need to B<export -f> the function
first. An alias will, however, not work (see why
http://www.perlmonks.org/index.pl?node_id=484296). http://www.perlmonks.org/index.pl?node_id=484296).
@ -1327,9 +1328,17 @@ Print the version GNU B<parallel> and exit.
Files transferred using B<--transfer> and B<--return> will be relative Files transferred using B<--transfer> and B<--return> will be relative
to I<mydir> on remote computers, and the command will be executed in to I<mydir> on remote computers, and the command will be executed in
that dir. The special workdir B<...> will create a workdir in the dir I<mydir>.
B<~/.parallel/tmp/> on the remote computers and will be removed if
using B<--cleanup>. The special I<mydir> value B<...> will create working dirs under
B<~/.parallel/tmp/> on the remote computers. If B<--cleanup> is given
these dirs will be removed.
The special I<mydir> value B<.> uses the current working dir. If the
current working dir is beneath your home dir, the value B<.> is
treated as the relative path to your home dir. This means that if your
home dir is different on remote computers (e.g. if your login is
different) the relative path will still be relative to your home dir.
=item B<--wait> =item B<--wait>

View file

@ -77,8 +77,9 @@ with the input.
If @emph{command} is given, GNU @strong{parallel} will behave similar to @strong{xargs}. If If @emph{command} is given, GNU @strong{parallel} will behave similar to @strong{xargs}. If
@emph{command} is not given GNU @strong{parallel} will behave similar to @strong{cat | sh}. @emph{command} is not given GNU @strong{parallel} will behave similar to @strong{cat | sh}.
The @emph{command} must be an executable, a script or a composed command: an The @emph{command} must be an executable, a script, a composed command, or
alias or a function will not work (see why a function. If it is a function you need to @strong{export -f} the function
first. An alias will, however, not work (see why
http://www.perlmonks.org/index.pl?node_id=484296). http://www.perlmonks.org/index.pl?node_id=484296).
@item @strong{@{@}} @item @strong{@{@}}
@ -1420,9 +1421,17 @@ Print the version GNU @strong{parallel} and exit.
Files transferred using @strong{--transfer} and @strong{--return} will be relative Files transferred using @strong{--transfer} and @strong{--return} will be relative
to @emph{mydir} on remote computers, and the command will be executed in to @emph{mydir} on remote computers, and the command will be executed in
that dir. The special workdir @strong{...} will create a workdir in the dir @emph{mydir}.
@strong{~/.parallel/tmp/} on the remote computers and will be removed if
using @strong{--cleanup}. The special @emph{mydir} value @strong{...} will create working dirs under
@strong{~/.parallel/tmp/} on the remote computers. If @strong{--cleanup} is given
these dirs will be removed.
The special @emph{mydir} value @strong{.} uses the current working dir. If the
current working dir is beneath your home dir, the value @strong{.} is
treated as the relative path to your home dir. This means that if your
home dir is different on remote computers (e.g. if your login is
different) the relative path will still be relative to your home dir.
@item @strong{--wait} @item @strong{--wait}
@anchor{@strong{--wait}} @anchor{@strong{--wait}}

View file

@ -5,19 +5,19 @@ SERVER2=parallel-server2
echo '### Test $PARALLEL - single line' echo '### Test $PARALLEL - single line'
echo | PARALLEL=--number-of-cpus parallel echo | PARALLEL=--number-of-cpus parallel
seq 1 2 | PARALLEL="-S$SERVER1 -Sssh\ -l\ parallel\ $SERVER2 -j1" parallel -kvv echo seq 1 2 | PARALLEL="-Sparallel\@$SERVER1 -Sssh\ -l\ parallel\ $SERVER2 -j1" parallel -kvv echo
echo '### Test $PARALLEL - multi line' echo '### Test $PARALLEL - multi line'
seq 1 2 | PARALLEL="-S$SERVER1 seq 1 2 | PARALLEL="-Sparallel\@$SERVER1
-Sssh\ -l\ parallel\ $SERVER2 -Sssh\ -l\ parallel\ $SERVER2
-j1" parallel -kvv echo -j1" parallel -kvv echo
echo '### Test ~/.parallel/config - single line' echo '### Test ~/.parallel/config - single line'
echo "-S$SERVER1 -Sssh\ -l\ parallel\ $SERVER2 -j1" > ~/.parallel/config echo "-Sparallel\@$SERVER1 -Sssh\ -l\ parallel\ $SERVER2 -j1" > ~/.parallel/config
seq 1 2 | parallel -kvv echo seq 1 2 | parallel -kvv echo
echo '### Test ~/.parallel/config - multi line' echo '### Test ~/.parallel/config - multi line'
echo "-S$SERVER1 echo "-Sparallel\@$SERVER1
-Sssh\ -l\ parallel\ $SERVER2 -Sssh\ -l\ parallel\ $SERVER2
-j1" > ~/.parallel/config -j1" > ~/.parallel/config
seq 1 2 | parallel -kvv echo seq 1 2 | parallel -kvv echo

View file

@ -2,17 +2,17 @@
#cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | nice timeout -k 1 40 parallel -j0 -k -L1 #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'; echo '### Test of --retries - it should run 13 jobs in total';
seq 0 12 | stdout parallel --progress -kj100% --retries 1 -S 12/localhost,1/:,parallel@server2 -vq \ seq 0 12 | stdout parallel --progress -kj100% --retries 1 -S 12/localhost,1/:,parallel@parallel-server1 -vq \
perl -e 'sleep 1;print "job{}\n";exit({})' | perl -e 'sleep 1;print "job{}\n";exit({})' |
perl -ne 'BEGIN{$/="\r";} @a=(split /\//,$_); END{print $a[1]+$a[4]+$a[7],"\n"}' perl -ne 'BEGIN{$/="\r";} @a=(split /\//,$_); END{print $a[1]+$a[4]+$a[7],"\n"}'
echo '### Test of --retries - it should run 25 jobs in total'; echo '### Test of --retries - it should run 25 jobs in total';
seq 0 12 | stdout parallel --progress -kj100% --retries 2 -S 12/localhost,1/:,parallel@server2 -vq \ seq 0 12 | stdout parallel --progress -kj100% --retries 2 -S 12/localhost,1/:,parallel@parallel-server1 -vq \
perl -e 'sleep 1;print "job{}\n";exit({})' | perl -e 'sleep 1;print "job{}\n";exit({})' |
perl -ne 'BEGIN{$/="\r";} @a=(split /\//,$_); END{print $a[1]+$a[4]+$a[7],"\n"}' perl -ne 'BEGIN{$/="\r";} @a=(split /\//,$_); END{print $a[1]+$a[4]+$a[7],"\n"}'
echo '### Test of --retries - it should run 49 jobs in total'; echo '### Test of --retries - it should run 49 jobs in total';
seq 0 12 | stdout parallel --progress -kj100% --retries 4 -S 12/localhost,1/:,parallel@server2 -vq \ seq 0 12 | stdout parallel --progress -kj100% --retries 4 -S 12/localhost,1/:,parallel@parallel-server1 -vq \
perl -e 'sleep 1;print "job{}\n";exit({})' | perl -e 'sleep 1;print "job{}\n";exit({})' |
perl -ne 'BEGIN{$/="\r";} @a=(split /\//,$_); END{print $a[1]+$a[4]+$a[7],"\n"}' perl -ne 'BEGIN{$/="\r";} @a=(split /\//,$_); END{print $a[1]+$a[4]+$a[7],"\n"}'
#EOF #EOF

View file

@ -7,10 +7,10 @@ echo '### Test $PARALLEL_SEQ - local'
seq 1 20 | parallel -kN2 echo arg1:{1} seq:'$'PARALLEL_SEQ arg2:{2} seq 1 20 | parallel -kN2 echo arg1:{1} seq:'$'PARALLEL_SEQ arg2:{2}
echo '### Test $PARALLEL_SEQ - remote' echo '### Test $PARALLEL_SEQ - remote'
seq 1 20 | parallel -kN2 -S $SERVER1,parallel@$SERVER2 echo arg1:{1} seq:'$'PARALLEL_SEQ arg2:{2} seq 1 20 | parallel -kN2 -S parallel@$SERVER1,parallel@$SERVER2 echo arg1:{1} seq:'$'PARALLEL_SEQ arg2:{2}
echo '### Test $PARALLEL_PID - local' echo '### Test $PARALLEL_PID - local'
seq 1 20 | parallel -kN2 echo arg1:{1} pid:'$'PARALLEL_PID arg2:{2} | perl -pe 's/\d{3,}/0/g' seq 1 20 | parallel -kN2 echo arg1:{1} pid:'$'PARALLEL_PID arg2:{2} | perl -pe 's/\d{3,}/0/g'
echo '### Test $PARALLEL_PID - remote' echo '### Test $PARALLEL_PID - remote'
seq 1 20 | parallel -kN2 -S $SERVER1,parallel@$SERVER2 echo arg1:{1} pid:'$'PARALLEL_PID arg2:{2} | perl -pe 's/\d{3,}/0/g' seq 1 20 | parallel -kN2 -S parallel@$SERVER1,parallel@$SERVER2 echo arg1:{1} pid:'$'PARALLEL_PID arg2:{2} | perl -pe 's/\d{3,}/0/g'

View file

@ -27,7 +27,7 @@ PARALLEL="-k --jobs 1 echo 1" parallel -v echo 2 ::: a b c
echo '### Test ugly quoting from $PARALLEL' echo '### Test ugly quoting from $PARALLEL'
PARALLEL="-k --jobs 1 perl -pe '\$a=1; print\$a'" parallel -v ::: <(echo a) <(echo b) PARALLEL="-k --jobs 1 perl -pe '\$a=1; print\$a'" parallel -v ::: <(echo a) <(echo b)
PARALLEL='-k --jobs 1 -S '$SERVER1' perl -pe "\\$a=1; print\\$a"' parallel -v '<(echo {})' ::: foo PARALLEL='-k --jobs 1 -S parallel@'$SERVER1' perl -pe "\\$a=1; print\\$a"' parallel -v '<(echo {})' ::: foo
echo '### Test ugly quoting from profile file' echo '### Test ugly quoting from profile file'
cat <<EOF >~/.parallel/test_profile cat <<EOF >~/.parallel/test_profile
@ -36,36 +36,36 @@ cat <<EOF >~/.parallel/test_profile
EOF EOF
parallel -v -J test_profile ::: <(echo a) <(echo b) parallel -v -J test_profile ::: <(echo a) <(echo b)
PARALLEL='-k --jobs 1 echo' parallel -S ssh\ $SERVER1\ ssh\ parallel@$SERVER2 -v ::: foo PARALLEL='-k --jobs 1 echo' parallel -S ssh\ parallel\@$SERVER1\ ssh\ parallel@$SERVER2 -v ::: foo
PARALLEL='-k --jobs 1 perl -pe "\\$a=1; print \\$a"' parallel -S ssh\ $SERVER1\ ssh\ parallel@$SERVER2 -vv '<(echo {})' ::: foo PARALLEL='-k --jobs 1 perl -pe "\\$a=1; print \\$a"' parallel -S ssh\ parallel\@$SERVER1\ ssh\ $SERVER2 -vv '<(echo {})' ::: foo
echo '### Test quoting of $ in command from profile file' echo '### Test quoting of $ in command from profile file'
cat <<EOF >~/.parallel/test_profile cat <<EOF >~/.parallel/test_profile
-k --jobs 1 perl -pe '\\\$a=1; print \\\$a' -k --jobs 1 perl -pe '\\\$a=1; print \\\$a'
EOF EOF
parallel -v -J test_profile -S ssh\ $SERVER1\ ssh\ parallel@$SERVER2 '<(echo {})' ::: foo parallel -v -J test_profile -S ssh\ parallel\@$SERVER1\ ssh\ $SERVER2 '<(echo {})' ::: foo
echo '### Test quoting of $ in command from $PARALLEL' echo '### Test quoting of $ in command from $PARALLEL'
PARALLEL='-k --jobs 1 perl -pe "\\$a=1; print \\$a" ' parallel -S ssh\ $SERVER1\ ssh\ parallel@$SERVER2 -v '<(echo {})' ::: foo PARALLEL='-k --jobs 1 perl -pe "\\$a=1; print \\$a" ' parallel -S ssh\ parallel\@$SERVER1\ ssh\ $SERVER2 -v '<(echo {})' ::: foo
echo '### Test quoting of space in arguments (-S) from profile file' echo '### Test quoting of space in arguments (-S) from profile file'
cat <<EOF >~/.parallel/test_profile cat <<EOF >~/.parallel/test_profile
-k --jobs 1 -S ssh\ $SERVER1\ ssh\ parallel@$SERVER2 perl -pe '\$a=1; print \$a' -k --jobs 1 -S ssh\ parallel\@$SERVER1\ ssh\ parallel@$SERVER2 perl -pe '\$a=1; print \$a'
EOF EOF
parallel -v -J test_profile '<(echo {})' ::: foo parallel -v -J test_profile '<(echo {})' ::: foo
echo '### Test quoting of space in arguments (-S) from $PARALLEL' echo '### Test quoting of space in arguments (-S) from $PARALLEL'
PARALLEL='-k --jobs 1 -S ssh\ '$SERVER1'\ ssh\ parallel@'$SERVER2' perl -pe "\\$a=1; print \\$a" ' parallel -v '<(echo {})' ::: foo PARALLEL='-k --jobs 1 -S ssh\ parallel@'$SERVER1'\ ssh\ parallel@'$SERVER2' perl -pe "\\$a=1; print \\$a" ' parallel -v '<(echo {})' ::: foo
echo '### Test quoting of space in long arguments (--sshlogin) from profile file' echo '### Test quoting of space in long arguments (--sshlogin) from profile file'
cat <<EOF >~/.parallel/test_profile cat <<EOF >~/.parallel/test_profile
# testprofile # testprofile
-k --jobs 1 --sshlogin ssh\ $SERVER1\ ssh\ parallel@$SERVER2 perl -pe '\$a=1; print \$a' -k --jobs 1 --sshlogin ssh\ parallel\@$SERVER1\ ssh\ parallel@$SERVER2 perl -pe '\$a=1; print \$a'
EOF EOF
parallel -v -J test_profile '<(echo {})' ::: foo parallel -v -J test_profile '<(echo {})' ::: foo
echo '### Test quoting of space in arguments (-S) from $PARALLEL' echo '### Test quoting of space in arguments (-S) from $PARALLEL'
PARALLEL='-k --jobs 1 --sshlogin ssh\ '$SERVER1'\ ssh\ parallel@'$SERVER2' perl -pe "\\$a=1; print \\$a" ' parallel -v '<(echo {})' ::: foo PARALLEL='-k --jobs 1 --sshlogin ssh\ parallel\@'$SERVER1'\ ssh\ parallel@'$SERVER2' perl -pe "\\$a=1; print \\$a" ' parallel -v '<(echo {})' ::: foo
echo '### Test merging of profiles - sort needed because -k only works on the single machine' echo '### Test merging of profiles - sort needed because -k only works on the single machine'
echo --tag > ~/.parallel/test_tag echo --tag > ~/.parallel/test_tag

View file

@ -5,5 +5,5 @@ SERVER2=parallel-server2
echo '### Test -M (--retries to avoid false errors)' echo '### Test -M (--retries to avoid false errors)'
seq 1 30 | parallel -j5 --retries 3 -k -M -S $SERVER1,parallel@$SERVER2 echo 2>/dev/null seq 1 30 | parallel -j5 --retries 3 -k -M -S parallel@$SERVER1,parallel@$SERVER2 echo 2>/dev/null
seq 1 30 | parallel -j10 --retries 3 -k -M -S $SERVER1,parallel@$SERVER2 echo 2>/dev/null seq 1 30 | parallel -j10 --retries 3 -k -M -S parallel@$SERVER1,parallel@$SERVER2 echo 2>/dev/null

View file

@ -5,13 +5,13 @@ SERVER2=parallel-server2
echo '### Test --trc with space added in filename' echo '### Test --trc with space added in filename'
echo original > '/tmp/parallel space file' echo original > '/tmp/parallel space file'
echo '/tmp/parallel space file' | stdout parallel --trc "{} more space" -S $SERVER1 cat {} ">{}\\ more\\ space" echo '/tmp/parallel space file' | stdout parallel --trc "{} more space" -S parallel@$SERVER1 cat {} ">{}\\ more\\ space"
cat '/tmp/parallel space file more space' cat '/tmp/parallel space file more space'
rm '/tmp/parallel space file more space' rm '/tmp/parallel space file more space'
echo '### Test --trc with >|< added in filename' echo '### Test --trc with >|< added in filename'
echo original > '/tmp/parallel space file' echo original > '/tmp/parallel space file'
echo '/tmp/parallel space file' | stdout parallel --trc "{} >|<" -S $SERVER1 cat {} ">{}\\ \\>\\|\\<" echo '/tmp/parallel space file' | stdout parallel --trc "{} >|<" -S parallel@$SERVER1 cat {} ">{}\\ \\>\\|\\<"
cat '/tmp/parallel space file >|<' cat '/tmp/parallel space file >|<'
rm '/tmp/parallel space file >|<' rm '/tmp/parallel space file >|<'

View file

@ -5,7 +5,7 @@ SERVER2=parallel-server2
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | parallel -j0 -k cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | parallel -j0 -k
echo '### Test --return of weirdly named file' echo '### Test --return of weirdly named file'
stdout parallel --return {} -vv -S $SERVER1 echo '>'{} ::: 'aa<${#}" b'; rm 'aa<${#}" b' stdout parallel --return {} -vv -S parallel\@$SERVER1 echo '>'{} ::: 'aa<${#}" b'; rm 'aa<${#}" b'
echo '### Test if remote login shell is csh' echo '### Test if remote login shell is csh'
stdout parallel -k -vv -S csh@localhost 'echo $PARALLEL_PID $PARALLEL_SEQ {}| wc -w' ::: a b c stdout parallel -k -vv -S csh@localhost 'echo $PARALLEL_PID $PARALLEL_SEQ {}| wc -w' ::: a b c

View file

@ -79,15 +79,15 @@ parallel: Warning: --cleanup ignored as there are no remote --sshlogin
10 10
### Check forced number of CPUs being respected ### Check forced number of CPUs being respected
alpha alpha
vh1 vm1
vh1 vm1
vh1 vm1
vh1 vm1
vh1 vm1
vh1 vm1
vh1 vm1
vh1 vm1
vh1 vm1
alpha alpha
alpha alpha
alpha alpha

View file

@ -2,20 +2,20 @@
1 1
ssh -l parallel parallel-server2 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 1; ssh -l parallel parallel-server2 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 1;
1 1
ssh parallel-server3 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 2; ssh parallel\@parallel-server3 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 2;
2 2
### Test $PARALLEL - multi line ### Test $PARALLEL - multi line
ssh -l parallel parallel-server2 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 1; ssh -l parallel parallel-server2 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 1;
1 1
ssh parallel-server3 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 2; ssh parallel\@parallel-server3 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 2;
2 2
### Test ~/.parallel/config - single line ### Test ~/.parallel/config - single line
ssh -l parallel parallel-server2 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 1; ssh -l parallel parallel-server2 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 1;
1 1
ssh parallel-server3 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 2; ssh parallel\@parallel-server3 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 2;
2 2
### Test ~/.parallel/config - multi line ### Test ~/.parallel/config - multi line
ssh -l parallel parallel-server2 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 1; ssh -l parallel parallel-server2 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 1;
1 1
ssh parallel-server3 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 2; ssh parallel\@parallel-server3 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ 2;
2 2

View file

@ -37,7 +37,7 @@ perl -pe '$a=1; print $a' /dev/fd/62
1b 1b
echo foo echo foo
foo foo
ssh parallel-server3 ssh parallel@parallel-server2 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' perl\ -pe\ \"\\\$a=1\;\ print\ \\\$a\"\ \<\(echo\ foo\); ssh parallel@parallel-server3 ssh parallel-server2 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' perl\ -pe\ \"\\\$a=1\;\ print\ \\\$a\"\ \<\(echo\ foo\);
1foo 1foo
### Test quoting of $ in command from profile file ### Test quoting of $ in command from profile file
perl -pe '$a=1; print $a' <(echo foo) perl -pe '$a=1; print $a' <(echo foo)

View file

@ -50,16 +50,16 @@
3 3
3 3
### Test --nonall ### Test --nonall
vh1 vm1
vh2.pi.dk vm10
### Test --nonall -u ### Test --nonall -u
vh2.pi.dk vm10
vh1 vm1
vh2.pi.dk vm10
vh1 vm1
### Test read sshloginfile from STDIN ### Test read sshloginfile from STDIN
vh1 vm1
vh1 vm1
### Test --nonall --basefile ### Test --nonall --basefile
/tmp/nonall--basefile /tmp/nonall--basefile
/tmp/nonall--basefile /tmp/nonall--basefile

View file

@ -1,5 +1,5 @@
### Test --return of weirdly named file ### Test --return of weirdly named file
ssh parallel-server3 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ \>aa\\\<\\\$\\\{\\\#\\\}\\\"\\\ b;_EXIT_status=$?; rsync -rlDzR -essh parallel-server3:././aa\\\<\\\$\\\{\\\#\\\}\\\"\\\ b ./; exit $_EXIT_status; ssh parallel@parallel-server3 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ \>aa\\\<\\\$\\\{\\\#\\\}\\\"\\\ b;_EXIT_status=$?; rsync -rlDzR -essh parallel@parallel-server3:././aa\\\<\\\$\\\{\\\#\\\}\\\"\\\ b ./; exit $_EXIT_status;
### Test if remote login shell is csh ### Test if remote login shell is csh
ssh csh@localhost 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ \$PARALLEL_PID\ \$PARALLEL_SEQ\ a\|\ wc\ -w; ssh csh@localhost 'eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\;PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' echo\ \$PARALLEL_PID\ \$PARALLEL_SEQ\ a\|\ wc\ -w;
3 3