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

MUMPS from Trilinos requires matrix to exist on destruction/ reinitialization #13686

Open
mwichro opened this issue May 6, 2022 · 2 comments

Comments

@mwichro
Copy link
Contributor

mwichro commented May 6, 2022

TrilinosWrappers::SolverDirect crashes with segfault on destruction if the matrix it was initialized with does not exist anymore. The same problem occurs while calling initialize (if SolverDirect was previously initialized).

I only noticed this behavior with Amesos_Mumps, Amesos_Klu works fine. For this reason, the problem was particularly hard to locate in larger project. It would be nice to have some assertion to catch that an output meaningful message.

I don't have a good idea how to improve that, maybe we can try catching an exception when resenting the internal unique_ptr storing the Trilinos solver.

@bangerth
Copy link
Member

bangerth commented May 6, 2022

Do you think you can come up with a small test case that shows this?

The way we often deal with this is that we keep pointers to objects such as SparseMatrix via SmartPointer. If you delete the matrix while something else still points to it, you'll get an error message.

@jpthiele
Copy link
Contributor

I also came across this recently. I'm not sure whether we can fix this in deal.II as either Mumps or Amesos keeps a pointer to the original matrix, so the change would have to be done there I suppose.
Also afaik a segfault cannot be caught from inside the program, so I guess it would be hard to catch.

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

No branches or pull requests

3 participants