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);