From f16d67f67ec31a26238462a2e4bbf64cba9fb7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20F=C3=BCrst?= Date: Tue, 23 Jan 2024 19:38:49 +0100 Subject: [PATCH] wait per iteration for caching mode --- .../benchmark/pipelines/MAX_scan_filter_pipe.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h b/qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h index 152df14..4658c67 100755 --- a/qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h +++ b/qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h @@ -232,7 +232,7 @@ private: public: void scan_b(size_t gid, size_t gcnt, size_t tid) { - size_t tcnt = thread_count_fc; + size_t tcnt = thread_count_ag; assert(chunk_size_w % tcnt == 0); assert(chunk_size_w % 16 == 0); assert(chunk_size_w % tcnt * 16 == 0); @@ -254,15 +254,18 @@ public: if constexpr (caching) { const auto data = cache_.Access(reinterpret_cast(chunk_ptr), chunk_size_b / tcnt); - data->WaitOnCompletion(); + data->WaitOnCompletion(); } pvc->stop("scan_b", tid * gcnt + gid); trt->stop_timer(1, tid * gcnt + gid); bt->timed_wait(*(*sync_barrier)[barrier_idx], 1, tid * gcnt + gid); + + if constexpr (caching) (*(*sync_barrier)[barrier_idx]).arrive_and_drop(); } - (*(*sync_barrier)[barrier_idx]).arrive_and_drop(); + + if constexpr (!caching) (*(*sync_barrier)[barrier_idx]).arrive_and_drop(); } void scan_a(size_t gid, size_t gcnt, size_t tid) { @@ -291,8 +294,11 @@ public: pvc->stop("scan_a", tid * gcnt + gid); trt->stop_timer(0, tid * gcnt + gid); bt->timed_wait(*(*sync_barrier)[barrier_idx], 0, tid * gcnt + gid); + + if constexpr (caching) (*(*sync_barrier)[barrier_idx]).arrive_and_drop(); } - (*(*sync_barrier)[barrier_idx]).arrive_and_drop(); + + if constexpr (!caching) (*(*sync_barrier)[barrier_idx]).arrive_and_drop(); } void aggr_j(size_t gid, size_t gcnt, size_t tid) { @@ -332,8 +338,8 @@ public: // even after waiting, so this must be checked if (data_ptr == nullptr) { - std::cerr << "[x] Cache Miss!" << std::endl; - exit(-1); + std::cerr << "[x] Cache Miss!" << std::endl; + exit(-1); } } else {