feat: add log
This commit is contained in:
parent
9b95b11f4d
commit
a53cedd6d5
@ -341,6 +341,7 @@ find_row_mask(std::vector<set_t> &sets,
|
|||||||
// if (!step) { ++step; }
|
// if (!step) { ++step; }
|
||||||
fprintf(stderr, "worker_step: %ld\n", step);
|
fprintf(stderr, "worker_step: %ld\n", step);
|
||||||
|
|
||||||
|
std::atomic<uint64_t> cnt{0};
|
||||||
for (int i = 0; i < thread_num; ++i) {
|
for (int i = 0; i < thread_num; ++i) {
|
||||||
workers.emplace_back([&] {
|
workers.emplace_back([&] {
|
||||||
while (!found) {
|
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)) {
|
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) {
|
for (int i = std::min(step_count, step); i > 0 && cur_mask < last_mask; --i) {
|
||||||
cur_mask = next_bit_permutation(cur_mask);
|
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);
|
step_count -= std::min(step_count, step);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user