Commit a500a7da authored by Rob Latham's avatar Rob Latham
Browse files

hoist ROMIO init into MPI_Init



some libraries like HDF5 want to register their cleanup routines into
finalize.  these cleanup routines use MPI-IO, so they need to fire
before ROMIO cleans up.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent bac25133
......@@ -4341,6 +4341,7 @@ int MPIR_Type_size_x_impl(MPI_Datatype datatype, MPI_Count *size);
/* random initializers */
int MPIR_Group_init(void);
int MPIR_Comm_init(MPID_Comm *);
int MPIR_MPIOInit(int *error);
/* Collective functions cannot be called from multiple threads. These
......
......@@ -560,6 +560,10 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
if (mpi_errno == MPI_SUCCESS)
mpi_errno = MPID_InitCompleted();
#ifdef HAVE_ROMIO
MPIR_MPIOInit(&mpi_errno);
#endif
fn_exit:
MPIU_THREAD_CS_EXIT(INIT,required);
/* Make fields of MPIR_Process global visible and set mpich_state
......
......@@ -19,23 +19,8 @@ extern int ADIO_Init_keyval;
void MPIR_MPIOInit(int * error_code) {
int flag;
char myname[] = "MPIR_MPIOInit";
/* first check if ADIO has been initialized. If not, initialize it */
if (ADIO_Init_keyval == MPI_KEYVAL_INVALID) {
MPI_Initialized(&flag);
/* --BEGIN ERROR HANDLING-- */
if (!flag) {
*error_code = MPIO_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE, myname, __LINE__,
MPI_ERR_OTHER, "**initialized", 0);
*error_code = MPIO_Err_return_file(MPI_FILE_NULL, *error_code);
return;
}
/* --END ERROR HANDLING-- */
MPI_Keyval_create(MPI_NULL_COPY_FN, ADIOI_End_call, &ADIO_Init_keyval,
(void *) 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment