diff --git a/qdp_project/src/Benchmark.cpp b/qdp_project/src/Benchmark.cpp index 236aaf1..4600773 100644 --- a/qdp_project/src/Benchmark.cpp +++ b/qdp_project/src/Benchmark.cpp @@ -39,9 +39,12 @@ uint64_t* DATA_DST_; // if more j than b -> subsplit b like it is now void scan_b(size_t gid, size_t tid) { - constexpr size_t SUBCHUNK_COUNT = TC_AGGRJ / (TC_SCANB == 0 ? 1 : TC_SCANB); + constexpr size_t RUN_INCREMENT = TC_SCANB / TC_AGGRJ; + constexpr size_t THREAD_RATIO = TC_AGGRJ / (TC_SCANB == 0 ? 1 : TC_SCANB); + constexpr size_t SUBCHUNK_COUNT = THREAD_RATIO > 0 ? THREAD_RATIO : 1; constexpr size_t SUBCHUNK_SIZE_B = CHUNK_SIZE_B / SUBCHUNK_COUNT; constexpr size_t SUBCHUNK_SIZE_ELEMENTS = CHUNK_SIZE_ELEMENTS / SUBCHUNK_COUNT; + constexpr size_t TC_ACTUAL = TC_AGGRJ >= TC_SCANB ? TC_SCANB : TC_AGGRJ; THREAD_TIMING_[SCANB_TIMING_INDEX][UniqueIndex(gid,tid)].clear(); THREAD_TIMING_[SCANB_TIMING_INDEX][UniqueIndex(gid,tid)].resize(1); @@ -51,9 +54,9 @@ void scan_b(size_t gid, size_t tid) { THREAD_TIMING_[SCANB_TIMING_INDEX][UniqueIndex(gid,tid)][0][TIME_STAMP_BEGIN] = std::chrono::steady_clock::now(); if constexpr (PERFORM_CACHING) { - for (size_t i = 0; i < RUN_COUNT; i++) { + for (size_t i = 0; i < RUN_COUNT; i += RUN_INCREMENT) { const size_t chunk_index = get_chunk_index(gid, i); - uint64_t* chunk_ptr = get_chunk(DATA_B_, chunk_index, tid); + uint64_t* chunk_ptr = get_chunk(DATA_B_, chunk_index, tid); for (size_t j = 0; j < SUBCHUNK_COUNT; j++) { uint64_t* sub_chunk_ptr = &chunk_ptr[j * SUBCHUNK_SIZE_ELEMENTS]; diff --git a/qdp_project/src/Configuration.hpp b/qdp_project/src/Configuration.hpp index 66e87f2..df4de1d 100644 --- a/qdp_project/src/Configuration.hpp +++ b/qdp_project/src/Configuration.hpp @@ -5,10 +5,10 @@ constexpr uint32_t WARMUP_ITERATION_COUNT = 5; constexpr uint32_t ITERATION_COUNT = 5; #ifdef MODE_SIMPLE_PREFETCH -constexpr uint32_t GROUP_COUNT = 16; +constexpr uint32_t GROUP_COUNT = 8; constexpr size_t CHUNK_SIZE_B = 64_MiB; constexpr uint32_t TC_SCANA = 2; -constexpr uint32_t TC_SCANB = 1; +constexpr uint32_t TC_SCANB = 2; constexpr uint32_t TC_AGGRJ = 1; constexpr bool PERFORM_CACHING = true; constexpr bool STORE_B_IN_HBM = false;