From 5c0831383077ef3548443de9c12d263c5b5b9540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20F=C3=BCrst?= Date: Wed, 24 Jan 2024 20:58:42 +0100 Subject: [PATCH] properly set barrier when using iterrative aggregation --- qdp_project/src/Benchmark.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/qdp_project/src/Benchmark.cpp b/qdp_project/src/Benchmark.cpp index 0ba05e9..52af4cb 100644 --- a/qdp_project/src/Benchmark.cpp +++ b/qdp_project/src/Benchmark.cpp @@ -254,7 +254,12 @@ void aggr_j(size_t gid, size_t tid) { THREAD_TIMING_[AGGRJ_TIMING_INDEX][tid * gid][0][TIME_STAMP_BEGIN] = std::chrono::steady_clock::now(); - BARRIERS_[gid]->arrive_and_wait(); + if constexpr (AGGRJ_ITERATIVE) { + if (tid == 0) BARRIERS_[gid]->arrive_and_wait(); + } + else { + BARRIERS_[gid]->arrive_and_wait(); + } THREAD_TIMING_[AGGRJ_TIMING_INDEX][tid * gid][0][TIME_STAMP_WAIT] = std::chrono::steady_clock::now(); @@ -341,7 +346,12 @@ int main() { std::vector agg_pool; for(uint32_t gid = 0; gid < GROUP_COUNT; ++gid) { - BARRIERS_.emplace_back(new std::barrier(TC_COMBINED)); + if constexpr (AGGRJ_ITERATIVE) { + BARRIERS_.emplace_back(new std::barrier(TC_SCANA + TC_SCANB + 1)); + } + else { + BARRIERS_.emplace_back(new std::barrier(TC_COMBINED)); + } for(uint32_t tid = 0; tid < TC_SCANA; ++tid) { filter_pool.emplace_back(scan_a, gid, tid);