parallel: Multiple --sshloginfile supported. Passes testsuite.

This commit is contained in:
Ole Tange 2011-10-17 03:10:32 +02:00
parent ebac7477d7
commit 0cd02204c4
22 changed files with 303 additions and 241 deletions

View file

@ -167,7 +167,17 @@ Dont start:
Video 30. 36. 41. 48 # GNU Parallel 20111022 - The Steve Ritchie release
--tag
-Jt (e.g. --tag --nonall)
-Jr (--sshloginfile myremoteservers)
-Jl (--sshloginfile mylocalservers)
-Jt -Jr -Jl
./src/parallel --sshloginfile ~/.parallel/remote --slf ~/.parallel/local --nonall hostname
# GNU Parallel 20110522 - The Pakistan Release # GNU Parallel 20110522 - The Pakistan Release

View file

@ -186,9 +186,22 @@ available for download at: http://ftp.gnu.org/gnu/parallel/
New in this release: New in this release:
* --tag prepends lines with the argument(s). If used with --(n)onall
the line will be prepended with the sshlogin instead.
* --shellquote does not run the command but quotes it using \'s. * --shellquote does not run the command but quotes it using \'s.
Useful for making quoted composed commands. Useful for making quoted composed commands.
* --profile can now be repeated merging multiple profiles.
* --bibtex now gives the BibTeX entry.
Thanks to Aleksandr Levchuk for testing.
* Makefile for simple .deb package.
cd packager/debian; make
* sql: --list-databases lists the databases.
* GNU Parallel officially in Fedora 16 * GNU Parallel officially in Fedora 16
http://www.spinics.net/lists/fedora-package-announce/msg67130.html http://www.spinics.net/lists/fedora-package-announce/msg67130.html

View file

@ -10,7 +10,7 @@ build:
echo "To install, run:" ; \ echo "To install, run:" ; \
echo -e "\tapt-get install dpkg-dev" ; \ echo -e "\tapt-get install dpkg-dev" ; \
false ) false )
cd parallel-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]; perl -i -pe "s/201[0-9]{5}-[0-9]+/"`src/parallel --minversion 1`"/" debian/{changelog,parallel/DEBIAN/control} cd parallel-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]; perl -i -pe "s/201[0-9]{5}-[0-9]+/"`src/parallel --minversion 1`"/" debian/{changelog,control}
cd parallel-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]; dpkg-buildpackage -us -uc cd parallel-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]; dpkg-buildpackage -us -uc
@echo @echo
@echo "To install the GNU Parallel Debian package, run:" @echo "To install the GNU Parallel Debian package, run:"
@ -25,4 +25,5 @@ distclean:
rm -rf parallel-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] rm -rf parallel-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
makedist: makedist:
cd ../..; make dist-bzip2 dist-gzip cd ../..; make dist-bzip2
cd ../..; make dist-gzip

View file

@ -406,7 +406,7 @@ sub options_hash {
"onall" => \$::opt_onall, "onall" => \$::opt_onall,
"nonall" => \$::opt_nonall, "nonall" => \$::opt_nonall,
"sshlogin|S=s" => \@::opt_sshlogin, "sshlogin|S=s" => \@::opt_sshlogin,
"sshloginfile=s" => \$::opt_sshloginfile, "sshloginfile|slf=s" => \@::opt_sshloginfile,
"controlmaster|M" => \$::opt_controlmaster, "controlmaster|M" => \$::opt_controlmaster,
"return=s" => \@::opt_return, "return=s" => \@::opt_return,
"trc=s" => \@::opt_trc, "trc=s" => \@::opt_trc,
@ -571,7 +571,7 @@ sub parse_options {
if(defined $::opt_bibtex) { bibtex(); wait_and_exit(0); } if(defined $::opt_bibtex) { bibtex(); wait_and_exit(0); }
if(defined $::opt_show_limits) { show_limits(); } if(defined $::opt_show_limits) { show_limits(); }
if(defined @::opt_sshlogin) { @Global::sshlogin = @::opt_sshlogin; } if(defined @::opt_sshlogin) { @Global::sshlogin = @::opt_sshlogin; }
if(defined $::opt_sshloginfile) { read_sshloginfile($::opt_sshloginfile); } if(defined @::opt_sshloginfile) { read_sshloginfiles(@::opt_sshloginfile); }
if(defined @::opt_return) { push @Global::ret_files, @::opt_return; } if(defined @::opt_return) { push @Global::ret_files, @::opt_return; }
if(not defined $::opt_recstart and if(not defined $::opt_recstart and
not defined $::opt_recend) { $::opt_recend = "\n"; } not defined $::opt_recend) { $::opt_recend = "\n"; }
@ -1384,6 +1384,13 @@ sub get_job_with_sshlogin {
sub __REMOTE_SSH__ {} sub __REMOTE_SSH__ {}
sub read_sshloginfiles {
# Returns: N/A
for (@_) {
read_sshloginfile($_);
}
}
sub read_sshloginfile { sub read_sshloginfile {
# Returns: N/A # Returns: N/A
my $file = shift; my $file = shift;
@ -1735,7 +1742,7 @@ sub bibtex {
print "WARNING: YOU ARE USING --tollef. USE --gnu FOR GNU PARALLEL\n\n"; print "WARNING: YOU ARE USING --tollef. USE --gnu FOR GNU PARALLEL\n\n";
} }
print join("\n", print join("\n",
"\@article{Tange2011,", "\@article{Tange2011a,",
" title = {GNU Parallel - The Command-Line Power Tool},", " title = {GNU Parallel - The Command-Line Power Tool},",
" author = {O. Tange},", " author = {O. Tange},",
" address = {Frederiksberg, Denmark},", " address = {Frederiksberg, Denmark},",

View file

@ -610,8 +610,9 @@ jobs while GNU B<parallel> is running.
=item B<-k> =item B<-k>
Keep sequence of output same as the order of input. Try this to see Keep sequence of output same as the order of input. Normally the
the difference: output of a job will be printed as soon as the job completes. Try this
to see the difference:
parallel -j4 sleep {}\; echo {} ::: 2 1 4 3 parallel -j4 sleep {}\; echo {} ::: 2 1 4 3
parallel -j4 -k sleep {}\; echo {} ::: 2 1 4 3 parallel -j4 -k sleep {}\; echo {} ::: 2 1 4 3
@ -1098,6 +1099,8 @@ B<--cleanup>, and B<--trc>.
=item B<--sshloginfile> I<filename> =item B<--sshloginfile> I<filename>
=item B<--slf> I<filename>
File with sshlogins. The file consists of sshlogins on separate File with sshlogins. The file consists of sshlogins on separate
lines. Empty lines and lines starting with '#' are ignored. Example: lines. Empty lines and lines starting with '#' are ignored. Example:
@ -1119,6 +1122,8 @@ lines. Empty lines and lines starting with '#' are ignored. Example:
When using a different ssh program the last argument must be the hostname. When using a different ssh program the last argument must be the hostname.
Multiple B<--sshloginfile> are allowed.
The sshloginfile '..' is special, it read sshlogins from The sshloginfile '..' is special, it read sshlogins from
~/.parallel/sshloginfile ~/.parallel/sshloginfile

View file

@ -30,7 +30,7 @@ expect "echo opt--interactive 3"
send "y\n" send "y\n"
expect "opt--interactive 3" expect "opt--interactive 3"
_EOF _EOF
echo
cat <<'EOF' | parallel -j0 -k cat <<'EOF' | parallel -j0 -k
echo '### Test -L -l and --max-lines' echo '### Test -L -l and --max-lines'
(echo a_b;echo c) | parallel -km -L2 echo (echo a_b;echo c) | parallel -km -L2 echo

View file

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
SERVER1=parallel-server3 SERVER1=parallel-server1
SERVER2=parallel-server2 SERVER2=parallel-server2
SSHLOGIN1=parallel@$SERVER1
SSHLOGIN2=parallel@$SERVER2
# Make sure sort order is the same # Make sure sort order is the same
export LANG=C export LANG=C
@ -9,8 +11,8 @@ export LANG=C
echo '### Test --transfer --return --cleanup' echo '### Test --transfer --return --cleanup'
rm -rf /tmp/parallel.file* rm -rf /tmp/parallel.file*
stdout ssh $SERVER1 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*' stdout ssh $SSHLOGIN1 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*'
stdout ssh parallel@$SERVER2 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*' stdout ssh $SSHLOGIN2 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*'
(seq 1 3;echo '>fire';seq 5 10; /bin/echo ' : & ) \n*.jpg'; echo '/./sub dir'; seq 13 20) >/tmp/test17 (seq 1 3;echo '>fire';seq 5 10; /bin/echo ' : & ) \n*.jpg'; echo '/./sub dir'; seq 13 20) >/tmp/test17
echo '# Create some weirdly files in /tmp' echo '# Create some weirdly files in /tmp'
mkdir -p /tmp/parallel.file mkdir -p /tmp/parallel.file
@ -19,178 +21,178 @@ cat /tmp/test17 | parallel -k /bin/echo /tmp/parallel.file{}.file >/tmp/test17ab
cat /tmp/test17 | parallel -k /bin/echo tmp/parallel.file{}.file >/tmp/test17rel cat /tmp/test17 | parallel -k /bin/echo tmp/parallel.file{}.file >/tmp/test17rel
echo '### --transfer - abspath' echo '### --transfer - abspath'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
cat /tmp/test17abs | parallel -k --transfer --sshlogin $SERVER1,parallel@$SERVER2 cat {}";"rm {} cat /tmp/test17abs | parallel -k --transfer --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {}";"rm {}
# One of these should give the empty dir /tmp/parallel.file # One of these should give the empty dir /tmp/parallel.file
echo good if no file echo good if no file
stdout ssh $SERVER1 ls '/tmp/parallel.file*' stdout ssh $SSHLOGIN1 ls '/tmp/parallel.file*'
# The other: No such file or directory # The other: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*'
echo '### --transfer - relpath' echo '### --transfer - relpath'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
cd / cd /
cat /tmp/test17rel | parallel -k --transfer --sshlogin $SERVER1,parallel@$SERVER2 cat {}";"rm {} cat /tmp/test17rel | parallel -k --transfer --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {}";"rm {}
# Should give: No such file or directory # Should give: No such file or directory
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*'
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*'
echo '### --transfer --cleanup - abspath' echo '### --transfer --cleanup - abspath'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
cat /tmp/test17abs | parallel -k --transfer --cleanup --sshlogin $SERVER1,parallel@$SERVER2 cat {} cat /tmp/test17abs | parallel -k --transfer --cleanup --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {}
echo good if no file echo good if no file
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh $SERVER1 ls '/tmp/parallel.file*' stdout ssh $SSHLOGIN1 ls '/tmp/parallel.file*'
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*'
echo '### --transfer --cleanup - relpath' echo '### --transfer --cleanup - relpath'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
cat /tmp/test17rel | parallel -k --transfer --cleanup --sshlogin $SERVER1,parallel@$SERVER2 cat {} cat /tmp/test17rel | parallel -k --transfer --cleanup --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {}
# Should give: No such file or directory # Should give: No such file or directory
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --return - abspath' echo '### --return - abspath'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
rm -rf /tmp/parallel.file*out rm -rf /tmp/parallel.file*out
cat /tmp/test17abs | parallel -k --return {.}.out --sshlogin $SERVER1,parallel@$SERVER2 mkdir -p /tmp/parallel.file";"echo {} ">"{.}.out cat /tmp/test17abs | parallel -k --return {.}.out --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p /tmp/parallel.file";"echo {} ">"{.}.out
ls /tmp/parallel.file*out /tmp/parallel.file/*out ls /tmp/parallel.file*out /tmp/parallel.file/*out
echo '### --return - relpath' echo '### --return - relpath'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf /tmp/parallel.file*out rm -rf /tmp/parallel.file*out
cat /tmp/test17rel | parallel -k --return {.}.out --sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out cat /tmp/test17rel | parallel -k --return {.}.out --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out
ls tmp/parallel.file*out tmp/parallel.file/*out ls tmp/parallel.file*out tmp/parallel.file/*out
echo '### --return - multiple files' echo '### --return - multiple files'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done \ cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';'
ls tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done ls tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
echo '### --return --cleanup - abspath' echo '### --return --cleanup - abspath'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
rm -rf /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done rm -rf /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
cat /tmp/test17abs | parallel -k --return {.}.out --return {}.done --cleanup \ cat /tmp/test17abs | parallel -k --return {.}.out --return {}.done --cleanup \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p /tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p /tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls '/tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*' || echo OK
echo '### --return --cleanup - relpath' echo '### --return --cleanup - relpath'
rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done --cleanup \ cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done --cleanup \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';'
ls tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done ls tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --return --cleanup - multiple returns' echo '### --return --cleanup - multiple returns'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done --cleanup \ cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done --cleanup \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --transfer --return --cleanup - abspath' echo '### --transfer --return --cleanup - abspath'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
rm -rf /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done rm -rf /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
cat /tmp/test17abs | parallel -k --transfer --return {.}.out --return {}.done --cleanup \ cat /tmp/test17abs | parallel -k --transfer --return {.}.out --return {}.done --cleanup \
--sshlogin $SERVER1,parallel@$SERVER2 cat {} ">"{.}.out';'cat {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {} ">"{.}.out';'cat {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls '/tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*' || echo OK
echo '### --transfer --return --cleanup - relpath' echo '### --transfer --return --cleanup - relpath'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
cat /tmp/test17rel | parallel -k --transfer --return {.}.out --return {}.done --cleanup \ cat /tmp/test17rel | parallel -k --transfer --return {.}.out --return {}.done --cleanup \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --transfer --return --cleanup - multiple files' echo '### --transfer --return --cleanup - multiple files'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
cat /tmp/test17rel | parallel -k --transfer --return {.}.out --return {}.done --cleanup \ cat /tmp/test17rel | parallel -k --transfer --return {.}.out --return {}.done --cleanup \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --trc - abspath' echo '### --trc - abspath'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
rm -rf /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done rm -rf /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
cat /tmp/test17abs | parallel -k --trc {.}.out --trc {}.done \ cat /tmp/test17abs | parallel -k --trc {.}.out --trc {}.done \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls '/tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*' || echo OK
echo '### --trc - relpath' echo '### --trc - relpath'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done rm -rf tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
cat /tmp/test17rel | parallel -k --trc {.}.out --trc {}.done \ cat /tmp/test17rel | parallel -k --trc {.}.out --trc {}.done \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';'
ls tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done ls tmp/parallel.file*out tmp/parallel.file/*out tmp/parallel.file*done tmp/parallel.file/*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --trc - multiple files' echo '### --trc - multiple files'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
rm -rf /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done rm -rf /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
cat /tmp/test17abs | parallel -k --trc {.}.out --trc {}.done \ cat /tmp/test17abs | parallel -k --trc {.}.out --trc {}.done \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done ls /tmp/parallel.file*out /tmp/parallel.file/*out /tmp/parallel.file*done /tmp/parallel.file/*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls '/tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*' || echo OK
echo '### --transfer --cleanup - multiple argument files' echo '### --transfer --cleanup - multiple argument files'
parallel --xapply -kv --transfer --cleanup -Sparallel@$SERVER2 cat {2} {1} :::: /tmp/test17rel <(sort -r /tmp/test17abs) parallel --xapply -kv --transfer --cleanup -S$SSHLOGIN2 cat {2} {1} :::: /tmp/test17rel <(sort -r /tmp/test17abs)
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*' || echo OK

View file

@ -1,23 +1,25 @@
#!/bin/bash #!/bin/bash
SERVER1=parallel-server3 SERVER1=parallel-server1
SERVER2=parallel-server2 SERVER2=parallel-server2
SSHLOGIN1=parallel@$SERVER1
SSHLOGIN2=parallel@$SERVER2
echo '### Check -S .. and --serverloginfile ..' echo '### Check -S .. and --serverloginfile ..'
echo $SERVER1 > ~/.parallel/sshloginfile echo $SSHLOGIN1 > ~/.parallel/sshloginfile
echo parallel@$SERVER2 >> ~/.parallel/sshloginfile echo $SSHLOGIN2 >> ~/.parallel/sshloginfile
seq 1 20 | parallel -k -S .. echo seq 1 20 | parallel -k -S .. echo
seq 1 20 | parallel -k --sshloginfile .. echo seq 1 20 | parallel -k --sshloginfile .. echo
echo '### Check warning if --transfer but file not found' echo '### Check warning if --transfer but file not found'
echo /tmp/noexistant/file | stdout parallel -k -S $SERVER1 --transfer echo echo /tmp/noexistant/file | stdout parallel -k -S $SSHLOGIN1 --transfer echo
echo '### Transfer for file starting with :' echo '### Transfer for file starting with :'
cd /tmp cd /tmp
(echo ':'; echo file:name; echo file:name.foo; echo file: name.foo; echo file : name.foo;) \ (echo ':'; echo file:name; echo file:name.foo; echo file: name.foo; echo file : name.foo;) \
> /tmp/test18 > /tmp/test18
cat /tmp/test18 | parallel echo content-{} ">" {} cat /tmp/test18 | parallel echo content-{} ">" {}
cat /tmp/test18 | parallel -j1 --trc {}.{.} -S $SERVER1,parallel@$SERVER2,: \ cat /tmp/test18 | parallel -j1 --trc {}.{.} -S $SSHLOGIN1,parallel@$SERVER2,: \
'(echo remote-{}.{.};cat {}) > {}.{.}' '(echo remote-{}.{.};cat {}) > {}.{.}'
cat /tmp/test18 | parallel -j1 -k 'cat {}.{.}' cat /tmp/test18 | parallel -j1 -k 'cat {}.{.}'
@ -32,7 +34,7 @@ echo | stdout parallel -k --cleanup echo
echo '### Test --sshlogin -S --sshloginfile' echo '### Test --sshlogin -S --sshloginfile'
echo localhost >/tmp/parallel-sshlogin echo localhost >/tmp/parallel-sshlogin
seq 1 3 | parallel -k --sshlogin 8/$SERVER1 -S "7/ssh -l parallel $SERVER2",: --sshloginfile /tmp/parallel-sshlogin echo seq 1 3 | parallel -k --sshlogin 8/$SSHLOGIN1 -S "7/ssh -l parallel $SERVER2",: --sshloginfile /tmp/parallel-sshlogin echo
echo '### Test --sshloginfile with extra content' echo '### Test --sshloginfile with extra content'
echo "2/ssh -l parallel $SERVER2" >>/tmp/parallel-sshlogin echo "2/ssh -l parallel $SERVER2" >>/tmp/parallel-sshlogin
@ -41,13 +43,13 @@ echo "#2/ssh -l tange nothing" >>/tmp/parallel-sshlogin
seq 1 10 | parallel -k --sshloginfile /tmp/parallel-sshlogin echo seq 1 10 | parallel -k --sshloginfile /tmp/parallel-sshlogin echo
echo '### Check forced number of CPUs being respected' echo '### Check forced number of CPUs being respected'
stdout seq 1 20 | parallel -k -j+0 -S 1/:,9/$SERVER1 "hostname; echo {} >/dev/null" stdout seq 1 20 | parallel -k -j+0 -S 1/:,9/$SSHLOGIN1 "hostname; echo {} >/dev/null"
echo '### Check more than 9 simultaneous sshlogins' echo '### Check more than 9 simultaneous sshlogins'
seq 1 11 | parallel -k -j0 -S "/ssh $SERVER1" echo seq 1 11 | parallel -k -j0 -S "/ssh $SSHLOGIN1" echo
echo '### Check more than 9(relative) simultaneous sshlogins' echo '### Check more than 9(relative) simultaneous sshlogins'
seq 1 11 | parallel -k -j10000% -S "ssh $SERVER1" echo seq 1 11 | parallel -k -j10000% -S "ssh $SSHLOGIN1" echo
echo '### Check -S syntax' echo '### Check -S syntax'
seq 1 11 | parallel -k -j100% -S "/:" echo seq 1 11 | parallel -k -j100% -S "/:" echo

View file

@ -2,14 +2,16 @@
# TODO return multiple # TODO return multiple
SERVER1=parallel-server3 SERVER1=parallel-server1
SERVER2=parallel-server2 SERVER2=parallel-server2
SSHLOGIN1=parallel@parallel-server1
SSHLOGIN2=parallel@parallel-server2
echo '### Test --transfer --return --cleanup - files with newline' echo '### Test --transfer --return --cleanup - files with newline'
rm -rf /tmp/parallel.file* rm -rf /tmp/parallel.file*
stdout ssh $SERVER1 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*' stdout ssh $SSHLOGIN1 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*'
stdout ssh parallel@$SERVER2 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*' stdout ssh $SSHLOGIN2 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*'
cd / cd /
echo '### --transfer - file with newline' echo '### --transfer - file with newline'
@ -17,24 +19,24 @@ echo newline > '/tmp/parallel.file.
newline1' newline1'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline2' newline2'
find tmp/parallel*newline* -print0 | parallel -0 -k --transfer --sshlogin $SERVER1,parallel@$SERVER2 cat {}";"rm {} find tmp/parallel*newline* -print0 | parallel -0 -k --transfer --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {}";"rm {}
# Should give: No such file or directory # Should give: No such file or directory
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*'
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*'
echo '### --transfer --cleanup - file with newline' echo '### --transfer --cleanup - file with newline'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline1' newline1'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline2' newline2'
find tmp/parallel*newline* -print0 | parallel -0 -k --transfer --cleanup --sshlogin $SERVER1,parallel@$SERVER2 cat {} find tmp/parallel*newline* -print0 | parallel -0 -k --transfer --cleanup --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {}
# Should give: No such file or directory # Should give: No such file or directory
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*'
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*'
echo '### --return - file with newline' echo '### --return - file with newline'
rm -rf /tmp/parallel.file.*newline* rm -rf /tmp/parallel.file.*newline*
@ -42,64 +44,64 @@ echo newline > '/tmp/parallel.file.
newline1' newline1'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline2' newline2'
find tmp/parallel*newline* -print0 | parallel -0 -k --return {}.out --sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp\;echo remote '>' {}.out find tmp/parallel*newline* -print0 | parallel -0 -k --return {}.out --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp\;echo remote '>' {}.out
ls tmp/parallel*newline*out ls tmp/parallel*newline*out
rm tmp/parallel*newline*out rm tmp/parallel*newline*out
# Cleanup remote # Cleanup remote
stdout ssh $SERVER1 rm -rf 'tmp/parallel.file*' stdout ssh $SSHLOGIN1 rm -rf 'tmp/parallel.file*'
stdout ssh parallel@$SERVER2 rm -rf 'tmp/parallel.file*' stdout ssh $SSHLOGIN2 rm -rf 'tmp/parallel.file*'
echo '### --return --cleanup - file with newline' echo '### --return --cleanup - file with newline'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline1' newline1'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline2' newline2'
find tmp/parallel*newline* -print0 | parallel -0 -k --return {}.out --cleanup --sshlogin $SERVER1,parallel@$SERVER2 echo remote '>' {}.out find tmp/parallel*newline* -print0 | parallel -0 -k --return {}.out --cleanup --sshlogin $SSHLOGIN1,$SSHLOGIN2 echo remote '>' {}.out
ls tmp/parallel*newline*out ls tmp/parallel*newline*out
rm tmp/parallel*newline*out rm tmp/parallel*newline*out
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --transfer --return --cleanup - file with newline' echo '### --transfer --return --cleanup - file with newline'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline1' newline1'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline2' newline2'
find tmp/parallel*newline* -print0 | parallel -0 -k --transfer --return {}.out --cleanup --sshlogin $SERVER1,parallel@$SERVER2 cat {} '>' {}.out find tmp/parallel*newline* -print0 | parallel -0 -k --transfer --return {}.out --cleanup --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {} '>' {}.out
ls tmp/parallel*newline*out ls tmp/parallel*newline*out
rm tmp/parallel*newline*out rm tmp/parallel*newline*out
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --trc - file with newline' echo '### --trc - file with newline'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline1' newline1'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline2' newline2'
find tmp/parallel*newline* -print0 | parallel -0 -k --trc {}.out --sshlogin $SERVER1,parallel@$SERVER2 cat {} '>' {}.out find tmp/parallel*newline* -print0 | parallel -0 -k --trc {}.out --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {} '>' {}.out
ls tmp/parallel*newline*out ls tmp/parallel*newline*out
rm tmp/parallel*newline*out rm tmp/parallel*newline*out
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --trc - multiple file with newline' echo '### --trc - multiple file with newline'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline1' newline1'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline2' newline2'
find tmp/parallel*newline* -print0 | parallel -0 -k --trc {}.out --trc {}.out2 --sshlogin $SERVER1,parallel@$SERVER2 cat {} '>' {}.out';'cat {} '>' {}.out2 find tmp/parallel*newline* -print0 | parallel -0 -k --trc {}.out --trc {}.out2 --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {} '>' {}.out';'cat {} '>' {}.out2
ls tmp/parallel*newline*out* ls tmp/parallel*newline*out*
rm tmp/parallel*newline*out* rm tmp/parallel*newline*out*
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### Test use special ssh' echo '### Test use special ssh'
echo 'ssh "$@"; echo "$@" >>/tmp/myssh1-run' >/tmp/myssh1 echo 'ssh "$@"; echo "$@" >>/tmp/myssh1-run' >/tmp/myssh1
@ -111,14 +113,14 @@ newline1'
echo newline > '/tmp/parallel.file. echo newline > '/tmp/parallel.file.
newline2' newline2'
find tmp/parallel*newline* -print0 | parallel -0 -k -j1 --trc {}.out --trc {}.out2 \ find tmp/parallel*newline* -print0 | parallel -0 -k -j1 --trc {}.out --trc {}.out2 \
--sshlogin "/tmp/myssh1 $SERVER1, /tmp/myssh2 parallel@$SERVER2" \ --sshlogin "/tmp/myssh1 $SSHLOGIN1, /tmp/myssh2 $SSHLOGIN2" \
cat {} '>' {}.out';'cat {} '>' {}.out2 cat {} '>' {}.out';'cat {} '>' {}.out2
ls tmp/parallel*newline*out* ls tmp/parallel*newline*out*
rm tmp/parallel*newline*out* rm tmp/parallel*newline*out*
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo 'Input for ssh' echo 'Input for ssh'
cat /tmp/myssh1-run /tmp/myssh2-run | perl -pe 's/(PID.)\d+/${1}00000/g' cat /tmp/myssh1-run /tmp/myssh2-run | perl -pe 's/(PID.)\d+/${1}00000/g'
rm /tmp/myssh1-run /tmp/myssh2-run rm /tmp/myssh1-run /tmp/myssh2-run
@ -127,5 +129,5 @@ echo '### Test use special ssh with > 9 simultaneous'
echo 'ssh "$@"; echo "$@" >>/tmp/myssh1-run' >/tmp/myssh1 echo 'ssh "$@"; echo "$@" >>/tmp/myssh1-run' >/tmp/myssh1
echo 'ssh "$@"; echo "$@" >>/tmp/myssh2-run' >/tmp/myssh2 echo 'ssh "$@"; echo "$@" >>/tmp/myssh2-run' >/tmp/myssh2
chmod 755 /tmp/myssh1 /tmp/myssh2 chmod 755 /tmp/myssh1 /tmp/myssh2
seq 1 100 | parallel --sshlogin "/tmp/myssh1 $SERVER1, /tmp/myssh2 parallel@$SERVER2" \ seq 1 100 | parallel --sshlogin "/tmp/myssh1 $SSHLOGIN1, /tmp/myssh2 $SSHLOGIN2" \
-j10000% -k echo -j10000% -k echo

View file

@ -1,8 +1,10 @@
#!/bin/bash #!/bin/bash
PAR=parallel PAR=parallel
SERVER1=parallel-server3 SERVER1=parallel-server1
SERVER2=parallel-server2 SERVER2=parallel-server2
SSHLOGIN1=parallel@$SERVER1
SSHLOGIN2=parallel@$SERVER2
cd /tmp cd /tmp
@ -13,10 +15,10 @@ echo '### Test --basefile + --cleanup + permissions'
echo echo script1 run '"$@"' > script1 echo echo script1 run '"$@"' > script1
echo echo script2 run '"$@"' > script2 echo echo script2 run '"$@"' > script2
chmod 755 script1 script2 chmod 755 script1 script2
seq 1 5 | parallel -kS $SERVER1 --cleanup -B script1 --basefile script2 "./script1 {};./script2 {}" seq 1 5 | parallel -kS $SSHLOGIN1 --cleanup -B script1 --basefile script2 "./script1 {};./script2 {}"
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'script1' || echo OK stdout ssh $SSHLOGIN1 ls 'script1' || echo OK
stdout ssh $SERVER1 ls 'script2' || echo OK stdout ssh $SSHLOGIN1 ls 'script2' || echo OK
echo '### Test --basefile + --sshlogin :' echo '### Test --basefile + --sshlogin :'
echo cat '"$@"' > my_script echo cat '"$@"' > my_script
@ -25,6 +27,6 @@ rm -f parallel_*.test parallel_*.out
seq 1 13 | parallel echo {} '>' parallel_{}.test seq 1 13 | parallel echo {} '>' parallel_{}.test
ls parallel_*.test | parallel -j+0 --trc {.}.out -B my_script \ ls parallel_*.test | parallel -j+0 --trc {.}.out -B my_script \
-S $SERVER1,parallel@$SERVER2,: "./my_script {} > {.}.out" -S $SSHLOGIN1,$SSHLOGIN2,: "./my_script {} > {.}.out"
cat parallel_*.test parallel_*.out cat parallel_*.test parallel_*.out

View file

@ -70,4 +70,6 @@ PARALLEL='-k --jobs 1 --sshlogin ssh\ '$SERVER1'\ ssh\ parallel@'$SERVER2' perl
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
echo -S .. > ~/.parallel/test_S.. echo -S .. > ~/.parallel/test_S..
echo parallel@parallel-server1 > ~/.parallel/sshloginfile
echo parallel@parallel-server2 >> ~/.parallel/sshloginfile
parallel -Jtest_tag -Jtest_S.. --nonall echo a | sort parallel -Jtest_tag -Jtest_S.. --nonall echo a | sort

View file

@ -2,6 +2,8 @@
SERVER1=parallel-server3 SERVER1=parallel-server3
SERVER2=parallel-server2 SERVER2=parallel-server2
SSHLOGIN1=parallel@$SERVER1
SSHLOGIN2=parallel@$SERVER2
# Minimal version of test17 # Minimal version of test17
@ -11,8 +13,8 @@ export LANG=C
echo '### Test --transfer --return --cleanup' echo '### Test --transfer --return --cleanup'
rm -rf /tmp/parallel.file* rm -rf /tmp/parallel.file*
stdout ssh $SERVER1 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*' stdout ssh $SSHLOGIN1 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*'
stdout ssh parallel@$SERVER2 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*' stdout ssh $SSHLOGIN2 rm -rf 'tmp/parallel.file*' '/tmp/parallel.file*'
(seq 1 2) >/tmp/test17 (seq 1 2) >/tmp/test17
echo '# Create some weirdly files in /tmp' echo '# Create some weirdly files in /tmp'
mkdir -p /tmp/parallel.file mkdir -p /tmp/parallel.file
@ -21,178 +23,178 @@ cat /tmp/test17 | parallel -k /bin/echo /tmp/parallel.file{}.file >/tmp/test17ab
cat /tmp/test17 | parallel -k /bin/echo tmp/parallel.file{}.file >/tmp/test17rel cat /tmp/test17 | parallel -k /bin/echo tmp/parallel.file{}.file >/tmp/test17rel
echo '### --transfer - abspath' echo '### --transfer - abspath'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
cat /tmp/test17abs | parallel -k --transfer --sshlogin $SERVER1,parallel@$SERVER2 cat {}";"rm {} cat /tmp/test17abs | parallel -k --transfer --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {}";"rm {}
# One of these should give the empty dir /tmp/parallel.file # One of these should give the empty dir /tmp/parallel.file
echo good if no file echo good if no file
stdout ssh $SERVER1 ls '/tmp/parallel.file*' stdout ssh $SSHLOGIN1 ls '/tmp/parallel.file*'
# The other: No such file or directory # The other: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*'
echo '### --transfer - relpath' echo '### --transfer - relpath'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
cd / cd /
cat /tmp/test17rel | parallel -k --transfer --sshlogin $SERVER1,parallel@$SERVER2 cat {}";"rm {} cat /tmp/test17rel | parallel -k --transfer --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {}";"rm {}
# Should give: No such file or directory # Should give: No such file or directory
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*'
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*'
echo '### --transfer --cleanup - abspath' echo '### --transfer --cleanup - abspath'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
cat /tmp/test17abs | parallel -k --transfer --cleanup --sshlogin $SERVER1,parallel@$SERVER2 cat {} cat /tmp/test17abs | parallel -k --transfer --cleanup --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {}
echo good if no file echo good if no file
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh $SERVER1 ls '/tmp/parallel.file*' stdout ssh $SSHLOGIN1 ls '/tmp/parallel.file*'
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*'
echo '### --transfer --cleanup - relpath' echo '### --transfer --cleanup - relpath'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
cat /tmp/test17rel | parallel -k --transfer --cleanup --sshlogin $SERVER1,parallel@$SERVER2 cat {} cat /tmp/test17rel | parallel -k --transfer --cleanup --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {}
# Should give: No such file or directory # Should give: No such file or directory
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --return - abspath' echo '### --return - abspath'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
rm -rf /tmp/parallel.file*out rm -rf /tmp/parallel.file*out
cat /tmp/test17abs | parallel -k --return {.}.out --sshlogin $SERVER1,parallel@$SERVER2 echo {} ">"{.}.out cat /tmp/test17abs | parallel -k --return {.}.out --sshlogin $SSHLOGIN1,$SSHLOGIN2 echo {} ">"{.}.out
ls /tmp/parallel.file*out ls /tmp/parallel.file*out
echo '### --return - relpath' echo '### --return - relpath'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf /tmp/parallel.file*out rm -rf /tmp/parallel.file*out
cat /tmp/test17rel | parallel -k --return {.}.out --sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out cat /tmp/test17rel | parallel -k --return {.}.out --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out
ls tmp/parallel.file*out ls tmp/parallel.file*out
echo '### --return - multiple files' echo '### --return - multiple files'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf tmp/parallel.file*out tmp/parallel.file*done rm -rf tmp/parallel.file*out tmp/parallel.file*done
cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done \ cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'echo {} ">"{.}.out';'echo {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp ';'echo {} ">"{.}.out';'echo {} ">"{}.done';'
ls tmp/parallel.file*out tmp/parallel.file*done ls tmp/parallel.file*out tmp/parallel.file*done
echo '### --return --cleanup - abspath' echo '### --return --cleanup - abspath'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
rm -rf /tmp/parallel.file*out /tmp/parallel.file*done rm -rf /tmp/parallel.file*out /tmp/parallel.file*done
cat /tmp/test17abs | parallel -k --return {.}.out --return {}.done --cleanup \ cat /tmp/test17abs | parallel -k --return {.}.out --return {}.done --cleanup \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp/parallel.file ';'echo {} ">"{.}.out';'echo {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file*done ls /tmp/parallel.file*out /tmp/parallel.file*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls '/tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*' || echo OK
echo '### --return --cleanup - relpath' echo '### --return --cleanup - relpath'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf tmp/parallel.file*out tmp/parallel.file*done rm -rf tmp/parallel.file*out tmp/parallel.file*done
cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done --cleanup \ cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done --cleanup \
--sshlogin $SERVER1,parallel@$SERVER2 echo {} ">"{.}.out';'echo {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 echo {} ">"{.}.out';'echo {} ">"{}.done';'
ls tmp/parallel.file*out tmp/parallel.file*done ls tmp/parallel.file*out tmp/parallel.file*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --return --cleanup - multiple returns' echo '### --return --cleanup - multiple returns'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf tmp/parallel.file*out tmp/parallel.file*done rm -rf tmp/parallel.file*out tmp/parallel.file*done
cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done --cleanup \ cat /tmp/test17rel | parallel -k --return {.}.out --return {}.done --cleanup \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp";"echo {} ">"{.}.out';'echo {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp";"echo {} ">"{.}.out';'echo {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file*done ls /tmp/parallel.file*out /tmp/parallel.file*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --transfer --return --cleanup - abspath' echo '### --transfer --return --cleanup - abspath'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
rm -rf /tmp/parallel.file*out /tmp/parallel.file*done rm -rf /tmp/parallel.file*out /tmp/parallel.file*done
cat /tmp/test17abs | parallel -k --transfer --return {.}.out --return {}.done --cleanup \ cat /tmp/test17abs | parallel -k --transfer --return {.}.out --return {}.done --cleanup \
--sshlogin $SERVER1,parallel@$SERVER2 cat {} ">"{.}.out';'cat {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {} ">"{.}.out';'cat {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file*done ls /tmp/parallel.file*out /tmp/parallel.file*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls '/tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*' || echo OK
echo '### --transfer --return --cleanup - relpath' echo '### --transfer --return --cleanup - relpath'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf tmp/parallel.file*out tmp/parallel.file*done rm -rf tmp/parallel.file*out tmp/parallel.file*done
cat /tmp/test17rel | parallel -k --transfer --return {.}.out --return {}.done --cleanup \ cat /tmp/test17rel | parallel -k --transfer --return {.}.out --return {}.done --cleanup \
--sshlogin $SERVER1,parallel@$SERVER2 cat {} ">"{.}.out';'cat {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {} ">"{.}.out';'cat {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file*done ls /tmp/parallel.file*out /tmp/parallel.file*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --transfer --return --cleanup - multiple files' echo '### --transfer --return --cleanup - multiple files'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf tmp/parallel.file*out tmp/parallel.file*done rm -rf tmp/parallel.file*out tmp/parallel.file*done
cat /tmp/test17rel | parallel -k --transfer --return {.}.out --return {}.done --cleanup \ cat /tmp/test17rel | parallel -k --transfer --return {.}.out --return {}.done --cleanup \
--sshlogin $SERVER1,parallel@$SERVER2 cat {} ">"{.}.out';'cat {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {} ">"{.}.out';'cat {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file*done ls /tmp/parallel.file*out /tmp/parallel.file*done
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --trc - abspath' echo '### --trc - abspath'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
rm -rf /tmp/parallel.file*out /tmp/parallel.file*done rm -rf /tmp/parallel.file*out /tmp/parallel.file*done
cat /tmp/test17abs | parallel -k --trc {.}.out --trc {}.done \ cat /tmp/test17abs | parallel -k --trc {.}.out --trc {}.done \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file*done ls /tmp/parallel.file*out /tmp/parallel.file*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls '/tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*' || echo OK
echo '### --trc - relpath' echo '### --trc - relpath'
stdout ssh $SERVER1 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf tmp/parallel.file*'
rm -rf tmp/parallel.file*out tmp/parallel.file*done rm -rf tmp/parallel.file*out tmp/parallel.file*done
cat /tmp/test17rel | parallel -k --trc {.}.out --trc {}.done \ cat /tmp/test17rel | parallel -k --trc {.}.out --trc {}.done \
--sshlogin $SERVER1,parallel@$SERVER2 cat {} ">"{.}.out';'cat {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 cat {} ">"{.}.out';'cat {} ">"{}.done';'
ls tmp/parallel.file*out tmp/parallel.file*done ls tmp/parallel.file*out tmp/parallel.file*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls 'tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls 'tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls 'tmp/parallel.file*' || echo OK
echo '### --trc - multiple files' echo '### --trc - multiple files'
stdout ssh $SERVER1 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN1 'rm -rf /tmp/parallel.file*'
stdout ssh parallel@$SERVER2 'rm -rf /tmp/parallel.file*' stdout ssh $SSHLOGIN2 'rm -rf /tmp/parallel.file*'
rm -rf /tmp/parallel.file*out /tmp/parallel.file*done rm -rf /tmp/parallel.file*out /tmp/parallel.file*done
cat /tmp/test17abs | parallel -k --trc {.}.out --trc {}.done \ cat /tmp/test17abs | parallel -k --trc {.}.out --trc {}.done \
--sshlogin $SERVER1,parallel@$SERVER2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';' --sshlogin $SSHLOGIN1,$SSHLOGIN2 mkdir -p tmp ';'cat {} ">"{.}.out';'cat {} ">"{}.done';'
ls /tmp/parallel.file*out /tmp/parallel.file*done ls /tmp/parallel.file*out /tmp/parallel.file*done
echo good if no file echo good if no file
stdout ssh $SERVER1 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN1 ls '/tmp/parallel.file*' || echo OK
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*' || echo OK
echo '### --transfer --cleanup - multiple argument files' echo '### --transfer --cleanup - multiple argument files'
parallel -kv --xapply --transfer --cleanup -Sparallel@$SERVER2 cat {2} {1} :::: /tmp/test17rel <(sort -r /tmp/test17abs) parallel -kv --xapply --transfer --cleanup -S$SSHLOGIN2 cat {2} {1} :::: /tmp/test17rel <(sort -r /tmp/test17abs)
# Should give: No such file or directory # Should give: No such file or directory
stdout ssh parallel@$SERVER2 ls '/tmp/parallel.file*' || echo OK stdout ssh $SSHLOGIN2 ls '/tmp/parallel.file*' || echo OK

View file

@ -1,34 +1,36 @@
#!/bin/bash #!/bin/bash
SERVER1=parallel-server3 SERVER1=parallel-server1
SERVER2=parallel-server2 SERVER2=parallel-server2
SSHLOGIN1=parallel@$SERVER1
SSHLOGIN2=parallel@$SERVER2
# -L1 will join lines ending in ' ' # -L1 will join lines ending in ' '
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | parallel -j0 -k -L1 cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/\;s/\$SSHLOGIN1/$SSHLOGIN1/\;s/\$SSHLOGIN2/$SSHLOGIN2/ | parallel -j0 -k -L1
echo '### Test --onall'; echo '### Test --onall';
parallel --onall -S parallel@$SERVER2,$SERVER1 '(echo {3} {2}) | awk \{print\ \$2}' ::: a b c ::: 1 2 parallel --onall -S $SSHLOGIN1,$SSHLOGIN2 '(echo {3} {2}) | awk \{print\ \$2}' ::: a b c ::: 1 2
echo '### Test | --onall'; echo '### Test | --onall';
seq 3 | parallel --onall -S parallel@$SERVER2,$SERVER1 '(echo {3} {2}) | awk \{print\ \$2}' ::: a b c :::: - seq 3 | parallel --onall -S $SSHLOGIN1,$SSHLOGIN2 '(echo {3} {2}) | awk \{print\ \$2}' ::: a b c :::: -
echo '### Test --onall -u'; echo '### Test --onall -u';
parallel --onall -S parallel@$SERVER2,$SERVER1 -u '(echo {3} {2}) | awk \{print\ \$2}' ::: a b c ::: 1 2 3 | sort parallel --onall -S $SSHLOGIN1,$SSHLOGIN2 -u '(echo {3} {2}) | awk \{print\ \$2}' ::: a b c ::: 1 2 3 | sort
echo '### Test --nonall'; echo '### Test --nonall';
parallel --nonall -k -S parallel@$SERVER2,$SERVER1 'hostname' | sort parallel --nonall -k -S $SSHLOGIN1,$SSHLOGIN2 'hostname' | sort
echo '### Test --nonall -u'; echo '### Test --nonall -u';
parallel --nonall -S parallel@$SERVER2,$SERVER1 -u 'hostname|grep -q nlv.pi.dk && sleep 2; hostname;sleep 4;hostname;' parallel --nonall -S $SSHLOGIN1,$SSHLOGIN2 -u 'hostname|grep -q nlv.pi.dk && sleep 2; hostname;sleep 4;hostname;'
echo '### Test read sshloginfile from STDIN'; echo '### Test read sshloginfile from STDIN';
echo nlv.pi.dk | parallel -S - --nonall hostname; echo $SSHLOGIN1 | parallel -S - --nonall hostname;
echo nlv.pi.dk | parallel --sshloginfile - --nonall hostname echo $SSHLOGIN1 | parallel --sshloginfile - --nonall hostname
echo '### Test --nonall --basefile'; echo '### Test --nonall --basefile';
touch /tmp/nonall--basefile; touch /tmp/nonall--basefile;
parallel --nonall --basefile /tmp/nonall--basefile -S parallel@$SERVER2,$SERVER1 ls /tmp/nonall--basefile parallel --nonall --basefile /tmp/nonall--basefile -S $SSHLOGIN1,$SSHLOGIN2 ls /tmp/nonall--basefile
echo '### Test --onall --basefile'; echo '### Test --onall --basefile';
touch /tmp/onall--basefile; touch /tmp/onall--basefile;
parallel --onall --basefile /tmp/onall--basefile -S parallel@$SERVER2,$SERVER1 ls ::: /tmp/onall--basefile parallel --onall --basefile /tmp/onall--basefile -S $SSHLOGIN1,$SSHLOGIN2 ls ::: /tmp/onall--basefile
EOF EOF

View file

@ -10,3 +10,7 @@ echo '### Test --shellquote'
cat <<'_EOF' | parallel --shellquote cat <<'_EOF' | parallel --shellquote
awk -v FS="\",\"" '{print $1, $3, $4, $5, $9, $14}' | grep -v "#" | sed -e '1d' -e 's/\"//g' -e 's/\/\/\//\t/g' | cut -f1-6,11 | sed -e 's/\/\//\t/g' -e 's/ /\t/g awk -v FS="\",\"" '{print $1, $3, $4, $5, $9, $14}' | grep -v "#" | sed -e '1d' -e 's/\"//g' -e 's/\/\/\//\t/g' | cut -f1-6,11 | sed -e 's/\/\//\t/g' -e 's/ /\t/g
_EOF _EOF
echo '### Test make .deb package'
cd ~/privat/parallel/packager/debian
stdout make | grep 'To install the GNU Parallel Debian package, run:'

View file

@ -17,13 +17,13 @@ end
0 0
### Test exit val - false ### Test exit val - false
1 1
sh: non_exist: command not found /bin/bash: non_exist: command not found
### Test --halt-on-error 0 ### Test --halt-on-error 0
1 1
2 2
parallel: Starting no more jobs. Waiting for 2 jobs to finish. This job failed: parallel: Starting no more jobs. Waiting for 2 jobs to finish. This job failed:
sleep 2;false sleep 2;false
sh: non_exist: command not found /bin/bash: non_exist: command not found
parallel: Starting no more jobs. Waiting for 3 jobs to finish. This job failed: parallel: Starting no more jobs. Waiting for 3 jobs to finish. This job failed:
sleep 2;false sleep 2;false
parallel: Starting no more jobs. Waiting for 1 jobs to finish. This job failed: parallel: Starting no more jobs. Waiting for 1 jobs to finish. This job failed:

View file

@ -10,6 +10,7 @@ sleep 0.1; echo opt--interactive 2 ?...n
sleep 0.1; echo opt--interactive 3 ?...y sleep 0.1; echo opt--interactive 3 ?...y
opt--interactive 1 opt--interactive 1
opt--interactive 3 opt--interactive 3
### Test -L -l and --max-lines ### Test -L -l and --max-lines
a_b a_b
c c

View file

@ -78,16 +78,16 @@ parallel: Warning: --cleanup ignored as there are no remote --sshlogin
9 9
10 10
### Check forced number of CPUs being respected ### Check forced number of CPUs being respected
nlv.pi.dk
nlv.pi.dk
nlv.pi.dk
nlv.pi.dk
nlv.pi.dk
nlv.pi.dk
nlv.pi.dk
nlv.pi.dk
nlv.pi.dk
alpha alpha
vh1
vh1
vh1
vh1
vh1
vh1
vh1
vh1
vh1
alpha alpha
alpha alpha
alpha alpha

View file

@ -75,17 +75,17 @@ OK
ls: cannot access tmp/parallel.file*: No such file or directory ls: cannot access tmp/parallel.file*: No such file or directory
OK OK
Input for ssh Input for ssh
parallel-server3 rsync --server -lDrRze.iLsf . . -l parallel parallel-server1 rsync --server -lDrRze.iLsf . .
parallel-server3 eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ 2\; setenv PARALLEL_PID 00000 || echo PARALLEL_SEQ=2\;export PARALLEL_SEQ\;PARALLEL_PID=00000\;export PARALLEL_PID` ; cat tmp/parallel.file.' parallel@parallel-server1 eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ 2\; setenv PARALLEL_PID 00000 || echo PARALLEL_SEQ=2\;export PARALLEL_SEQ\;PARALLEL_PID=00000\;export PARALLEL_PID` ; cat tmp/parallel.file.'
'newline2 > tmp/parallel.file.' 'newline2 > tmp/parallel.file.'
'newline2.out;cat tmp/parallel.file.' 'newline2.out;cat tmp/parallel.file.'
'newline2 > tmp/parallel.file.' 'newline2 > tmp/parallel.file.'
'newline2.out2 'newline2.out2
parallel-server3 rsync --server --sender -lDrRze.iLsf --remove-source-files . ././tmp/parallel.file.' -l parallel parallel-server1 rsync --server --sender -lDrRze.iLsf --remove-source-files . ././tmp/parallel.file.'
'newline2.out 'newline2.out
parallel-server3 rsync --server --sender -lDrRze.iLsf --remove-source-files . ././tmp/parallel.file.' -l parallel parallel-server1 rsync --server --sender -lDrRze.iLsf --remove-source-files . ././tmp/parallel.file.'
'newline2.out2 'newline2.out2
parallel-server3 rm -f ./tmp/parallel.file.' parallel@parallel-server1 rm -f ./tmp/parallel.file.'
'newline2; rmdir 2>/dev/null ./tmp 'newline2; rmdir 2>/dev/null ./tmp
-l parallel parallel-server2 rsync --server -lDrRze.iLsf . . -l parallel parallel-server2 rsync --server -lDrRze.iLsf . .
parallel@parallel-server2 eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ 1\; setenv PARALLEL_PID 00000 || echo PARALLEL_SEQ=1\;export PARALLEL_SEQ\;PARALLEL_PID=00000\;export PARALLEL_PID` ; cat tmp/parallel.file.' parallel@parallel-server2 eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null && echo setenv PARALLEL_SEQ 1\; setenv PARALLEL_PID 00000 || echo PARALLEL_SEQ=1\;export PARALLEL_SEQ\;PARALLEL_PID=00000\;export PARALLEL_PID` ; cat tmp/parallel.file.'

View file

@ -21,6 +21,11 @@ cat ... | parallel --pipe [options] [command [arguments]]
--recstart str Record start separator for --pipe. --recstart str Record start separator for --pipe.
See 'man parallel' for details See 'man parallel' for details
When using 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.
Parsing of --jobs/-j/--max-procs/-P failed Parsing of --jobs/-j/--max-procs/-P failed
### Test of -j filename ### Test of -j filename
sleep 0.7 sleep 0.7

View file

@ -58,5 +58,5 @@ perl -pe '$a=1; print $a' <(echo foo)
perl -pe "\$a=1; print \$a" <(echo foo) perl -pe "\$a=1; print \$a" <(echo foo)
1foo 1foo
### Test merging of profiles - sort needed because -k only works on the single machine ### Test merging of profiles - sort needed because -k only works on the single machine
parallel-server3 a parallel@parallel-server1 a
parallel@parallel-server2 a parallel@parallel-server2 a

View file

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

View file

@ -6,3 +6,5 @@
4.4 4.4
### Test --shellquote ### Test --shellquote
awk\ -v\ FS=\"\\\",\\\"\"\ \'\{print\ \$1,\ \$3,\ \$4,\ \$5,\ \$9,\ \$14\}\'\ \|\ grep\ -v\ \"\#\"\ \|\ sed\ -e\ \'1d\'\ -e\ \'s/\\\"//g\'\ -e\ \'s/\\/\\/\\//\\t/g\'\ \|\ cut\ -f1-6,11\ \|\ sed\ -e\ \'s/\\/\\//\\t/g\'\ -e\ \'s/\ /\\t/g awk\ -v\ FS=\"\\\",\\\"\"\ \'\{print\ \$1,\ \$3,\ \$4,\ \$5,\ \$9,\ \$14\}\'\ \|\ grep\ -v\ \"\#\"\ \|\ sed\ -e\ \'1d\'\ -e\ \'s/\\\"//g\'\ -e\ \'s/\\/\\/\\//\\t/g\'\ \|\ cut\ -f1-6,11\ \|\ sed\ -e\ \'s/\\/\\//\\t/g\'\ -e\ \'s/\ /\\t/g
### Test make .deb package
To install the GNU Parallel Debian package, run: