Skip to content

Commit

Permalink
Fix error configuring jobs with one task. Issue marbl#1166.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwalenz committed Dec 4, 2018
1 parent 56008b5 commit 76e87b2
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/pipelines/canu/Configure.pm
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,27 @@ sub getAllowedResources ($$$$$@) {

my $np = ($np_cpu < $np_mem) ? $np_cpu : $np_mem; # Number of processes we can fit on this machine.

$np = 1 if ($uni); # But don't care if there is only one process to run!

if ($dbg) {
print STDERR "-- ERROR for $t threads and $m memory - class$ii can support $np_cpu jobs(cores) and $np_mem jobs(memory), so $np jobs.\n";
}

$processes += $np; # Total number of processes running
$cores += $np * $t; # Total cores in use
$memory += $np * $m; # Total memory in use
# If we only need to run one task, just remember if we can run the task on any machine here.

if ($uni) {
if ($np > 1) {
$processes = 1;
$cores = $t;
$memory = $m;
}
}

# Otherwise, sum the number of processes we can run on the entire grid.

else {
$processes += $np; # Total number of processes running
$cores += $np * $t; # Total cores in use
$memory += $np * $m; # Total memory in use
}
}

if ($dbg) {
Expand Down Expand Up @@ -408,7 +420,7 @@ sub getAllowedResources ($$$$$@) {

my $nc = ($nct < $ncm) ? $nct : $ncm;

$nc = 1 if ($uni);
$nc = 1 if (($uni) && ($nc > 0));

# If already set (on the command line), reset if too big.

Expand Down

0 comments on commit 76e87b2

Please sign in to comment.