Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initialization of buffer capacity during resize #243

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/CAghostnodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
streeve marked this conversation as resolved.
Show resolved Hide resolved
for (int BufComp = 0; BufComp < 8; BufComp++) {
BufferNorthSend(BufPosition, BufComp) = -1.0;
BufferSouthSend(BufPosition, BufComp) = -1.0;
}
});
}
else
NewBufSize = OldBufSize;
Expand Down