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;