From bdfb94bf11f810e2db01958be80a343d5fd07fc0 Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Fri, 3 Feb 2023 20:58:41 +0000 Subject: [PATCH] Grid overflow fix --- Grid/Benchmark_Grid.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Grid/Benchmark_Grid.cpp b/Grid/Benchmark_Grid.cpp index ae71449..86f5b29 100644 --- a/Grid/Benchmark_Grid.cpp +++ b/Grid/Benchmark_Grid.cpp @@ -258,7 +258,8 @@ class Benchmark Coordinate latt_size({lat * mpi_layout[0], lat * mpi_layout[1], lat * mpi_layout[2], lat * mpi_layout[3]}); - uint64_t vol = latt_size[0] * latt_size[1] * latt_size[2] * latt_size[3]; + double vol = + static_cast(latt_size[0]) * latt_size[1] * latt_size[2] * latt_size[3]; GridCartesian Grid(latt_size, simd_layout, mpi_layout); @@ -328,7 +329,8 @@ class Benchmark Coordinate latt_size({lat * mpi_layout[0], lat * mpi_layout[1], lat * mpi_layout[2], lat * mpi_layout[3]}); - int64_t vol = latt_size[0] * latt_size[1] * latt_size[2] * latt_size[3]; + double vol = + static_cast(latt_size[0]) * latt_size[1] * latt_size[2] * latt_size[3]; GridCartesian Grid(latt_size, simd_layout, mpi_layout);