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

Boundary LF Integrators fast assembly minor bug #4297

Open
stefanhenneking opened this issue May 11, 2024 · 0 comments
Open

Boundary LF Integrators fast assembly minor bug #4297

stefanhenneking opened this issue May 11, 2024 · 0 comments

Comments

@stefanhenneking
Copy link
Contributor

stefanhenneking commented May 11, 2024

#4027 resolved a seg fault issue in fast assembly of a boundary lf integrator that occurred when a proc in a ParMesh does not have any boundary element. The fix in #4027 (causing procs w/o boundary elements to simply return) resolves most cases; however, for some cases, the fix in #4027 is not sufficient. For example, if EnsureNodes() was not previously called for the ParMesh, then the following calling sequence now ends in a deadlock due to ParMesh::SetCurvature attempting to create a new ParFiniteElementSpace which requires all procs of the ParMesh (not just the ones owning boundary elements of the ParMesh).

BoundaryLFIntegrator::AssembleDevice
--> BLFEvalAssemble
--> Mesh::GetFaceGeometricFactors
--> Mesh::EnsureNodes
--> ParMesh::SetCurvature
--> new ParFiniteElementSpace

Here are two possible fixes for this issue:

  • Calling EnsureNodes in BoundaryLFIntegrator::AssembleDevice before checking fes.GetNBE() == 0 (or calling EnsureNodes in LinearFormExtension::Assemble)
  • Not using the particular fix from Boundary LF Integrators fast assembly bug fix #4027 that returns if fes.GetNBE() == 0 but instead making BoundaryLFIntegrator::AssembleDevice, BoundaryNormalLFIntegrator::AssembleDevice, etc. safe for procs that don't have any boundary elements.

Which one is preferable comes perhaps down to what MFEM internally assumes when calling functions on ParMesh. The first fix solves the particular issue at hand but since BoundaryLFIntegrator::AssembleDevice etc. still call ParMesh functions from only a subset of ParMesh procs, it could lead to issues in the future if those ParMesh functions are changed and (reasonably) assume all procs that are part of the ParMesh are calling a function (not just the ones owning boundary elements of that mesh).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant