3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-18 11:58:31 +00:00

fix bug in propagation of parameters to combined solvers

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-01-31 17:17:58 -08:00
parent bdfa84c6fe
commit f015e3e4cc
5 changed files with 7 additions and 4 deletions

View file

@ -35,6 +35,7 @@ namespace sat {
m_glue("glue"), m_glue("glue"),
m_glue_psm("glue_psm"), m_glue_psm("glue_psm"),
m_psm_glue("psm_glue") { m_psm_glue("psm_glue") {
m_num_parallel = 1;
updt_params(p); updt_params(p);
} }

View file

@ -804,7 +804,7 @@ namespace sat {
sat::par par; sat::par par;
symbol saved_phase = m_params.get_sym("phase", symbol("caching")); symbol saved_phase = m_params.get_sym("phase", symbol("caching"));
for (int i = 0; i < num_extra_solvers; ++i) { for (int i = 0; i < num_extra_solvers; ++i) {
m_params.set_uint("random_seed", i + m_config.m_random_seed); m_params.set_uint("random_seed", m_rand());
if (i == 1 + num_threads/2) { if (i == 1 + num_threads/2) {
m_params.set_sym("phase", symbol("random")); m_params.set_sym("phase", symbol("random"));
} }
@ -813,13 +813,13 @@ namespace sat {
solvers[i]->set_par(&par); solvers[i]->set_par(&par);
scoped_rlimit.push_child(&solvers[i]->rlimit()); scoped_rlimit.push_child(&solvers[i]->rlimit());
} }
set_par(&par);
m_params.set_sym("phase", saved_phase); m_params.set_sym("phase", saved_phase);
int finished_id = -1; int finished_id = -1;
std::string ex_msg; std::string ex_msg;
par_exception_kind ex_kind; par_exception_kind ex_kind;
unsigned error_code = 0; unsigned error_code = 0;
lbool result = l_undef; lbool result = l_undef;
flet<unsigned> _overwrite_thread_number(m_config.m_num_parallel, 1);
#pragma omp parallel for #pragma omp parallel for
for (int i = 0; i < num_threads; ++i) { for (int i = 0; i < num_threads; ++i) {
try { try {
@ -867,6 +867,7 @@ namespace sat {
} }
} }
} }
set_par(0);
if (finished_id != -1 && finished_id < num_extra_solvers) { if (finished_id != -1 && finished_id < num_extra_solvers) {
m_stats = solvers[finished_id]->m_stats; m_stats = solvers[finished_id]->m_stats;
} }

View file

@ -54,7 +54,7 @@ public:
/** /**
\brief Update the solver internal settings. \brief Update the solver internal settings.
*/ */
virtual void updt_params(params_ref const & p) {} virtual void updt_params(params_ref const & p) { }
/** /**
\brief Store in \c r a description of the configuration \brief Store in \c r a description of the configuration

View file

@ -93,6 +93,7 @@ public:
{} {}
virtual void updt_params(params_ref const & p) { virtual void updt_params(params_ref const & p) {
m_params.append(p);
m_solver->updt_params(p); m_solver->updt_params(p);
} }

View file

@ -96,7 +96,7 @@ tactic2solver::~tactic2solver() {
} }
void tactic2solver::updt_params(params_ref const & p) { void tactic2solver::updt_params(params_ref const & p) {
m_params = p; m_params.append(p);
} }
void tactic2solver::collect_param_descrs(param_descrs & r) { void tactic2solver::collect_param_descrs(param_descrs & r) {