Skip to content

Moving _values_manually_retrieved to after _get_array in PetscVector#3494

Merged
roystgnr merged 1 commit intolibMesh:develfrom
zachmprince:petsc_vector
Mar 17, 2023
Merged

Moving _values_manually_retrieved to after _get_array in PetscVector#3494
roystgnr merged 1 commit intolibMesh:develfrom
zachmprince:petsc_vector

Conversation

@zachmprince
Copy link
Copy Markdown
Contributor

Closes #3493

@moosebuild
Copy link
Copy Markdown

Job Coverage on 95a66d9 wanted to post the following:

Coverage

f630ba #3494 95a66d
Total Total +/- New
Rate 60.02% 60.02% - 0.00%
Hits 48864 48864 - 0
Misses 32545 32545 - 3

Diff coverage report

Full coverage report

Warnings

  • New new line coverage rate 0.00% is less than the suggested 90.0%

This comment will be updated on new commits.

@jwpeterson
Copy link
Copy Markdown
Member

I see that you updated the unit test, but CIVET reports no coverage of the new lines of code. It's possible that's an error with the coverage itself, but probably good to confirm that we know exactly what's going on before merging...

@YaqiWang
Copy link
Copy Markdown
Contributor

@loganharbour or @roystgnr any comments about @jwpeterson 's comment? I checked the full coverage report, which does not make sense on this change.

@loganharbour
Copy link
Copy Markdown
Member

It's not hit in the current coverage either: https://mooseframework.inl.gov/libmesh/docs/coverage/include/numerics/petsc_vector.h.gcov.html

I would not be surprised here if we are missing coverage because we're running with -O2

@jwpeterson
Copy link
Copy Markdown
Member

OK, so this patch fixes a correctness issue that is only relevant in debug-mode (or less aggressively optimized) binaries. That sounds good to me, but I think it's more interesting that the compiler can actually make this optimization... setting a class member boolean seems like an "observable side effect" that would not be considered a candidate for elision.

@roystgnr roystgnr merged commit 3d9bab8 into libMesh:devel Mar 17, 2023
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.

PetscVector not allowing raw array access after read-only operations

6 participants