
Refs https://github.com/open-mpi/ompi/issues/6278. This commit is intended to be cherry-picked to v4.0.x and the following commit will ammend to this functionality for master's removal. Changes the prototypes for MPI removed functions in the following ways: There are 4 cases: 1) User wants MPI-1 compatibility (--enable-mpi1-compatibility) MPI_Address (and friends) are declared in mpi.h with deprecation notice 2) User does not want MPI-1 compatibility, and has a C11-capable compiler Declare an MPI_Address (etc.) macro in mpi.h, which will cause a compile-time error using _Static_assert C11 feature 3) User does not want MPI-1 compatibility, and does not have a C11-capable compiler, but the compiler supports error function attributes. Declare an MPI_Address (etc.) macro in mpi.h, which will cause a compile-time error using error function attribute. 4) User does not want MPI-1 compatibility, and does not have a C11-capable compiler, or a compiler that supports error function attributes. Do not declare MPI_Address (etc.) in mpi.h at all. Unless the user is compiling with something like -Werror, this will allow the user's code to compile. We are choosing this because it seems like a losing battle to make some kind of compile time error that is friendly to the user (and doesn't make it look like mpi.h itself is broken). On v4.0.x, this will allow the user code to both compile (albeit with a warning) and link (because the MPI_Address will be in the MPI library because we are preserving ABI back to 3.0.x). On master/v5.0.x, this will allow the user code to compile, but it will fail to link (because the MPI_Address symbol will not be in the MPI library). Signed-off-by: Geoffrey Paulsen <gpaulsen@us.ibm.com> (cherry-picked from 3136a1706cdacb3f7530937da1dcfe15d2febc79)
67 строки
2.1 KiB
C
67 строки
2.1 KiB
C
/*
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
|
* University Research and Technology
|
|
* Corporation. All rights reserved.
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
* of Tennessee Research Foundation. All rights
|
|
* reserved.
|
|
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
|
|
* University of Stuttgart. All rights reserved.
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
* All rights reserved.
|
|
* Copyright (c) 2015 Research Organization for Information Science
|
|
* and Technology (RIST). All rights reserved.
|
|
* Copyright (c) 2019 IBM Corporation. All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#include "ompi_config.h"
|
|
|
|
/* This implementation has been removed from the MPI 3.0 standard.
|
|
* Open MPI v4.0.x is keeping the implementation in the library, but
|
|
* removing the prototypes from the headers, unless the user configures
|
|
* with --enable-mpi1-compatibility.
|
|
*/
|
|
|
|
#include "ompi/mpi/c/bindings.h"
|
|
#include "ompi/runtime/params.h"
|
|
#include "ompi/communicator/communicator.h"
|
|
#include "ompi/errhandler/errhandler.h"
|
|
#include "ompi/memchecker.h"
|
|
|
|
#if OMPI_BUILD_MPI_PROFILING
|
|
#if OPAL_HAVE_WEAK_SYMBOLS
|
|
#pragma weak MPI_Errhandler_get = PMPI_Errhandler_get
|
|
#endif
|
|
/* undef before defining, to prevent possible redefinition when
|
|
* using _Static_assert to error on usage of removed functions.
|
|
*/
|
|
#undef MPI_Errhandler_get
|
|
#define MPI_Errhandler_get PMPI_Errhandler_get
|
|
#endif
|
|
|
|
static const char FUNC_NAME[] = "MPI_Errhandler_get";
|
|
|
|
|
|
int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
|
|
{
|
|
MEMCHECKER(
|
|
memchecker_comm(comm);
|
|
);
|
|
|
|
OPAL_CR_NOOP_PROGRESS();
|
|
|
|
if (MPI_PARAM_CHECK) {
|
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
|
}
|
|
|
|
/* This is a deprecated -- just turn around and call the real
|
|
function */
|
|
|
|
return PMPI_Comm_get_errhandler(comm, errhandler);
|
|
}
|