Skip to content

Commit eef0139

Browse files
committed
Change the number of failures from 5 to 2 to stop the second (sequential) search earlier
1 parent 62ba1fe commit eef0139

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tree/tree.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,10 @@ void cmaple::Tree::doPlacementTemplate(const int num_threads, std::ostream& out_
746746

747747
// sequentially seek placement (again from the found placement if found or from the root) and place the sample
748748
const size_t current_chunk_size = parallel_search ? chunk_size : 1;
749+
// update the threshold to stop the search earlier if starting from placements found from the parallel search
750+
const int bk_failure_limit_sample = params->failure_limit_sample;
751+
if (parallel_search)
752+
params->failure_limit_sample = 2;
749753
for (size_t j = 0; j < current_chunk_size; ++j)
750754
{
751755
// increase i and move the sequence pointer
@@ -847,6 +851,10 @@ void cmaple::Tree::doPlacementTemplate(const int num_threads, std::ostream& out_
847851
}
848852
}
849853
}
854+
855+
// restore the threshold for pleacement search, if it has been changed
856+
if (parallel_search)
857+
params->failure_limit_sample = bk_failure_limit_sample;
850858
}
851859

852860
// flag denotes whether there is any new nodes added

0 commit comments

Comments
 (0)