From 099b64712d8257eb33bbc98ff144fbbf2f0cffba Mon Sep 17 00:00:00 2001 From: "Brian P. Walenz" Date: Tue, 31 May 2016 14:31:47 -0400 Subject: [PATCH] Reserve memory for the error profiles. --- src/bogart/AS_BAT_OverlapCache.C | 10 +++++++--- src/bogart/AS_BAT_Unitig.H | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/bogart/AS_BAT_OverlapCache.C b/src/bogart/AS_BAT_OverlapCache.C index 71b0cea2a..6bfcae71d 100644 --- a/src/bogart/AS_BAT_OverlapCache.C +++ b/src/bogart/AS_BAT_OverlapCache.C @@ -173,13 +173,16 @@ OverlapCache::OverlapCache(ovStore *ovlStoreUniq, uint64 memFI = FI->memoryUsage(); uint64 memBE = FI->numFragments() * sizeof(BestEdgeOverlap); - uint64 memUL = FI->numFragments() * sizeof(ufNode); // For fragment positions in unitigs - uint64 memUT = FI->numFragments() * sizeof(uint32) / 16; // For unitigs (assumes 32 frag / unitig) - uint64 memID = FI->numFragments() * sizeof(uint32) * 2; // For maps of fragment id to unitig id + uint64 memUL = FI->numFragments() * sizeof(ufNode); // For fragment positions in unitigs + uint64 memUT = FI->numFragments() * sizeof(uint32) / 16; // For unitigs (assumes 32 frag / unitig) + uint64 memID = FI->numFragments() * sizeof(uint32) * 2; // For maps of fragment id to unitig id + uint64 memEP = FI->numFragments() * Unitig::epValueSize() * 2; // For error profile + uint64 memC1 = (FI->numFragments() + 1) * (sizeof(BAToverlapInt *) + sizeof(uint32)); uint64 memC2 = _ovsMax * (sizeof(ovOverlap) + sizeof(uint64) + sizeof(uint64)); uint64 memC3 = _threadMax * _thread[0]._batMax * sizeof(BAToverlap); uint64 memC4 = (FI->numFragments() + 1) * sizeof(uint32); + uint64 memOS = (_memLimit == getMemorySize()) ? (0.1 * getMemorySize()) : 0.0; uint64 memTT = memFI + memBE + memUL + memUT + memID + memC1 + memC2 + memC3 + memC4 + memOS; @@ -198,6 +201,7 @@ OverlapCache::OverlapCache(ovStore *ovlStoreUniq, fprintf(stderr, "OverlapCache()-- %7"F_U64P"MB for unitig layouts.\n", memUL >> 20); fprintf(stderr, "OverlapCache()-- %7"F_U64P"MB for unitigs.\n", memUT >> 20); fprintf(stderr, "OverlapCache()-- %7"F_U64P"MB for id maps.\n", memID >> 20); + fprintf(stderr, "OverlapCache()-- %7"F_U64P"MB for error profiles.\n", memEP >> 20); fprintf(stderr, "OverlapCache()-- %7"F_U64P"MB for overlap cache pointers.\n", memC1 >> 20); fprintf(stderr, "OverlapCache()-- %7"F_U64P"MB for overlap cache initial bucket.\n", memC2 >> 20); fprintf(stderr, "OverlapCache()-- %7"F_U64P"MB for overlap cache thread data.\n", memC3 >> 20); diff --git a/src/bogart/AS_BAT_Unitig.H b/src/bogart/AS_BAT_Unitig.H index 8f8c7b1a8..432ced4fc 100644 --- a/src/bogart/AS_BAT_Unitig.H +++ b/src/bogart/AS_BAT_Unitig.H @@ -215,6 +215,7 @@ public: stdDev dev; }; + static size_t epValueSize(void) { return(sizeof(epValue)); }; void computeArrivalRate(const char *prefix, const char *label,