By using opal atomics to modify/read the following ompi initialize/finalize related variables:
ompi_mpi_init_started
ompi_mpi_initialized
ompi_mpi_finalized
ompi_rte_initialized
ompi_mpi_finalize_started
would help in bringing some MPI query functions into compliance with the MPI-3 specification.
See issue #493.