Visitar URL original
Check if MPI is finalized before freeing MPI types by jayeshkrishna · Pull Request #720 · E3SM-Project/scorpio · GitHub
Skip to content

Check if MPI is finalized before freeing MPI types - #720

Open
jayeshkrishna wants to merge 1 commit into
masterfrom
jayeshkrishna/check_mpi_init_before_type_free
Open

jayeshkrishna wants to merge 1 commit into
masterfrom
jayeshkrishna/check_mpi_init_before_type_free

Conversation

@jayeshkrishna

Copy link
Copy Markdown
Contributor

Add an explicit check to see if MPI is finalized or not
before freeing MPI types associated with an I/O
decomposition.

Add an explicit check to see if MPI is finalized or not before
freeing MPI types associated with an I/O decomposition.
@jayeshkrishna jayeshkrishna self-assigned this Nov 12, 2026
@jayeshkrishna

Copy link
Copy Markdown
Contributor Author

This change provides a better error message to the user instead of the generic error message from the MPI library

*** The MPI_Type_free() function was called after MPI_FINALIZE was invoked.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the change guarding MPI datatype cleanup after MPI finalization.

No open issues 🎉

What changed in this PR

This PR makes SCORPIO’s I/O decomposition cleanup skip MPI datatype frees
after MPI has been finalized.

Changes:

  • Check MPI_Finalized before calling MPI_Type_free.
  • Warn when cleanup skips a datatype, advising users to finalize all I/O
    systems with PIOc_finalize.
File Description
src/​clib/​core/​spio_iodesc_utils.cpp Guard datatype cleanup after MPI finalization and add a resource-cleanup warning.

Review effort: Balanced

@jayeshkrishna
jayeshkrishna marked this pull request as ready for review November 12, 2026 18:56
jayeshkrishna added a commit that referenced this pull request Nov 12, 2026
…elop (PR #720)

Add an explicit check to see if MPI is finalized or not
before freeing MPI types associated with an I/O
decomposition.

* jayeshkrishna/check_mpi_init_before_type_free:
  Check if MPI is finalized before freeing MPI types

This branch has not been deployed

No deployments
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.

3 participants