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

Free communicator only if MPI has not been finalized #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kmittal2
Copy link
Contributor

@kmittal2 kmittal2 commented Mar 6, 2025

Currently comm_free causes a segfault when the memory allocated by findpts is attempted to be freed after MPI_Finalize has been called.

@stgeke
Copy link
Contributor

stgeke commented Mar 7, 2025

Isn't this expected? I would argue that it's illegal to call comm_free after MPI_Finalize.

@kmittal2
Copy link
Contributor Author

kmittal2 commented Mar 7, 2025

Yes, it is expected.. We are trying to eliminate the need for the user to free findpts data manually by moving the call to findpts_free to the destructor of the class that sets up the findpts object. This destructor can potentially be called after MPI_Finalize depending on how the user has setup their driver.

A non-invasive solution is to skip findpts_free in the destructor if MPI_Finalize has been called, but that would result in a memory leak.

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.

2 participants