Skip to content

Get PetscVector::type() from Vec sizes, not type#4402

Merged
lindsayad merged 2 commits into
libMesh:develfrom
roystgnr:more_petsc_vectypes
Feb 18, 2026
Merged

Get PetscVector::type() from Vec sizes, not type#4402
lindsayad merged 2 commits into
libMesh:develfrom
roystgnr:more_petsc_vectypes

Conversation

@roystgnr
Copy link
Copy Markdown
Member

Otherwise we think that e.g. a VECKOKKOS in parallel should be SERIAL.

Otherwise we think that e.g. a VECKOKKOS in parallel should be SERIAL.
@roystgnr
Copy link
Copy Markdown
Member Author

This isn't just a theoretical problem - see https://civet.inl.gov/job/3585537/ for some example failures. Our callbacks from PETSc SNES operate by using this constructor, swapping the constructed PetscVector with the system solution, and doing a system update() ... and in parallel, that update copies it to a GHOSTED current_local_solution, which if we mistakenly think solution is SERIAL is now forbidden as of #4374

@roystgnr
Copy link
Copy Markdown
Member Author

Damn. This isn't a fix for us yet. I get to VecGhostGetGhostIS was not supported for vec type mpikokkos. I hate having to go back to hardcoded types, but for now I'll have to hard-code that only VECMPI might be ghosted, even if other types might be parallel or serial.

PETSc doesn't even want to let us call these functions on e.g. a Kokkos
vector without throwing an error, so we'll hardcode for now that other
vectors just can't be ghosted.
@lindsayad
Copy link
Copy Markdown
Member

Yea that's https://gitlab.com/petsc/petsc/-/issues/1096. It's one of the things we're hoping to have the PETSc team work on under Genesis ties

@moosebuild
Copy link
Copy Markdown

Job Coverage, step Generate coverage on 52745d4 wanted to post the following:

Coverage

No coverage report(s) were found for the base commit 20eccfe.
Full coverage report

This comment will be updated on new commits.

Comment on lines -653 to -654
Vec localrep;
LibmeshPetscCall(VecGhostGetLocalForm(_vec,&localrep));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this just an unused variable previously?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah; I just moved it (to get the declaration and thus scope out of the new if()), despite the diff looking like I removed it.

@lindsayad lindsayad merged commit f8a1758 into libMesh:devel Feb 18, 2026
26 checks passed
@roystgnr roystgnr deleted the more_petsc_vectypes branch February 18, 2026 16:40
@roystgnr
Copy link
Copy Markdown
Member Author

For the record, in my own testing that last commit was enough to fix the -vec_type kokkos test case from @NamjaeChoi. Thanks for the reviews!

@NamjaeChoi
Copy link
Copy Markdown
Contributor

When are you anticipating next submodule update?

@roystgnr
Copy link
Copy Markdown
Member Author

We're in master as of yesterday afternoon, and IMHO ready to go now. @loganharbour said yesterday he'd "need an update for some python formatting stuff I did" and I figured I'd let him combine us with that, but if he's too swamped and the python update isn't urgent then I'll get a PR up myself this afternoon.

@roystgnr
Copy link
Copy Markdown
Member Author

We should be getting this downstream in idaholab/moose#32379; cross your fingers.

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.

5 participants