From 0f6bd4fca8a4eab81db86660827ad00b378b6010 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Wed, 15 May 2024 13:00:13 -0600 Subject: [PATCH] Simplify unit test indexing --- unit_tests/test_alltoall.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unit_tests/test_alltoall.cpp b/unit_tests/test_alltoall.cpp index 61397734..fcda51aa 100644 --- a/unit_tests/test_alltoall.cpp +++ b/unit_tests/test_alltoall.cpp @@ -51,8 +51,8 @@ TYPED_TEST(Alltoall, 1D_contig) { Kokkos::parallel_reduce( rv.extent(0), KOKKOS_LAMBDA(const int &i, int &lsum) { - const int src = i / nContrib; // who sent this data - const int j = rank * nContrib + (i % nContrib); // what index i was at the source + const int src = i / nContrib; // who sent this data + const int j = i - rank * nContrib; // what index i was at the source lsum += rv(i) != src + j; }, errs); @@ -80,8 +80,8 @@ TYPED_TEST(Alltoall, 1D_inplace_contig) { Kokkos::parallel_reduce( rv.extent(0), KOKKOS_LAMBDA(const int &i, int &lsum) { - const int src = i / nContrib; // who sent this data - const int j = rank * nContrib + (i % nContrib); // what index i was at the source + const int src = i / nContrib; // who sent this data + const int j = i - rank * nContrib; // what index i was at the source lsum += rv(i) != src + j; }, errs);