eval $perlexpr as function. Added --plus. Forced --noctrlc if --controlmaster.

Added CITATION. --title for pod2html. Testsuite updates due to LinuxMint15/17 diffs.
This commit is contained in:
Ole Tange 2014-07-26 13:17:13 +02:00
parent 6a4bd4911b
commit 9a25177a19
25 changed files with 1766 additions and 1533 deletions

23
CITATION Normal file
View file

@ -0,0 +1,23 @@
When using programs that use GNU Parallel to process data for publication please cite:
@article{Tange2011a,
title = {GNU Parallel - The Command-Line Power Tool},
author = {O. Tange},
address = {Frederiksberg, Denmark},
journal = {;login: The USENIX Magazine},
month = {Feb},
number = {1},
volume = {36},
url = {http://www.gnu.org/s/parallel},
year = {2011},
pages = {42-47}
}
(Feel free to use \nocite{Tange2011a})
Or:
O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
;login: The USENIX Magazine, February 2011:42-47.
This helps funding further development.

View file

@ -2,3 +2,5 @@ SUBDIRS = src
test: test:
cd testsuite; make 1 cd testsuite; make 1
EXTRA_DIST = CITATION

View file

@ -197,6 +197,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
SUBDIRS = src SUBDIRS = src
EXTRA_DIST = CITATION
all: config.h all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive $(MAKE) $(AM_MAKEFLAGS) all-recursive

View file

@ -164,6 +164,7 @@ YYYYMMDD=`yyyymmdd`
git tag -s -m "Released as $YYYYMMDD ('$TAG')" $TAG git tag -s -m "Released as $YYYYMMDD ('$TAG')" $TAG
git tag -s -m "Released as $YYYYMMDD ('$TAG')" $YYYYMMDD git tag -s -m "Released as $YYYYMMDD ('$TAG')" $YYYYMMDD
git push
== Update Savannah == == Update Savannah ==

View file

@ -38,35 +38,35 @@ niceload.1: niceload.pod
|| echo "Warning: pod2man not found. Using old niceload.1" || echo "Warning: pod2man not found. Using old niceload.1"
parallel.html: parallel.pod parallel.html: parallel.pod
pod2html $(srcdir)/parallel.pod > $(srcdir)/parallel.htmln \ pod2html --title "GNU Parallel" $(srcdir)/parallel.pod > $(srcdir)/parallel.htmln \
&& mv $(srcdir)/parallel.htmln $(srcdir)/parallel.html \ && mv $(srcdir)/parallel.htmln $(srcdir)/parallel.html \
|| echo "Warning: pod2html not found. Using old parallel.html" || echo "Warning: pod2html not found. Using old parallel.html"
rm -f $(srcdir)/pod2htm* rm -f $(srcdir)/pod2htm*
# Depending on parallel.html to avoid stupid pod2html race condition # Depending on parallel.html to avoid stupid pod2html race condition
parallel_tutorial.html: parallel_tutorial.pod parallel.html parallel_tutorial.html: parallel_tutorial.pod parallel.html
pod2html $(srcdir)/parallel_tutorial.pod > $(srcdir)/parallel_tutorial.htmln \ pod2html --title "GNU Parallel tutorial" $(srcdir)/parallel_tutorial.pod > $(srcdir)/parallel_tutorial.htmln \
&& mv $(srcdir)/parallel_tutorial.htmln $(srcdir)/parallel_tutorial.html \ && mv $(srcdir)/parallel_tutorial.htmln $(srcdir)/parallel_tutorial.html \
|| echo "Warning: pod2html not found. Using old parallel_tutorial.html" || echo "Warning: pod2html not found. Using old parallel_tutorial.html"
rm -f $(srcdir)/pod2htm* rm -f $(srcdir)/pod2htm*
# Depending on parallel_tutorial.html to avoid stupid pod2html race condition # Depending on parallel_tutorial.html to avoid stupid pod2html race condition
sem.html: sem.pod parallel_tutorial.html sem.html: sem.pod parallel_tutorial.html
pod2html $(srcdir)/sem.pod > $(srcdir)/sem.htmln \ pod2html --title "sem (GNU Parallel)" $(srcdir)/sem.pod > $(srcdir)/sem.htmln \
&& mv $(srcdir)/sem.htmln $(srcdir)/sem.html \ && mv $(srcdir)/sem.htmln $(srcdir)/sem.html \
|| echo "Warning: pod2html not found. Using old sem.html" || echo "Warning: pod2html not found. Using old sem.html"
rm -f $(srcdir)/pod2htm* rm -f $(srcdir)/pod2htm*
# Depending on sem.html to avoid stupid pod2html race condition # Depending on sem.html to avoid stupid pod2html race condition
sql.html: sql sem.html sql.html: sql sem.html
pod2html $(srcdir)/sql > $(srcdir)/sql.htmln \ pod2html --title "GNU SQL" $(srcdir)/sql > $(srcdir)/sql.htmln \
&& mv $(srcdir)/sql.htmln $(srcdir)/sql.html \ && mv $(srcdir)/sql.htmln $(srcdir)/sql.html \
|| echo "Warning: pod2html not found. Using old sql.html" || echo "Warning: pod2html not found. Using old sql.html"
rm -f $(srcdir)/pod2htm* rm -f $(srcdir)/pod2htm*
# Depending on sql.html to avoid stupid pod2html race condition # Depending on sql.html to avoid stupid pod2html race condition
niceload.html: niceload.pod sql.html niceload.html: niceload.pod sql.html
pod2html $(srcdir)/niceload.pod > $(srcdir)/niceload.htmln \ pod2html --title "GNU niceload" $(srcdir)/niceload.pod > $(srcdir)/niceload.htmln \
&& mv $(srcdir)/niceload.htmln $(srcdir)/niceload.html \ && mv $(srcdir)/niceload.htmln $(srcdir)/niceload.html \
|| echo "Warning: pod2html not found. Using old niceload.html" || echo "Warning: pod2html not found. Using old niceload.html"
rm -f $(srcdir)/pod2htm* rm -f $(srcdir)/pod2htm*

View file

@ -192,7 +192,7 @@ sub pipe_part_files {
my @cmdlines; my @cmdlines;
for(my $i=0; $i<$#pos; $i++) { for(my $i=0; $i<$#pos; $i++) {
my $cmd = $Global::JobQueue->{'commandlinequeue'}->get(); my $cmd = $Global::JobQueue->{'commandlinequeue'}->get();
$cmd->{'replaced'} = $cmd->{'replaced'} =
cat_partial($file, 0, length($header), $pos[$i], $pos[$i+1]) . "|" . cat_partial($file, 0, length($header), $pos[$i], $pos[$i+1]) . "|" .
"(".$cmd->{'replaced'}.")"; "(".$cmd->{'replaced'}.")";
::debug("init", "Unget ", $cmd->{'replaced'}, "\n"); ::debug("init", "Unget ", $cmd->{'replaced'}, "\n");
@ -210,7 +210,7 @@ sub find_header {
$opt::header =~ s/^(\d+)$/"(.*\n)"x$1/e; $opt::header =~ s/^(\d+)$/"(.*\n)"x$1/e;
while(read($fh,substr($$buf_ref,length $$buf_ref,0),$opt::blocksize)) { while(read($fh,substr($$buf_ref,length $$buf_ref,0),$opt::blocksize)) {
if($$buf_ref=~s/^($opt::header)//) { if($$buf_ref=~s/^($opt::header)//) {
$header = $1; $header = $1;
last; last;
} }
} }
@ -310,7 +310,7 @@ sub spreadstdin {
} }
} }
if($Global::max_lines and not $Global::max_number_of_args) { if($Global::max_lines and not $Global::max_number_of_args) {
# Read n-line records # Read n-line records
my $n_lines = $buf=~tr/\n/\n/; my $n_lines = $buf=~tr/\n/\n/;
my $last_newline_pos = rindex($buf,"\n"); my $last_newline_pos = rindex($buf,"\n");
while($n_lines % $Global::max_lines) { while($n_lines % $Global::max_lines) {
@ -572,6 +572,7 @@ sub options_hash {
# Replacement strings # Replacement strings
"parens=s" => \$opt::parens, "parens=s" => \$opt::parens,
"rpl=s" => \@opt::rpl, "rpl=s" => \@opt::rpl,
"plus" => \$opt::plus,
"I=s" => \$opt::I, "I=s" => \$opt::I,
"extensionreplace|er=s" => \$opt::U, "extensionreplace|er=s" => \$opt::U,
"U=s" => \$opt::retired, "U=s" => \$opt::retired,
@ -739,6 +740,21 @@ sub parse_options {
'{/.}' => 's:.*/::; s:\.[^/.]+$::;', '{/.}' => 's:.*/::; s:\.[^/.]+$::;',
'{.}' => 's:\.[^/.]+$::', '{.}' => 's:\.[^/.]+$::',
); );
%Global::plus =
(
# {} = {+/}/{/}
# = {.}.{+.} = {+/}/{/.}.{+.}
# = {..}.{+..} = {+/}/{/..}.{+..}
# = {...}.{+...} = {+/}/{/...}.{+...}
'{+/}' => 's:/[^/]*$::',
'{+.}' => 's:.*\.::',
'{+..}' => 's:.*\.([^.]*\.):$1:',
'{+...}' => 's:.*\.([^.]*\.[^.]*\.):$1:',
'{..}' => 's:\.[^/.]+$::; s:\.[^/.]+$::',
'{...}' => 's:\.[^/.]+$::; s:\.[^/.]+$::; s:\.[^/.]+$::',
'{/..}' => 's:.*/::; s:\.[^/.]+$::; s:\.[^/.]+$::',
'{/...}' => 's:.*/::; s:\.[^/.]+$::; s:\.[^/.]+$::; s:\.[^/.]+$::',
);
# Modifiable copy of %Global::replace # Modifiable copy of %Global::replace
%Global::rpl = %Global::replace; %Global::rpl = %Global::replace;
$Global::parens = "{==}"; $Global::parens = "{==}";
@ -784,6 +800,7 @@ sub parse_options {
my $parenslen = 0.5*length $Global::parens; my $parenslen = 0.5*length $Global::parens;
$Global::parensleft = substr($Global::parens,0,$parenslen); $Global::parensleft = substr($Global::parens,0,$parenslen);
$Global::parensright = substr($Global::parens,$parenslen); $Global::parensright = substr($Global::parens,$parenslen);
if(defined $opt::plus) { %Global::rpl = (%Global::plus,%Global::rpl); }
if(defined $opt::I) { rpl('{}',$opt::I); } if(defined $opt::I) { rpl('{}',$opt::I); }
if(defined $opt::U) { rpl('{.}',$opt::U); } if(defined $opt::U) { rpl('{.}',$opt::U); }
if(defined $opt::i and $opt::i) { rpl('{}',$opt::i); } if(defined $opt::i and $opt::i) { rpl('{}',$opt::i); }
@ -828,6 +845,7 @@ sub parse_options {
not defined $opt::recend) { $opt::recend = "\n"; } not defined $opt::recend) { $opt::recend = "\n"; }
if(not defined $opt::blocksize) { $opt::blocksize = "1M"; } if(not defined $opt::blocksize) { $opt::blocksize = "1M"; }
$opt::blocksize = multiply_binary_prefix($opt::blocksize); $opt::blocksize = multiply_binary_prefix($opt::blocksize);
if(defined $opt::controlmaster) { $opt::noctrlc = 1; }
if(defined $opt::semaphore) { $Global::semaphore = 1; } if(defined $opt::semaphore) { $Global::semaphore = 1; }
if(defined $opt::semaphoretimeout) { $Global::semaphore = 1; } if(defined $opt::semaphoretimeout) { $Global::semaphore = 1; }
if(defined $opt::semaphorename) { $Global::semaphore = 1; } if(defined $opt::semaphorename) { $Global::semaphore = 1; }
@ -1057,8 +1075,8 @@ sub parse_env_var {
# Create lines like: # Create lines like:
# echo $SHELL | grep "/t\\{0,1\\}csh" >/dev/null && setenv V1 val1 && setenv V2 val2 || export V1=val1 && export V2=val2 ; echo "$V1$V2" # echo $SHELL | grep "/t\\{0,1\\}csh" >/dev/null && setenv V1 val1 && setenv V2 val2 || export V1=val1 && export V2=val2 ; echo "$V1$V2"
if(@vars) { if(@vars) {
$Global::envvar .= $Global::envvar .=
join"", join"",
(q{echo $SHELL | grep "/t\\{0,1\\}csh" > /dev/null && } (q{echo $SHELL | grep "/t\\{0,1\\}csh" > /dev/null && }
. join(" && ", @qcsh) . join(" && ", @qcsh)
. q{ || } . q{ || }
@ -1148,7 +1166,7 @@ sub which {
# Returns: # Returns:
# $full_path = full path to $program. undef if not found # $full_path = full path to $program. undef if not found
my $program = $_[0]; my $program = $_[0];
return (grep { -e $_."/".$program } split(":",$ENV{'PATH'}))[0]; return (grep { -e $_."/".$program } split(":",$ENV{'PATH'}))[0];
} }
@ -1358,8 +1376,10 @@ sub shell_quote_scalar {
# $shell_quoted = string quoted with \ as needed by the shell # $shell_quoted = string quoted with \ as needed by the shell
my $a = $_[0]; my $a = $_[0];
if(defined $a) { if(defined $a) {
$a =~ s/([\002-\011\013-\032\\\#\?\`\(\)\{\}\[\]\*\>\<\~\|\; \"\!\$\&\'\202-\377])/\\$1/g; # $a =~ s/([\002-\011\013-\032\\\#\?\`\(\)\{\}\[\]\*\>\<\~\|\; \"\!\$\&\'\202-\377])/\\$1/g;
$a =~ s/[\n]/'\n'/g; # filenames with '\n' is quoted using \' # This is 1% faster than the above
$a =~ s/[\002-\011\013-\032\\\#\?\`\(\)\{\}\[\]\*\>\<\~\|\; \"\!\$\&\'\202-\377]/\\$&/go;
$a =~ s/[\n]/'\n'/go; # filenames with '\n' is quoted using \'
} }
return $a; return $a;
} }
@ -1443,7 +1463,7 @@ sub save_stdin_stdout_stderr {
# Returns: N/A # Returns: N/A
# Find file descriptors that are already opened (by the shell) # Find file descriptors that are already opened (by the shell)
for my $fdno (1..61) { for my $fdno (1..61) {
# /dev/fd/62 and above are used by bash for <(cmd) # /dev/fd/62 and above are used by bash for <(cmd)
my $fh; my $fh;
if(open($fh,">&=",$fdno)) { if(open($fh,">&=",$fdno)) {
@ -1468,7 +1488,7 @@ sub enough_file_handles {
my $enough_filehandles = 1; my $enough_filehandles = 1;
# perl uses 7 filehandles for something? # perl uses 7 filehandles for something?
# open3 uses 2 extra filehandles temporarily # open3 uses 2 extra filehandles temporarily
# We need a filehandle for each redirected file descriptor # We need a filehandle for each redirected file descriptor
# (normally just STDOUT and STDERR) # (normally just STDOUT and STDERR)
for my $i (1..(7+2+keys %Global::fd)) { for my $i (1..(7+2+keys %Global::fd)) {
$enough_filehandles &&= open($fh{$i}, "<", "/dev/null"); $enough_filehandles &&= open($fh{$i}, "<", "/dev/null");
@ -1569,7 +1589,7 @@ sub start_more_jobs {
next; next;
} }
if($sshlogin->too_fast_remote_login()) { if($sshlogin->too_fast_remote_login()) {
# It has been too short since # It has been too short since
next; next;
} }
if($opt::delay and $opt::delay > ::now() - $Global::newest_starttime) { if($opt::delay and $opt::delay > ::now() - $Global::newest_starttime) {
@ -1795,9 +1815,9 @@ sub progress {
} }
$eta = sprintf("ETA: %ds Left: %d AVG: %.2fs ", $this_eta, $left, $avgtime); $eta = sprintf("ETA: %ds Left: %d AVG: %.2fs ", $this_eta, $left, $avgtime);
if($opt::bar) { if($opt::bar) {
my $arg = $Global::newest_job ? my $arg = $Global::newest_job ?
$Global::newest_job->{'commandline'}->replace_placeholders(["\257<\257>"],0,0) : ""; $Global::newest_job->{'commandline'}->replace_placeholders(["\257<\257>"],0,0) : "";
my $bar_text = sprintf("%d%% %d:%d=%ds %s", my $bar_text = sprintf("%d%% %d:%d=%ds %s",
$pctcomplete*100, $completed, $left, $this_eta, $arg); $pctcomplete*100, $completed, $left, $this_eta, $arg);
my $rev = ''; my $rev = '';
my $reset = ''; my $reset = '';
@ -1807,7 +1827,7 @@ sub progress {
my $width = int($terminal_width * $pctcomplete); my $width = int($terminal_width * $pctcomplete);
$s =~ s/^(.{$width})/$1$reset/; $s =~ s/^(.{$width})/$1$reset/;
$s = "\r# ".int($this_eta)." sec $arg" . "\r". $pctcomplete*100 # Prefix with zenity header $s = "\r# ".int($this_eta)." sec $arg" . "\r". $pctcomplete*100 # Prefix with zenity header
. "\r" . $rev . $s . $reset; . "\r" . $rev . $s . $reset;
$status = $s; $status = $s;
} }
} }
@ -2064,7 +2084,7 @@ sub parse_sshlogin {
} }
debug("start", "sshlogin: ", my_dump(%Global::host),"\n"); # debug("start", "sshlogin: ", my_dump(%Global::host),"\n");
if($opt::transfer or @opt::return or $opt::cleanup or @opt::basefile) { if($opt::transfer or @opt::return or $opt::cleanup or @opt::basefile) {
if(not remote_hosts()) { if(not remote_hosts()) {
# There are no remote hosts # There are no remote hosts
@ -2262,7 +2282,7 @@ sub onall {
return $tmpfile; return $tmpfile;
} }
my @command = @_; my @command = @_;
if($Global::quoting) { if($Global::quoting) {
@command = shell_quote_empty(@command); @command = shell_quote_empty(@command);
} }
@ -2353,9 +2373,9 @@ sub save_original_signal_handler {
# Remember the original signal handler # Remember the original signal handler
# Returns: N/A # Returns: N/A
$SIG{TERM} ||= sub { exit 0; }; # $SIG{TERM} is not set on Mac OS X $SIG{TERM} ||= sub { exit 0; }; # $SIG{TERM} is not set on Mac OS X
$SIG{INT} = sub { if($opt::tmux) { qx { tmux kill-session -t p$$ }; } $SIG{INT} = sub { if($opt::tmux) { qx { tmux kill-session -t p$$ }; }
unlink keys %Global::unlink; exit -1 }; unlink keys %Global::unlink; exit -1 };
$SIG{TERM} = sub { if($opt::tmux) { qx { tmux kill-session -t p$$ }; } $SIG{TERM} = sub { if($opt::tmux) { qx { tmux kill-session -t p$$ }; }
unlink keys %Global::unlink; exit -1 }; unlink keys %Global::unlink; exit -1 };
%Global::original_sig = %SIG; %Global::original_sig = %SIG;
$SIG{TERM} = sub {}; # Dummy until jobs really start $SIG{TERM} = sub {}; # Dummy until jobs really start
@ -2426,11 +2446,11 @@ sub reaper {
$Private::job_end_sequence++, $Private::job_end_sequence++,
$j = $Private::print_later{$Private::job_end_sequence}) { $j = $Private::print_later{$Private::job_end_sequence}) {
debug("run", "Found job end $Private::job_end_sequence"); debug("run", "Found job end $Private::job_end_sequence");
if($j) { if($j) {
$j->print(); $j->print();
delete $Private::print_later{$Private::job_end_sequence}; delete $Private::print_later{$Private::job_end_sequence};
} }
} }
} else { } else {
$job->print(); $job->print();
} }
@ -2441,7 +2461,7 @@ sub reaper {
if($opt::halt_on_error) { if($opt::halt_on_error) {
if($opt::halt_on_error == 1 if($opt::halt_on_error == 1
or or
($opt::halt_on_error < 1 and $Global::total_failed > 3 ($opt::halt_on_error < 1 and $Global::total_failed > 3
and and
$Global::total_failed / $Global::total_started > $opt::halt_on_error)) { $Global::total_failed / $Global::total_started > $opt::halt_on_error)) {
# If halt on error == 1 or --halt 10% # If halt on error == 1 or --halt 10%
@ -2507,26 +2527,29 @@ sub usage {
print join print join
("\n", ("\n",
"Usage:", "Usage:",
"",
"$Global::progname [options] [command [arguments]] < list_of_arguments", "$Global::progname [options] [command [arguments]] < list_of_arguments",
"$Global::progname [options] [command [arguments]] (::: arguments|:::: argfile(s))...", "$Global::progname [options] [command [arguments]] (::: arguments|:::: argfile(s))...",
"cat ... | $Global::progname --pipe [options] [command [arguments]]", "cat ... | $Global::progname --pipe [options] [command [arguments]]",
"", "",
"-j n Run n jobs in parallel", "-j n Run n jobs in parallel",
"-k Keep same order", "-k Keep same order",
"-X Multiple arguments with context replace", "-X Multiple arguments with context replace",
"--colsep regexp Split input on regexp for positional replacements", "--colsep regexp Split input on regexp for positional replacements",
"{} {.} {/} {/.} {#} {%} Replacement strings", "{} {.} {/} {/.} {#} {%} {= perl code =} Replacement strings",
"{3} {3.} {3/} {3/.} Positional replacement strings", "{3} {3.} {3/} {3/.} {=3 perl code =} Positional replacement strings",
"With --plus: {} = {+/}/{/} = {.}.{+.} = {+/}/{/.}.{+.} = {..}.{+..} =",
" {+/}/{/..}.{+..} = {...}.{+...} = {+/}/{/...}.{+...}",
"", "",
"-S sshlogin Example: foo\@server.example.com", "-S sshlogin Example: foo\@server.example.com",
"--slf .. Use ~/.parallel/sshloginfile as the list of sshlogins", "--slf .. Use ~/.parallel/sshloginfile as the list of sshlogins",
"--trc {}.bar Shorthand for --transfer --return {}.bar --cleanup", "--trc {}.bar Shorthand for --transfer --return {}.bar --cleanup",
"--onall Run the given command with argument on all sshlogins", "--onall Run the given command with argument on all sshlogins",
"--nonall Run the given command with no arguments on all sshlogins", "--nonall Run the given command with no arguments on all sshlogins",
"", "",
"--pipe Split stdin (standard input) to multiple jobs.", "--pipe Split stdin (standard input) to multiple jobs.",
"--recend str Record end separator for --pipe.", "--recend str Record end separator for --pipe.",
"--recstart str Record start separator for --pipe.", "--recstart str Record start separator for --pipe.",
"", "",
"See 'man $Global::progname' for details", "See 'man $Global::progname' for details",
"", "",
@ -2552,7 +2575,7 @@ sub citation_notice {
-e $ENV{'HOME'}."/.parallel/will-cite") { -e $ENV{'HOME'}."/.parallel/will-cite") {
# skip # skip
} else { } else {
print $Global::original_stderr print $Global::original_stderr
("When using programs that use GNU Parallel to process data for publication please cite:\n", ("When using programs that use GNU Parallel to process data for publication please cite:\n",
"\n", "\n",
" O. Tange (2011): GNU Parallel - The Command-Line Power Tool,\n", " O. Tange (2011): GNU Parallel - The Command-Line Power Tool,\n",
@ -2647,7 +2670,7 @@ sub bibtex {
my $input = <STDIN>; my $input = <STDIN>;
if($input =~ /will cite/i) { if($input =~ /will cite/i) {
mkdir $ENV{'HOME'}."/.parallel"; mkdir $ENV{'HOME'}."/.parallel";
open (my $fh, ">", $ENV{'HOME'}."/.parallel/will-cite") open (my $fh, ">", $ENV{'HOME'}."/.parallel/will-cite")
|| ::die_bug("Cannot write: ".$ENV{'HOME'}."/.parallel/will-cite"); || ::die_bug("Cannot write: ".$ENV{'HOME'}."/.parallel/will-cite");
close $fh; close $fh;
print "\nThank you for your support. It is much appreciated. The citation\n", print "\nThank you for your support. It is much appreciated. The citation\n",
@ -3104,14 +3127,14 @@ sub swap_activity {
# $ vm_stat -c 2 1 # $ vm_stat -c 2 1
# Mach Virtual Memory Statistics: (page size of 4096 bytes) # Mach Virtual Memory Statistics: (page size of 4096 bytes)
# free active specul inactive throttle wired prgable faults copy 0fill reactive purged file-backed anonymous cmprssed cmprssor dcomprs comprs pageins pageout swapins swapouts # free active specul inactive throttle wired prgable faults copy 0fill reactive purged file-backed anonymous cmprssed cmprssor dcomprs comprs pageins pageout swapins swapouts
# 346306 829050 74871 606027 0 240231 90367 544858K 62343596 270837K 14178 415070 570102 939846 356 370 116 922 4019813 4 0 0 # 346306 829050 74871 606027 0 240231 90367 544858K 62343596 270837K 14178 415070 570102 939846 356 370 116 922 4019813 4 0 0
# 345740 830383 74875 606031 0 239234 90369 2696 359 553 0 0 570110 941179 356 370 0 0 0 0 0 0 # 345740 830383 74875 606031 0 239234 90369 2696 359 553 0 0 570110 941179 356 370 0 0 0 0 0 0
'darwin' => ['vm_stat -c 2 1 | tail -n1', '$21*$22'], 'darwin' => ['vm_stat -c 2 1 | tail -n1', '$21*$22'],
# ultrix: $12*$13 # ultrix: $12*$13
# $ vmstat -S 1 2 # $ vmstat -S 1 2
# procs faults cpu memory page disk # procs faults cpu memory page disk
# r b w in sy cs us sy id avm fre si so pi po fr de sr s0 # r b w in sy cs us sy id avm fre si so pi po fr de sr s0
# 1 0 0 4 23 2 3 0 97 7743 217k 0 0 0 0 0 0 0 0 # 1 0 0 4 23 2 3 0 97 7743 217k 0 0 0 0 0 0 0 0
# 1 0 0 6 40 8 0 1 99 7743 217k 0 0 3 0 0 0 0 0 # 1 0 0 6 40 8 0 1 99 7743 217k 0 0 3 0 0 0 0 0
'ultrix' => ['vmstat -S 1 2 | tail -1', '$12*$13'], 'ultrix' => ['vmstat -S 1 2 | tail -1', '$12*$13'],
@ -3119,8 +3142,8 @@ sub swap_activity {
# aix: $6*$7 # aix: $6*$7
# $ vmstat 1 2 # $ vmstat 1 2
# System configuration: lcpu=1 mem=2048MB # System configuration: lcpu=1 mem=2048MB
# #
# kthr memory page faults cpu # kthr memory page faults cpu
# ----- ----------- ------------------------ ------------ ----------- # ----- ----------- ------------------------ ------------ -----------
# r b avm fre re pi po fr sr cy in sy cs us sy id wa # r b avm fre re pi po fr sr cy in sy cs us sy id wa
# 0 0 333933 241803 0 0 0 0 0 0 10 143 90 0 0 99 0 # 0 0 333933 241803 0 0 0 0 0 0 10 143 90 0 0 99 0
@ -3193,7 +3216,7 @@ sub swap_activity {
#q[ { vmstat 1 2 2> /dev/null || vmstat -c 1 2; } | ]. #q[ { vmstat 1 2 2> /dev/null || vmstat -c 1 2; } | ].
# q[ awk 'NR!=4{next} NF==17||NF==16{print $7*$8} NF==22{print $21*$22} {exit}' ]; # q[ awk 'NR!=4{next} NF==17||NF==16{print $7*$8} NF==22{print $21*$22} {exit}' ];
$vmstat{$os}[1] =~ s/\$/\\\\\\\$/g; # $ => \\\$ $vmstat{$os}[1] =~ s/\$/\\\\\\\$/g; # $ => \\\$
$perlscript .= 'if($^O eq "'.$os.'") { print `'.$vmstat{$os}[0].' | awk "{print ' . $perlscript .= 'if($^O eq "'.$os.'") { print `'.$vmstat{$os}[0].' | awk "{print ' .
$vmstat{$os}[1] . '}"` }'; $vmstat{$os}[1] . '}"` }';
} }
$perlscript = "perl -e " . ::shell_quote_scalar($perlscript); $perlscript = "perl -e " . ::shell_quote_scalar($perlscript);
@ -3822,7 +3845,7 @@ sub nproc {
# Number of cores using `nproc` # Number of cores using `nproc`
my $no_of_cores = `nproc 2>/dev/null`; my $no_of_cores = `nproc 2>/dev/null`;
return $no_of_cores; return $no_of_cores;
} }
sub no_of_cpus_gnu_linux { sub no_of_cpus_gnu_linux {
# Returns: # Returns:
@ -4098,8 +4121,7 @@ sub no_of_cpus_irix {
# Returns: # Returns:
# Number of physical CPUs on IRIX # Number of physical CPUs on IRIX
# undef if not IRIX # undef if not IRIX
my $no_of_cpus = my $no_of_cpus = `hinv | grep HZ | grep Processor | awk '{print \$1}'`;
(`hinv | grep HZ | grep Processor | awk '{print \$1}'`);
return $no_of_cpus; return $no_of_cpus;
} }
@ -4107,8 +4129,7 @@ sub no_of_cores_irix {
# Returns: # Returns:
# Number of CPU cores on IRIX # Number of CPU cores on IRIX
# undef if not IRIX # undef if not IRIX
my $no_of_cores = my $no_of_cores = `hinv | grep HZ | grep Processor | awk '{print \$1}'`;
(`hinv | grep HZ | grep Processor | awk '{print \$1}'`);
return $no_of_cores; return $no_of_cores;
} }
@ -4116,8 +4137,7 @@ sub no_of_cpus_tru64 {
# Returns: # Returns:
# Number of physical CPUs on Tru64 # Number of physical CPUs on Tru64
# undef if not Tru64 # undef if not Tru64
my $no_of_cpus = my $no_of_cpus = `sizer -pr`;
(`sizer -pr`);
return $no_of_cpus; return $no_of_cpus;
} }
@ -4125,8 +4145,7 @@ sub no_of_cores_tru64 {
# Returns: # Returns:
# Number of CPU cores on Tru64 # Number of CPU cores on Tru64
# undef if not Tru64 # undef if not Tru64
my $no_of_cores = my $no_of_cores = `sizer -pr`;
(`sizer -pr`);
return $no_of_cores; return $no_of_cores;
} }
@ -4544,7 +4563,7 @@ sub openoutputfiles {
$self->fh($fdno,'name')) || die $?; $self->fh($fdno,'name')) || die $?;
$self->set_fh($fdno,'w',$fdw); $self->set_fh($fdno,'w',$fdw);
$self->set_fh($fdno,'wpid',$wpid); $self->set_fh($fdno,'wpid',$wpid);
my $rpid = open(my $fdr, "-|", "perl", "-e", $cattail, my $rpid = open(my $fdr, "-|", "perl", "-e", $cattail,
$opt::decompress_program, $wpid, $opt::decompress_program, $wpid,
$self->fh($fdno,'name'),$self->fh($fdno,'unlink')) || die $?; $self->fh($fdno,'name'),$self->fh($fdno,'unlink')) || die $?;
$self->set_fh($fdno,'r',$fdr); $self->set_fh($fdno,'r',$fdr);
@ -4556,7 +4575,7 @@ sub openoutputfiles {
# Re-open the file for reading # Re-open the file for reading
# so fdw can be closed seperately # so fdw can be closed seperately
# and fdr can be seeked seperately (for --line-buffer) # and fdr can be seeked seperately (for --line-buffer)
open(my $fdr,"<", $self->fh($fdno,'name')) || open(my $fdr,"<", $self->fh($fdno,'name')) ||
::die_bug("fdr: Cannot open ".$self->fh($fdno,'name')); ::die_bug("fdr: Cannot open ".$self->fh($fdno,'name'));
$self->set_fh($fdno,'r',$fdr); $self->set_fh($fdno,'r',$fdr);
# Unlink if required # Unlink if required
@ -4788,7 +4807,7 @@ sub kill {
my $self = shift; my $self = shift;
my $pid = $self->pid(); my $pid = $self->pid();
%pid_parentpid_cmd or %pid_parentpid_cmd = %pid_parentpid_cmd or %pid_parentpid_cmd =
( (
'aix' => q( ps -ef | awk '{print $2" "$3}' ), 'aix' => q( ps -ef | awk '{print $2" "$3}' ),
'cygwin' => q( ps -ef | awk '{print $2" "$3}' ), 'cygwin' => q( ps -ef | awk '{print $2" "$3}' ),
@ -4960,7 +4979,7 @@ sub sshlogin_wrap {
if($opt::workdir) { if($opt::workdir) {
my $wd = ::shell_quote_file($self->workdir()); my $wd = ::shell_quote_file($self->workdir());
$remote_pre .= ::shell_quote_scalar("mkdir -p ") . $wd . $remote_pre .= ::shell_quote_scalar("mkdir -p ") . $wd .
::shell_quote_scalar("; cd ") . $wd . ::shell_quote_scalar("; cd ") . $wd .
# exit 255 (instead of exec false) would be the correct thing, # exit 255 (instead of exec false) would be the correct thing,
# but that fails on tcsh # but that fails on tcsh
::shell_quote_scalar(qq{ || exec false;}); ::shell_quote_scalar(qq{ || exec false;});
@ -4971,14 +4990,14 @@ sub sshlogin_wrap {
# It works on Linux but not Solaris # It works on Linux but not Solaris
my $signal_script = "perl -e '". my $signal_script = "perl -e '".
q{ q{
use IO::Poll; use IO::Poll;
$SIG{CHLD} = sub {exit ($?&127 ? 128+($?&127) : 1+$?>>8)}; $SIG{CHLD} = sub {exit ($?&127 ? 128+($?&127) : 1+$?>>8)};
$p = IO::Poll->new; $p = IO::Poll->new;
$p->mask(STDOUT, POLLHUP); $p->mask(STDOUT, POLLHUP);
$pid=fork; unless($pid) {setpgrp; exec $ENV{SHELL}, "-c", @ARGV; die "exec: $!\n"} $pid=fork; unless($pid) {setpgrp; exec $ENV{SHELL}, "-c", @ARGV; die "exec: $!\n"}
$p->poll; $p->poll;
kill SIGHUP, -${pid} unless $done; kill SIGHUP, -${pid} unless $done;
wait; exit ($?&127 ? 128+($?&127) : 1+$?>>8) wait; exit ($?&127 ? 128+($?&127) : 1+$?>>8)
} . "' "; } . "' ";
$signal_script =~ s/\s+/ /g; $signal_script =~ s/\s+/ /g;
@ -4988,7 +5007,7 @@ sub sshlogin_wrap {
. $remote_pre . $remote_pre
# . ::shell_quote_scalar($signal_script . ::shell_quote_scalar($next_command_line)) # . ::shell_quote_scalar($signal_script . ::shell_quote_scalar($next_command_line))
. ::shell_quote_scalar($next_command_line) . ::shell_quote_scalar($next_command_line)
. ";" . ";"
. $post); . $post);
} }
} }
@ -5080,7 +5099,7 @@ sub sshreturn {
} }
# Only load File::Basename if actually needed # Only load File::Basename if actually needed
$Global::use{"File::Basename"} ||= eval "use File::Basename; 1;"; $Global::use{"File::Basename"} ||= eval "use File::Basename; 1;";
# dir/./file means relative to dir, so remove dir on remote # dir/./file means relative to dir, so remove dir on remote
$file =~ m:(.*)/\./:; $file =~ m:(.*)/\./:;
my $basedir = $1 ? ::shell_quote_file($1."/") : ""; my $basedir = $1 ? ::shell_quote_file($1."/") : "";
my $nobasedir = $file; my $nobasedir = $file;
@ -5089,8 +5108,8 @@ sub sshreturn {
my $rsync_cd = '--rsync-path='.::shell_quote_scalar("cd $wd$cd; rsync"); my $rsync_cd = '--rsync-path='.::shell_quote_scalar("cd $wd$cd; rsync");
my $basename = ::shell_quote_scalar(::shell_quote_file(basename($file))); my $basename = ::shell_quote_scalar(::shell_quote_file(basename($file)));
# --return # --return
# mkdir -p /home/tange/dir/subdir/; # mkdir -p /home/tange/dir/subdir/;
# rsync -rlDzR --rsync-path="cd /home/tange/dir/subdir/; rsync" # rsync -rlDzR --rsync-path="cd /home/tange/dir/subdir/; rsync"
# server:file.gz /home/tange/dir/subdir/ # server:file.gz /home/tange/dir/subdir/
$pre .= "mkdir -p $basedir$cd; rsync $rsync_cd $rsync_opt $serverlogin:". $pre .= "mkdir -p $basedir$cd; rsync $rsync_cd $rsync_opt $serverlogin:".
$basename . " ".$basedir.$cd.";"; $basename . " ".$basedir.$cd.";";
@ -5246,7 +5265,7 @@ sub start {
$job->seq(), "): $command\n"); $job->seq(), "): $command\n");
if($opt::pipe) { if($opt::pipe) {
my ($stdin_fh); my ($stdin_fh);
# Wrap command with end-of-file detector, # Wrap command with end-of-file detector,
# so we do not spawn a program if there is no input. # so we do not spawn a program if there is no input.
# Exit value: # Exit value:
# empty input = true # empty input = true
@ -5586,7 +5605,7 @@ sub print {
print $out_fd $buf; print $out_fd $buf;
} }
} }
close $in_fh; close $in_fh;
} }
flush $out_fd; flush $out_fd;
} }
@ -5731,7 +5750,7 @@ sub populate {
my $self = shift; my $self = shift;
my $next_arg; my $next_arg;
my $max_len = $Global::minimal_command_line_length || Limits::Command::max_length(); my $max_len = $Global::minimal_command_line_length || Limits::Command::max_length();
if($opt::cat or $opt::fifo) { if($opt::cat or $opt::fifo) {
# Get a tempfile name # Get a tempfile name
my($outfh,$name) = ::tempfile(SUFFIX => ".pip"); my($outfh,$name) = ::tempfile(SUFFIX => ".pip");
@ -5758,7 +5777,7 @@ sub populate {
last; last;
} else { } else {
my $args = join(" ", map { $_->orig() } @$next_arg); my $args = join(" ", map { $_->orig() } @$next_arg);
::error("Command line too long (", ::error("Command line too long (",
$self->len(), " >= ", $self->len(), " >= ",
Limits::Command::max_length(), Limits::Command::max_length(),
") at number ", ") at number ",
@ -5800,18 +5819,18 @@ sub push {
my $self = shift; my $self = shift;
my $record = shift; my $record = shift;
push @{$self->{'arg_list'}}, $record; push @{$self->{'arg_list'}}, $record;
my $arg_no = ($self->number_of_args()-1) * ($#$record+1);
my $quote_arg = $Global::noquote ? 0 : not $Global::quoting; my $quote_arg = $Global::noquote ? 0 : not $Global::quoting;
my $rep; my $rep;
for my $arg (@$record) { for my $arg (@$record) {
$arg_no++;
if(defined $arg) { if(defined $arg) {
for my $perlexpr (keys %{$self->{'replacecount'}}) { for my $perlexpr (keys %{$self->{'replacecount'}}) {
$rep = $arg->replace($perlexpr,$quote_arg,$self); # 50% faster than below
$self->{'len'}{$perlexpr} += length $rep; $self->{'len'}{$perlexpr} += length $arg->replace($perlexpr,$quote_arg,$self);
::debug("length", "Length: ", length $rep, # $rep = $arg->replace($perlexpr,$quote_arg,$self);
"(", $perlexpr, "=>", $rep, ")\n"); # $self->{'len'}{$perlexpr} += length $rep;
# ::debug("length", "Length: ", length $rep,
# "(", $perlexpr, "=>", $rep, ")\n");
} }
} }
} }
@ -5857,12 +5876,12 @@ sub number_of_args {
# Mdzrvadp Nvmdymeaz az 2011-04-10. Ftue oaawuq dqxqmeqp az # Mdzrvadp Nvmdymeaz az 2011-04-10. Ftue oaawuq dqxqmeqp az
# 2013-08-18 ue m nuf tmdpqd me kag tmhq fa geq daf14. Bxqmeq # 2013-08-18 ue m nuf tmdpqd me kag tmhq fa geq daf14. Bxqmeq
# qymux oaawuq@fmzsq.pw itqz kag dqmp ftue. # qymux oaawuq@fmzsq.pw itqz kag dqmp ftue.
# #
# U my ftq ymuzfmuzqd ar m buqoq ar rdqq earfimdq omxxqp SZG # U my ftq ymuzfmuzqd ar m buqoq ar rdqq earfimdq omxxqp SZG
# Bmdmxxqx. Rdqq earfimdq sgmdmzfqqe kag mooqee fa ftq eagdoq # Bmdmxxqx. Rdqq earfimdq sgmdmzfqqe kag mooqee fa ftq eagdoq
# oapq, ngf U tmhq nqqz iazpqduzs tai ymzk mofgmxxk _dqmp_ ftq # oapq, ngf U tmhq nqqz iazpqduzs tai ymzk mofgmxxk _dqmp_ ftq
# eagdoq oapq. # eagdoq oapq.
# #
# Fa fqef ftue U bgf uz m oayyqzf fqxxuzs bqabxq fa qymux yq itqz # Fa fqef ftue U bgf uz m oayyqzf fqxxuzs bqabxq fa qymux yq itqz
# ftqk dqmp ftue. Ftq oayyqzf ime bgf uz m eqofuaz ar ftq oapq # ftqk dqmp ftue. Ftq oayyqzf ime bgf uz m eqofuaz ar ftq oapq
# ftmf za azq iagxp xaaw fa ruj ad uybdahq ftq earfimdq - ea ftq # ftmf za azq iagxp xaaw fa ruj ad uybdahq ftq earfimdq - ea ftq
@ -5870,11 +5889,11 @@ sub number_of_args {
# oayyqzf iagxp zaf etai gb ur eayq azq vgef sdqbbqp ftdagst ftq # oayyqzf iagxp zaf etai gb ur eayq azq vgef sdqbbqp ftdagst ftq
# eagdoq oapq U daf13'qp ftq eagdoq oapq # eagdoq oapq U daf13'qp ftq eagdoq oapq
# tffb://qz.iuwubqpum.ads/iuwu/DAF13 # tffb://qz.iuwubqpum.ads/iuwu/DAF13
# #
# 2.5 yazfte xmfqd U dqoquhqp mz qymux rday eayqazq ita zaf azxk # 2.5 yazfte xmfqd U dqoquhqp mz qymux rday eayqazq ita zaf azxk
# ymzmsqp fa ruzp ftq oayyqzf, ngf mxea ymzmsqp fa sgqee ftq oapq # ymzmsqp fa ruzp ftq oayyqzf, ngf mxea ymzmsqp fa sgqee ftq oapq
# tmp fa nq daf13'qp. # tmp fa nq daf13'qp.
# #
# Ftue nduzse yq fa ftq oazoxgeuaz ftmf ftqdq _mdq_ bqabxq, ita # Ftue nduzse yq fa ftq oazoxgeuaz ftmf ftqdq _mdq_ bqabxq, ita
# mdq zaf mrruxumfqp iuft ftq bdavqof, ftmf iuxx dqmp ftq eagdoq # mdq zaf mrruxumfqp iuft ftq bdavqof, ftmf iuxx dqmp ftq eagdoq
# oapq - ftagst uf ymk zaf tmbbqz hqdk arfqz. # oapq - ftagst uf ymk zaf tmbbqz hqdk arfqz.
@ -5943,7 +5962,7 @@ sub header_indexes_sorted {
# Returns: # Returns:
# Indexes of %Global::input_source_header sorted # Indexes of %Global::input_source_header sorted
my $max_col = shift; my $max_col = shift;
no warnings 'numeric'; no warnings 'numeric';
for my $col (1 .. $max_col) { for my $col (1 .. $max_col) {
# Make sure the header is defined. If it is not: use column number # Make sure the header is defined. If it is not: use column number
@ -6033,17 +6052,17 @@ sub replaced {
if($opt::cat) { if($opt::cat) {
# Prepend 'cat > {};' # Prepend 'cat > {};'
# Append '_EXIT=$?;(rm {};exit $_EXIT)' # Append '_EXIT=$?;(rm {};exit $_EXIT)'
$self->{'replaced'} = $self->{'replaced'} =
$self->replace_placeholders(["cat > \257<\257>; ", $cmdstring, $self->replace_placeholders(["cat > \257<\257>; ", $cmdstring,
"; _EXIT=\$?; rm \257<\257>; exit \$_EXIT"], "; _EXIT=\$?; rm \257<\257>; exit \$_EXIT"],
0,0); 0,0);
} elsif($opt::fifo) { } elsif($opt::fifo) {
# Prepend 'mkfifo {}; (' # Prepend 'mkfifo {}; ('
# Append ') & _PID=$!; cat > {}; wait $_PID; _EXIT=$?;(rm {};exit $_EXIT)' # Append ') & _PID=$!; cat > {}; wait $_PID; _EXIT=$?;(rm {};exit $_EXIT)'
$self->{'replaced'} = $self->{'replaced'} =
$self->replace_placeholders(["mkfifo \257<\257>; (", $self->replace_placeholders(["mkfifo \257<\257>; (",
$cmdstring, $cmdstring,
") & _PID=\$!; cat > \257<\257>; ", ") & _PID=\$!; cat > \257<\257>; ",
"wait \$_PID; _EXIT=\$?; ", "wait \$_PID; _EXIT=\$?; ",
"rm \257<\257>; exit \$_EXIT"], "rm \257<\257>; exit \$_EXIT"],
0,0); 0,0);
@ -6077,7 +6096,7 @@ sub replaced {
} }
sub replace_placeholders { sub replace_placeholders {
# Replace foo{}bar with fooargbar # Replace foo{}bar with fooargbar
# Input: # Input:
# target = foo{}bar # target = foo{}bar
# quote = should this be quoted? # quote = should this be quoted?
@ -6163,7 +6182,7 @@ sub replace_placeholders {
if($w !~ /\257/) { if($w !~ /\257/) {
# No more replacement strings in $w: No need to do more # No more replacement strings in $w: No need to do more
CORE::push(@{$replace{$word}}, $w); CORE::push(@{$replace{$word}}, $w);
next; next;
} }
# for each arg: # for each arg:
@ -6200,14 +6219,14 @@ sub replace_placeholders {
if($quote) { if($quote) {
$val = ::shell_quote_scalar($val); $val = ::shell_quote_scalar($val);
} }
CORE::push(@{$replace{$ww}}, $val); CORE::push(@{$replace{$ww}}, $val);
} }
} }
if($quote) { if($quote) {
@target = ::shell_quote(@target); @target = ::shell_quote(@target);
} }
::debug("replace", "%replace=".(::my_dump(%replace))."\n"); # ::debug("replace", "%replace=",::my_dump(%replace),"\n");
if(%replace) { if(%replace) {
# Substitute the replace strings with the replacement values # Substitute the replace strings with the replacement values
# Must be sorted by length if a short word is a substring of a long word # Must be sorted by length if a short word is a substring of a long word
@ -6295,7 +6314,7 @@ sub new {
$contextgroups++; $contextgroups++;
} }
# All {= perl expr =} have been removed: The rest is non-context # All {= perl expr =} have been removed: The rest is non-context
$noncontextlen += length $c; $noncontextlen += length $c;
} }
if($opt::tagstring) { if($opt::tagstring) {
my $t = $opt::tagstring; my $t = $opt::tagstring;
@ -6437,7 +6456,7 @@ sub max_length {
# Returns: # Returns:
# number of chars on the longest command line allowed # number of chars on the longest command line allowed
if(not $Limits::Command::line_max_len) { if(not $Limits::Command::line_max_len) {
# Disk cache of max command line length # Disk cache of max command line length
my $len_cache = $ENV{'HOME'} . "/.parallel/tmp/linelen-" . ::hostname(); my $len_cache = $ENV{'HOME'} . "/.parallel/tmp/linelen-" . ::hostname();
my $cached_limit; my $cached_limit;
if(-e $len_cache) { if(-e $len_cache) {
@ -6795,22 +6814,22 @@ sub read_arg_from_fh {
my $prepend = undef; my $prepend = undef;
my $arg; my $arg;
do {{ do {{
if(eof($fh)) { # This makes 10% faster
if(not ($arg = <$fh>)) {
if(defined $prepend) { if(defined $prepend) {
return Arg->new($prepend); return Arg->new($prepend);
} else { } else {
return undef; return undef;
} }
} }
$arg = <$fh>; # ::debug("run", "read $arg\n");
::debug("run", "read $arg\n");
# Remove delimiter # Remove delimiter
$arg =~ s:$/$::; $arg =~ s:$/$::;
if($Global::end_of_file_string and if($Global::end_of_file_string and
$arg eq $Global::end_of_file_string) { $arg eq $Global::end_of_file_string) {
# Ignore the rest of input file # Ignore the rest of input file
while (<$fh>) {} while (<$fh>) {}
::debug("run", "EOF-string $arg\n"); # ::debug("run", "EOF-string $arg\n");
if(defined $prepend) { if(defined $prepend) {
return Arg->new($prepend); return Arg->new($prepend);
} else { } else {
@ -6878,7 +6897,7 @@ sub new {
sub replace { sub replace {
# Calculates the corresponding value for a given perl expression # Calculates the corresponding value for a given perl expression
# Returns: # Returns:
# The calculated string unquoted # The calculated string (quoted if asked for)
my $self = shift; my $self = shift;
my $perlexpr = shift; # E.g. $_=$_ or s/.gz// my $perlexpr = shift; # E.g. $_=$_ or s/.gz//
my $quote = (shift) ? 1 : 0; # should the string be quoted? my $quote = (shift) ? 1 : 0; # should the string be quoted?
@ -6887,15 +6906,26 @@ sub replace {
my $job = shift; my $job = shift;
$perlexpr =~ s/^-?\d+ //; # Positional replace treated as normal replace $perlexpr =~ s/^-?\d+ //; # Positional replace treated as normal replace
if(not defined $self->{"rpl",0,$perlexpr}) { if(not defined $self->{"rpl",0,$perlexpr}) {
my $s; local $_;
if($Global::trim eq "n") { if($Global::trim eq "n") {
$s = $self->{'orig'}; $_ = $self->{'orig'};
} else { } else {
$s = trim_of($self->{'orig'}); $_ = trim_of($self->{'orig'});
} }
local $_ = $s;
::debug("replace", "eval ", $perlexpr, " ", $_, "\n"); ::debug("replace", "eval ", $perlexpr, " ", $_, "\n");
eval $perlexpr; if(not $Global::perleval{$perlexpr}) {
# Make an anonymous function of the $perlexpr
# And more importantly: Compile it only once
if($Global::perleval{$perlexpr} = eval('sub { my $job = shift; '.$perlexpr.' }')) {
# All is good
} else {
# The eval failed. Maybe $perlexpr is invalid perl?
::error("Cannot use $perlexpr\n");
::wait_and_exit(255);
}
}
# Execute the function
$Global::perleval{$perlexpr}->($job);
$self->{"rpl",0,$perlexpr} = $_; $self->{"rpl",0,$perlexpr} = $_;
} }
if(not defined $self->{"rpl",$quote,$perlexpr}) { if(not defined $self->{"rpl",$quote,$perlexpr}) {
@ -6972,7 +7002,7 @@ sub remedian {
} }
sub set_remedian { sub set_remedian {
# Set median of the last 999^3 (=997002999) values using Remedian # Set median of the last 999^3 (=997002999) values using Remedian
# #
# Rousseeuw, Peter J., and Gilbert W. Bassett Jr. "The remedian: A # Rousseeuw, Peter J., and Gilbert W. Bassett Jr. "The remedian: A
# robust averaging method for large data sets." Journal of the # robust averaging method for large data sets." Journal of the

View file

@ -1,5 +1,7 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
=encoding utf8
=head1 NAME =head1 NAME
parallel - build and execute shell command lines from standard input in parallel parallel - build and execute shell command lines from standard input in parallel

View file

@ -172,7 +172,7 @@ If it is a zsh function you will need to use this helper function
SHELL=/bin/bash parallel "my_func {}" ::: 1 2 SHELL=/bin/bash parallel "my_func {}" ::: 1 2
@end verbatim @end verbatim
The command cannot contain the character \257 (¯). The command cannot contain the character \257 (¯).
@item @strong{@{@}} (alpha testing) @item @strong{@{@}} (alpha testing)
@anchor{@strong{@{@}} (alpha testing)} @anchor{@strong{@{@}} (alpha testing)}

View file

@ -1,4 +1,4 @@
.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
.\" .\"
.\" Standard preamble: .\" Standard preamble:
.\" ======================================================================== .\" ========================================================================
@ -38,6 +38,8 @@
. ds PI \(*p . ds PI \(*p
. ds L" `` . ds L" ``
. ds R" '' . ds R" ''
. ds C`
. ds C'
'br\} 'br\}
.\" .\"
.\" Escape single quotes in literal strings from groff's Unicode transform. .\" Escape single quotes in literal strings from groff's Unicode transform.
@ -48,17 +50,24 @@
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the .\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion. .\" output yourself in some meaningful fashion.
.ie \nF \{\ .\"
. de IX .\" Avoid warning from groff about undefined register 'F'.
. tm Index:\\$1\t\\n%\t"\\$2" .de IX
.. ..
. nr % 0 .nr rF 0
. rr F .if \n(.g .if rF .nr rF 1
.\} .if (\n(rF:(\n(.g==0)) \{
.el \{\ . if \nF \{
. de IX . de IX
. tm Index:\\$1\t\\n%\t"\\$2"
.. ..
. if !\nF==2 \{
. nr % 0
. nr F 2
. \}
. \}
.\} .\}
.rr rF
.\" .\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts. .\" Fear. Run. Save yourself. No user-serviceable parts.
@ -124,7 +133,7 @@
.\" ======================================================================== .\" ========================================================================
.\" .\"
.IX Title "PARALLEL_TUTORIAL 1" .IX Title "PARALLEL_TUTORIAL 1"
.TH PARALLEL_TUTORIAL 1 "2014-07-20" "20140711" "parallel" .TH PARALLEL_TUTORIAL 1 "2014-07-26" "20140722" "parallel"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents. .\" way too many mistakes in technical documents.
.if n .ad l .if n .ad l
@ -257,7 +266,7 @@ The input source can be a file:
.PP .PP
Output: Same as above. Output: Same as above.
.PP .PP
\&\s-1STDIN\s0 (standard input) can be the input source: \&\s-1STDIN \s0(standard input) can be the input source:
.PP .PP
.Vb 1 .Vb 1
\& cat abc\-file | parallel echo \& cat abc\-file | parallel echo
@ -296,7 +305,7 @@ The input sources can be files:
.PP .PP
Output: Same as above. Output: Same as above.
.PP .PP
\&\s-1STDIN\s0 (standard input) can be one of the input sources using '\-': \&\s-1STDIN \s0(standard input) can be one of the input sources using '\-':
.PP .PP
.Vb 1 .Vb 1
\& cat abc\-file | parallel \-a \- \-a def\-file echo \& cat abc\-file | parallel \-a \- \-a def\-file echo
@ -721,7 +730,7 @@ replacement string, too:
.PP .PP
Output: Same as above. Output: Same as above.
.PP .PP
\&\s-1GNU\s0 \fBparallel\fR's 7 replacement strings are implemented as: \&\s-1GNU \s0\fBparallel\fR's 7 replacement strings are implemented as:
.PP .PP
.Vb 7 .Vb 7
\& \-\-rpl \*(Aq{} \*(Aq \& \-\-rpl \*(Aq{} \*(Aq
@ -814,7 +823,7 @@ Output: Same as above.
.IX Subsection "Input from columns" .IX Subsection "Input from columns"
.PP .PP
The columns in a file can be bound to positional replacement strings The columns in a file can be bound to positional replacement strings
using \-\-colsep. Here the columns are separated with \s-1TAB\s0 (\et): using \-\-colsep. Here the columns are separated with \s-1TAB \s0(\et):
.PP .PP
.Vb 1 .Vb 1
\& parallel \-\-colsep \*(Aq\et\*(Aq echo 1={1} 2={2} :::: tsv\-file.tsv \& parallel \-\-colsep \*(Aq\et\*(Aq echo 1={1} 2={2} :::: tsv\-file.tsv
@ -2127,7 +2136,7 @@ where command_B is slow, and you want to speed up command_B.
.SS "Chunk size" .SS "Chunk size"
.IX Subsection "Chunk size" .IX Subsection "Chunk size"
By default \s-1GNU\s0 Parallel will start an instance of command_B, read a By default \s-1GNU\s0 Parallel will start an instance of command_B, read a
chunk of 1 \s-1MB\s0, and pass that to the instance. Then start another chunk of 1 \s-1MB,\s0 and pass that to the instance. Then start another
instance, read another chunk, and pass that to the second instance. instance, read another chunk, and pass that to the second instance.
.PP .PP
.Vb 1 .Vb 1
@ -2148,7 +2157,7 @@ Output (the order may be different):
.PP .PP
The size of the chunk is not exactly 1 \s-1MB\s0 because \s-1GNU\s0 Parallel only The size of the chunk is not exactly 1 \s-1MB\s0 because \s-1GNU\s0 Parallel only
passes full lines \- never half a line, thus the blocksize is only passes full lines \- never half a line, thus the blocksize is only
average 1 \s-1MB\s0. You can change the block size to 2 \s-1MB\s0 with \-\-block: average 1 \s-1MB.\s0 You can change the block size to 2 \s-1MB\s0 with \-\-block:
.PP .PP
.Vb 1 .Vb 1
\& cat num1000000 | parallel \-\-pipe \-\-block 2M wc \& cat num1000000 | parallel \-\-pipe \-\-block 2M wc

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -58,7 +58,7 @@ installparallel: ../src/parallel
startdb: startdb:
#echo shutdown abort | sudo su - oracle -c "sqlplus / as sysdba" #echo shutdown abort | sudo su - oracle -c "sqlplus / as sysdba"
sudo parallel /etc/init.d/{} restart ::: postgresql mysql # oracle-xe sudo parallel /etc/init.d/{} status '||' /etc/init.d/{} restart ::: postgresql mysql # oracle-xe
VBoxManage startvm OracleXE || true VBoxManage startvm OracleXE || true
clean: clean:

View file

@ -5,12 +5,15 @@ echo '### Test installation missing pod2*'
parallel which ::: pod2html pod2man pod2texi pod2pdf | sudo parallel mv {} {}.hidden parallel which ::: pod2html pod2man pod2texi pod2pdf | sudo parallel mv {} {}.hidden
cd ~/privat/parallel cd ~/privat/parallel
# Make a .tar.gz file
stdout make dist | perl -pe 's/make\[\d\]/make[0]/g;s/\d{8}/00000000/g' stdout make dist | perl -pe 's/make\[\d\]/make[0]/g;s/\d{8}/00000000/g'
LAST=$(ls *tar.gz | tail -n1) LAST=$(ls *tar.gz | tail -n1)
cd /tmp cd /tmp
rm -rf parallel-20??????/ rm -rf parallel-20??????/
tar xf ~/privat/parallel/$LAST tar xf ~/privat/parallel/$LAST
cd parallel-20??????/ cd parallel-20??????/
# Make sure files depending on *.pod have to be rebuilt
touch src/*pod src/sql touch src/*pod src/sql
./configure && sudo stdout make install | perl -pe 's/make\[\d\]/make[0]/g;s/\d{8}/00000000/g' ./configure && sudo stdout make install | perl -pe 's/make\[\d\]/make[0]/g;s/\d{8}/00000000/g'

View file

@ -58,6 +58,7 @@ echo '### bug #42055: --pipe -a bigfile should not require sequential reading of
parallel --pipepart -a /etc/passwd -l 1 should not be run parallel --pipepart -a /etc/passwd -l 1 should not be run
echo '### --tmux test - check termination' echo '### --tmux test - check termination'
perl -e 'map {printf "$_%o%c\n",$_,$_}1..255' | parallel --tmux echo {} :::: - ::: a b perl -e 'map {printf "$_%o%c\n",$_,$_}1..255' | stdout parallel --tmux echo {} :::: - ::: a b | perl -pe 's/\d/0/g'
EOF EOF

View file

@ -12,7 +12,7 @@ echo '### Test --keeporder'
(seq 0 2) | parallel --keeporder -j100% -S 1/:,2/parallel@parallel-server2 -q perl -e 'sleep 1;print "job{}\n";exit({})' (seq 0 2) | parallel --keeporder -j100% -S 1/:,2/parallel@parallel-server2 -q perl -e 'sleep 1;print "job{}\n";exit({})'
echo '### Test SIGTERM' echo '### Test SIGTERM'
parallel -k -j9 sleep 3';' echo ::: {1..99} >/tmp/$$ 2>&1 & parallel -k -j20 sleep 3';' echo ::: {1..99} >/tmp/$$ 2>&1 &
A=$! A=$!
sleep 5; kill -TERM $A sleep 5; kill -TERM $A
wait wait

View file

@ -43,7 +43,7 @@ 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/:,7/$SSHLOGIN1 "hostname; echo {} >/dev/null" seq 1 20 | stdout parallel -k -j+0 -S 1/:,7/$SSHLOGIN1 "hostname; echo {} >/dev/null" | sort
echo '### Check more than 9 simultaneous sshlogins' echo '### Check more than 9 simultaneous sshlogins'
seq 1 11 | parallel -k -j0 -S "ssh $SSHLOGIN1" echo seq 1 11 | parallel -k -j0 -S "ssh $SSHLOGIN1" echo

View file

@ -5,20 +5,20 @@ 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="-Sparallel\@$SERVER1 -Sssh\ -l\ parallel\ $SERVER2 -j1" parallel -kvv echo (echo 1; echo 1) | PARALLEL="-Sparallel\@$SERVER1 -Sssh\ -l\ parallel\ $SERVER2 -j1" parallel -kv hostname\; echo | sort
echo '### Test $PARALLEL - multi line' echo '### Test $PARALLEL - multi line'
seq 1 2 | PARALLEL="-Sparallel\@$SERVER1 (echo 1; echo 1) | PARALLEL="-Sparallel\@$SERVER1
-Sssh\ -l\ parallel\ $SERVER2 -Sssh\ -l\ parallel\ $SERVER2
-j1" parallel -kvv echo -j1" parallel -kv hostname\; echo | sort
echo '### Test ~/.parallel/config - single line' echo '### Test ~/.parallel/config - single line'
echo "-Sparallel\@$SERVER1 -Sssh\ -l\ parallel\ $SERVER2 -j1" > ~/.parallel/config echo "-Sparallel\@$SERVER1 -Sssh\ -l\ parallel\ $SERVER2 -j1" > ~/.parallel/config
seq 1 2 | parallel -kvv echo (echo 1; echo 1) | parallel -kv hostname\; echo | sort
echo '### Test ~/.parallel/config - multi line' echo '### Test ~/.parallel/config - multi line'
echo "-Sparallel\@$SERVER1 echo "-Sparallel\@$SERVER1
-Sssh\ -l\ parallel\ $SERVER2 -Sssh\ -l\ parallel\ $SERVER2
-j1" > ~/.parallel/config -j1" > ~/.parallel/config
seq 1 2 | parallel -kvv echo (echo 1; echo 1) | parallel -kv hostname\; echo | sort
rm ~/.parallel/config rm ~/.parallel/config

View file

@ -5,26 +5,6 @@ test -d "parallel-00000000" || mkdir "parallel-00000000"
(cd src && make top_distdir=../parallel-00000000 distdir=../parallel-00000000/src \ (cd src && make top_distdir=../parallel-00000000 distdir=../parallel-00000000/src \
am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir) am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[0]: Entering directory `/home/tange/privat/parallel/src' make[0]: Entering directory `/home/tange/privat/parallel/src'
pod2man --release='00000000' --center='parallel' \
--section=1 ./parallel.pod > ./parallel.1n \
&& mv ./parallel.1n ./parallel.1 \
|| echo "Warning: pod2man not found. Using old parallel.1"
/bin/bash: pod2man: command not found
Warning: pod2man not found. Using old parallel.1
pod2html ./parallel.pod > ./parallel.htmln \
&& mv ./parallel.htmln ./parallel.html \
|| echo "Warning: pod2html not found. Using old parallel.html"
/bin/bash: pod2html: command not found
Warning: pod2html not found. Using old parallel.html
rm -f ./pod2htm*
pod2texi --output=./parallel.texi ./parallel.pod \
|| echo "Warning: pod2texi not found. Using old parallel.texi"
/bin/bash: pod2texi: command not found
Warning: pod2texi not found. Using old parallel.texi
pod2pdf --output-file ./parallel.pdf ./parallel.pod --title "GNU Parallel" \
|| echo "Warning: pod2pdf not found. Using old parallel.pdf"
/bin/bash: pod2pdf: command not found
Warning: pod2pdf not found. Using old parallel.pdf
make[0]: Leaving directory `/home/tange/privat/parallel/src' make[0]: Leaving directory `/home/tange/privat/parallel/src'
test -n "" \ test -n "" \
|| find "parallel-00000000" -type d ! -perm -755 \ || find "parallel-00000000" -type d ! -perm -755 \

View file

@ -75,5 +75,5 @@ parallel: Error: --pipepart is incompatible with --max-replace-args, --max-lines
parallel: Error: --pipepart is incompatible with --max-replace-args, --max-lines, and -L. parallel: Error: --pipepart is incompatible with --max-replace-args, --max-lines, and -L.
echo '### --tmux test - check termination' echo '### --tmux test - check termination'
### --tmux test - check termination ### --tmux test - check termination
perl -e 'map {printf "$_%o%c\n",$_,$_}1..255' | parallel --tmux echo {} :::: - ::: a b perl -e 'map {printf "$_%o%c\n",$_,$_}1..255' | stdout parallel --tmux echo {} :::: - ::: a b | perl -pe 's/\d/0/g'
See output with: tmux attach -t p6522 See output with: tmux attach -t p00000

View file

@ -180,26 +180,29 @@ echo "# --recend '' --files --halt-on-error"
echo '### Test of -j filename - non-existent file'; nice stdout parallel -j no_such_file echo ::: 1 echo '### Test of -j filename - non-existent file'; nice stdout parallel -j no_such_file echo ::: 1
### Test of -j filename - non-existent file ### Test of -j filename - non-existent file
Usage: Usage:
parallel [options] [command [arguments]] < list_of_arguments parallel [options] [command [arguments]] < list_of_arguments
parallel [options] [command [arguments]] (::: arguments|:::: argfile(s))... parallel [options] [command [arguments]] (::: arguments|:::: argfile(s))...
cat ... | parallel --pipe [options] [command [arguments]] cat ... | parallel --pipe [options] [command [arguments]]
-j n Run n jobs in parallel -j n Run n jobs in parallel
-k Keep same order -k Keep same order
-X Multiple arguments with context replace -X Multiple arguments with context replace
--colsep regexp Split input on regexp for positional replacements --colsep regexp Split input on regexp for positional replacements
{} {.} {/} {/.} {#} {%} Replacement strings {} {.} {/} {/.} {#} {%} {= perl code =} Replacement strings
{3} {3.} {3/} {3/.} Positional replacement strings {3} {3.} {3/} {3/.} {=3 perl code =} Positional replacement strings
With --plus: {} = {+/}/{/} = {.}.{+.} = {+/}/{/.}.{+.} = {..}.{+..} =
{+/}/{/..}.{+..} = {...}.{+...} = {+/}/{/...}.{+...}
-S sshlogin Example: foo@server.example.com -S sshlogin Example: foo@server.example.com
--slf .. Use ~/.parallel/sshloginfile as the list of sshlogins --slf .. Use ~/.parallel/sshloginfile as the list of sshlogins
--trc {}.bar Shorthand for --transfer --return {}.bar --cleanup --trc {}.bar Shorthand for --transfer --return {}.bar --cleanup
--onall Run the given command with argument on all sshlogins --onall Run the given command with argument on all sshlogins
--nonall Run the given command with no arguments on all sshlogins --nonall Run the given command with no arguments on all sshlogins
--pipe Split stdin (standard input) to multiple jobs. --pipe Split stdin (standard input) to multiple jobs.
--recend str Record end separator for --pipe. --recend str Record end separator for --pipe.
--recstart str Record start separator for --pipe. --recstart str Record start separator for --pipe.
See 'man parallel' for details See 'man parallel' for details

View file

@ -1,5 +1,5 @@
### Test -k ### Test -k
parallel: Warning: Only enough file handles to run 8 jobs in parallel. parallel: Warning: Only enough file handles to run 9 jobs in parallel.
Raising ulimit -n or /etc/security/limits.conf may help. Raising ulimit -n or /etc/security/limits.conf may help.
begin begin
1 1
@ -9,8 +9,8 @@ begin
5 5
6 6
7 7
parallel: Warning: No more file handles. Raising ulimit -n or /etc/security/limits.conf may help.
8 8
parallel: Warning: No more file handles. Raising ulimit -n or /etc/security/limits.conf may help.
9 9
10 10
11 11
@ -51,6 +51,8 @@ job2
14 14
15 15
16 16
17
18
2 2
3 3
4 4
@ -61,8 +63,8 @@ job2
9 9
Raising ulimit -n or /etc/security/limits.conf may help. Raising ulimit -n or /etc/security/limits.conf may help.
parallel: SIGTERM received. No new jobs will be started. parallel: SIGTERM received. No new jobs will be started.
parallel: Waiting for these 8 jobs to finish. Send SIGTERM again to stop now. parallel: Waiting for these 9 jobs to finish. Send SIGTERM again to stop now.
parallel: Warning: Only enough file handles to run 8 jobs in parallel. parallel: Warning: Only enough file handles to run 9 jobs in parallel.
parallel: sleep 3; echo 10 parallel: sleep 3; echo 10
parallel: sleep 3; echo 11 parallel: sleep 3; echo 11
parallel: sleep 3; echo 12 parallel: sleep 3; echo 12
@ -70,7 +72,8 @@ parallel: sleep 3; echo 13
parallel: sleep 3; echo 14 parallel: sleep 3; echo 14
parallel: sleep 3; echo 15 parallel: sleep 3; echo 15
parallel: sleep 3; echo 16 parallel: sleep 3; echo 16
parallel: sleep 3; echo 9 parallel: sleep 3; echo 17
parallel: sleep 3; echo 18
### Test bug: empty line for | sh with -k ### Test bug: empty line for | sh with -k
a a
b b

View file

@ -383,8 +383,8 @@ line 2
### Test --no-run-if-empty and -r: This should give no output ### Test --no-run-if-empty and -r: This should give no output
### Test --help and -h: Help output (just check we get the same amount of lines) ### Test --help and -h: Help output (just check we get the same amount of lines)
Output from -h and --help Output from -h and --help
28 31
28 31
### Test --version: Version output (just check we get the same amount of lines) ### Test --version: Version output (just check we get the same amount of lines)
12 12
### Test --verbose and -t ### Test --verbose and -t

View file

@ -79,6 +79,18 @@ 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
aspire aspire
aspire
aspire
aspire
aspire
aspire
aspire
aspire
aspire
aspire
aspire
aspire
aspire
redhat9.tange.dk redhat9.tange.dk
redhat9.tange.dk redhat9.tange.dk
redhat9.tange.dk redhat9.tange.dk
@ -86,18 +98,6 @@ redhat9.tange.dk
redhat9.tange.dk redhat9.tange.dk
redhat9.tange.dk redhat9.tange.dk
redhat9.tange.dk redhat9.tange.dk
aspire
aspire
aspire
aspire
aspire
aspire
aspire
aspire
aspire
aspire
aspire
aspire
### Check more than 9 simultaneous sshlogins ### Check more than 9 simultaneous sshlogins
1 1
2 2

View file

@ -76,15 +76,15 @@ ls: tmp/parallel.file*: No such file or directory
OK OK
Input for ssh Input for ssh
parallel@parallel-server1 mkdir -p ./. parallel@parallel-server1 mkdir -p ./.
-l parallel parallel-server1 rsync --server -lDrRze.iLsf . ./. -l parallel parallel-server1 rsync --server -lDrRze.iLs . ./.
-tt -oLogLevel=quiet parallel@parallel-server1 eval `echo $SHELL | grep "/t\{0,1\}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` ; tty >/dev/null && stty isig -onlcr -echo;cat tmp/parallel.file.' -tt -oLogLevel=quiet parallel@parallel-server1 eval `echo $SHELL | grep "/t\{0,1\}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` ; tty >/dev/null && stty isig -onlcr -echo;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
-l parallel parallel-server1 cd ././tmp; rsync --server --sender -lDrRze.iLsf . ./parallel.file.' -l parallel parallel-server1 cd ././tmp; rsync --server --sender -lDrRze.iLs . ./parallel.file.'
'newline2.out 'newline2.out
-l parallel parallel-server1 cd ././tmp; rsync --server --sender -lDrRze.iLsf . ./parallel.file.' -l parallel parallel-server1 cd ././tmp; rsync --server --sender -lDrRze.iLs . ./parallel.file.'
'newline2.out2 'newline2.out2
parallel@parallel-server1 (rm -f ./tmp/parallel.file.' parallel@parallel-server1 (rm -f ./tmp/parallel.file.'
'newline2; rmdir ./tmp/ ./ 2>/dev/null;) 'newline2; rmdir ./tmp/ ./ 2>/dev/null;)
@ -93,15 +93,15 @@ parallel@parallel-server1 (rm -f ./tmp/parallel.file.'
parallel@parallel-server1 (rm -f ./tmp/parallel.file.' parallel@parallel-server1 (rm -f ./tmp/parallel.file.'
'newline2.out2; rmdir ./tmp/ ./ 2>/dev/null;) 'newline2.out2; rmdir ./tmp/ ./ 2>/dev/null;)
parallel@parallel-server2 mkdir -p ./. parallel@parallel-server2 mkdir -p ./.
-l parallel parallel-server2 rsync --server -lDrRze.iLsf . ./. -l parallel parallel-server2 rsync --server -lDrRze.iLs . ./.
-tt -oLogLevel=quiet parallel@parallel-server2 eval `echo $SHELL | grep "/t\{0,1\}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` ; tty >/dev/null && stty isig -onlcr -echo;cat tmp/parallel.file.' -tt -oLogLevel=quiet parallel@parallel-server2 eval `echo $SHELL | grep "/t\{0,1\}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` ; tty >/dev/null && stty isig -onlcr -echo;cat tmp/parallel.file.'
'newline1 > tmp/parallel.file.' 'newline1 > tmp/parallel.file.'
'newline1.out;cat tmp/parallel.file.' 'newline1.out;cat tmp/parallel.file.'
'newline1 > tmp/parallel.file.' 'newline1 > tmp/parallel.file.'
'newline1.out2 'newline1.out2
-l parallel parallel-server2 cd ././tmp; rsync --server --sender -lDrRze.iLsf . ./parallel.file.' -l parallel parallel-server2 cd ././tmp; rsync --server --sender -lDrRze.iLs . ./parallel.file.'
'newline1.out 'newline1.out
-l parallel parallel-server2 cd ././tmp; rsync --server --sender -lDrRze.iLsf . ./parallel.file.' -l parallel parallel-server2 cd ././tmp; rsync --server --sender -lDrRze.iLs . ./parallel.file.'
'newline1.out2 'newline1.out2
parallel@parallel-server2 (rm -f ./tmp/parallel.file.' parallel@parallel-server2 (rm -f ./tmp/parallel.file.'
'newline1; rmdir ./tmp/ ./ 2>/dev/null;) 'newline1; rmdir ./tmp/ ./ 2>/dev/null;)

View file

@ -1,21 +1,29 @@
### Test $PARALLEL - single line ### Test $PARALLEL - single line
1 1
ssh -l parallel -tt -oLogLevel=quiet parallel-server2 'eval `echo $SHELL | grep "/t\{0,1\}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` ;' tty\ \>/dev/null\ \&\&\ stty\ isig\ -onlcr\ -echo\;echo\ 1;
1 1
ssh -tt -oLogLevel=quiet parallel\@parallel-server3 'eval `echo $SHELL | grep "/t\{0,1\}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` ;' tty\ \>/dev/null\ \&\&\ stty\ isig\ -onlcr\ -echo\;echo\ 2; 1
2 centos3.tange.dk
hostname; echo 1
hostname; echo 1
nlv
### Test $PARALLEL - multi line ### Test $PARALLEL - multi line
ssh -l parallel -tt -oLogLevel=quiet parallel-server2 'eval `echo $SHELL | grep "/t\{0,1\}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` ;' tty\ \>/dev/null\ \&\&\ stty\ isig\ -onlcr\ -echo\;echo\ 1;
1 1
ssh -tt -oLogLevel=quiet parallel\@parallel-server3 'eval `echo $SHELL | grep "/t\{0,1\}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` ;' tty\ \>/dev/null\ \&\&\ stty\ isig\ -onlcr\ -echo\;echo\ 2; 1
2 centos3.tange.dk
hostname; echo 1
hostname; echo 1
nlv
### Test ~/.parallel/config - single line ### Test ~/.parallel/config - single line
ssh -l parallel -tt -oLogLevel=quiet parallel-server2 'eval `echo $SHELL | grep "/t\{0,1\}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` ;' tty\ \>/dev/null\ \&\&\ stty\ isig\ -onlcr\ -echo\;echo\ 1;
1 1
ssh -tt -oLogLevel=quiet parallel\@parallel-server3 'eval `echo $SHELL | grep "/t\{0,1\}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` ;' tty\ \>/dev/null\ \&\&\ stty\ isig\ -onlcr\ -echo\;echo\ 2; 1
2 centos3.tange.dk
hostname; echo 1
hostname; echo 1
nlv
### Test ~/.parallel/config - multi line ### Test ~/.parallel/config - multi line
ssh -l parallel -tt -oLogLevel=quiet parallel-server2 'eval `echo $SHELL | grep "/t\{0,1\}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` ;' tty\ \>/dev/null\ \&\&\ stty\ isig\ -onlcr\ -echo\;echo\ 1;
1 1
ssh -tt -oLogLevel=quiet parallel\@parallel-server3 'eval `echo $SHELL | grep "/t\{0,1\}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` ;' tty\ \>/dev/null\ \&\&\ stty\ isig\ -onlcr\ -echo\;echo\ 2; 1
2 centos3.tange.dk
hostname; echo 1
hostname; echo 1
nlv