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

Commit 8854704

Browse files
hjelmnjsquyres
authored andcommitted
Fix MPI_Get_address (MPI_BOTTOM, ...)
Nowhere in the standard does it say that it is invalid to pass MPI_BOTTOM to MPI_Get_address yet we were returning an error. This commit removes the error check on NULL == location. Fixes open-mpi/ompi#1355. Signed-off-by: Nathan Hjelm <[email protected]> (cherry picked from commit open-mpi/ompi@064a67f)
1 parent 6cc6958 commit 8854704

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ompi/mpi/c/get_address.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
13+
* Copyright (c) 2013-2016 Los Alamos National Security, LLC. All rights
1414
* reserved.
1515
* Copyright (c) 2015 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
@@ -42,7 +42,7 @@ int MPI_Get_address(const void *location, MPI_Aint *address)
4242

4343
if( MPI_PARAM_CHECK ) {
4444
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
45-
if (NULL == location || NULL == address) {
45+
if (NULL == address) {
4646
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
4747
}
4848
}

ompi/mpi/fortran/mpif-h/get_address_f.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "ompi_config.h"
2323

2424
#include "ompi/mpi/fortran/mpif-h/bindings.h"
25+
#include "ompi/mpi/fortran/base/constants.h"
2526

2627
#if OMPI_BUILD_MPI_PROFILING
2728
#if OPAL_HAVE_WEAK_SYMBOLS
@@ -71,7 +72,7 @@ void ompi_get_address_f(char *location, MPI_Aint *address, MPI_Fint *ierr)
7172
int c_ierr;
7273
MPI_Aint c_address;
7374

74-
c_ierr = PMPI_Get_address(location, &c_address);
75+
c_ierr = PMPI_Get_address(OMPI_F2C_BOTTOM(location), &c_address);
7576
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
7677

7778
if (MPI_SUCCESS == c_ierr) {

0 commit comments

Comments
 (0)