mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-25 07:27:55 +00:00
parallel: Error and warning sub to ensure consistent errors and warnings.
This commit is contained in:
parent
ed6903976b
commit
783d2d42f3
147
src/parallel
147
src/parallel
|
@ -34,8 +34,8 @@ use strict;
|
||||||
$::oodebug=0;
|
$::oodebug=0;
|
||||||
$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
|
||||||
if(not $ENV{SHELL}) {
|
if(not $ENV{SHELL}) {
|
||||||
# $ENV{SHELL} is sometimes not set on Mac OS X
|
# $ENV{SHELL} is sometimes not set on Mac OS X and Windows
|
||||||
print STDERR ("parallel: Warning: \$SHELL not set. Using /bin/sh\n");
|
::warning("\$SHELL not set. Using /bin/sh.\n");
|
||||||
$ENV{SHELL} = "/bin/sh";
|
$ENV{SHELL} = "/bin/sh";
|
||||||
}
|
}
|
||||||
%Global::original_sig = %SIG;
|
%Global::original_sig = %SIG;
|
||||||
|
@ -110,9 +110,8 @@ if($::opt_filter_hosts) {
|
||||||
} elsif($col[6] eq "127") {
|
} elsif($col[6] eq "127") {
|
||||||
# signal == 127: parallel not installed remote
|
# signal == 127: parallel not installed remote
|
||||||
# Set ncpus and ncores = 1
|
# Set ncpus and ncores = 1
|
||||||
print $Global::original_stderr
|
::warning("Could not figure out ",
|
||||||
("parallel: Warning: Could not figure out ",
|
"number of cpus on $col[1]. Using 1.\n");
|
||||||
"number of cpus on $col[1]. Using 1\n");
|
|
||||||
$ncores{$col[1]} = 1;
|
$ncores{$col[1]} = 1;
|
||||||
$ncpus{$col[1]} = 1;
|
$ncpus{$col[1]} = 1;
|
||||||
$maxlen{$col[1]} = Limits::Command::max_length();
|
$maxlen{$col[1]} = Limits::Command::max_length();
|
||||||
|
@ -614,13 +613,13 @@ sub parse_options {
|
||||||
@ARGV=read_options();
|
@ARGV=read_options();
|
||||||
|
|
||||||
if(defined $::opt_retired) {
|
if(defined $::opt_retired) {
|
||||||
print STDERR "$Global::progname: -g has been retired. Use --group.\n";
|
::error("-g has been retired. Use --group.\n");
|
||||||
print STDERR "$Global::progname: -B has been retired. Use --bf.\n";
|
::error("-B has been retired. Use --bf.\n");
|
||||||
print STDERR "$Global::progname: -T has been retired. Use --tty.\n";
|
::error("-T has been retired. Use --tty.\n");
|
||||||
print STDERR "$Global::progname: -U has been retired. Use --er.\n";
|
::error("-U has been retired. Use --er.\n");
|
||||||
print STDERR "$Global::progname: -W has been retired. Use --wd.\n";
|
::error("-W has been retired. Use --wd.\n");
|
||||||
print STDERR "$Global::progname: -Y has been retired. Use --shebang.\n";
|
::error("-Y has been retired. Use --shebang.\n");
|
||||||
print STDERR "$Global::progname: -H has been retired. Use --halt.\n";
|
::error("-H has been retired. Use --halt.\n");
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
if(@::opt_v) { $Global::verbose = $#::opt_v+1; } # Convert -v -v to v=2
|
if(@::opt_v) { $Global::verbose = $#::opt_v+1; } # Convert -v -v to v=2
|
||||||
|
@ -791,8 +790,8 @@ sub parse_options {
|
||||||
$::opt_P = 1;
|
$::opt_P = 1;
|
||||||
}
|
}
|
||||||
if($Global::interactive and $::opt_bg) {
|
if($Global::interactive and $::opt_bg) {
|
||||||
print STDERR "$Global::progname: Jobs running in the ".
|
::error("Jobs running in the ".
|
||||||
"background cannot be interactive.\n";
|
"background cannot be interactive.\n");
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -806,8 +805,7 @@ sub parse_options {
|
||||||
# As we do not know the max line length on the remote machine
|
# As we do not know the max line length on the remote machine
|
||||||
# long commands generated by xargs may fail
|
# long commands generated by xargs may fail
|
||||||
# If opt_N is set, it is probably safe
|
# If opt_N is set, it is probably safe
|
||||||
print STDERR ("$Global::progname: Warning: using -X or -m ",
|
::warning("Using -X or -m with --sshlogin may fail.\n");
|
||||||
"with --sshlogin may fail\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(not defined $::opt_P) {
|
if(not defined $::opt_P) {
|
||||||
|
@ -819,7 +817,7 @@ sub parse_options {
|
||||||
sub open_joblog {
|
sub open_joblog {
|
||||||
my $append = 0;
|
my $append = 0;
|
||||||
if($::opt_resume and not $::opt_joblog) {
|
if($::opt_resume and not $::opt_joblog) {
|
||||||
print STDERR ("$Global::progname: --resume requires --joblog\n");
|
::error("--resume requires --joblog.\n");
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
if($::opt_joblog) {
|
if($::opt_joblog) {
|
||||||
|
@ -832,7 +830,7 @@ sub open_joblog {
|
||||||
# This is 30% faster than set_job_already_run($1);
|
# This is 30% faster than set_job_already_run($1);
|
||||||
vec($Global::job_already_run,$1,1) = 1;
|
vec($Global::job_already_run,$1,1) = 1;
|
||||||
} else {
|
} else {
|
||||||
print STDERR ("$Global::progname: Format of '$::opt_joblog' is wrong\n");
|
::error("Format of '$::opt_joblog' is wrong.\n");
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -842,15 +840,13 @@ sub open_joblog {
|
||||||
if($append) {
|
if($append) {
|
||||||
# Append to joblog
|
# Append to joblog
|
||||||
if(not open($Global::joblog,">>$::opt_joblog")) {
|
if(not open($Global::joblog,">>$::opt_joblog")) {
|
||||||
print STDERR ("$Global::progname: Cannot append to ",
|
::error("Cannot append to --joblog $::opt_joblog.\n");
|
||||||
"--joblog $::opt_joblog\n");
|
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
# Overwrite the joblog
|
# Overwrite the joblog
|
||||||
if(not open($Global::joblog,">$::opt_joblog")) {
|
if(not open($Global::joblog,">$::opt_joblog")) {
|
||||||
print STDERR ("$Global::progname: Cannot write to ",
|
::error("Cannot write to --joblog $::opt_joblog.\n");
|
||||||
"--joblog $::opt_joblog\n");
|
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
} else {
|
} else {
|
||||||
print $Global::joblog
|
print $Global::joblog
|
||||||
|
@ -908,7 +904,7 @@ sub read_options {
|
||||||
if(grep /^$profile$/, @config_profiles) {
|
if(grep /^$profile$/, @config_profiles) {
|
||||||
# config file is not required to exist
|
# config file is not required to exist
|
||||||
} else {
|
} else {
|
||||||
print STDERR "$Global::progname: $profile not readable\n";
|
::error("$profile not readable.\n");
|
||||||
wait_and_exit(255);
|
wait_and_exit(255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1096,9 +1092,7 @@ sub open_or_exit {
|
||||||
}
|
}
|
||||||
my $fh = gensym;
|
my $fh = gensym;
|
||||||
if(not open($fh,"<",$file)) {
|
if(not open($fh,"<",$file)) {
|
||||||
print STDERR "$Global::progname: ".
|
::error("Cannot open input file `$file': No such file or directory.\n");
|
||||||
"Cannot open input file `$file': ".
|
|
||||||
"No such file or directory\n";
|
|
||||||
wait_and_exit(255);
|
wait_and_exit(255);
|
||||||
}
|
}
|
||||||
return $fh;
|
return $fh;
|
||||||
|
@ -1229,9 +1223,8 @@ sub start_another_job {
|
||||||
$sshlogin->set_max_jobs_running($max);
|
$sshlogin->set_max_jobs_running($max);
|
||||||
# Sleep up to 300 ms to give other processes time to die
|
# Sleep up to 300 ms to give other processes time to die
|
||||||
::usleep(rand()*300);
|
::usleep(rand()*300);
|
||||||
print $Global::original_stderr
|
::warning("No more processes: ",
|
||||||
("parallel: Warning: No more processes: ".
|
"Decreasing number of running jobs to $max. ",
|
||||||
"Decreasing number of running jobs to $max. ".
|
|
||||||
"Raising ulimit -u may help.\n");
|
"Raising ulimit -u may help.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1559,7 +1552,7 @@ sub read_sshloginfile {
|
||||||
$close = 0;
|
$close = 0;
|
||||||
} else {
|
} else {
|
||||||
if(not open(IN, $file)) {
|
if(not open(IN, $file)) {
|
||||||
print $Global::original_stderr "Cannot open $file\n";
|
::error("Cannot open $file.\n");
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1598,20 +1591,15 @@ sub parse_sshlogin {
|
||||||
if(not remote_hosts()) {
|
if(not remote_hosts()) {
|
||||||
# There are no remote hosts
|
# There are no remote hosts
|
||||||
if(@::opt_trc) {
|
if(@::opt_trc) {
|
||||||
print $Global::original_stderr
|
::warning("--trc ignored as there are no remote --sshlogin.\n");
|
||||||
"parallel: Warning: --trc ignored as there are no remote --sshlogin\n";
|
|
||||||
} elsif (defined $::opt_transfer) {
|
} elsif (defined $::opt_transfer) {
|
||||||
print $Global::original_stderr
|
::warning("--transfer ignored as there are no remote --sshlogin.\n");
|
||||||
"parallel: Warning: --transfer ignored as there are no remote --sshlogin\n";
|
|
||||||
} elsif (@::opt_return) {
|
} elsif (@::opt_return) {
|
||||||
print $Global::original_stderr
|
::warning("--return ignored as there are no remote --sshlogin.\n");
|
||||||
"parallel: Warning: --return ignored as there are no remote --sshlogin\n";
|
|
||||||
} elsif (defined $::opt_cleanup) {
|
} elsif (defined $::opt_cleanup) {
|
||||||
print $Global::original_stderr
|
::warning("--cleanup ignored as there are no remote --sshlogin.\n");
|
||||||
"parallel: Warning: --cleanup ignored as there are no remote --sshlogin\n";
|
|
||||||
} elsif (@::opt_basefile) {
|
} elsif (@::opt_basefile) {
|
||||||
print $Global::original_stderr
|
::warning("--basefile ignored as there are no remote --sshlogin.\n");
|
||||||
"parallel: Warning: --basefile ignored as there are no remote --sshlogin\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1835,6 +1823,22 @@ sub usage {
|
||||||
"");
|
"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub warning {
|
||||||
|
my @w = @_;
|
||||||
|
my $fh = $Global::original_stderr || *STDERR;
|
||||||
|
my $prog = $Global::progname || "parallel";
|
||||||
|
print $fh $prog, ": Warning: ", @w;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub error {
|
||||||
|
my @w = @_;
|
||||||
|
my $fh = $Global::original_stderr || *STDERR;
|
||||||
|
my $prog = $Global::progname || "parallel";
|
||||||
|
print $fh $prog, ": Error: ", @w;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub die_bug {
|
sub die_bug {
|
||||||
my $bugid = shift;
|
my $bugid = shift;
|
||||||
print STDERR
|
print STDERR
|
||||||
|
@ -2558,20 +2562,16 @@ sub processes_available_by_system_limit {
|
||||||
if($system_limit < $wanted_processes) {
|
if($system_limit < $wanted_processes) {
|
||||||
# The system_limit is less than the wanted_processes
|
# The system_limit is less than the wanted_processes
|
||||||
if($system_limit < 1 and not $Global::JobQueue->empty()) {
|
if($system_limit < 1 and not $Global::JobQueue->empty()) {
|
||||||
print $Global::original_stderr "$Global::progname: Cannot spawn any jobs. ",
|
::warning("Cannot spawn any jobs. Raising ulimit -u may help.\n");
|
||||||
"Raising ulimit -u may help.\n";
|
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
if(not $more_filehandles) {
|
if(not $more_filehandles) {
|
||||||
print $Global::original_stderr
|
::warning("Only enough filehandles to run ", $system_limit,
|
||||||
("parallel: Warning: Only enough filehandles to run ",
|
" jobs in parallel. Raising ulimit -n may help.\n");
|
||||||
$system_limit, " jobs in parallel. ",
|
|
||||||
"Raising ulimit -n may help.\n");
|
|
||||||
}
|
}
|
||||||
if($max_system_proc_reached) {
|
if($max_system_proc_reached) {
|
||||||
print $Global::original_stderr
|
::warning("Only enough available processes to run ", $system_limit,
|
||||||
("parallel: Warning: Only enough available processes to run ",
|
" jobs in parallel. Raising ulimit -u may help.\n");
|
||||||
$system_limit, " jobs in parallel. Raising ulimit -u may help.\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($Global::JobQueue->empty()) {
|
if($Global::JobQueue->empty()) {
|
||||||
|
@ -2598,13 +2598,12 @@ sub simultaneous_sshlogin_limit {
|
||||||
$self->simultaneous_sshlogin($wanted_processes));
|
$self->simultaneous_sshlogin($wanted_processes));
|
||||||
if($ssh_limit < $wanted_processes) {
|
if($ssh_limit < $wanted_processes) {
|
||||||
my $serverlogin = $self->serverlogin();
|
my $serverlogin = $self->serverlogin();
|
||||||
print $Global::original_stderr
|
::warning("ssh to $serverlogin only allows ",
|
||||||
("parallel: Warning: ssh to $serverlogin only allows ",
|
|
||||||
"for $ssh_limit simultaneous logins.\n",
|
"for $ssh_limit simultaneous logins.\n",
|
||||||
"You may raise this by changing ",
|
"You may raise this by changing ",
|
||||||
"/etc/ssh/sshd_config:MaxStartup on $serverlogin\n",
|
"/etc/ssh/sshd_config:MaxStartup on $serverlogin.\n",
|
||||||
"Using only ",$ssh_limit-1," connections ",
|
"Using only ",$ssh_limit-1," connections ",
|
||||||
"to avoid race conditions\n");
|
"to avoid race conditions.\n");
|
||||||
}
|
}
|
||||||
# Race condition can cause problem if using all sshs.
|
# Race condition can cause problem if using all sshs.
|
||||||
if($ssh_limit > 1) { $ssh_limit -= 1; }
|
if($ssh_limit > 1) { $ssh_limit -= 1; }
|
||||||
|
@ -2672,11 +2671,11 @@ sub user_requested_processes {
|
||||||
close IN;
|
close IN;
|
||||||
$processes = $self->user_requested_processes($opt_P_file);
|
$processes = $self->user_requested_processes($opt_P_file);
|
||||||
} else {
|
} else {
|
||||||
print $Global::original_stderr "Cannot open $opt_P\n";
|
::error("Cannot open $opt_P.\n");
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print $Global::original_stderr "Parsing of --jobs/-j/--max-procs/-P failed\n";
|
::error("Parsing of --jobs/-j/--max-procs/-P failed.\n");
|
||||||
::die_usage();
|
::die_usage();
|
||||||
}
|
}
|
||||||
if($processes < 1) {
|
if($processes < 1) {
|
||||||
|
@ -2708,9 +2707,8 @@ sub ncpus {
|
||||||
if($ncpu =~ /^\s*[0-9]+\s*$/s) {
|
if($ncpu =~ /^\s*[0-9]+\s*$/s) {
|
||||||
$self->{'ncpus'} = $ncpu;
|
$self->{'ncpus'} = $ncpu;
|
||||||
} else {
|
} else {
|
||||||
print $Global::original_stderr
|
::warning("Could not figure out ",
|
||||||
("parallel: Warning: Could not figure out ",
|
"number of cpus on $serverlogin ($ncpu). Using 1.\n");
|
||||||
"number of cpus on $serverlogin ($ncpu). Using 1\n");
|
|
||||||
$self->{'ncpus'} = 1;
|
$self->{'ncpus'} = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2745,7 +2743,7 @@ sub no_of_cpus {
|
||||||
chomp $no_of_cpus;
|
chomp $no_of_cpus;
|
||||||
return $no_of_cpus;
|
return $no_of_cpus;
|
||||||
} else {
|
} else {
|
||||||
warn("parallel: Cannot figure out number of cpus. Using 1");
|
::warning("Cannot figure out number of cpus. Using 1.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2777,7 +2775,7 @@ sub no_of_cores {
|
||||||
chomp $no_of_cores;
|
chomp $no_of_cores;
|
||||||
return $no_of_cores;
|
return $no_of_cores;
|
||||||
} else {
|
} else {
|
||||||
warn("parallel: Cannot figure out number of CPU cores. Using 1");
|
::warning("Cannot figure out number of CPU cores. Using 1.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3459,9 +3457,7 @@ sub sshtransfer {
|
||||||
$pre .= "$mkremote_workdir; rsync $rsync_opt "
|
$pre .= "$mkremote_workdir; rsync $rsync_opt "
|
||||||
. ::shell_quote_scalar($file)." $serverlogin:$rsync_destdir;";
|
. ::shell_quote_scalar($file)." $serverlogin:$rsync_destdir;";
|
||||||
} else {
|
} else {
|
||||||
print $Global::original_stderr
|
::warning($file, " is not readable and will not be transferred.\n");
|
||||||
"parallel: Warning: "
|
|
||||||
. $file . " is not readable and will not be transferred\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $pre;
|
return $pre;
|
||||||
|
@ -4232,9 +4228,7 @@ sub replaced {
|
||||||
# Is this really a command in $PATH starting with '-'?
|
# Is this really a command in $PATH starting with '-'?
|
||||||
my $cmd = $1;
|
my $cmd = $1;
|
||||||
if(not grep { -e $_."/".$cmd } split(":",$ENV{'PATH'})) {
|
if(not grep { -e $_."/".$cmd } split(":",$ENV{'PATH'})) {
|
||||||
print STDERR "parallel: Error:"
|
::error("Command ($cmd) starts with '-'. Is this a wrong option?.\n");
|
||||||
. " Command ($cmd) starts with '-'."
|
|
||||||
. " Is this a wrong option?\n";
|
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4501,8 +4495,7 @@ sub get {
|
||||||
if($::opt_pipe) {
|
if($::opt_pipe) {
|
||||||
if($cmd_line->replaced() eq "") {
|
if($cmd_line->replaced() eq "") {
|
||||||
# Empty command - pipe requires a command
|
# Empty command - pipe requires a command
|
||||||
print STDERR "$Global::progname: --pipe must have a ".
|
::error("--pipe must have a command to pipe into (e.g. 'cat').\n");
|
||||||
"command to pipe into (e.g. 'cat')\n";
|
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -4582,8 +4575,8 @@ sub max_length {
|
||||||
if($::opt_s <= $Limits::Command::line_max_len) {
|
if($::opt_s <= $Limits::Command::line_max_len) {
|
||||||
$Limits::Command::line_max_len = $::opt_s;
|
$Limits::Command::line_max_len = $::opt_s;
|
||||||
} else {
|
} else {
|
||||||
print STDERR "$Global::progname: value for -s option ",
|
::warning("Value for -s option ",
|
||||||
"should be < $Limits::Command::line_max_len\n";
|
"should be < $Limits::Command::line_max_len.\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$Limits::Command::line_max_len = real_max_length();
|
$Limits::Command::line_max_len = real_max_length();
|
||||||
|
@ -4769,9 +4762,9 @@ sub new {
|
||||||
my $fhs = shift;
|
my $fhs = shift;
|
||||||
for my $fh (@$fhs) {
|
for my $fh (@$fhs) {
|
||||||
if(-t $fh) {
|
if(-t $fh) {
|
||||||
print STDERR "$Global::progname: Input is read from the terminal. ".
|
::warning("Input is read from the terminal. ".
|
||||||
"Only experts do this on purpose. ".
|
"Only experts do this on purpose. ".
|
||||||
"Press CTRL-D to exit.\n";
|
"Press CTRL-D to exit.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return bless {
|
return bless {
|
||||||
|
@ -5056,8 +5049,7 @@ sub trim_of {
|
||||||
} elsif($Global::trim eq "rl" or $Global::trim eq "lr") {
|
} elsif($Global::trim eq "rl" or $Global::trim eq "lr") {
|
||||||
for $arg (@strings) { $arg =~ s/^\s+//; $arg =~ s/\s+$//; }
|
for $arg (@strings) { $arg =~ s/^\s+//; $arg =~ s/\s+$//; }
|
||||||
} else {
|
} else {
|
||||||
print STDERR "$Global::progname: --trim must be one of: r l ".
|
::error("--trim must be one of: r l rl lr.\n");
|
||||||
"rl lr\n";
|
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
return wantarray ? @strings : "@strings";
|
return wantarray ? @strings : "@strings";
|
||||||
|
@ -5251,9 +5243,8 @@ sub lock {
|
||||||
$Global::use{"Fcntl"} ||= eval "use Fcntl qw(:DEFAULT :flock); 1;";
|
$Global::use{"Fcntl"} ||= eval "use Fcntl qw(:DEFAULT :flock); 1;";
|
||||||
while(not flock $self->{'lockfh'}, LOCK_EX()|LOCK_NB()) {
|
while(not flock $self->{'lockfh'}, LOCK_EX()|LOCK_NB()) {
|
||||||
if ($! =~ m/Function not implemented/) {
|
if ($! =~ m/Function not implemented/) {
|
||||||
print $Global::original_stderr
|
::warning("flock: $!");
|
||||||
("parallel: Warning: flock: $!");
|
::warning("Will wait for a random while\n");
|
||||||
print "parallel: Will wait for a random while\n";
|
|
||||||
::usleep(rand(5000));
|
::usleep(rand(5000));
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
|
@ -5286,7 +5277,7 @@ sub mkdir_or_die {
|
||||||
mkdir $ddir;
|
mkdir $ddir;
|
||||||
}
|
}
|
||||||
if(not -w $dir) {
|
if(not -w $dir) {
|
||||||
print STDERR "$Global::progname: Cannot write to $dir: $!\n";
|
::error("Cannot write to $dir: $!\n");
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -797,6 +797,12 @@ defaults to '\n'. To have no record separator use B<--recend "">.
|
||||||
B<--files> is often used with B<--pipe>.
|
B<--files> is often used with B<--pipe>.
|
||||||
|
|
||||||
|
|
||||||
|
=item B<--plain> (not implemented)
|
||||||
|
|
||||||
|
Ignore any B<--profile>, $PARALLEL, ~/.parallel/config, B<--tollef> to
|
||||||
|
get full control on the command line (used by GNU B<parallel> itself
|
||||||
|
when called with B<--sshlogin>).
|
||||||
|
|
||||||
=item B<--progress>
|
=item B<--progress>
|
||||||
|
|
||||||
Show progress of computations. List the computers involved in the task
|
Show progress of computations. List the computers involved in the task
|
||||||
|
|
|
@ -853,6 +853,13 @@ defaults to '\n'. To have no record separator use @strong{--recend ""}.
|
||||||
|
|
||||||
@strong{--files} is often used with @strong{--pipe}.
|
@strong{--files} is often used with @strong{--pipe}.
|
||||||
|
|
||||||
|
@item @strong{--plain} (not implemented)
|
||||||
|
@anchor{@strong{--plain} (not implemented)}
|
||||||
|
|
||||||
|
Ignore any @strong{--profile}, $PARALLEL, ~/.parallel/config, @strong{--tollef} to
|
||||||
|
get full control on the command line (used by GNU @strong{parallel} itself
|
||||||
|
when called with @strong{--sshlogin}).
|
||||||
|
|
||||||
@item @strong{--progress}
|
@item @strong{--progress}
|
||||||
@anchor{@strong{--progress}}
|
@anchor{@strong{--progress}}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ seq 1 10 >/tmp/$$-1; parallel -k -a /tmp/$$-1 echo
|
||||||
seq 1 10 >/tmp/$$-2; parallel -k --arg-file /tmp/$$-2 echo
|
seq 1 10 >/tmp/$$-2; parallel -k --arg-file /tmp/$$-2 echo
|
||||||
|
|
||||||
echo '### Test killing children with --timeout and exit value (failed if timed out)'
|
echo '### Test killing children with --timeout and exit value (failed if timed out)'
|
||||||
pstree | grep sleep | grep -v anacron | wc; parallel --timeout 3 'true {} ; for i in `seq 100 120`; do bash -c "(sleep $i)" & sleep $i & done; wait; echo No good' ::: 1000000000 1000000001 ; echo $?; pstree | grep sleep | grep -v anacron | wc
|
pstree | grep sleep | grep -v anacron | grep -v screensave | wc; parallel --timeout 3 'true {} ; for i in `seq 100 120`; do bash -c "(sleep $i)" & sleep $i & done; wait; echo No good' ::: 1000000000 1000000001 ; echo $?; pstree | grep sleep | grep -v anacron | grep -v screensave | wc
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
#echo '### Test bugfix if no command given'
|
#echo '### Test bugfix if no command given'
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
### Test of quoting of > bug if line continuation
|
### Test of quoting of > bug if line continuation
|
||||||
> > >
|
> > >
|
||||||
### Test of --trim illegal
|
### Test of --trim illegal
|
||||||
parallel: --trim must be one of: r l rl lr
|
parallel: Error: --trim must be one of: r l rl lr.
|
||||||
### Test of eof string on :::
|
### Test of eof string on :::
|
||||||
foo
|
foo
|
||||||
### Test of ignore-empty string on :::
|
### Test of ignore-empty string on :::
|
||||||
|
|
|
@ -17,4 +17,4 @@ ajob2b job2
|
||||||
### Test bug #35820: sem breaks if $HOME is not writable
|
### Test bug #35820: sem breaks if $HOME is not writable
|
||||||
Workaround: use another writable dir
|
Workaround: use another writable dir
|
||||||
OK
|
OK
|
||||||
parallel: Cannot write to /usr/this/should/fail/.parallel: No such file or directory
|
parallel: Error: Cannot write to /usr/this/should/fail/.parallel: No such file or directory
|
||||||
|
|
|
@ -31,7 +31,7 @@ echo '### Test of --retries on unreachable host'
|
||||||
### Test of --retries on unreachable host
|
### Test of --retries on unreachable host
|
||||||
seq 2 | stdout parallel -k --retries 2 -v -S 4.3.2.1,: echo
|
seq 2 | stdout parallel -k --retries 2 -v -S 4.3.2.1,: echo
|
||||||
ssh: connect to host 4.3.2.1 port 22: Connection timed out
|
ssh: connect to host 4.3.2.1 port 22: Connection timed out
|
||||||
parallel: Warning: Could not figure out number of cpus on 4.3.2.1 (). Using 1
|
parallel: Warning: Could not figure out number of cpus on 4.3.2.1 (). Using 1.
|
||||||
echo 1
|
echo 1
|
||||||
1
|
1
|
||||||
echo 2
|
echo 2
|
||||||
|
|
|
@ -86,7 +86,7 @@ When using GNU Parallel for a publication please cite:
|
||||||
|
|
||||||
O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
|
O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
|
||||||
;login: The USENIX Magazine, February 2011:42-47.
|
;login: The USENIX Magazine, February 2011:42-47.
|
||||||
Parsing of --jobs/-j/--max-procs/-P failed
|
parallel: Error: Parsing of --jobs/-j/--max-procs/-P failed.
|
||||||
### Test of -j filename
|
### Test of -j filename
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
sleep 0.7
|
sleep 0.7
|
||||||
|
@ -151,7 +151,7 @@ sleep 0.3
|
||||||
3 4 5
|
3 4 5
|
||||||
6 7
|
6 7
|
||||||
### Test :::: on nonexistent
|
### Test :::: on nonexistent
|
||||||
parallel: Cannot open input file `nonexistent': No such file or directory
|
parallel: Error: Cannot open input file `nonexistent': No such file or directory.
|
||||||
### Test :::: two files
|
### Test :::: two files
|
||||||
1 5
|
1 5
|
||||||
2 6
|
2 6
|
||||||
|
@ -233,8 +233,8 @@ b a
|
||||||
echo b a
|
echo b a
|
||||||
b a
|
b a
|
||||||
### Multiple -a: nonexistent
|
### Multiple -a: nonexistent
|
||||||
parallel: Cannot open input file `nonexist': No such file or directory
|
parallel: Error: Cannot open input file `nonexist': No such file or directory.
|
||||||
parallel: Cannot open input file `nonexist': No such file or directory
|
parallel: Error: Cannot open input file `nonexist': No such file or directory.
|
||||||
### Test {#.}
|
### Test {#.}
|
||||||
echo c-ext b-withext a-noext
|
echo c-ext b-withext a-noext
|
||||||
c-ext b-withext a-noext
|
c-ext b-withext a-noext
|
||||||
|
|
|
@ -117,4 +117,4 @@ done 4
|
||||||
39
|
39
|
||||||
40
|
40
|
||||||
### Test bug #33621: --bg -p should give an error message
|
### Test bug #33621: --bg -p should give an error message
|
||||||
parallel: Jobs running in the background cannot be interactive.
|
parallel: Error: Jobs running in the background cannot be interactive.
|
||||||
|
|
|
@ -39,11 +39,11 @@ def 3
|
||||||
2 17
|
2 17
|
||||||
2 17
|
2 17
|
||||||
### Test --db-size --dbsize
|
### Test --db-size --dbsize
|
||||||
2 6 53
|
2 6 54
|
||||||
2 6 53
|
2 6 54
|
||||||
### Test --table-size --tablesize
|
### Test --table-size --tablesize
|
||||||
30
|
39
|
||||||
30
|
39
|
||||||
### Test --debug
|
### Test --debug
|
||||||
dburl mysql://sqlunittest:CB5A1FFFA5A@localhost:3306/sqlunittest
|
dburl mysql://sqlunittest:CB5A1FFFA5A@localhost:3306/sqlunittest
|
||||||
databasedriver mysql user sqlunittest password CB5A1FFFA5A host localhost port 3306 database sqlunittest query
|
databasedriver mysql user sqlunittest password CB5A1FFFA5A host localhost port 3306 database sqlunittest query
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
19
|
19
|
||||||
20
|
20
|
||||||
### Check warning if --transfer but file not found
|
### Check warning if --transfer but file not found
|
||||||
parallel: Warning: /tmp/noexistant/file is not readable and will not be transferred
|
parallel: Warning: /tmp/noexistant/file is not readable and will not be transferred.
|
||||||
/tmp/noexistant/file
|
/tmp/noexistant/file
|
||||||
### Transfer for file starting with :
|
### Transfer for file starting with :
|
||||||
remote-:.:
|
remote-:.:
|
||||||
|
@ -54,13 +54,13 @@ content-file: name.foo
|
||||||
remote-file : name.foo.file : name
|
remote-file : name.foo.file : name
|
||||||
content-file : name.foo
|
content-file : name.foo
|
||||||
### Check warning if --transfer but not --sshlogin
|
### Check warning if --transfer but not --sshlogin
|
||||||
parallel: Warning: --transfer ignored as there are no remote --sshlogin
|
parallel: Warning: --transfer ignored as there are no remote --sshlogin.
|
||||||
|
|
||||||
### Check warning if --return but not --sshlogin
|
### Check warning if --return but not --sshlogin
|
||||||
parallel: Warning: --return ignored as there are no remote --sshlogin
|
parallel: Warning: --return ignored as there are no remote --sshlogin.
|
||||||
|
|
||||||
### Check warning if --cleanup but not --sshlogin
|
### Check warning if --cleanup but not --sshlogin
|
||||||
parallel: Warning: --cleanup ignored as there are no remote --sshlogin
|
parallel: Warning: --cleanup ignored as there are no remote --sshlogin.
|
||||||
|
|
||||||
### Test --sshlogin -S --sshloginfile
|
### Test --sshlogin -S --sshloginfile
|
||||||
1
|
1
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
### Test --basefile with no --sshlogin
|
### Test --basefile with no --sshlogin
|
||||||
parallel: Warning: --basefile ignored as there are no remote --sshlogin
|
parallel: Warning: --basefile ignored as there are no remote --sshlogin.
|
||||||
|
|
||||||
### Test --basefile + --cleanup + permissions
|
### Test --basefile + --cleanup + permissions
|
||||||
script1 run 1
|
script1 run 1
|
||||||
|
@ -45,7 +45,7 @@ OK
|
||||||
8
|
8
|
||||||
9
|
9
|
||||||
### Test combined -X --return {/}_{/.}_{#/.}_{#/}_{#.} with files containing space
|
### Test combined -X --return {/}_{/.}_{#/.}_{#/}_{#.} with files containing space
|
||||||
parallel: Warning: using -X or -m with --sshlogin may fail
|
parallel: Warning: Using -X or -m with --sshlogin may fail.
|
||||||
mkdir -p tmp/number1.c_number1_number2_number2.c_a/number2 tmp/number2.c_number2_number2_number2.c_a/number2 tmp/number3.c_number3_number2_number2.c_a/number2 tmp/number4_number4_number2_number2.c_a/number2 tmp/number5_number5_number2_number2.c_a/number2 tmp/number6_number6_number2_number2.c_a/number2 tmp/number\ 7_number\ 7_number2_number2.c_a/number2 tmp/number\ \<8\|8\>_number\ \<8\|8\>_number2_number2.c_a/number2 ;touch tmp/number1.c_number1_number2_number2.c_a/number2/file tmp/number2.c_number2_number2_number2.c_a/number2/file tmp/number3.c_number3_number2_number2.c_a/number2/file tmp/number4_number4_number2_number2.c_a/number2/file tmp/number5_number5_number2_number2.c_a/number2/file tmp/number6_number6_number2_number2.c_a/number2/file tmp/number\ 7_number\ 7_number2_number2.c_a/number2/file tmp/number\ \<8\|8\>_number\ \<8\|8\>_number2_number2.c_a/number2/file
|
mkdir -p tmp/number1.c_number1_number2_number2.c_a/number2 tmp/number2.c_number2_number2_number2.c_a/number2 tmp/number3.c_number3_number2_number2.c_a/number2 tmp/number4_number4_number2_number2.c_a/number2 tmp/number5_number5_number2_number2.c_a/number2 tmp/number6_number6_number2_number2.c_a/number2 tmp/number\ 7_number\ 7_number2_number2.c_a/number2 tmp/number\ \<8\|8\>_number\ \<8\|8\>_number2_number2.c_a/number2 ;touch tmp/number1.c_number1_number2_number2.c_a/number2/file tmp/number2.c_number2_number2_number2.c_a/number2/file tmp/number3.c_number3_number2_number2.c_a/number2/file tmp/number4_number4_number2_number2.c_a/number2/file tmp/number5_number5_number2_number2.c_a/number2/file tmp/number6_number6_number2_number2.c_a/number2/file tmp/number\ 7_number\ 7_number2_number2.c_a/number2/file tmp/number\ \<8\|8\>_number\ \<8\|8\>_number2_number2.c_a/number2/file
|
||||||
tmp
|
tmp
|
||||||
tmp/number 7_number 7_number2_number2.c_a
|
tmp/number 7_number 7_number2_number2.c_a
|
||||||
|
|
|
@ -25,6 +25,6 @@ slept 1
|
||||||
slept 1
|
slept 1
|
||||||
jobs failed: 2
|
jobs failed: 2
|
||||||
### --pipe without command
|
### --pipe without command
|
||||||
parallel: --pipe must have a command to pipe into (e.g. 'cat')
|
parallel: Error: --pipe must have a command to pipe into (e.g. 'cat').
|
||||||
### bug #36260: {n} expansion in --colsep files fails for empty fields if all following fields are also empty
|
### bug #36260: {n} expansion in --colsep files fails for empty fields if all following fields are also empty
|
||||||
AB
|
AB
|
||||||
|
|
|
@ -20,27 +20,27 @@ OK
|
||||||
7.7
|
7.7
|
||||||
8.8
|
8.8
|
||||||
### Test retired
|
### Test retired
|
||||||
parallel: -g has been retired. Use --group.
|
parallel: Error: -g has been retired. Use --group.
|
||||||
parallel: -B has been retired. Use --bf.
|
parallel: Error: -B has been retired. Use --bf.
|
||||||
parallel: -T has been retired. Use --tty.
|
parallel: Error: -T has been retired. Use --tty.
|
||||||
parallel: -U has been retired. Use --er.
|
parallel: Error: -U has been retired. Use --er.
|
||||||
parallel: -W has been retired. Use --wd.
|
parallel: Error: -W has been retired. Use --wd.
|
||||||
parallel: -Y has been retired. Use --shebang.
|
parallel: Error: -Y has been retired. Use --shebang.
|
||||||
parallel: -H has been retired. Use --halt.
|
parallel: Error: -H has been retired. Use --halt.
|
||||||
parallel: -g has been retired. Use --group.
|
parallel: Error: -g has been retired. Use --group.
|
||||||
parallel: -B has been retired. Use --bf.
|
parallel: Error: -B has been retired. Use --bf.
|
||||||
parallel: -T has been retired. Use --tty.
|
parallel: Error: -T has been retired. Use --tty.
|
||||||
parallel: -U has been retired. Use --er.
|
parallel: Error: -U has been retired. Use --er.
|
||||||
parallel: -W has been retired. Use --wd.
|
parallel: Error: -W has been retired. Use --wd.
|
||||||
parallel: -Y has been retired. Use --shebang.
|
parallel: Error: -Y has been retired. Use --shebang.
|
||||||
parallel: -H has been retired. Use --halt.
|
parallel: Error: -H has been retired. Use --halt.
|
||||||
parallel: -g has been retired. Use --group.
|
parallel: Error: -g has been retired. Use --group.
|
||||||
parallel: -B has been retired. Use --bf.
|
parallel: Error: -B has been retired. Use --bf.
|
||||||
parallel: -T has been retired. Use --tty.
|
parallel: Error: -T has been retired. Use --tty.
|
||||||
parallel: -U has been retired. Use --er.
|
parallel: Error: -U has been retired. Use --er.
|
||||||
parallel: -W has been retired. Use --wd.
|
parallel: Error: -W has been retired. Use --wd.
|
||||||
parallel: -Y has been retired. Use --shebang.
|
parallel: Error: -Y has been retired. Use --shebang.
|
||||||
parallel: -H has been retired. Use --halt.
|
parallel: Error: -H has been retired. Use --halt.
|
||||||
### Test --joblog followed by --resume --joblog
|
### Test --joblog followed by --resume --joblog
|
||||||
5 49
|
5 49
|
||||||
### Test --resume --joblog followed by --resume --joblog
|
### Test --resume --joblog followed by --resume --joblog
|
||||||
|
|
Loading…
Reference in a new issue