From 4304baebbbcc72aac25e65011b17e24c528d3992 Mon Sep 17 00:00:00 2001 From: tqcq Date: Thu, 24 Oct 2024 05:30:52 +0000 Subject: [PATCH] feat: fast --- drama/src/rev-mc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drama/src/rev-mc.c b/drama/src/rev-mc.c index c5bba1f..f3bf53d 100644 --- a/drama/src/rev-mc.c +++ b/drama/src/rev-mc.c @@ -320,7 +320,6 @@ find_row_mask(std::vector &sets, std::atomic_bool found{false}; std::mutex lock; - const uint64_t step = 10000; // while (row_mask < last_mask) { // row_mask = next_bit_permutation(row_mask); @@ -329,6 +328,8 @@ find_row_mask(std::vector &sets, std::vector workers; auto thread_num = std::thread::hardware_concurrency(); if (thread_num > 2) { thread_num -= 2; } + const uint64_t step = (last_mask - row_mask) / thread_num; + for (int i = 0; i < thread_num; ++i) { workers.emplace_back([&] { while (!found) {