feat: add log

This commit is contained in:
tqcq 2024-10-26 10:10:59 +00:00
parent 9b95b11f4d
commit a53cedd6d5

View File

@ -341,6 +341,7 @@ find_row_mask(std::vector<set_t> &sets,
// if (!step) { ++step; }
fprintf(stderr, "worker_step: %ld\n", step);
std::atomic<uint64_t> cnt{0};
for (int i = 0; i < thread_num; ++i) {
workers.emplace_back([&] {
while (!found) {
@ -357,6 +358,9 @@ find_row_mask(std::vector<set_t> &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));
}
}
step_count -= std::min(step_count, step);