Skip to content

Commit 8a09ff5

Browse files
committed
Drop bogart memory requirements, especially for HiFi. Issue #1788.
1 parent e3ec0ab commit 8a09ff5

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

src/pipelines/canu.pl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,9 @@
409409
configureCloud($asm, $rootdir);
410410
configureDNANexus();
411411

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

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

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

656+
# Now we can set memory/thread limits and any other parameters.
657+
658+
configureAssembler($numPacBio, $numNanopore, $numHiFi);
659+
659660
checkParameters(); # Check all parameters (except error rates) are valid and consistent.
660661
printHelp(); # And one final last chance to fail.
661662

src/pipelines/canu/Configure.pm

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,10 @@ sub getAllowedResources ($$$$$@) {
534534
# If minMemory or minThreads isn't defined, pick a reasonable pair based on genome size.
535535
#
536536

537-
sub configureAssembler () {
537+
sub configureAssembler ($$$) {
538+
my $numPacBio = shift @_;
539+
my $numNanopore = shift @_;
540+
my $numHiFi = shift @_;
538541

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

783786
# And bogart.
784787

785-
if (getGlobal("genomeSize") < adjustGenomeSize("40m")) {
786-
setGlobalIfUndef("batMemory", "4-16"); setGlobalIfUndef("batThreads", "2-4");
787-
788-
} elsif (getGlobal("genomeSize") < adjustGenomeSize("500m")) {
789-
setGlobalIfUndef("batMemory", "16-64"); setGlobalIfUndef("batThreads", "2-8");
790-
791-
} elsif (getGlobal("genomeSize") < adjustGenomeSize("2g")) {
792-
setGlobalIfUndef("batMemory", "32-256"); setGlobalIfUndef("batThreads", "4-16");
793-
794-
} elsif (getGlobal("genomeSize") < adjustGenomeSize("5g")) {
795-
setGlobalIfUndef("batMemory", "128-512"); setGlobalIfUndef("batThreads", "8-32");
796-
788+
if ($numHiFi == 0) {
789+
if (getGlobal("genomeSize") < adjustGenomeSize("40m")) { setGlobalIfUndef("batMemory", "4-16"); setGlobalIfUndef("batThreads", "2-4"); }
790+
elsif (getGlobal("genomeSize") < adjustGenomeSize("500m")) { setGlobalIfUndef("batMemory", "16-48"); setGlobalIfUndef("batThreads", "2-8"); }
791+
elsif (getGlobal("genomeSize") < adjustGenomeSize("2g")) { setGlobalIfUndef("batMemory", "32-128"); setGlobalIfUndef("batThreads", "4-16"); }
792+
elsif (getGlobal("genomeSize") < adjustGenomeSize("5g")) { setGlobalIfUndef("batMemory", "64-256"); setGlobalIfUndef("batThreads", "8-32"); }
793+
else { setGlobalIfUndef("batMemory", "64-512"); setGlobalIfUndef("batThreads", "8-64"); }
797794
} else {
798-
setGlobalIfUndef("batMemory", "256-1024"); setGlobalIfUndef("batThreads", "16-64");
795+
if (getGlobal("genomeSize") < adjustGenomeSize("40m")) { setGlobalIfUndef("batMemory", "4-16"); setGlobalIfUndef("batThreads", "2-4"); }
796+
elsif (getGlobal("genomeSize") < adjustGenomeSize("500m")) { setGlobalIfUndef("batMemory", "8-32"); setGlobalIfUndef("batThreads", "2-8"); }
797+
elsif (getGlobal("genomeSize") < adjustGenomeSize("2g")) { setGlobalIfUndef("batMemory", "16-64"); setGlobalIfUndef("batThreads", "4-16"); }
798+
elsif (getGlobal("genomeSize") < adjustGenomeSize("5g")) { setGlobalIfUndef("batMemory", "32-128"); setGlobalIfUndef("batThreads", "8-32"); }
799+
else { setGlobalIfUndef("batMemory", "32-256"); setGlobalIfUndef("batThreads", "8-64"); }
799800
}
800801

801802
# Log maxMemory setting.

0 commit comments

Comments
 (0)