Skip to content

Commit

Permalink
Detect when Slurm returns 'ERROR' from a job submission and ignore it…
Browse files Browse the repository at this point in the history
… properly.
  • Loading branch information
brianwalenz committed Sep 18, 2020
1 parent 1987868 commit 268b8c3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/pipelines/canu/Execution.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1283,8 +1283,15 @@ sub submitOrRunParallelJob ($$$$@) {
}

if (uc(getGlobal("gridEngine")) eq "SLURM") {
# BPW has seen Slurm report "ERROR" instead of something
# useful here. If that is seen, report the error to the
# screen and ignore this job. We'll redo it on the next
# iteration (unless this is the second iteration, then
# we're screwed either way).
if (m/Submitted\sbatch\sjob\s(\d+)/) {
$jobName = $1;
} elsif (m/ERROR/) {
$jobName = undef;
} else {
$jobName = $_;
}
Expand All @@ -1296,13 +1303,17 @@ sub submitOrRunParallelJob ($$$$@) {
}
close(F);

if ($j =~ m/^\d+$/) {
if (!defined($jobName)) {
print STDERR "-- '$cmd.sh' -> returned an error; job not submitted.\n";
} elsif ($j =~ m/^\d+$/) {
print STDERR "-- '$cmd.sh' -> job $jobName task $j.\n";
} else {
print STDERR "-- '$cmd.sh' -> job $jobName tasks $j.\n";
}

push @jobsSubmitted, $jobName;
if (defined($jobName)) {
push @jobsSubmitted, $jobName;
}
}

print STDERR "--\n";
Expand Down

0 comments on commit 268b8c3

Please sign in to comment.