From e5c08e4adbfa267e7e96fe3d3ff01c07ad0395eb Mon Sep 17 00:00:00 2001 From: Gilbert Lee Date: Mon, 29 Jun 2026 20:14:44 +0000 Subject: [PATCH] Adjusting location of the fence --- src/header/TransferBench.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/header/TransferBench.hpp b/src/header/TransferBench.hpp index d72f4f8..b2f3ffd 100644 --- a/src/header/TransferBench.hpp +++ b/src/header/TransferBench.hpp @@ -5037,9 +5037,6 @@ static bool IsConfiguredGid(union ibv_gid const& gid) } } - // Drain every thread's writes out to system scope - __threadfence_system(); - // Wait for all threads to finish this subiteration if (seType == 1) { // For warp-level, sync within warp only @@ -5058,6 +5055,9 @@ static bool IsConfiguredGid(union ibv_gid const& gid) } if (shouldRecordTiming) { + // Previous sync ensures data from all threads in this subexecutor has landed in cache + // so only one thread needs to do system level threadfence. + __threadfence_system(); p.stopCycle = GetTimestamp(); p.startCycle = startCycle; GetHwId(p.hwId); @@ -5218,9 +5218,6 @@ static bool IsConfiguredGid(union ibv_gid const& gid) } } - // Drain every thread's writes out to system scope - __threadfence_system(); - // Wait for all threads to finish this subiteration if (seType == 1) { // For warp-level, sync within warp only @@ -5239,6 +5236,9 @@ static bool IsConfiguredGid(union ibv_gid const& gid) } if (shouldRecordTiming) { + // Previous sync ensures data from all threads in this subexecutor has landed in cache + // so only one thread needs to do system level threadfence. + __threadfence_system(); p.stopCycle = GetTimestamp(); p.startCycle = startCycle; GetHwId(p.hwId);