mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-25 15:37:56 +00:00
src/parallel: Fixed bug #39754: --result --resume should work.
This commit is contained in:
parent
2852939aa5
commit
c463bbc728
24
src/parallel
24
src/parallel
|
@ -1137,8 +1137,10 @@ sub parse_env_var {
|
||||||
|
|
||||||
sub open_joblog {
|
sub open_joblog {
|
||||||
my $append = 0;
|
my $append = 0;
|
||||||
if(($opt::resume or $opt::resume_failed) and not $opt::joblog) {
|
if(($opt::resume or $opt::resume_failed)
|
||||||
::error("--resume and --resume-failed require --joblog.\n");
|
and
|
||||||
|
not ($opt::joblog or $opt::results)) {
|
||||||
|
::error("--resume and --resume-failed require --joblog or --results.\n");
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
}
|
}
|
||||||
if($opt::joblog) {
|
if($opt::joblog) {
|
||||||
|
@ -1650,6 +1652,8 @@ sub start_another_job {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
my $job;
|
my $job;
|
||||||
|
# Skip jobs already in job log
|
||||||
|
# Skip jobs already in results
|
||||||
do {
|
do {
|
||||||
$job = get_job_with_sshlogin($sshlogin);
|
$job = get_job_with_sshlogin($sshlogin);
|
||||||
if(not defined $job) {
|
if(not defined $job) {
|
||||||
|
@ -1657,7 +1661,9 @@ sub start_another_job {
|
||||||
debug("Not starting: no jobs available for ".$sshlogin->string()."\n");
|
debug("Not starting: no jobs available for ".$sshlogin->string()."\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} while ($job->is_already_in_joblog());
|
} while ($job->is_already_in_joblog()
|
||||||
|
or
|
||||||
|
($opt::results and $opt::resume and $job->is_already_in_results()));
|
||||||
debug("Command to run on '".$job->sshlogin()->string()."': '".$job->replaced()."'\n");
|
debug("Command to run on '".$job->sshlogin()->string()."': '".$job->replaced()."'\n");
|
||||||
if($job->start()) {
|
if($job->start()) {
|
||||||
$Global::running{$job->pid()} = $job;
|
$Global::running{$job->pid()} = $job;
|
||||||
|
@ -4671,6 +4677,18 @@ sub start {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub is_already_in_results {
|
||||||
|
# Do we already have results for this job?
|
||||||
|
# Returns:
|
||||||
|
# $job_already_run = bool whether there is output for this or not
|
||||||
|
my $job = $_[0];
|
||||||
|
my $args_as_dirname = $job->{'commandline'}->args_as_dirname();
|
||||||
|
# prefix/name1/val1/name2/val2/
|
||||||
|
my $dir = $opt::results."/".$args_as_dirname;
|
||||||
|
::debug("Test $dir/stdout", -e "$dir/stdout","\n");
|
||||||
|
return -e "$dir/stdout";
|
||||||
|
}
|
||||||
|
|
||||||
sub is_already_in_joblog {
|
sub is_already_in_joblog {
|
||||||
my $job = shift;
|
my $job = shift;
|
||||||
return vec($Global::job_already_run,$job->seq(),1);
|
return vec($Global::job_already_run,$job->seq(),1);
|
||||||
|
|
Loading…
Reference in a new issue