From b7cbd59a13f36eae6fae7ce94fc41a5a2dd6c720 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 19 Oct 2022 13:02:07 -0500 Subject: [PATCH] Changing types to mitigate overflow problems --- src/volume_calc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/volume_calc.cpp b/src/volume_calc.cpp index 3ae98fdc3..002171d49 100644 --- a/src/volume_calc.cpp +++ b/src/volume_calc.cpp @@ -99,9 +99,9 @@ vector VolumeCalculation::execute() const { // Shared data that is collected from all threads int n = domain_ids_.size(); - vector> master_indices( + vector> master_indices( n); // List of material indices for each domain - vector> master_hits( + vector> master_hits( n); // Number of hits for each material in each domain int iterations = 0; @@ -281,7 +281,7 @@ vector VolumeCalculation::execute() const #endif if (mpi::master) { - int total_hits = 0; + size_t total_hits = 0; for (int j = 0; j < master_indices[i_domain].size(); ++j) { total_hits += master_hits[i_domain][j]; double f =