Skip to content

Commit

Permalink
fix lcit initData: affect lcitb's performance
Browse files Browse the repository at this point in the history
  • Loading branch information
JiakunYan committed Mar 8, 2024
1 parent afec656 commit 60051b0
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 81 deletions.
18 changes: 10 additions & 8 deletions benchmarks/lcitb_pt2pt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using namespace lcit;

void test(Context ctx)
{
Data data = 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
Expand All @@ -21,20 +22,20 @@ void test(Context ctx)
std::vector<LCI_comp_t> comps;
// send
for (int j = 0; j < ctx.config.send_window; ++j) {
LCI_comp_t comp = postSend(ctx, peer_rank, size, tag);
LCI_comp_t comp = postSend(ctx, peer_rank, data, size, tag);
comps.push_back(comp);
}
for (auto comp : comps) {
waitSend(ctx, comp);
waitSend(ctx, data, comp);
}
// recv
comps.clear();
for (int j = 0; j < ctx.config.recv_window; ++j) {
LCI_comp_t comp = postRecv(ctx, peer_rank, size, tag);
LCI_comp_t comp = postRecv(ctx, peer_rank, data, size, tag);
comps.push_back(comp);
}
for (auto comp : comps) {
waitRecv(ctx, comp);
waitRecv(ctx, data, comp);
}
});
if (TRD_RANK_ME == 0 && LCI_RANK == 0) {
Expand All @@ -56,24 +57,25 @@ void test(Context ctx)
std::vector<LCI_comp_t> comps;
// recv
for (int j = 0; j < ctx.config.send_window; ++j) {
LCI_comp_t comp = postRecv(ctx, peer_rank, size, tag);
LCI_comp_t comp = postRecv(ctx, peer_rank, data, size, tag);
comps.push_back(comp);
}
for (auto comp : comps) {
waitRecv(ctx, comp);
waitRecv(ctx, data, comp);
}
// send
comps.clear();
for (int j = 0; j < ctx.config.recv_window; ++j) {
LCI_comp_t comp = postSend(ctx, peer_rank, size, tag);
LCI_comp_t comp = postSend(ctx, peer_rank, data, size, tag);
comps.push_back(comp);
}
for (auto comp : comps) {
waitSend(ctx, comp);
waitSend(ctx, data, comp);
}
});
}
}
freeData(ctx, data);
}

int main(int argc, char** args)
Expand Down
20 changes: 10 additions & 10 deletions lci/backend/ofi/server_ofi.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
#include <rdma/fi_errno.h>
#include <rdma/fi_rma.h>

#define FI_SAFECALL(x) \
{ \
int err = (x); \
if (err < 0) err = -err; \
if (err) { \
LCI_DBG_Assert(false, "err : %s (%s:%d)\n", fi_strerror(err), __FILE__, \
__LINE__); \
} \
} \
while (0) \
#define FI_SAFECALL(x) \
{ \
int err = (x); \
if (err < 0) err = -err; \
if (err) { \
LCI_Assert(false, "err : %s (%s:%d)\n", fi_strerror(err), __FILE__, \
__LINE__); \
} \
} \
while (0) \
;

#define LCISI_OFI_CS_TRY_ENTER(endpoint_p, mode, ret) \
Expand Down
Loading

0 comments on commit 60051b0

Please sign in to comment.