Skip to content

Commit

Permalink
test(sessions): update test accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
dssgabriel committed May 23, 2024
1 parent 822722d commit 8faf205
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions perf_tests/test_2dhalo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ void benchmark_2dhalo(benchmark::State &state) {
int ny = 512;
int nprops = 3;

auto universe = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
auto comm = universe.comm();
auto ctx = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
const auto &comm = ctx.comm();

int rank = comm.rank();
int size = comm.size();
Expand Down
4 changes: 2 additions & 2 deletions perf_tests/test_sendrecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ void send_recv(benchmark::State &, const KokkosComm::Communicator<Space> &comm,
}

void benchmark_sendrecv(benchmark::State &state) {
auto universe = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
auto comm = universe.comm();
auto ctx = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
const auto &comm = ctx.comm();

int rank = comm.rank();
int size = comm.size();
Expand Down
4 changes: 2 additions & 2 deletions perf_tests/test_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

// F is a function that takes (state, MPI_Comm, args...)
template <typename F, typename... Args>
void do_iteration(benchmark::State &state, KokkosComm::Communicator<Kokkos::DefaultExecutionSpace> &comm, F &&func,
Args... args) {
void do_iteration(benchmark::State &state, const KokkosComm::Communicator<Kokkos::DefaultExecutionSpace> &comm,
F &&func, Args... args) {
using Clock = std::chrono::steady_clock;
using Duration = std::chrono::duration<double>;

Expand Down
8 changes: 4 additions & 4 deletions unit_tests/test_isendirecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ void test_1d(const View1D &a) {
static_assert(View1D::rank == 1, "");
using Scalar = typename View1D::non_const_value_type;

auto universe = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
auto comm = universe.comm();
auto ctx = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
const auto &comm = ctx.comm();

int rank = comm.rank();
int size = comm.size();
Expand Down Expand Up @@ -68,8 +68,8 @@ void test_2d(const View2D &a) {
static_assert(View2D::rank == 2, "");
using Scalar = typename View2D::non_const_value_type;

auto universe = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
auto comm = universe.comm();
auto ctx = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
const auto &comm = ctx.comm();

int rank = comm.rank();
int size = comm.size();
Expand Down
8 changes: 4 additions & 4 deletions unit_tests/test_isendrecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ void isend_comm_mode_1d_contig() {

Kokkos::View<Scalar *> a("a", 1000);

auto universe = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
auto comm = universe.comm();
auto ctx = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
const auto &comm = ctx.comm();

int rank = comm.rank();
int size = comm.size();
Expand Down Expand Up @@ -71,8 +71,8 @@ void isend_comm_mode_1d_noncontig() {
Kokkos::View<Scalar **, Kokkos::LayoutRight> b("a", 10, 10);
auto a = Kokkos::subview(b, Kokkos::ALL, 2); // take column 2 (non-contiguous)

auto universe = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
auto comm = universe.comm();
auto ctx = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
const auto &comm = ctx.comm();

int rank = comm.rank();
if (0 == rank) {
Expand Down
8 changes: 4 additions & 4 deletions unit_tests/test_sendrecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ void send_comm_mode_1d_contig() {

Kokkos::View<Scalar *> a("a", 1000);

auto universe = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
auto comm = universe.comm();
auto ctx = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
const auto &comm = ctx.comm();

int rank = comm.rank();
int size = comm.size();
Expand Down Expand Up @@ -70,8 +70,8 @@ void send_comm_mode_1d_noncontig() {
Kokkos::View<Scalar **, Kokkos::LayoutRight> b("b", 10, 10);
auto a = Kokkos::subview(b, Kokkos::ALL, 2); // take column 2 (non-contiguous)

auto universe = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
auto comm = universe.comm();
auto ctx = KokkosComm::initialize<Kokkos::DefaultExecutionSpace>();
const auto &comm = ctx.comm();

int rank = comm.rank();
if (0 == rank) {
Expand Down

0 comments on commit 8faf205

Please sign in to comment.