Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Vec's state counter for MixedDat #670

Merged
merged 3 commits into from
Jul 27, 2022
Merged

Conversation

nbouziani
Copy link
Contributor

MixedDat objects don’t only rely on the PETSc Vec of the underlying Dat objects, they is also a Vec living on the mixed space that is made by duplicating the layout vector of the dataset attached to the MixedDat instance.

The data version of MixedDat is obtained by summing the data version of the underlying Dat (not unique but enough to detect that the data value changed), but we also need to update the data version of the vector in the mixed space in the vec_context where it is populated.

This causes a test to fail in firedrake as PETSc Vecs cache some operations (e.g. norm computations) based on the Vec's state counter which can lead to wrong numerical values.

pyop2/types/dat.py Outdated Show resolved Hide resolved
@dham dham merged commit 7036b5d into master Jul 27, 2022
@dham dham deleted the fix-mixed-dat-object-versioning branch July 27, 2022 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants