Skip to content

Commit

Permalink
Drop bogart memory requirements, especially for HiFi. Issue #1788.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwalenz committed Jul 17, 2024
1 parent e3ec0ab commit 8a09ff5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
7 changes: 4 additions & 3 deletions src/pipelines/canu.pl
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,9 @@
configureCloud($asm, $rootdir);
configureDNANexus();

# Set jobs sizes based on genomeSize and available hosts;
# Check that parameters (except error rates) are valid and consistent;
# Fail if any thing flagged an error condition;

checkParameters();
configureAssembler(); # Set job sizes and etc bases on genomeSize and hosts available.

# Make space for us to work in, and move there.
#
Expand Down Expand Up @@ -656,6 +653,10 @@
caExit("ERROR: HiFi data cannot currently be combined with another read type", undef);
}

# Now we can set memory/thread limits and any other parameters.

configureAssembler($numPacBio, $numNanopore, $numHiFi);

checkParameters(); # Check all parameters (except error rates) are valid and consistent.
printHelp(); # And one final last chance to fail.

Expand Down
29 changes: 15 additions & 14 deletions src/pipelines/canu/Configure.pm
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,10 @@ sub getAllowedResources ($$$$$@) {
# If minMemory or minThreads isn't defined, pick a reasonable pair based on genome size.
#

sub configureAssembler () {
sub configureAssembler ($$$) {
my $numPacBio = shift @_;
my $numNanopore = shift @_;
my $numHiFi = shift @_;

# For overlapper and mhap, allow larger maximums for larger genomes. More memory won't help
# smaller genomes, and the smaller minimums won't hurt larger genomes (which are probably being
Expand Down Expand Up @@ -782,20 +785,18 @@ sub configureAssembler () {

# And bogart.

if (getGlobal("genomeSize") < adjustGenomeSize("40m")) {
setGlobalIfUndef("batMemory", "4-16"); setGlobalIfUndef("batThreads", "2-4");

} elsif (getGlobal("genomeSize") < adjustGenomeSize("500m")) {
setGlobalIfUndef("batMemory", "16-64"); setGlobalIfUndef("batThreads", "2-8");

} elsif (getGlobal("genomeSize") < adjustGenomeSize("2g")) {
setGlobalIfUndef("batMemory", "32-256"); setGlobalIfUndef("batThreads", "4-16");

} elsif (getGlobal("genomeSize") < adjustGenomeSize("5g")) {
setGlobalIfUndef("batMemory", "128-512"); setGlobalIfUndef("batThreads", "8-32");

if ($numHiFi == 0) {
if (getGlobal("genomeSize") < adjustGenomeSize("40m")) { setGlobalIfUndef("batMemory", "4-16"); setGlobalIfUndef("batThreads", "2-4"); }
elsif (getGlobal("genomeSize") < adjustGenomeSize("500m")) { setGlobalIfUndef("batMemory", "16-48"); setGlobalIfUndef("batThreads", "2-8"); }
elsif (getGlobal("genomeSize") < adjustGenomeSize("2g")) { setGlobalIfUndef("batMemory", "32-128"); setGlobalIfUndef("batThreads", "4-16"); }
elsif (getGlobal("genomeSize") < adjustGenomeSize("5g")) { setGlobalIfUndef("batMemory", "64-256"); setGlobalIfUndef("batThreads", "8-32"); }
else { setGlobalIfUndef("batMemory", "64-512"); setGlobalIfUndef("batThreads", "8-64"); }
} else {
setGlobalIfUndef("batMemory", "256-1024"); setGlobalIfUndef("batThreads", "16-64");
if (getGlobal("genomeSize") < adjustGenomeSize("40m")) { setGlobalIfUndef("batMemory", "4-16"); setGlobalIfUndef("batThreads", "2-4"); }
elsif (getGlobal("genomeSize") < adjustGenomeSize("500m")) { setGlobalIfUndef("batMemory", "8-32"); setGlobalIfUndef("batThreads", "2-8"); }
elsif (getGlobal("genomeSize") < adjustGenomeSize("2g")) { setGlobalIfUndef("batMemory", "16-64"); setGlobalIfUndef("batThreads", "4-16"); }
elsif (getGlobal("genomeSize") < adjustGenomeSize("5g")) { setGlobalIfUndef("batMemory", "32-128"); setGlobalIfUndef("batThreads", "8-32"); }
else { setGlobalIfUndef("batMemory", "32-256"); setGlobalIfUndef("batThreads", "8-64"); }
}

# Log maxMemory setting.
Expand Down

0 comments on commit 8a09ff5

Please sign in to comment.