Skip to content

Commit 0e55b49

Browse files
authored
nixlbench: Fix timer for PostXferReq (#944)
Update timer after call of PostXferReq in the refactor. Signed-off-by: Adit Ranadive <[email protected]>
1 parent 6f0c39d commit 0e55b49

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

benchmark/nixlbench/src/worker/nixl/nixl_worker.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,8 +1087,12 @@ xferBenchNixlWorker::exchangeIOV(const std::vector<std::vector<xferBenchIOV>> &l
10871087

10881088
// Helper to execute a single transfer iteration
10891089
static inline nixl_status_t
1090-
execSingleTransfer(nixlAgent *agent, nixlXferReqH *req) {
1090+
execSingleTransfer(nixlAgent *agent,
1091+
nixlXferReqH *req,
1092+
xferBenchTimer &timer,
1093+
xferBenchStats &thread_stats) {
10911094
nixl_status_t rc = agent->postXferReq(req);
1095+
thread_stats.post_duration.add(timer.lap());
10921096
while (NIXL_IN_PROG == rc) {
10931097
rc = agent->getXferStatus(req);
10941098
}
@@ -1156,8 +1160,7 @@ execTransferIterations(nixlAgent *agent,
11561160
}
11571161
total_prepare_duration += timer.lap();
11581162

1159-
thread_stats.post_duration.add(timer.lap());
1160-
nixl_status_t rc = execSingleTransfer(agent, req);
1163+
nixl_status_t rc = execSingleTransfer(agent, req, timer, thread_stats);
11611164

11621165
if (__builtin_expect(rc != NIXL_SUCCESS, 0)) {
11631166
std::cout << "NIXL Xfer failed with status: " << nixlEnumStrings::statusStr(rc)
@@ -1177,8 +1180,7 @@ execTransferIterations(nixlAgent *agent,
11771180
} else {
11781181
// Standard path: Single request for all iterations
11791182
for (int i = 0; i < num_iter; ++i) {
1180-
thread_stats.post_duration.add(timer.lap());
1181-
nixl_status_t rc = execSingleTransfer(agent, req);
1183+
nixl_status_t rc = execSingleTransfer(agent, req, timer, thread_stats);
11821184

11831185
if (__builtin_expect(rc != NIXL_SUCCESS, 0)) {
11841186
std::cout << "NIXL Xfer failed with status: " << nixlEnumStrings::statusStr(rc)

0 commit comments

Comments
 (0)