mirror of
https://github.com/Z3Prover/z3
synced 2026-02-23 16:57:51 +00:00
set clean shutdown for local search and re-enable local search when it parallelizes with PB solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
b2b3bab246
commit
8de2544abb
4 changed files with 24 additions and 9 deletions
|
|
@ -1243,8 +1243,11 @@ namespace sat {
|
|||
m_cleaner(true);
|
||||
return do_local_search(num_lits, lits);
|
||||
}
|
||||
if ((m_config.m_num_threads > 1 || m_config.m_local_search_threads > 0 ||
|
||||
m_config.m_ddfw_threads > 0) && !m_par && !m_ext) {
|
||||
if ((m_config.m_num_threads > 1 || m_config.m_ddfw_threads > 0) && !m_par && !m_ext) {
|
||||
SASSERT(scope_lvl() == 0);
|
||||
return check_par(num_lits, lits);
|
||||
}
|
||||
if (m_config.m_local_search_threads > 0 && !m_par && (!m_ext || m_ext->is_pb())) {
|
||||
SASSERT(scope_lvl() == 0);
|
||||
return check_par(num_lits, lits);
|
||||
}
|
||||
|
|
@ -1460,15 +1463,17 @@ namespace sat {
|
|||
if (!rlimit().inc()) {
|
||||
return l_undef;
|
||||
}
|
||||
if (m_ext)
|
||||
if (m_ext && !m_ext->is_pb())
|
||||
return l_undef;
|
||||
|
||||
scoped_ptr_vector<i_local_search> ls;
|
||||
scoped_ptr_vector<solver> uw;
|
||||
|
||||
int num_extra_solvers = m_config.m_num_threads - 1;
|
||||
int num_local_search = static_cast<int>(m_config.m_local_search_threads);
|
||||
int num_ddfw = m_ext ? 0 : static_cast<int>(m_config.m_ddfw_threads);
|
||||
int num_threads = num_extra_solvers + 1 + num_local_search + num_ddfw;
|
||||
vector<reslimit> lims(num_ddfw);
|
||||
scoped_ptr_vector<i_local_search> ls;
|
||||
scoped_ptr_vector<solver> uw;
|
||||
for (int i = 0; i < num_local_search; ++i) {
|
||||
local_search* l = alloc(local_search);
|
||||
l->updt_params(m_params);
|
||||
|
|
@ -1477,7 +1482,7 @@ namespace sat {
|
|||
ls.push_back(l);
|
||||
}
|
||||
|
||||
vector<reslimit> lims(num_ddfw);
|
||||
|
||||
// set up ddfw search
|
||||
for (int i = 0; i < num_ddfw; ++i) {
|
||||
ddfw* d = alloc(ddfw);
|
||||
|
|
@ -1593,6 +1598,7 @@ namespace sat {
|
|||
if (!canceled) {
|
||||
rlimit().reset_cancel();
|
||||
}
|
||||
par.reset();
|
||||
set_par(nullptr, 0);
|
||||
ls.reset();
|
||||
uw.reset();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue