From 595cef78057fed3ac9f9fdd7f57cd4c66e082e39 Mon Sep 17 00:00:00 2001 From: GregorySchwing Date: Thu, 12 Aug 2021 16:04:34 -0500 Subject: [PATCH] roughly calculating the true memory usage --- MainSimpleParallel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MainSimpleParallel.cpp b/MainSimpleParallel.cpp index c493946..6592bbe 100644 --- a/MainSimpleParallel.cpp +++ b/MainSimpleParallel.cpp @@ -52,7 +52,9 @@ int main(int argc, char *argv[]) //int treeSize = 200000; int numberOfLevels = 15; long long treeSize = ParallelB1::CalculateSpaceForDesiredNumberOfLevels(numberOfLevels); - long long sizeOfSingleGraph = sizeof(g); + long long expandedData = g.GetEdgesLeftToCover(); + long long condensedData = g.GetVertexCount(); + long long sizeOfSingleGraph = expandedData*2*sizeof(int) + 2*condensedData*sizeof(int); long long totalMem = sizeOfSingleGraph * treeSize; long long memAvail = getTotalSystemMemory(); std::cout << "You are about to allocate " << double(totalMem)/1024/1024/1024 << " GB" << std::endl;