Skip to content

Commit

Permalink
Add information to Depth and Filling lines. Removed some verbiage and
Browse files Browse the repository at this point in the history
made rates be in million/s to try to keep things more concise.
  • Loading branch information
rokicki committed Oct 9, 2023
1 parent 5fe0ed1 commit 3fda092
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/cpp/prunetable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,9 @@ prunetable::prunetable(const puzdef &pd, ull maxmem) {
void prunetable::filltable(const puzdef &pd, int d) {
popped = 0;
wbval = min(d, 14);
ll ofillcnt = fillcnt;
if (quiet == 0)
cout << "Filling table at depth " << d << " with val " << wval << flush;
cout << "Filling depth " << d << " val " << wval << flush;
makeworkchunks(pd, d, pd.solved);
int wthreads = setupthreads(pd, *this);
for (int t = 0; t < wthreads; t++)
Expand All @@ -320,10 +321,12 @@ void prunetable::filltable(const puzdef &pd, int d) {
#else
fillthreadworker((void *)&workerparams[0]);
#endif
if (quiet == 0)
cout << " saw " << popped << " (" << fillcnt << ") in " << duration()
<< endl
<< flush;
if (quiet == 0) {
double dur = duration();
double rate = (fillcnt - ofillcnt) / dur / 1e6 ;
cout << " saw " << popped << " (" << (fillcnt - ofillcnt)
<< ") in " << dur << " rate " << rate << endl << flush;
}
ptotpop = totpop;
totpop += popped;
justread = 0;
Expand Down
9 changes: 6 additions & 3 deletions src/cpp/solve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ int solve(const puzdef &pd, prunetable &pt, const setval p, generatingset *gs) {
int hid = 0;
randomized.clear();
for (int d = initd; d <= maxdepth; d++) {
ll olookups = pt.lookupcnt;
if (randomstart) {
while ((int)randomized.size() <= d) {
randomized.push_back({});
Expand Down Expand Up @@ -250,16 +251,18 @@ int solve(const puzdef &pd, prunetable &pt, const setval p, generatingset *gs) {
duration();
double actualtime = start - starttime;
cout << "Found " << solutionsfound << " solution"
<< (solutionsfound != 1 ? "s" : "") << " at maximum depth " << d
<< (solutionsfound != 1 ? "s" : "") << " max depth " << d
<< " lookups " << totlookups << " in " << actualtime << " rate "
<< (totlookups / actualtime) << endl
<< (totlookups / actualtime / 1e6) << endl
<< flush;
return d;
}
double dur = duration();
ll lookups = pt.lookupcnt - olookups;
double rate = lookups / dur / 1e6;
if (verbose) {
if (verbose > 1 || dur > 1)
cout << "Depth " << d << " finished in " << dur << endl << flush;
cout << "Depth " << d << " in " << dur << " lookups " << lookups << " rate " << rate << endl << flush;
}
if (flushback)
if (flushback(d))
Expand Down

0 comments on commit 3fda092

Please sign in to comment.