Skip to content

Commit

Permalink
Return MPI1 function implementations to build list
Browse files Browse the repository at this point in the history
Adding the implementations of the functions that were removed
from the MPI standard to the build list, regardless of the
state of the OMPI_ENABLE_MPI1_COMPAT.

According to the README, we want the OMPI_ENABLE_MPI1_COMPAT
configure flag to control which MPI prototypes are exposed in
mpi.h, NOT, which are built into the mpi library.  Those will
remain in the mpi library until a future major release (5.0?)

NOTE: for the Fortran implementations, we instead define
      OMPI_OMIT_MPI1_COMPAT_DECLS to 0 instead of
      OMPI_ENABLE_MPI1_COMPAT to 1.  I'm not sure why, but
      this seems to work correctly.

Also changing the removed MPI_Errhandler_create implementation
to use the non removed MPI_Comm_errhandler_function prototype
(prototype remains unchanged from MPI_Comm_errhandler_fn)

NOTE: This commit is *NOT* a cherry-pick from master, because
      on master, we are no longer building those symbols by
      default, but on v4.0.x we _ARE_ still building these
      symbols by default.   This is because the v4.0.x branch
      is to remain backwards compatible with v3.0.x, while at
      the same time removing the "removed" symbols from mpi.h
      (unless the user configures with --enable-mpi1-compatibility)

Signed-off-by: Geoffrey Paulsen <[email protected]>
  • Loading branch information
gpaulsen committed Dec 20, 2018
1 parent 0ade49c commit 4aa91e1
Show file tree
Hide file tree
Showing 25 changed files with 69 additions and 13 deletions.
6 changes: 3 additions & 3 deletions ompi/include/mpi.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
# define __mpi_interface_deprecated__(msg) __attribute__((__deprecated__))
# endif
# endif
# if OMPI_ENABLE_MPI1_COMPAT
# if (OMPI_ENABLE_MPI1_COMPAT && !OMPI_BUILDING)
# define __mpi_interface_removed__(msg) __mpi_interface_deprecated__(msg)
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
# endif
Expand Down Expand Up @@ -1001,7 +1001,7 @@ OMPI_DECLSPEC extern struct ompi_predefined_info_t ompi_mpi_info_env;
OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUS_IGNORE;
OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE;

#if !OMPI_OMIT_MPI1_COMPAT_DECLS
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS || OMPI_BUILDING)
/*
* Removed datatypes. These datatypes are only available if Open MPI
* was configured with --enable-mpi1-compatibility.
Expand Down Expand Up @@ -2662,7 +2662,7 @@ OMPI_DECLSPEC int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval,
void* extra_state )
__mpi_interface_deprecated__("MPI_NULL_DELETE_FN was deprecated in MPI-2.0; use MPI_COMM_NULL_DELETE_FN instead.");

#if !OMPI_OMIT_MPI1_COMPAT_DECLS
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS || OMPI_BUILDING)
/*
* Removed typedefs. These typedefs are only available if Open MPI
* was configured with --enable-mpi1-compatibility.
Expand Down
4 changes: 2 additions & 2 deletions ompi/mpi/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ libmpi_c_mpi_la_SOURCES = \
win_wait.c


if OMPI_ENABLE_MPI1_COMPAT
# include all of the removed MPI functions in library
# for v4.0.x regardless of state of OMPI_ENABLE_MPI1_COMPAT
libmpi_c_mpi_la_SOURCES += \
address.c \
errhandler_create.c \
Expand All @@ -449,7 +450,6 @@ libmpi_c_mpi_la_SOURCES += \
type_lb.c \
type_struct.c \
type_ub.c
endif

# Conditionally install the header files

Expand Down
11 changes: 11 additions & 0 deletions ompi/mpi/c/address.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
#include "ompi_config.h"
#include <stdio.h>

/* This implementation has been removed from the MPI 3.1 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.
*
* To prevent having to port these implementations of removed functions
* to the newer MPI calls, we are defining ENABLE_MPI1_COMPAT to 1
* before including the c bindings.
*/
#define ENABLE_MPI1_COMPAT 1

#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
Expand Down
6 changes: 5 additions & 1 deletion ompi/mpi/c/errhandler_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include "ompi_config.h"

/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
* see comments in address.c for more information. */
#define ENABLE_MPI1_COMPAT 1

#include "ompi/mpi/c/bindings.h"
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
Expand All @@ -31,7 +35,7 @@
#define MPI_Errhandler_create PMPI_Errhandler_create
#endif

int MPI_Errhandler_create(MPI_Handler_function *function,
int MPI_Errhandler_create(MPI_Comm_errhandler_function *function,
MPI_Errhandler *errhandler)
{

Expand Down
4 changes: 4 additions & 0 deletions ompi/mpi/c/errhandler_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include "ompi_config.h"

/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
* see comments in address.c for more information. */
#define ENABLE_MPI1_COMPAT 1

#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
Expand Down
4 changes: 4 additions & 0 deletions ompi/mpi/c/errhandler_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include "ompi_config.h"

/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
* see comments in address.c for more information. */
#define ENABLE_MPI1_COMPAT 1

#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
Expand Down
4 changes: 2 additions & 2 deletions ompi/mpi/c/profile/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ nodist_libmpi_c_pmpi_la_SOURCES = \
pwin_unlock_all.c \
pwin_wait.c

if OMPI_ENABLE_MPI1_COMPAT
# include all of the removed MPI functions in library
# for v4.0.x regardless of state of OMPI_ENABLE_MPI1_COMPAT
nodist_libmpi_c_pmpi_la_SOURCES += \
paddress.c \
perrhandler_create.c \
Expand All @@ -428,7 +429,6 @@ nodist_libmpi_c_pmpi_la_SOURCES += \
ptype_lb.c \
ptype_struct.c \
ptype_ub.c
endif

#
# Sym link in the sources from the real MPI directory
Expand Down
4 changes: 4 additions & 0 deletions ompi/mpi/c/type_extent.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include "ompi_config.h"

/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
* see comments in address.c for more information. */
#define ENABLE_MPI1_COMPAT 1

#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
Expand Down
4 changes: 4 additions & 0 deletions ompi/mpi/c/type_hindexed.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include "ompi_config.h"

/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
* see comments in address.c for more information. */
#define ENABLE_MPI1_COMPAT 1

#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
Expand Down
4 changes: 4 additions & 0 deletions ompi/mpi/c/type_hvector.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include "ompi_config.h"

/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
* see comments in address.c for more information. */
#define ENABLE_MPI1_COMPAT 1

#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
Expand Down
4 changes: 4 additions & 0 deletions ompi/mpi/c/type_lb.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include "ompi_config.h"

/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
* see comments in address.c for more information. */
#define ENABLE_MPI1_COMPAT 1

#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
Expand Down
4 changes: 4 additions & 0 deletions ompi/mpi/c/type_struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include "ompi_config.h"

/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
* see comments in address.c for more information. */
#define ENABLE_MPI1_COMPAT 1

#include "ompi/mpi/c/bindings.h"

#if OMPI_BUILD_MPI_PROFILING
Expand Down
4 changes: 4 additions & 0 deletions ompi/mpi/c/type_ub.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include "ompi_config.h"

/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
* see comments in address.c for more information. */
#define ENABLE_MPI1_COMPAT 1

#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
Expand Down
5 changes: 2 additions & 3 deletions ompi/mpi/fortran/mpif-h/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
win_flush_local_f.c \
win_flush_local_all_f.c


if OMPI_ENABLE_MPI1_COMPAT
# include all of the removed MPI functions in library
# for v4.0.x regardless of state of OMPI_ENABLE_MPI1_COMPAT
lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
address_f.c \
errhandler_create_f.c \
Expand All @@ -495,7 +495,6 @@ lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
type_struct_f.c \
type_ub_f.c
endif
endif

#
# Conditionally install the header files
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpif-h/address_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpif-h/errhandler_create_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpif-h/errhandler_get_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpif-h/errhandler_set_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
4 changes: 2 additions & 2 deletions ompi/mpi/fortran/mpif-h/profile/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@ linked_files = \
pwin_flush_local_f.c \
pwin_flush_local_all_f.c

if OMPI_ENABLE_MPI1_COMPAT
# include all of the removed MPI functions in library
# for v4.0.x regardless of state of OMPI_ENABLE_MPI1_COMPAT
linked_files += \
paddress_f.c \
perrhandler_create_f.c \
Expand All @@ -409,7 +410,6 @@ linked_files += \
ptype_lb_f.c \
ptype_struct_f.c \
ptype_ub_f.c
endif

#
# Sym link in the sources from the real MPI directory
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpif-h/type_extent_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpif-h/type_hindexed_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpif-h/type_hvector_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpif-h/type_lb_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpif-h/type_struct_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/fortran/mpif-h/type_ub_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down

0 comments on commit 4aa91e1

Please sign in to comment.