From 5663f0e110d20d24a08d0a4640e5663200704d48 Mon Sep 17 00:00:00 2001 From: Jiakun Yan Date: Thu, 7 Mar 2024 22:59:55 -0600 Subject: [PATCH] fix lcit initData: affect lcitb's performance --- benchmarks/lcitb_pt2pt.cpp | 2 ++ lci/backend/ofi/server_ofi.h | 4 ++-- tests/lcit/lcit.h | 2 -- tests/lcit/lcit_many2one.cpp | 2 ++ tests/lcit/lcit_pt2pt.cpp | 2 ++ 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/benchmarks/lcitb_pt2pt.cpp b/benchmarks/lcitb_pt2pt.cpp index 19d82a93..ac25d5e9 100644 --- a/benchmarks/lcitb_pt2pt.cpp +++ b/benchmarks/lcitb_pt2pt.cpp @@ -6,6 +6,7 @@ using namespace lcit; void test(Context ctx) { + initData(ctx); int tag = 245 + TRD_RANK_ME; // int peer_rank = ((1 - LCI_RANK % 2) + LCI_RANK / 2 * 2) % // LCI_NUM_PROCESSES; // 0 <-> 1, 2 <-> 3 @@ -74,6 +75,7 @@ void test(Context ctx) }); } } + freeData(ctx); } int main(int argc, char** args) diff --git a/lci/backend/ofi/server_ofi.h b/lci/backend/ofi/server_ofi.h index f3387284..f22384ec 100644 --- a/lci/backend/ofi/server_ofi.h +++ b/lci/backend/ofi/server_ofi.h @@ -17,8 +17,8 @@ int err = (x); \ if (err < 0) err = -err; \ if (err) { \ - LCI_DBG_Assert(false, "err : %s (%s:%d)\n", fi_strerror(err), __FILE__, \ - __LINE__); \ + LCI_Assert(false, "err : %s (%s:%d)\n", fi_strerror(err), __FILE__, \ + __LINE__); \ } \ } \ while (0) \ diff --git a/tests/lcit/lcit.h b/tests/lcit/lcit.h index 7a4e7d1b..18fbf345 100644 --- a/tests/lcit/lcit.h +++ b/tests/lcit/lcit.h @@ -439,7 +439,6 @@ Context initCtx(Config config) LCI_endpoint_init(&ctx.ep, ctx.device, plist); LCI_plist_free(&plist); - initData(ctx); if (config.nthreads - config.nprgthreads > 1) { ctx.threadBarrier = new ThreadBarrier(config.nthreads - config.nprgthreads); } @@ -450,7 +449,6 @@ void freeCtx(Context& ctx) { delete ctx.threadBarrier; ctx.threadBarrier = nullptr; - freeData(ctx); freeComp(ctx.config.send_comp_type, &ctx.send_comp); freeComp(ctx.config.recv_comp_type, &ctx.recv_comp); LCI_endpoint_free(&ctx.ep); diff --git a/tests/lcit/lcit_many2one.cpp b/tests/lcit/lcit_many2one.cpp index 71e00189..fa5ff37c 100644 --- a/tests/lcit/lcit_many2one.cpp +++ b/tests/lcit/lcit_many2one.cpp @@ -5,6 +5,7 @@ using namespace lcit; void test(Context ctx) { + initData(ctx); int rank = LCI_RANK; int tag = 245 + TRD_RANK_ME; @@ -70,6 +71,7 @@ void test(Context ctx) } } } + freeData(ctx); } int main(int argc, char** args) diff --git a/tests/lcit/lcit_pt2pt.cpp b/tests/lcit/lcit_pt2pt.cpp index fa133a74..ff6b9c48 100644 --- a/tests/lcit/lcit_pt2pt.cpp +++ b/tests/lcit/lcit_pt2pt.cpp @@ -5,6 +5,7 @@ using namespace lcit; void test(Context ctx) { + initData(ctx); int rank = LCI_RANK; int tag = 245 + TRD_RANK_ME; int peer_rank = ((1 - LCI_RANK % 2) + LCI_RANK / 2 * 2) % LCI_NUM_PROCESSES; @@ -63,6 +64,7 @@ void test(Context ctx) } } } + freeData(ctx); } int main(int argc, char** args)