Hi,
> I developed a parallel solver which includes clause and unit sharing.
> However, I've noticed some bugs in the solver, namely in the vec structures.
> With some debugging I concluded that if I do the assertion below the solver
> (very rarely) aborts.
>
Does this also happen when you disable all the parallelism in your solver?
> unitLits.push (learntUnits[i][j]);
> assert (unitLits.last() == learntUnits[i][j]);
>
> The structures unitLits and ** learntUnits are of vec<Lit>
>
> Shouldn't this assertion be always right?
> Can anyone tell me why does this happen?
>
In all likelihood you are concurrently modifying unitLits or learntUnits.
Essentially two cases will cause this assertion to fail (assuming that i and j
aren't shared):
- Multiple threads execute unitLits.push (learntUnits[i][j]) before either of
them reaches the assertion.
- Another thread modifies learntUnits[i][j] before the assertion is tested.
Best,
Michael