35438ae9b5
Per MPI-3.1:8.7.1 p361:11-13, it's valid for MPI_FINALIZED to be invoked during an attribute destruction callback (e.g., during the destruction of keyvals on MPI_COMM_SELF during the very beginning of MPI_FINALIZE). In such cases, MPI_FINALIZED must return "false". Prior to this commit, we hung in FINALIZED if it were invoked during a COMM_SELF attribute destruction callback in FINALIZE. See https://github.com/open-mpi/ompi/issues/5084. This commit converts the MPI_INITIALIZED / MPI_FINALIZED infrastructure to use a single enum (ompi_mpi_state, set atomically) to represent the state of MPI: - not initialized - init started - init completed - finalize started - finalize past COMM_SELF destruction - finalize completed The "finalize past COMM_SELF destruction" state is what allows us to return "false" from MPI_FINALIZED before COMM_SELF has been fully destroyed / all attribute callbacks have been invoked. Since this state is checked at nearly every MPI API call (to see if we're outside of the INIT/FINALIZE epoch), care was taken to use atomics to *set* the ompi_mpi_state value in ompi_mpi_init() and ompi_mpi_finalize(), but performance-critical code paths can simply read the variable without needing to use a slow call to an opal_atomic_*() function. Thanks to @AndrewGaspar for reporting the issue. Signed-off-by: Jeff Squyres <jsquyres@cisco.com> |
||
---|---|---|
.. | ||
profile | ||
category_changed.c | ||
category_get_categories.c | ||
category_get_cvars.c | ||
category_get_index.c | ||
category_get_info.c | ||
category_get_num.c | ||
category_get_pvars.c | ||
cvar_get_index.c | ||
cvar_get_info.c | ||
cvar_get_num.c | ||
cvar_handle_alloc.c | ||
cvar_handle_free.c | ||
cvar_read.c | ||
cvar_write.c | ||
enum_get_info.c | ||
enum_get_item.c | ||
finalize.c | ||
init_thread.c | ||
Makefile.am | ||
mpit_common.c | ||
mpit-internal.h | ||
pvar_get_index.c | ||
pvar_get_info.c | ||
pvar_get_num.c | ||
pvar_handle_alloc.c | ||
pvar_handle_free.c | ||
pvar_read.c | ||
pvar_readreset.c | ||
pvar_reset.c | ||
pvar_session_create.c | ||
pvar_session_free.c | ||
pvar_start.c | ||
pvar_stop.c | ||
pvar_write.c |