diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-18 15:18:22 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-18 15:43:57 +0200 |
| commit | 59baae55d72f3aae5ff0d656bf3a3cda7795a879 (patch) | |
| tree | bac300e9284830fa1ce78f5d99d0aeb4d5d14da3 /src/solvers | |
| parent | e5c5f5ed2be13f597bd4674d399a407509f023f7 (diff) | |
| download | nissy-core-59baae55d72f3aae5ff0d656bf3a3cda7795a879.tar.gz nissy-core-59baae55d72f3aae5ff0d656bf3a3cda7795a879.zip | |
Small improvements
Diffstat (limited to 'src/solvers')
| -rw-r--r-- | src/solvers/h48/gendata_h48.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index e8ffee3..6f87685 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h | |||
| @@ -344,7 +344,7 @@ gendata_h48k2(gendata_h48_arg_t *arg) | |||
| 344 | 344 | ||
| 345 | uint8_t t, selectedbase, *table; | 345 | uint8_t t, selectedbase, *table; |
| 346 | int64_t j; | 346 | int64_t j; |
| 347 | uint64_t nshort, i, ii, inext, count; | 347 | uint64_t i, ii, inext, count; |
| 348 | h48map_t shortcubes; | 348 | h48map_t shortcubes; |
| 349 | gendata_h48short_arg_t shortarg; | 349 | gendata_h48short_arg_t shortarg; |
| 350 | h48k2_dfs_arg_t dfsarg[THREADS]; | 350 | h48k2_dfs_arg_t dfsarg[THREADS]; |
| @@ -367,8 +367,7 @@ gendata_h48k2(gendata_h48_arg_t *arg) | |||
| 367 | .selfsim = arg->selfsim, | 367 | .selfsim = arg->selfsim, |
| 368 | .map = &shortcubes | 368 | .map = &shortcubes |
| 369 | }; | 369 | }; |
| 370 | nshort = gendata_h48short(&shortarg); | 370 | gendata_h48short(&shortarg); |
| 371 | LOG("Cubes in <= %" PRIu8 " moves: %" PRIu64 "\n", shortdepth, nshort); | ||
| 372 | 371 | ||
| 373 | selectedbase = base[arg->h]; | 372 | selectedbase = base[arg->h]; |
| 374 | arg->info = (tableinfo_t) { | 373 | arg->info = (tableinfo_t) { |
| @@ -434,6 +433,7 @@ gendata_h48k2_return_size: | |||
| 434 | STATIC void * | 433 | STATIC void * |
| 435 | gendata_h48k2_runthread(void *arg) | 434 | gendata_h48k2_runthread(void *arg) |
| 436 | { | 435 | { |
| 436 | uint64_t count, c; | ||
| 437 | kvpair_t kv; | 437 | kvpair_t kv; |
| 438 | h48k2_dfs_arg_t *dfsarg; | 438 | h48k2_dfs_arg_t *dfsarg; |
| 439 | 439 | ||
| @@ -447,15 +447,21 @@ gendata_h48k2_runthread(void *arg) | |||
| 447 | pthread_mutex_unlock(dfsarg->shortcubes_mutex); | 447 | pthread_mutex_unlock(dfsarg->shortcubes_mutex); |
| 448 | break; | 448 | break; |
| 449 | } | 449 | } |
| 450 | (*dfsarg->count)++; | 450 | count = ++(*dfsarg->count); |
| 451 | if (*dfsarg->count % UINT64_C(1000000) == 0) | ||
| 452 | LOG("Processing %" PRIu64 "th short cube\n", | ||
| 453 | *dfsarg->count); | ||
| 454 | |||
| 455 | pthread_mutex_unlock(dfsarg->shortcubes_mutex); | 451 | pthread_mutex_unlock(dfsarg->shortcubes_mutex); |
| 456 | 452 | ||
| 457 | dfsarg->cube = invcoord_h48(kv.key, dfsarg->crep, 11); | 453 | if (count % UINT64_C(1000000) == 0) |
| 458 | gendata_h48k2_dfs(dfsarg); | 454 | LOG("Processing %" PRIu64 "th short cube\n", count); |
| 455 | |||
| 456 | if (kv.val < dfsarg->shortdepth) { | ||
| 457 | c = kv.key >> (int64_t)(11 - dfsarg->h); | ||
| 458 | pthread_mutex_lock(dfsarg->table_mutex[c % CHUNKS]); | ||
| 459 | set_h48_pval(dfsarg->table, c, dfsarg->k, 0); | ||
| 460 | pthread_mutex_unlock(dfsarg->table_mutex[c % CHUNKS]); | ||
| 461 | } else { | ||
| 462 | dfsarg->cube = invcoord_h48(kv.key, dfsarg->crep, 11); | ||
| 463 | gendata_h48k2_dfs(dfsarg); | ||
| 464 | } | ||
| 459 | } | 465 | } |
| 460 | 466 | ||
| 461 | return NULL; | 467 | return NULL; |
