Skip to content

Commit f199d2d

Browse files
parallel,UNSAT: assign from global to thread status
When we find UNSAT during sync, e.g. by receiving clauses, make sure this status is propagated to the thread status as well, as this is used to then terminate search with the proper status as well. Signed-off-by: Norbert Manthey <nmanthey@conp-solutions.com>
1 parent 9d8b8ef commit f199d2d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

minisat/parallel/ParSolver.cc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ bool ParSolver::sync_evaluate_state_deterministic(size_t threadnr, bool caller_h
13171317
"if unassigned, no assumptions should available anymore");
13181318
assert(data->partitionAssumptions.size() == 0 && "if unassigned, no assumptions should available anymore");
13191319
// signal that the overall tree might now be UNSAT
1320-
notifyEvaluatePartitions.store(true);
1320+
// notifyEvaluatePartitions.store(true);
13211321
}
13221322
}
13231323

@@ -1464,7 +1464,14 @@ bool ParSolver::sync_deterministic(size_t threadnr, bool caller_has_solution)
14641464

14651465
// TODO: refactor into separate method
14661466
if (threadnr == 0) {
1467-
if (notifyEvaluatePartitions.load()) evaluatePartitionTree();
1467+
if (true) { /* (notifyEvaluatePartitions.load()) */
1468+
if (!evaluatePartitionTree()) {
1469+
std::cout << "c found UNSAT during evaluating partition tree" << std::endl;
1470+
assert(solved_current_call != 10);
1471+
solverData[threadnr]->_status = l_False; /* use thread 0 to propagate status */
1472+
solved_current_call.store(20);
1473+
}
1474+
}
14681475
/* thread 0 asignes new partitions to threads with an UNSAT current partition */
14691476
if (!assignPartitionAndTasks(threadnr)) {
14701477
assert(false && "implement failure of assigning extra task");
@@ -1516,6 +1523,11 @@ bool ParSolver::sync_deterministic(size_t threadnr, bool caller_has_solution)
15161523
/* If unsat here, formula is unsat, so all need to stop */
15171524
if (solverData[threadnr]->_status == l_False) {
15181525
solved_current_call.store(20);
1526+
} else if (solved_current_call.load() == 20) {
1527+
solverData[threadnr]->_status = l_False;
1528+
if (verbosity > 1)
1529+
std::cout << "c set thread " << threadnr << " status to " << solverData[threadnr]->_status
1530+
<< " based on global status " << solved_current_call << std::endl;
15191531
}
15201532

15211533
/* block on the barrier; needs to sync 'solved_current_call' from unsat partitions */

0 commit comments

Comments
 (0)