Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 2e5429c

Browse files
committed
ompio: always return valid info from FILE_GET_INFO
MPI-3.1 says that even if no info keys are set on the file, we need to return a new, empty info. Thanks to Lisandro Dalcin for identifying the issue. Fixes open-mpi/ompi#1630 Signed-off-by: Jeff Squyres <[email protected]> (cherry picked from commit open-mpi/ompi@f167be1)
1 parent 74d8ea0 commit 2e5429c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ompi/mca/io/ompio/io_ompio_file_open.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -599,14 +600,14 @@ int mca_io_ompio_file_get_info (ompi_file_t *fh,
599600
int ret = OMPI_SUCCESS;
600601
ompi_info_t *info=NULL;
601602

602-
if ( MPI_INFO_NULL == fh->f_info ) {
603-
*info_used = MPI_INFO_NULL;
603+
info = OBJ_NEW(ompi_info_t);
604+
if (NULL == info) {
605+
return MPI_ERR_INFO;
604606
}
605-
else {
606-
info = OBJ_NEW(ompi_info_t);
607+
if (MPI_INFO_NULL != fh->f_info) {
607608
ret = ompi_info_dup (fh->f_info, &info);
608-
*info_used = info;
609609
}
610+
*info_used = info;
610611

611612
return ret;
612613
}

0 commit comments

Comments
 (0)