From 955414e17f20639d16ee433dc4091bb3fb6b325b Mon Sep 17 00:00:00 2001 From: MattRolchigo <65y@ornl.gov> Date: Tue, 17 Oct 2023 13:23:56 -0400 Subject: [PATCH] Fix initialization of buffer capacity during resize --- src/CAghostnodes.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/CAghostnodes.cpp b/src/CAghostnodes.cpp index 88cbc53e..face1320 100644 --- a/src/CAghostnodes.cpp +++ b/src/CAghostnodes.cpp @@ -55,6 +55,14 @@ int ResizeBuffers(Buffer2D &BufferNorthSend, Buffer2D &BufferSouthSend, Buffer2D SendSizeNorth(0) = OldBufSize; SendSizeSouth(0) = OldBufSize; }); + // Set -1 values for the new (currently empty) positions in the resized buffer + Kokkos::parallel_for( + "InitNewBufCapacity", Kokkos::RangePolicy<>(OldBufSize, NewBufSize), KOKKOS_LAMBDA(const int &BufPosition) { + for (int BufComp = 0; BufComp < 8; BufComp++) { + BufferNorthSend(BufPosition, BufComp) = -1.0; + BufferSouthSend(BufPosition, BufComp) = -1.0; + } + }); } else NewBufSize = OldBufSize;