Commit 470667cb authored by Rob Latham's avatar Rob Latham
Browse files

avoid hang if subset of procs have invalid INFO

In response to IBM's integration ticket 1822 (but reworked), turn
MPIO_CHECK_INFO into a collective macro; exchange result of info
inspection with all procs.  Now a bogus info on one proc won't cause a
process hang.
parent 49195779
......@@ -163,10 +163,17 @@ if ((fh->file_system == ADIO_PIOFS) || \
/* Check MPI_Info object by calling MPI_Info_dup, if the info object is valid
then the dup operation will succeed */
#define MPIO_CHECK_INFO(info, error_code) { \
/* a collective check for error makes this macro collective */
#define MPIO_CHECK_INFO_ALL(info, error_code, comm) { \
MPI_Info dupinfo; \
int tmp_err = MPI_SUCCESS; \
error_code = MPI_Info_dup(info, &dupinfo); \
if(error_code != MPI_SUCCESS) goto fn_fail; \
MPI_Allreduce(&error_code, &tmp_err, 1, MPI_INT, MPI_MAX, comm); \
if(tmp_err != MPI_SUCCESS) { \
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, \
myname, __LINE__, MPI_ERR_OTHER, "**info", 0); \
goto fn_fail; \
} \
if (dupinfo != MPI_INFO_NULL) { \
MPI_Info_free(&dupinfo); \
} \
......
......@@ -61,8 +61,7 @@ int MPI_File_open(MPI_Comm comm, const char *filename, int amode,
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_COMM(comm, myname, error_code);
if(info != MPI_INFO_NULL)
MPIO_CHECK_INFO(info, error_code);
MPIO_CHECK_INFO_ALL(info, error_code, comm);
/* --END ERROR HANDLING-- */
error_code = MPI_Comm_test_inter(comm, &flag);
......
......@@ -44,7 +44,7 @@ int MPI_File_set_info(MPI_File fh, MPI_Info info)
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
MPIO_CHECK_INFO(info, error_code);
MPIO_CHECK_INFO_ALL(info, error_code, fh->comm);
/* --END ERROR HANDLING-- */
/* set new info */
......
......@@ -106,9 +106,7 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
error_code = MPIO_Err_return_file(adio_fh, error_code);
goto fn_exit;
}
if(info != MPI_INFO_NULL){
MPIO_CHECK_INFO(info, error_code);
}
MPIO_CHECK_INFO_ALL(info, error_code, adio_fh->comm);
/* --END ERROR HANDLING-- */
MPI_Type_size(filetype, &filetype_size);
......
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