Skip to content

Commit b991135

Browse files
authored
Merge pull request #4128 from jsquyres/pr/fix-info-delete-return-value
mpi/info_delete: fix return code
2 parents f5fb43e + ea5093f commit b991135

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ompi/mpi/c/info_delete.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* reserved.
1515
* Copyright (c) 2015 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
17+
* Copyright (c) 2017 Cisco Systems, Inc. All rights reserved
1718
* $COPYRIGHT$
1819
*
1920
* Additional copyrights may follow
@@ -78,5 +79,14 @@ int MPI_Info_delete(MPI_Info info, const char *key) {
7879
OPAL_CR_ENTER_LIBRARY();
7980

8081
err = ompi_info_delete (info, key);
82+
83+
// Note that ompi_info_delete() (i.e., opal_info_delete()) will
84+
// return OPAL_ERR_NOT_FOUND if there was no corresponding key to
85+
// delete. Per MPI-3.1, we need to convert that to
86+
// MPI_ERR_INFO_NOKEY.
87+
if (OPAL_ERR_NOT_FOUND == err) {
88+
err = MPI_ERR_INFO_NOKEY;
89+
}
90+
8191
OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, err, FUNC_NAME);
8292
}

0 commit comments

Comments
 (0)