From 0d2eb735ddb4f3ac6c028ab0ac8a45ca5e5ec980 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Tue, 23 May 2023 13:31:40 +0200 Subject: [PATCH] #2074: Add checks in sparse handler --- tests/unit/lb/test_offlinelb.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/unit/lb/test_offlinelb.cc b/tests/unit/lb/test_offlinelb.cc index f46f096fcc..003753951d 100644 --- a/tests/unit/lb/test_offlinelb.cc +++ b/tests/unit/lb/test_offlinelb.cc @@ -76,6 +76,15 @@ struct SimCol : vt::Collection { } void sparseHandler(Msg* m){ + auto const this_node = theContext()->getNode(); + auto const num_nodes = theContext()->getNumNodes(); + auto const next_node = (this_node + 1) % num_nodes; + vt_debug_print(terse, lb, "sparseHandler: idx={}: elm={}\n", getIndex(), getElmID()); + if (m->iter == 0 or m->iter == 1) { + EXPECT_EQ(getIndex().x() / 2, this_node); + } else if (m->iter == 2 or m->iter == 3 or m->iter == 4 or m->iter == 5 or m->iter == 6) { + EXPECT_EQ(getIndex().x() / 2, next_node); + } } };