From c074264780f7ba1961dfc64a762ef9958db41cd6 Mon Sep 17 00:00:00 2001 From: tqcq Date: Sat, 26 Oct 2024 10:14:29 +0000 Subject: [PATCH] feat: update --- drama/src/rev-mc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drama/src/rev-mc.c b/drama/src/rev-mc.c index f953563..5cad791 100644 --- a/drama/src/rev-mc.c +++ b/drama/src/rev-mc.c @@ -358,19 +358,20 @@ find_row_mask(std::vector &sets, while (cur_mask < last_mask && step_count > 0 && !found.load(std::memory_order_relaxed)) { for (int i = std::min(step_count, step); i > 0 && cur_mask < last_mask; --i) { cur_mask = next_bit_permutation(cur_mask); - if (cnt.fetch_add(1) % 10000 == 0) { - fprintf(stderr, "cnt : %5ld\n", cnt.load(std::memory_order_relaxed)); + if (cnt.fetch_add(1) % 1000000000 == 0) { + fprintf(stderr, "cnt : %ld, step_count: %5ld\n", cnt.load(std::memory_order_relaxed), + step_count); } } step_count -= std::min(step_count, step); - if (my_pos > g_base_pos) { + if (my_pos > g_base_pos.load(std::memory_order_relaxed)) { std::lock_guard _(lock); if (my_pos > g_base_pos) { g_base_pos = my_pos; row_mask = cur_mask; } - } else if (g_base_pos <= g_cur_pos) { + } else if (g_base_pos.load(std::memory_order_relaxed) < g_cur_pos.load(std::memory_order_relaxed)) { std::lock_guard _(lock); if (g_base_pos < g_cur_pos) { cur_mask = row_mask;