diff --git a/.gitignore b/.gitignore index dfa2e7c86d0..d31d774b831 100644 --- a/.gitignore +++ b/.gitignore @@ -271,6 +271,7 @@ ompi/tools/ompi_info/ompi_info ompi/tools/wrappers/mpic++-wrapper-data.txt ompi/tools/wrappers/mpicc-wrapper-data.txt +ompi/tools/wrappers/mpicc_abi-wrapper-data.txt ompi/tools/wrappers/mpifort-wrapper-data.txt ompi/tools/wrappers/ompi_wrapper_script ompi/tools/wrappers/ompi.pc @@ -534,6 +535,9 @@ docs/man # Generated C Bindings ompi/mpi/c/*_generated*.c +ompi/mpi/c/standard_*.c +ompi/mpi/c/abi.h +ompi/mpi/c/standard_abi # Generated Fortran Bindings ompi/mpi/fortran/use-mpi-f08/*_generated.F90 diff --git a/config/ompi_config_files.m4 b/config/ompi_config_files.m4 index 21d1e3eb791..f378cc3ce00 100644 --- a/config/ompi_config_files.m4 +++ b/config/ompi_config_files.m4 @@ -48,6 +48,7 @@ AC_DEFUN([OMPI_CONFIG_FILES],[ ompi/tools/ompi_info/Makefile ompi/tools/wrappers/Makefile ompi/tools/wrappers/mpicc-wrapper-data.txt + ompi/tools/wrappers/mpicc_abi-wrapper-data.txt ompi/tools/wrappers/mpic++-wrapper-data.txt ompi/tools/wrappers/mpifort-wrapper-data.txt ompi/tools/wrappers/ompi.pc diff --git a/config/ompi_configure_options.m4 b/config/ompi_configure_options.m4 index c00ead8792c..72a84353394 100644 --- a/config/ompi_configure_options.m4 +++ b/config/ompi_configure_options.m4 @@ -256,5 +256,26 @@ AM_CONDITIONAL(OMPI_OMPIO_SUPPORT, test "$ompi_want_ompio" = "1") AC_ARG_ENABLE([deprecate-mpif-h], [AS_HELP_STRING([--enable-deprecate-mpif-h], [Mark the mpif.h bindings as deprecated (default: enabled)])]) +# If the binding source files don't exist, then we need Python to generate them +AM_PATH_PYTHON([3.6],,[:]) +binding_file="${srcdir}/ompi/mpi/c/ompi_send_generated.c" +AS_IF([! test -e "$binding_file" && test "$PYTHON" = ":"], + [AC_MSG_ERROR([Open MPI requires Python >=3.6 for generating the bindings. Aborting])]) +AM_CONDITIONAL(OMPI_GENERATE_BINDINGS,[test "$PYTHON" != ":"]) + +AC_MSG_CHECKING([if want to enable standard ABI library]) +AC_ARG_ENABLE([standard-abi], + [AS_HELP_STRING([--enable-standard-abi], + [Enable building the standard ABI library (default: disabled)])]) +if test "$enable_standard_abi" = "yes"; then + AC_MSG_RESULT([yes]) + ompi_standard_abi=1 +else + AC_MSG_RESULT([no]) + ompi_standard_abi=0 +fi +AC_DEFINE_UNQUOTED([OMPI_STANDARD_ABI],[$ompi_standard_abi], + [Whether we want to build the standard ABI library]) +AM_CONDITIONAL(OMPI_STANDARD_ABI,[test "$enable_standard_abi" = "yes"]) ])dnl diff --git a/ompi/Makefile.am b/ompi/Makefile.am index f855492ef15..14857566c9b 100644 --- a/ompi/Makefile.am +++ b/ompi/Makefile.am @@ -126,36 +126,72 @@ DIST_SUBDIRS = \ $(MCA_ompi_FRAMEWORKS_SUBDIRS) \ $(MCA_ompi_FRAMEWORK_COMPONENT_ALL_SUBDIRS) -# Build the main MPI library - +noinst_LTLIBRARIES = libopen_mpi.la lib_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@.la -lib@OMPI_LIBMPI_NAME@_la_SOURCES = -lib@OMPI_LIBMPI_NAME@_la_LIBADD = \ +if OMPI_STANDARD_ABI +lib_LTLIBRARIES += libmpi_abi.la +endif + +# +# ABI Refactor +# +# As required by the standard ABI, ompi must now provide libmpi_abi.la for +# ABI-specific code. Since we also want to avoid breaking the existing ompi +# ABI, the libraries in this directory are now organized as follows: +# +# +----------------------+----------------------+ +# | libmpi_abi.la | libmpi.la | +# +----------------------+----------------------+ +# | libopen_mpi.la | +# +----------------------+----------------------+ +# +# This includes a new library, libopen_mpi.la, that links in all backend code +# built in this directory or SUBDIRs of this directory. Previously everything +# was just linked directly into libmpi.la (lib@OMPI_LIBMPI_NAME@.la). +# +# libmpi_abi.la and libmpi.la both now link in libopen_mpi.la, the only +# difference between them being that one includes the standard ABI functions +# and the other the ompi-specific versions of those. +# + +# Build the Open MPI internal library +libopen_mpi_la_SOURCES = +libopen_mpi_la_LIBADD = \ datatype/libdatatype.la \ debuggers/libdebuggers.la \ + $(OMPI_TOP_BUILDDIR)/opal/lib@OPAL_LIB_NAME@.la \ + $(MCA_ompi_FRAMEWORK_LIBS) \ + $(OMPI_LIBMPI_EXTRA_LIBS) +libopen_mpi_la_DEPENDENCIES = $(libopen_mpi_la_LIBADD) + +# Build the main MPI library +lib@OMPI_LIBMPI_NAME@_la_SOURCES = +lib@OMPI_LIBMPI_NAME@_la_LIBADD = \ + libopen_mpi.la \ mpi/c/libmpi_c.la \ mpi/tool/libmpi_mpit.la \ $(c_mpi_lib) \ $(c_pmpi_lib) \ - $(mpi_fortran_base_lib) \ - $(MCA_ompi_FRAMEWORK_LIBS) \ $(OMPI_MPIEXT_C_LIBS) \ - $(OMPI_LIBMPI_EXTRA_LIBS) + $(mpi_fortran_base_lib) - -lib@OMPI_LIBMPI_NAME@_la_LIBADD += \ - $(OMPI_TOP_BUILDDIR)/opal/lib@OPAL_LIB_NAME@.la -lib@OMPI_LIBMPI_NAME@_la_DEPENDENCIES = $(lib@OMPI_LIBMPI_NAME@_la_LIBADD) lib@OMPI_LIBMPI_NAME@_la_LDFLAGS = \ -version-info $(libmpi_so_version) \ $(OMPI_LIBMPI_EXTRA_LDFLAGS) +# The MPI Standard ABI library +libmpi_abi_la_SOURCES = +libmpi_abi_la_LIBADD = \ + libopen_mpi.la \ + mpi/c/libmpi_c_abi.la + # included subdirectory Makefile.am's and appended-to variables headers = -noinst_LTLIBRARIES = include_HEADERS = EXTRA_DIST = lib@OMPI_LIBMPI_NAME@_la_SOURCES += $(headers) +dist_ompidata_DATA = +libopen_mpi_la_SOURCES += $(headers) # Conditionally install the header files diff --git a/ompi/attribute/Makefile.am b/ompi/attribute/Makefile.am index cb1193deb2f..0418c1c0cc7 100644 --- a/ompi/attribute/Makefile.am +++ b/ompi/attribute/Makefile.am @@ -22,6 +22,6 @@ headers += \ attribute/attribute.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ attribute/attribute.c \ attribute/attribute_predefined.c diff --git a/ompi/class/Makefile.am b/ompi/class/Makefile.am index 7784da8ad69..ea755a11f3d 100644 --- a/ompi/class/Makefile.am +++ b/ompi/class/Makefile.am @@ -23,6 +23,5 @@ headers += \ class/ompi_seq_tracker.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ class/ompi_seq_tracker.c - diff --git a/ompi/communicator/Makefile.am b/ompi/communicator/Makefile.am index e1d25ad1026..8700ae88f48 100644 --- a/ompi/communicator/Makefile.am +++ b/ompi/communicator/Makefile.am @@ -29,14 +29,14 @@ headers += \ communicator/communicator.h \ communicator/comm_request.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ communicator/comm_init.c \ communicator/comm.c \ communicator/comm_cid.c \ communicator/comm_request.c if WANT_FT_MPI -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ communicator/ft/comm_ft.c communicator/ft/comm_ft_reliable_bcast.c communicator/ft/comm_ft_propagator.c communicator/ft/comm_ft_detector.c communicator/ft/comm_ft_revoke.c endif # WANT_FT_MPI diff --git a/ompi/dpm/Makefile.am b/ompi/dpm/Makefile.am index 02562525b9f..6e32c781ca5 100644 --- a/ompi/dpm/Makefile.am +++ b/ompi/dpm/Makefile.am @@ -17,5 +17,5 @@ EXTRA_DIST += dpm/help-dpm.txt headers += \ dpm/dpm.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ dpm/dpm.c diff --git a/ompi/errhandler/Makefile.am b/ompi/errhandler/Makefile.am index 9f94623a9ff..f8a84c249a1 100644 --- a/ompi/errhandler/Makefile.am +++ b/ompi/errhandler/Makefile.am @@ -30,7 +30,7 @@ headers += \ errhandler/errhandler.h \ errhandler/errhandler_predefined.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ errhandler/errhandler.c \ errhandler/errhandler_invoke.c \ errhandler/errhandler_predefined.c \ diff --git a/ompi/file/Makefile.am b/ompi/file/Makefile.am index e7d846ddde8..b78a18962e7 100644 --- a/ompi/file/Makefile.am +++ b/ompi/file/Makefile.am @@ -22,5 +22,5 @@ headers += \ file/file.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ file/file.c diff --git a/ompi/group/Makefile.am b/ompi/group/Makefile.am index f92a900da8d..850173c4d9f 100644 --- a/ompi/group/Makefile.am +++ b/ompi/group/Makefile.am @@ -25,7 +25,7 @@ headers += \ group/group.h \ group/group_dbg.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ group/group.c \ group/group_init.c \ group/group_set_rank.c \ diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index e838fe66061..f9ded080d7c 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -1433,6 +1433,10 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub; /* * MPI API */ +#ifndef OMPI_NO_MPI_PROTOTYPES +OMPI_DECLSPEC int MPI_Abi_supported(int *flag); +OMPI_DECLSPEC int MPI_Abi_version(int *abi_major, int *abi_minor); +OMPI_DECLSPEC int MPI_Abi_details(int *buflen, char *details, MPI_Info *info); OMPI_DECLSPEC int MPI_Abort(MPI_Comm comm, int errorcode); OMPI_DECLSPEC int MPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, @@ -2169,8 +2173,6 @@ OMPI_DECLSPEC int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int sou int tag, MPI_Comm comm, MPI_Status *status); OMPI_DECLSPEC int MPI_Recv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status); -OMPI_DECLSPEC int MPI_Recv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source, - int tag, MPI_Comm comm, MPI_Status *status); OMPI_DECLSPEC int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); OMPI_DECLSPEC int MPI_Reduce_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, @@ -3328,8 +3330,6 @@ OMPI_DECLSPEC int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int so int tag, MPI_Comm comm, MPI_Status *status); OMPI_DECLSPEC int PMPI_Recv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status); -OMPI_DECLSPEC int PMPI_Recv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source, - int tag, MPI_Comm comm, MPI_Status *status); OMPI_DECLSPEC int PMPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); OMPI_DECLSPEC int PMPI_Reduce_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype, @@ -4092,6 +4092,9 @@ OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub) #define MPI_Type_ub(...) THIS_FUNCTION_WAS_REMOVED_IN_MPI30(MPI_Type_ub, MPI_Type_get_extent) #endif +#endif /* OMPI_NO_MPI_PROTOTYPES */ + + #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/ompi/instance/Makefile.am b/ompi/instance/Makefile.am index 2ee7f5d59a3..73bb25273be 100644 --- a/ompi/instance/Makefile.am +++ b/ompi/instance/Makefile.am @@ -23,4 +23,4 @@ headers += instance/instance.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += instance/instance.c +libopen_mpi_la_SOURCES += instance/instance.c diff --git a/ompi/interlib/Makefile.am b/ompi/interlib/Makefile.am index 1a40fe8b260..d80d1d3d937 100644 --- a/ompi/interlib/Makefile.am +++ b/ompi/interlib/Makefile.am @@ -25,5 +25,5 @@ headers += \ interlib/interlib.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ interlib/interlib.c diff --git a/ompi/mca/bml/r2/Makefile.am b/ompi/mca/bml/r2/Makefile.am index 0fdb3e636f3..ea4e7eccc0e 100644 --- a/ompi/mca/bml/r2/Makefile.am +++ b/ompi/mca/bml/r2/Makefile.am @@ -37,7 +37,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_bml_r2_la_SOURCES = $(r2_sources) mca_bml_r2_la_LDFLAGS = -module -avoid-version -mca_bml_r2_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_bml_r2_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_bml_r2_la_SOURCES = $(r2_sources) diff --git a/ompi/mca/coll/basic/Makefile.am b/ompi/mca/coll/basic/Makefile.am index 8e1562c12f9..ad89fe227fb 100644 --- a/ompi/mca/coll/basic/Makefile.am +++ b/ompi/mca/coll/basic/Makefile.am @@ -63,7 +63,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_coll_basic_la_SOURCES = $(sources) mca_coll_basic_la_LDFLAGS = -module -avoid-version -mca_coll_basic_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_coll_basic_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_coll_basic_la_SOURCES =$(sources) diff --git a/ompi/mca/coll/demo/Makefile.am b/ompi/mca/coll/demo/Makefile.am index 1246c5d4389..2ae6731cefa 100644 --- a/ompi/mca/coll/demo/Makefile.am +++ b/ompi/mca/coll/demo/Makefile.am @@ -57,7 +57,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_coll_demo_la_SOURCES = $(sources) mca_coll_demo_la_LDFLAGS = -module -avoid-version -mca_coll_demo_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_coll_demo_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_coll_demo_la_SOURCES = $(sources) diff --git a/ompi/mca/coll/hcoll/Makefile.am b/ompi/mca/coll/hcoll/Makefile.am index 37ec1c96c92..254a97c9a0b 100644 --- a/ompi/mca/coll/hcoll/Makefile.am +++ b/ompi/mca/coll/hcoll/Makefile.am @@ -39,7 +39,7 @@ endif mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_coll_hcoll_la_SOURCES = $(coll_hcoll_sources) -mca_coll_hcoll_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_coll_hcoll_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(coll_hcoll_LIBS) mca_coll_hcoll_la_LDFLAGS = -module -avoid-version $(coll_hcoll_LDFLAGS) diff --git a/ompi/mca/coll/inter/Makefile.am b/ompi/mca/coll/inter/Makefile.am index ea9188cffd4..c82b9f513b9 100644 --- a/ompi/mca/coll/inter/Makefile.am +++ b/ompi/mca/coll/inter/Makefile.am @@ -34,7 +34,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_coll_inter_la_SOURCES = $(sources) mca_coll_inter_la_LDFLAGS = -module -avoid-version -mca_coll_inter_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_coll_inter_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_coll_inter_la_SOURCES = $(sources) diff --git a/ompi/mca/coll/libnbc/Makefile.am b/ompi/mca/coll/libnbc/Makefile.am index 4afa48cdd2c..09b30b4e172 100644 --- a/ompi/mca/coll/libnbc/Makefile.am +++ b/ompi/mca/coll/libnbc/Makefile.am @@ -72,7 +72,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_coll_libnbc_la_SOURCES = $(sources) mca_coll_libnbc_la_LDFLAGS = -module -avoid-version -mca_coll_libnbc_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_coll_libnbc_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_coll_libnbc_la_SOURCES =$(sources) diff --git a/ompi/mca/coll/monitoring/Makefile.am b/ompi/mca/coll/monitoring/Makefile.am index 9c6e96b1c52..cb1eed8b135 100644 --- a/ompi/mca/coll/monitoring/Makefile.am +++ b/ompi/mca/coll/monitoring/Makefile.am @@ -46,7 +46,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_coll_monitoring_la_SOURCES = $(monitoring_sources) mca_coll_monitoring_la_LDFLAGS = -module -avoid-version -mca_coll_monitoring_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_coll_monitoring_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(OMPI_TOP_BUILDDIR)/ompi/mca/common/monitoring/libmca_common_monitoring.la noinst_LTLIBRARIES = $(component_noinst) diff --git a/ompi/mca/coll/portals4/Makefile.am b/ompi/mca/coll/portals4/Makefile.am index 8f9babbd13b..7070e01f2e6 100644 --- a/ompi/mca/coll/portals4/Makefile.am +++ b/ompi/mca/coll/portals4/Makefile.am @@ -33,7 +33,7 @@ AM_CPPFLAGS = $(coll_portals4_CPPFLAGS) mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_coll_portals4_la_SOURCES = $(local_sources) -mca_coll_portals4_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_coll_portals4_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(coll_portals4_LIBS) mca_coll_portals4_la_LDFLAGS = -module -avoid-version $(coll_portals4_LDFLAGS) diff --git a/ompi/mca/coll/self/Makefile.am b/ompi/mca/coll/self/Makefile.am index 6b06aab4028..c4e5e13dc86 100644 --- a/ompi/mca/coll/self/Makefile.am +++ b/ompi/mca/coll/self/Makefile.am @@ -55,7 +55,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_coll_self_la_SOURCES = $(sources) mca_coll_self_la_LDFLAGS = -module -avoid-version -mca_coll_self_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_coll_self_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_coll_self_la_SOURCES =$(sources) diff --git a/ompi/mca/coll/sync/Makefile.am b/ompi/mca/coll/sync/Makefile.am index dad4f8f7138..d1fcfff91b5 100644 --- a/ompi/mca/coll/sync/Makefile.am +++ b/ompi/mca/coll/sync/Makefile.am @@ -46,7 +46,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_coll_sync_la_SOURCES = $(sources) mca_coll_sync_la_LDFLAGS = -module -avoid-version -mca_coll_sync_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_coll_sync_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_coll_sync_la_SOURCES =$(sources) diff --git a/ompi/mca/coll/tuned/Makefile.am b/ompi/mca/coll/tuned/Makefile.am index 82be7bb72aa..73f1f22a171 100644 --- a/ompi/mca/coll/tuned/Makefile.am +++ b/ompi/mca/coll/tuned/Makefile.am @@ -61,7 +61,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_coll_tuned_la_SOURCES = $(sources) mca_coll_tuned_la_LDFLAGS = -module -avoid-version -mca_coll_tuned_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_coll_tuned_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_coll_tuned_la_SOURCES =$(sources) diff --git a/ompi/mca/coll/ucc/Makefile.am b/ompi/mca/coll/ucc/Makefile.am index 8d2f4c7c3eb..95ec95401ac 100644 --- a/ompi/mca/coll/ucc/Makefile.am +++ b/ompi/mca/coll/ucc/Makefile.am @@ -50,7 +50,7 @@ endif mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_coll_ucc_la_SOURCES = $(coll_ucc_sources) -mca_coll_ucc_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_coll_ucc_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(coll_ucc_LIBS) mca_coll_ucc_la_LDFLAGS = -module -avoid-version $(coll_ucc_LDFLAGS) diff --git a/ompi/mca/common/monitoring/Makefile.am b/ompi/mca/common/monitoring/Makefile.am index 28f4d442d27..d0dfa439f7d 100644 --- a/ompi/mca/common/monitoring/Makefile.am +++ b/ompi/mca/common/monitoring/Makefile.am @@ -34,7 +34,7 @@ endif ompi_monitoring_prof_la_LDFLAGS= \ -module -avoid-version -shared $(WRAPPER_EXTRA_LDFLAGS) ompi_monitoring_prof_la_LIBADD = \ - $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ + $(top_builddir)/ompi/libopen-mpi.la \ $(top_builddir)/opal/lib@OPAL_LIB_NAME@.la if OPAL_INSTALL_BINARIES diff --git a/ompi/mca/fbtl/ime/Makefile.am b/ompi/mca/fbtl/ime/Makefile.am index 2dfebbcb0c0..41908982b5e 100644 --- a/ompi/mca/fbtl/ime/Makefile.am +++ b/ompi/mca/fbtl/ime/Makefile.am @@ -30,7 +30,7 @@ AM_CPPFLAGS = $(fbtl_ime_CPPFLAGS) mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_fbtl_ime_la_SOURCES = $(fbtl_ime_sources) -mca_fbtl_ime_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_fbtl_ime_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(fbtl_ime_LIBS) mca_fbtl_ime_la_LDFLAGS = -module -avoid-version $(fbtl_ime_LDFLAGS) diff --git a/ompi/mca/fbtl/posix/Makefile.am b/ompi/mca/fbtl/posix/Makefile.am index 1ce19cb09b7..37a98c30e48 100644 --- a/ompi/mca/fbtl/posix/Makefile.am +++ b/ompi/mca/fbtl/posix/Makefile.am @@ -34,7 +34,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_fbtl_posix_la_SOURCES = $(sources) mca_fbtl_posix_la_LDFLAGS = -module -avoid-version -mca_fbtl_posix_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_fbtl_posix_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(OMPI_TOP_BUILDDIR)/ompi/mca/common/ompio/libmca_common_ompio.la noinst_LTLIBRARIES = $(component_noinst) diff --git a/ompi/mca/fs/ime/Makefile.am b/ompi/mca/fs/ime/Makefile.am index db15704e732..9afbc08115a 100644 --- a/ompi/mca/fs/ime/Makefile.am +++ b/ompi/mca/fs/ime/Makefile.am @@ -37,7 +37,7 @@ AM_CPPFLAGS = $(fs_ime_CPPFLAGS) mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_fs_ime_la_SOURCES = $(fs_ime_sources) -mca_fs_ime_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_fs_ime_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(fs_ime_LIBS) mca_fs_ime_la_LDFLAGS = -module -avoid-version $(fs_ime_LDFLAGS) diff --git a/ompi/mca/fs/lustre/Makefile.am b/ompi/mca/fs/lustre/Makefile.am index bf4f487de7a..9f862506c7d 100644 --- a/ompi/mca/fs/lustre/Makefile.am +++ b/ompi/mca/fs/lustre/Makefile.am @@ -43,7 +43,7 @@ AM_CPPFLAGS = $(fs_lustre_CPPFLAGS) mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_fs_lustre_la_SOURCES = $(fs_lustre_sources) -mca_fs_lustre_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_fs_lustre_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(fs_lustre_LIBS) mca_fs_lustre_la_LDFLAGS = -module -avoid-version $(fs_lustre_LDFLAGS) diff --git a/ompi/mca/fs/ufs/Makefile.am b/ompi/mca/fs/ufs/Makefile.am index 50201a80ca2..aa2e4b728fd 100644 --- a/ompi/mca/fs/ufs/Makefile.am +++ b/ompi/mca/fs/ufs/Makefile.am @@ -34,7 +34,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_fs_ufs_la_SOURCES = $(sources) mca_fs_ufs_la_LDFLAGS = -module -avoid-version -mca_fs_ufs_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_fs_ufs_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_fs_ufs_la_SOURCES = $(sources) diff --git a/ompi/mca/hook/comm_method/hook_comm_method_fns.c b/ompi/mca/hook/comm_method/hook_comm_method_fns.c index b1ab8c200b3..303538ac15f 100644 --- a/ompi/mca/hook/comm_method/hook_comm_method_fns.c +++ b/ompi/mca/hook/comm_method/hook_comm_method_fns.c @@ -511,6 +511,7 @@ ompi_report_comm_methods(int called_from_location) free(p); } +#if 0 MPI_Datatype mydt; MPI_Op myop; MPI_Type_contiguous(sizeof(comm_method_string_conversion_t), MPI_BYTE, &mydt); @@ -521,6 +522,7 @@ ompi_report_comm_methods(int called_from_location) leader_comm->c_coll->coll_allreduce_module); MPI_Op_free(&myop); MPI_Type_free(&mydt); +#endif // Sort communication method string arrays after reduction qsort(&comm_method_string_conversion.str[1], diff --git a/ompi/mca/mtl/ofi/Makefile.am b/ompi/mca/mtl/ofi/Makefile.am index 5842abd3018..fa46bba2d56 100644 --- a/ompi/mca/mtl/ofi/Makefile.am +++ b/ompi/mca/mtl/ofi/Makefile.am @@ -80,7 +80,7 @@ mca_mtl_ofi_la_SOURCES = $(mtl_ofi_sources) mca_mtl_ofi_la_LDFLAGS = \ $(mtl_ofi_LDFLAGS) \ -module -avoid-version -mca_mtl_ofi_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_mtl_ofi_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(OPAL_TOP_BUILDDIR)/opal/mca/common/ofi/lib@OPAL_LIB_NAME@mca_common_ofi.la \ $(mtl_ofi_LIBS) diff --git a/ompi/mca/mtl/portals4/Makefile.am b/ompi/mca/mtl/portals4/Makefile.am index df3f13a5586..437b9343d24 100644 --- a/ompi/mca/mtl/portals4/Makefile.am +++ b/ompi/mca/mtl/portals4/Makefile.am @@ -60,7 +60,7 @@ endif mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_mtl_portals4_la_SOURCES = $(local_sources) -mca_mtl_portals4_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_mtl_portals4_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(mtl_portals4_LIBS) mca_mtl_portals4_la_LDFLAGS = -module -avoid-version $(mtl_portals4_LDFLAGS) diff --git a/ompi/mca/mtl/psm2/Makefile.am b/ompi/mca/mtl/psm2/Makefile.am index 8b889bf726a..af1878c4f08 100644 --- a/ompi/mca/mtl/psm2/Makefile.am +++ b/ompi/mca/mtl/psm2/Makefile.am @@ -59,7 +59,7 @@ endif mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_mtl_psm2_la_SOURCES = $(mtl_psm2_sources) -mca_mtl_psm2_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_mtl_psm2_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(mtl_psm2_LIBS) mca_mtl_psm2_la_LDFLAGS = -module -avoid-version $(mtl_psm2_LDFLAGS) diff --git a/ompi/mca/op/avx/Makefile.am b/ompi/mca/op/avx/Makefile.am index b1d84d90b33..022c2dc7da0 100644 --- a/ompi/mca/op/avx/Makefile.am +++ b/ompi/mca/op/avx/Makefile.am @@ -86,7 +86,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_op_avx_la_SOURCES = $(sources) mca_op_avx_la_LIBADD = $(specialized_op_libs) -mca_op_avx_la_LDFLAGS = -module -avoid-version $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_op_avx_la_LDFLAGS = -module -avoid-version $(top_builddir)/ompi/libopen-mpi.la # Specific information for static builds. diff --git a/ompi/mca/op/example/Makefile.am b/ompi/mca/op/example/Makefile.am index e0990e52716..5b2f80ee706 100644 --- a/ompi/mca/op/example/Makefile.am +++ b/ompi/mca/op/example/Makefile.am @@ -71,7 +71,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component) mca_op_example_la_SOURCES = $(component_sources) mca_op_example_la_LDFLAGS = -module -avoid-version -mca_op_example_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_op_example_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la # Specific information for static builds. # diff --git a/ompi/mca/osc/monitoring/Makefile.am b/ompi/mca/osc/monitoring/Makefile.am index a90ce38c6e3..2567b2a4b54 100644 --- a/ompi/mca/osc/monitoring/Makefile.am +++ b/ompi/mca/osc/monitoring/Makefile.am @@ -31,7 +31,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_osc_monitoring_la_SOURCES = $(monitoring_sources) mca_osc_monitoring_la_LDFLAGS = -module -avoid-version -mca_osc_monitoring_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_osc_monitoring_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(OMPI_TOP_BUILDDIR)/ompi/mca/common/monitoring/libmca_common_monitoring.la noinst_LTLIBRARIES = $(component_noinst) diff --git a/ompi/mca/osc/portals4/Makefile.am b/ompi/mca/osc/portals4/Makefile.am index a7f5a061254..3971fafa7ac 100644 --- a/ompi/mca/osc/portals4/Makefile.am +++ b/ompi/mca/osc/portals4/Makefile.am @@ -36,7 +36,7 @@ endif mcacomponentdir = $(pkglibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_osc_portals4_la_SOURCES = $(portals4_sources) -mca_osc_portals4_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_osc_portals4_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(osc_portals4_LIBS) mca_osc_portals4_la_LDFLAGS = -module -avoid-version $(osc_portals4_LDFLAGS) diff --git a/ompi/mca/osc/rdma/Makefile.am b/ompi/mca/osc/rdma/Makefile.am index 4757ce6aa93..0af844602c1 100644 --- a/ompi/mca/osc/rdma/Makefile.am +++ b/ompi/mca/osc/rdma/Makefile.am @@ -63,7 +63,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_osc_rdma_la_SOURCES = $(rdma_sources) mca_osc_rdma_la_LDFLAGS = -module -avoid-version -mca_osc_rdma_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_osc_rdma_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_osc_rdma_la_SOURCES = $(rdma_sources) diff --git a/ompi/mca/osc/sm/Makefile.am b/ompi/mca/osc/sm/Makefile.am index 01d230d7bf3..db6aedf13f8 100644 --- a/ompi/mca/osc/sm/Makefile.am +++ b/ompi/mca/osc/sm/Makefile.am @@ -34,7 +34,7 @@ endif mcacomponentdir = $(pkglibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_osc_sm_la_SOURCES = $(sm_sources) -mca_osc_sm_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_osc_sm_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(osc_sm_LIBS) mca_osc_sm_la_LDFLAGS = -module -avoid-version $(osc_sm_LDFLAGS) diff --git a/ompi/mca/osc/ucx/Makefile.am b/ompi/mca/osc/ucx/Makefile.am index 77184d83584..4c3fbd6da91 100644 --- a/ompi/mca/osc/ucx/Makefile.am +++ b/ompi/mca/osc/ucx/Makefile.am @@ -34,7 +34,7 @@ endif mcacomponentdir = $(pkglibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_osc_ucx_la_SOURCES = $(ucx_sources) -mca_osc_ucx_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la $(osc_ucx_LIBS) \ +mca_osc_ucx_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la $(osc_ucx_LIBS) \ $(OPAL_TOP_BUILDDIR)/opal/mca/common/ucx/lib@OPAL_LIB_NAME@mca_common_ucx.la mca_osc_ucx_la_LDFLAGS = -module -avoid-version $(osc_ucx_LDFLAGS) diff --git a/ompi/mca/part/persist/Makefile.am b/ompi/mca/part/persist/Makefile.am index fab2975e92b..910ea0a59ad 100644 --- a/ompi/mca/part/persist/Makefile.am +++ b/ompi/mca/part/persist/Makefile.am @@ -42,7 +42,7 @@ local_sources = \ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_part_persist_la_SOURCES = $(local_sources) -mca_part_persist_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_part_persist_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(part_persist_LIBS) mca_part_persist_la_LDFLAGS = -module -avoid-version $(part_persist_LDFLAGS) diff --git a/ompi/mca/pml/cm/Makefile.am b/ompi/mca/pml/cm/Makefile.am index d1a43fe8841..fa7327d6372 100644 --- a/ompi/mca/pml/cm/Makefile.am +++ b/ompi/mca/pml/cm/Makefile.am @@ -43,7 +43,7 @@ local_sources = \ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_pml_cm_la_SOURCES = $(local_sources) -mca_pml_cm_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_pml_cm_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(pml_cm_LIBS) mca_pml_cm_la_LDFLAGS = -module -avoid-version $(pml_cm_LDFLAGS) diff --git a/ompi/mca/pml/example/Makefile.am b/ompi/mca/pml/example/Makefile.am index 4c3588848a9..2ea3b1bb269 100644 --- a/ompi/mca/pml/example/Makefile.am +++ b/ompi/mca/pml/example/Makefile.am @@ -53,7 +53,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_pml_example_la_SOURCES = $(local_sources) mca_pml_example_la_LDFLAGS = -module -avoid-version -mca_pml_example_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_pml_example_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_pml_example_la_SOURCES = $(local_sources) diff --git a/ompi/mca/pml/monitoring/Makefile.am b/ompi/mca/pml/monitoring/Makefile.am index 431f5be9ba9..6e4215de807 100644 --- a/ompi/mca/pml/monitoring/Makefile.am +++ b/ompi/mca/pml/monitoring/Makefile.am @@ -32,7 +32,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_pml_monitoring_la_SOURCES = $(monitoring_sources) mca_pml_monitoring_la_LDFLAGS = -module -avoid-version -mca_pml_monitoring_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ +mca_pml_monitoring_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la \ $(OMPI_TOP_BUILDDIR)/ompi/mca/common/monitoring/libmca_common_monitoring.la noinst_LTLIBRARIES = $(component_noinst) diff --git a/ompi/mca/pml/ob1/Makefile.am b/ompi/mca/pml/ob1/Makefile.am index 38487f5a2e6..4a84f9ec69b 100644 --- a/ompi/mca/pml/ob1/Makefile.am +++ b/ompi/mca/pml/ob1/Makefile.am @@ -72,7 +72,7 @@ mcacomponent_LTLIBRARIES = $(component_install) mca_pml_ob1_la_SOURCES = $(ob1_sources) mca_pml_ob1_la_LDFLAGS = -module -avoid-version -mca_pml_ob1_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_pml_ob1_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_pml_ob1_la_SOURCES = $(ob1_sources) diff --git a/ompi/mca/pml/ucx/Makefile.am b/ompi/mca/pml/ucx/Makefile.am index fe6c8e47c35..04ab6a445a0 100644 --- a/ompi/mca/pml/ucx/Makefile.am +++ b/ompi/mca/pml/ucx/Makefile.am @@ -37,7 +37,7 @@ endif mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_pml_ucx_la_SOURCES = $(local_sources) -mca_pml_ucx_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la $(pml_ucx_LIBS) \ +mca_pml_ucx_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la $(pml_ucx_LIBS) \ $(OPAL_TOP_BUILDDIR)/opal/mca/common/ucx/lib@OPAL_LIB_NAME@mca_common_ucx.la mca_pml_ucx_la_LDFLAGS = -module -avoid-version $(pml_ucx_LDFLAGS) diff --git a/ompi/mca/pml/v/Makefile.am b/ompi/mca/pml/v/Makefile.am index 3fd61be21df..e68c373e09a 100644 --- a/ompi/mca/pml/v/Makefile.am +++ b/ompi/mca/pml/v/Makefile.am @@ -32,7 +32,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_pml_v_la_SOURCES = $(local_sources) mca_pml_v_la_LDFLAGS = -module -avoid-version -mca_pml_v_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_pml_v_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_pml_v_la_SOURCES = $(local_sources) diff --git a/ompi/mca/topo/basic/Makefile.am b/ompi/mca/topo/basic/Makefile.am index 9ed7b26dadd..907f5ffa282 100644 --- a/ompi/mca/topo/basic/Makefile.am +++ b/ompi/mca/topo/basic/Makefile.am @@ -37,7 +37,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component) mca_topo_basic_la_SOURCES = $(component_sources) mca_topo_basic_la_LDFLAGS = -module -avoid-version -mca_topo_basic_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_topo_basic_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(lib) libmca_topo_basic_la_SOURCES = $(lib_sources) diff --git a/ompi/mca/topo/example/Makefile.am b/ompi/mca/topo/example/Makefile.am index 22acd1a360f..29e78f455a0 100644 --- a/ompi/mca/topo/example/Makefile.am +++ b/ompi/mca/topo/example/Makefile.am @@ -46,7 +46,7 @@ mcacomponentdir = $(pkglibdir) mcacomponent_LTLIBRARIES = $(component) mca_topo_example_la_SOURCES = $(component_sources) mca_topo_example_la_LDFLAGS = -module -avoid-version -mca_topo_example_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_topo_example_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(lib) libmca_topo_example_la_SOURCES = $(lib_sources) diff --git a/ompi/mca/topo/treematch/Makefile.am b/ompi/mca/topo/treematch/Makefile.am index e17d4e18085..eeb694a136f 100644 --- a/ompi/mca/topo/treematch/Makefile.am +++ b/ompi/mca/topo/treematch/Makefile.am @@ -43,7 +43,7 @@ mcacomponentdir = $(pkglibdir) mcacomponent_LTLIBRARIES = $(component) mca_topo_treematch_la_SOURCES = $(component_sources) mca_topo_treematch_la_LDFLAGS = -module -avoid-version $(topo_treematch_LDFLAGS) -mca_topo_treematch_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la $(topo_treematch_LIBS) +mca_topo_treematch_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la $(topo_treematch_LIBS) noinst_LTLIBRARIES = $(lib) libmca_topo_treematch_la_SOURCES = $(lib_sources) diff --git a/ompi/mca/vprotocol/example/Makefile.am b/ompi/mca/vprotocol/example/Makefile.am index 64ec3e4cca0..2d00dbbb1fc 100644 --- a/ompi/mca/vprotocol/example/Makefile.am +++ b/ompi/mca/vprotocol/example/Makefile.am @@ -37,7 +37,7 @@ local_sources = \ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_vprotocol_example_la_SOURCES = $(local_sources) -mca_vprotocol_example_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_vprotocol_example_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la mca_vprotocol_example_la_CFLAGS = mca_vprotocol_example_la_LDFLAGS = -module -avoid-version diff --git a/ompi/mca/vprotocol/pessimist/Makefile.am b/ompi/mca/vprotocol/pessimist/Makefile.am index f037b9f6d00..8f931fccb8e 100644 --- a/ompi/mca/vprotocol/pessimist/Makefile.am +++ b/ompi/mca/vprotocol/pessimist/Makefile.am @@ -50,7 +50,7 @@ mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_vprotocol_pessimist_la_SOURCES = $(local_sources) mca_vprotocol_pessimist_la_LDFLAGS = -module -avoid-version -mca_vprotocol_pessimist_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la +mca_vprotocol_pessimist_la_LIBADD = $(top_builddir)/ompi/libopen-mpi.la noinst_LTLIBRARIES = $(component_noinst) libmca_vprotocol_pessimist_la_SOURCES = $(local_sources) diff --git a/ompi/message/Makefile.am b/ompi/message/Makefile.am index 8fc7c07e4cd..b5650a5f81d 100644 --- a/ompi/message/Makefile.am +++ b/ompi/message/Makefile.am @@ -24,5 +24,5 @@ headers += \ message/message.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ message/message.c diff --git a/ompi/mpi/bindings/ompi_bindings/c.py b/ompi/mpi/bindings/ompi_bindings/c.py index 362f481d11b..9957c56ad7b 100644 --- a/ompi/mpi/bindings/ompi_bindings/c.py +++ b/ompi/mpi/bindings/ompi_bindings/c.py @@ -137,18 +137,57 @@ def generate_comm_convert_fn_intern_to_abi(self): def generate_info_convert_fn(self): self.generic_convert(ConvertFuncs.INFO, 'info', 'MPI_Info', consts.RESERVED_INFOS) + def generate_info_convert_fn_intern_to_abi(self): + self.generic_convert_reverse(ConvertOMPIToStandard.INFO, 'info', 'MPI_Info', consts.RESERVED_INFOS) + + def generate_file_convert_fn(self): + self.generic_convert(ConvertFuncs.FILE, 'file', 'MPI_File', consts.RESERVED_FILES) + def generate_file_convert_fn_intern_to_abi(self): - self.generic_convert_reverse(ConvertFuncs.FILE, 'file', 'MPI_File', consts.RESERVED_FILES) + self.generic_convert_reverse(ConvertOMPIToStandard.FILE, 'file', 'MPI_File', consts.RESERVED_FILES) def generate_datatype_convert_fn(self): self.generic_convert(ConvertFuncs.DATATYPE, 'datatype', 'MPI_Datatype', consts.PREDEFINED_DATATYPES) + def generate_datatype_convert_fn_intern_to_abi(self): + self.generic_convert_reverse(ConvertOMPIToStandard.DATATYPE, 'datatype', 'MPI_Datatype', consts.PREDEFINED_DATATYPES) + + def generate_errhandler_convert_fn(self): + self.generic_convert(ConvertFuncs.ERRHANDLER, 'errorhandler', 'MPI_Errhandler', consts.RESERVED_ERRHANDLERS) + + def generate_errhandler_convert_fn_intern_to_abi(self): + self.generic_convert_reverse(ConvertOMPIToStandard.ERRHANDLER, 'errorhandler', 'MPI_Errhandler', consts.RESERVED_ERRHANDLERS) + + def generate_group_convert_fn(self): + self.generic_convert(ConvertFuncs.GROUP, 'group', 'MPI_Group', consts.RESERVED_GROUPS) + + def generate_group_convert_fn_intern_to_abi(self): + self.generic_convert_reverse(ConvertOMPIToStandard.GROUP, 'group', 'MPI_Group', consts.RESERVED_GROUPS) + + def generate_message_convert_fn(self): + self.generic_convert(ConvertFuncs.MESSAGE, 'message', 'MPI_Message', consts.RESERVED_MESSAGES) + + def generate_message_convert_fn_intern_to_abi(self): + self.generic_convert_reverse(ConvertOMPIToStandard.MESSAGE, 'message', 'MPI_Message', consts.RESERVED_MESSAGES) + def generate_op_convert_fn(self): self.generic_convert(ConvertFuncs.OP, 'op', 'MPI_Op', consts.COLLECTIVE_OPERATIONS) + def generate_op_convert_fn_intern_to_abi(self): + self.generic_convert_reverse(ConvertOMPIToStandard.OP, 'op', 'MPI_Op', consts.RESERVED_OPS) + + def generate_session_convert_fn(self): + self.generic_convert(ConvertFuncs.SESSION, 'session', 'MPI_Session', consts.RESERVED_SESSIONS) + + def generate_session_convert_fn_intern_to_abi(self): + self.generic_convert_reverse(ConvertOMPIToStandard.SESSION, 'session', 'MPI_Session', consts.RESERVED_SESSIONS) + def generate_win_convert_fn(self): self.generic_convert(ConvertFuncs.WIN, 'win', 'MPI_Win', consts.RESERVED_WINDOWS) + def generate_win_convert_fn_intern_to_abi(self): + self.generic_convert_reverse(ConvertOMPIToStandard.WIN, 'win', 'MPI_Win', consts.RESERVED_WINDOWS) + def generate_pointer_convert_fn(self, type_, fn_name, constants): abi_type = self.mangle_name(type_) self.dump(f'{consts.INLINE_ATTRS} void {fn_name}({abi_type} *ptr)') @@ -168,20 +207,40 @@ def generate_pointer_convert_fn(self, type_, fn_name, constants): def generate_request_convert_fn(self): self.generate_pointer_convert_fn('MPI_Request', ConvertFuncs.REQUEST, consts.RESERVED_REQUESTS) - def generate_file_convert_fn(self): - self.generate_pointer_convert_fn('MPI_File', ConvertFuncs.FILE, consts.RESERVED_FILES) + def generate_request_convert_fn_intern_to_abi(self): + self.generic_convert_reverse(ConvertOMPIToStandard.REQUEST, 'request', 'MPI_Request', consts.RESERVED_REQUESTS) + +# def generate_file_convert_fn(self): +# self.generate_pointer_convert_fn('MPI_File', ConvertFuncs.FILE, consts.RESERVED_FILES) def generate_status_convert_fn(self): type_ = 'MPI_Status' abi_type = self.mangle_name(type_) - self.dump(f'{consts.INLINE_ATTRS} void {ConvertFuncs.STATUS}({abi_type} *out, {type_} *inp)') + self.dump(f'{consts.INLINE_ATTRS} void {ConvertFuncs.STATUS}({type_} *out, {abi_type} *inp)') self.dump('{') + self.dump(' void *ptr = &out->_ucount;') self.dump(' out->MPI_SOURCE = inp->MPI_SOURCE;') self.dump(' out->MPI_TAG = inp->MPI_TAG;') + self.dump(' out->_cancelled = inp->MPI_Internal[0];') + self.dump(' memcpy(ptr, &inp->MPI_Internal[1],sizeof(out->_ucount));') self.dump(f' out->MPI_ERROR = {ConvertFuncs.ERROR_CLASS}(inp->MPI_ERROR);') # Ignoring the private fields for now self.dump('}') + def generate_status_convert_fn_intern_to_abi(self): + type_ = 'MPI_Status' + abi_type = self.mangle_name(type_) + self.dump(f'{consts.INLINE_ATTRS} void {ConvertOMPIToStandard.STATUS}({abi_type} *out, {type_} *inp)') + self.dump('{') + self.dump(' void *ptr = &out->MPI_Internal[1];') + self.dump(' out->MPI_SOURCE = inp->MPI_SOURCE;') + self.dump(' out->MPI_TAG = inp->MPI_TAG;') + self.dump(' out->MPI_Internal[0] =inp->_cancelled;') + self.dump(' memcpy(ptr, &inp->_ucount,sizeof(inp->_ucount));') +# self.dump(f' out->MPI_ERROR = {ConvertOMPIToStandard.ERROR_CLASS}(inp->MPI_ERROR);') + # Ignoring the private fields for now + self.dump('}') + def define(self, type_, name, value): self.dump(f'#define {name} OMPI_CAST_CONSTANT({type_}, {value})') @@ -217,12 +276,17 @@ def dump_header(self): self.dump() self.define_all('MPI_Datatype', consts.PREDEFINED_DATATYPES) - self.define_all('MPI_Op', COLLECTIVE_OPERATIONS) + self.define_all('MPI_Op', consts.COLLECTIVE_OPERATIONS) + self.define_all('MPI_Op', consts.RESERVED_OPS) self.define_all('MPI_Comm', consts.RESERVED_COMMUNICATORS) + self.define_all('MPI_Errhandler', consts.RESERVED_ERRHANDLERS) + self.define_all('MPI_Group', consts.RESERVED_GROUPS) self.define_all('MPI_Request', consts.RESERVED_REQUESTS) + self.define_all('MPI_Session', consts.RESERVED_SESSIONS) self.define_all('MPI_Win', consts.RESERVED_WINDOWS) self.define_all('MPI_Info', consts.RESERVED_INFOS) self.define_all('MPI_File', consts.RESERVED_FILES) + self.define_all('MPI_Message', consts.RESERVED_MESSAGES) for name, value in consts.VARIOUS_CONSTANTS.items(): self.dump(f'#define {self.mangle_name(name)} {value}') @@ -251,13 +315,17 @@ def dump_header(self): int MPI_SOURCE; int MPI_TAG; int MPI_ERROR; - int mpi_abi_private[5]; + int MPI_Internal[5]; };""") self.dump(f'typedef struct MPI_Status_ABI {self.mangle_name("MPI_Status")};') self.dump() + # user functions + self.dump('typedef int (MPI_Copy_function)(MPI_Comm_ABI_INTERNAL, int, void *, void *, void *, int *);') + self.dump('typedef int (MPI_Delete_function)(MPI_Comm_ABI_INTERNAL, int, void *, void *);') # Function signatures for sig in self.signatures: self.dump(f'{sig};') +# print("Working on signature " + str(sig)) self.dump('int MPI_Abi_details(int *buflen, char *details, MPI_Info *info);') self.dump('int MPI_Abi_supported(int *flag);') self.dump('int MPI_Abi_version(int *abi_major, int *abi_minor);') @@ -267,12 +335,27 @@ def dump_header(self): self.generate_comm_convert_fn() self.generate_comm_convert_fn_intern_to_abi() self.generate_info_convert_fn() + self.generate_info_convert_fn_intern_to_abi() self.generate_file_convert_fn() + self.generate_file_convert_fn_intern_to_abi() + self.generate_group_convert_fn() + self.generate_group_convert_fn_intern_to_abi() self.generate_datatype_convert_fn() + self.generate_datatype_convert_fn_intern_to_abi() + self.generate_errhandler_convert_fn() + self.generate_errhandler_convert_fn_intern_to_abi() + self.generate_message_convert_fn() + self.generate_message_convert_fn_intern_to_abi() self.generate_op_convert_fn() + self.generate_op_convert_fn_intern_to_abi() + self.generate_session_convert_fn() + self.generate_session_convert_fn_intern_to_abi() self.generate_win_convert_fn() + self.generate_win_convert_fn_intern_to_abi() self.generate_request_convert_fn() + self.generate_request_convert_fn_intern_to_abi() self.generate_status_convert_fn() + self.generate_status_convert_fn_intern_to_abi() self.dump(""" #if defined(c_plusplus) || defined(__cplusplus) @@ -292,7 +375,7 @@ def print_profiling_header(fn_name, out): out.dump('#endif') -def print_cdefs_for_bigcount(fn_name, out, enable_count=False): +def print_cdefs_for_bigcount(out, enable_count=False): if enable_count: out.dump('#undef OMPI_BIGCOUNT_SRC') out.dump('#define OMPI_BIGCOUNT_SRC 1') @@ -304,14 +387,14 @@ def ompi_abi(base_name, template, out): """Generate the OMPI ABI functions.""" template.print_header(out) print_profiling_header(base_name, out) - print_cdefs_for_bigcount(base_name, out) + print_cdefs_for_bigcount(out) out.dump(template.prototype.signature(base_name, abi_type='ompi')) template.print_body(func_name=base_name, out=out) # Check if we need to generate the bigcount interface if util.prototype_has_bigcount(template.prototype): base_name_c = f'{base_name}_c' print_profiling_header(base_name_c, out) - print_cdefs_for_bigcount(base_name_c, out, enable_count=True) + print_cdefs_for_bigcount(out, enable_count=True) out.dump(template.prototype.signature(base_name_c, abi_type='ompi', enable_count=True)) template.print_body(func_name=base_name_c, out=out) @@ -326,15 +409,23 @@ def standard_abi(base_name, template, out): # Static internal function (add a random component to avoid conflicts) internal_name = f'ompi_abi_{template.prototype.name}' + print_cdefs_for_bigcount(out) internal_sig = template.prototype.signature(internal_name, abi_type='ompi', - enable_count=True) + enable_count=False) out.dump(consts.INLINE_ATTRS, internal_sig) template.print_body(func_name=base_name, out=out) - - def generate_function(prototype, fn_name, internal_fn, enable_count=False): + if util.prototype_has_bigcount(template.prototype): + internal_name = f'ompi_abi_{template.prototype.name}_c' + print_cdefs_for_bigcount(out, enable_count=True) + internal_sig = template.prototype.signature(internal_name, abi_type='ompi', + enable_count=True) + out.dump(consts.INLINE_ATTRS, internal_sig) + template.print_body(func_name=base_name, out=out) + + def generate_function(prototype, fn_name, internal_fn, out, enable_count=False): """Generate a function for the standard ABI.""" - print_profiling_header(fn_name) - print_cdefs_for_bigcount(fn_name,enable_count) + print_profiling_header(fn_name,out) +# print_cdefs_for_bigcount(out, enable_count) # Handle type conversions and arguments params = [param.construct(abi_type='standard') for param in prototype.params] @@ -344,6 +435,7 @@ def generate_function(prototype, fn_name, internal_fn, enable_count=False): return_type = prototype.return_type.construct(abi_type='standard') lines.append(f'{return_type.tmp_type_text()} ret_value;') for param in params: +# print("param = " + str(param) + " " + str(param.argument)) if param.init_code: lines.extend(param.init_code) pass_args = ', '.join(param.argument for param in params) @@ -359,10 +451,12 @@ def generate_function(prototype, fn_name, internal_fn, enable_count=False): out.dump(line) out.dump('}') - generate_function(template.prototype, base_name, internal_name) + internal_name = f'ompi_abi_{template.prototype.name}' + generate_function(template.prototype, base_name, internal_name, out) if util.prototype_has_bigcount(template.prototype): base_name_c = f'{base_name}_c' - generate_function(template.prototype, base_name_c, internal_name, + internal_name = f'ompi_abi_{template.prototype.name}_c' + generate_function(template.prototype, base_name_c, internal_name, out, enable_count=True) diff --git a/ompi/mpi/bindings/ompi_bindings/c_type.py b/ompi/mpi/bindings/ompi_bindings/c_type.py index 532dfb88e37..825e275417d 100644 --- a/ompi/mpi/bindings/ompi_bindings/c_type.py +++ b/ompi/mpi/bindings/ompi_bindings/c_type.py @@ -8,8 +8,8 @@ # $HEADER$ """C type definitions.""" from abc import ABC, abstractmethod -from ompi_bindings.consts import ConvertFuncs, ConvertOMPIToStandard - +from ompi_bindings.consts import ConvertFuncs, ConvertOMPIToStandard, IGNORED_STATUS_HANDLES +from ompi_bindings import util class Type(ABC): """Type representation.""" @@ -24,7 +24,7 @@ def __init__(self, type_name, name=None, self.type = type_name self.name = name self.count_param = count_param - self.mangle_name = mangle_name + self.mangle_name = util.abi_internal_name @staticmethod def construct(abi_type, type_name, **kwargs): @@ -32,6 +32,7 @@ def construct(abi_type, type_name, **kwargs): if abi_type == 'ompi': return Type.PARAMS_OMPI_ABI[type_name](type_name, **kwargs) elif abi_type == 'standard': +# print("Checkint oug type " + str(type_name)) return Type.PARAMS_STANDARD_ABI[type_name](type_name, **kwargs) else: raise RuntimeError(f'invalid ABI type {abi_type}') @@ -43,6 +44,7 @@ def wrapper(class_): if 'ompi' in abi_type: Type.PARAMS_OMPI_ABI[type_name] = class_ if 'standard' in abi_type: +# print("Adding type " + str(type_name) + " to PARAMS_STANDARD_ABI") Type.PARAMS_STANDARD_ABI[type_name] = class_ return class_ return wrapper @@ -340,6 +342,12 @@ class TypeDatatype(Type): def type_text(self, enable_count=False): return 'MPI_Datatype' +@Type.add_type('DATATYPE_OUT', abi_type=['ompi']) +class TypeDatatypeOut(Type): + + def type_text(self, enable_count=False): + return 'MPI_Datatype *' + @Type.add_type('DATATYPE_ARRAY', abi_type=['ompi']) class TypeDatatypeArray(Type): @@ -369,19 +377,18 @@ class TypeDatatypeStandard(StandardABIType): def init_code(self): return [f'MPI_Datatype {self.tmpname} = {ConvertFuncs.DATATYPE}({self.name});'] - def type_text(self, enable_count=False): - return self.mangle_name('MPI_Datatype') - + def tmp_type_text(self, enable_count=False): + return 'MPI_Datatype' -@Type.add_type('DATATYPE_OUT', abi_type=['ompi']) -class TypeDatatypeOut(Type): + def return_code(self, name): + return [f'return {ConvertOMPIToStandard.DATATYPE}({name});'] def type_text(self, enable_count=False): - return 'MPI_Datatype *' + return self.mangle_name('MPI_Datatype') @Type.add_type('DATATYPE_OUT', abi_type=['standard']) -class TypeDatatypeStandard(Type): +class TypeDatatypeOutStandard(StandardABIType): @property def final_code(self): @@ -395,6 +402,43 @@ def type_text(self, enable_count=False): def argument(self): return f'(MPI_Datatype *) {self.name}' +# +# TODO THIS IS NOT COMPLETE +# +@Type.add_type('DATATYPE_ARRAY', abi_type=['standard']) +class TypeDatatypeArrayStandard(StandardABIType): + + @property + def init_code(self): + if self.count_param is None: + code = [f'MPI_Comm comm_{self.tmpname} = {ConvertFuncs.COMM}(comm);'] + code.append(f'int size_{self.tmpname} = OMPI_COMM_IS_INTER(comm_{self.tmpname})?ompi_comm_remote_size(comm_{self.tmpname}):ompi_comm_size(comm_{self.tmpname});') + else: + code = [f'int size_{self.tmpname} = {self.count_param};'] + code.append(f'MPI_Datatype *{self.tmpname} = (MPI_Datatype *)malloc(sizeof(MPI_Datatype) * size_{self.tmpname});') + code.append(f'for(int i=0;iMPI_SOURCE = inp->MPI_SOURCE;') + self.dump(' out->MPI_TAG = inp->MPI_TAG;') + self.dump(f' out->MPI_ERROR = {ConvertFuncs.ERROR_CLASS}(inp->MPI_ERROR);') + # TODO: What to do with the private fields? + self.dump('}') + + def define(self, type_, name, value): + self.dump(f'#define {name} OMPI_CAST_CONSTANT({type_}, {value})') + + def define_all(self, type_, constants): + for i, const in enumerate(constants): + self.define(self.mangle_name(type_), self.mangle_name(const), i + 1) + self.dump() + + def dump_header(self): + header_guard = '_ABI_INTERNAL_' + self.dump(f'#ifndef {header_guard}') + self.dump(f'#define {header_guard}') + + self.dump('#include "stddef.h"') + self.dump('#include "stdint.h"') + + self.dump(""" +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif +""") + + self.dump(""" +#if defined(c_plusplus) || defined(__cplusplus) +#define OMPI_CAST_CONSTANT(type, value) (static_cast (static_cast (value))) +#else +#define OMPI_CAST_CONSTANT(type, value) ((type) ((void *) value)) +#endif +""") + + for i, err in enumerate(ERROR_CLASSES): + self.dump(f'#define {self.mangle_name(err)} {i + 1}') + self.dump() + + self.define_all('MPI_Datatype', PREDEFINED_DATATYPES) + self.define_all('MPI_Op', COLLECTIVE_OPERATIONS) + self.define_all('MPI_Comm', RESERVED_COMMUNICATORS) + self.define_all('MPI_Request', RESERVED_REQUESTS) + self.define_all('MPI_Win', RESERVED_WINDOWS) + self.define_all('MPI_Info', RESERVED_INFOS) + self.define_all('MPI_File', RESERVED_FILES) + + for name, value in VARIOUS_CONSTANTS.items(): + self.dump(f'#define {self.mangle_name(name)} {value}') + self.dump() + + status_type = self.mangle_name('MPI_Status') + for i, name in enumerate(IGNORED_STATUS_HANDLES): + self.define(f'{status_type} *', self.mangle_name(name), i + 1) + self.dump() + + for i, name in enumerate(COMMUNICATOR_SPLIT_TYPES): + self.dump(f'#define {self.mangle_name(name)} {i}') + self.dump() + + for mpi_type, c_type in C_OPAQUE_TYPES.items(): + self.dump(f'typedef {c_type} {self.mangle_name(mpi_type)};') + self.dump() + + for handle in C_HANDLES: + prefix, suffix = handle.split('_') + name = f'{prefix}_ABI_{suffix}' + self.dump(f'typedef struct {self.mangle_name(name)} *{self.mangle_name(handle)};') + self.dump() + self.dump(""" +struct MPI_Status_ABI { + int MPI_SOURCE; + int MPI_TAG; + int MPI_ERROR; + int mpi_abi_private[5]; +};""") + self.dump(f'typedef struct MPI_Status_ABI {self.mangle_name("MPI_Status")};') + self.dump() + # Function signatures + for sig in self.signatures: + self.dump(f'{sig};') + self.dump('int MPI_Abi_details(int *buflen, char *details, MPI_Info *info);') + self.dump('int MPI_Abi_supported(int *flag);') + self.dump('int MPI_Abi_version(int *abi_major, int *abi_minor);') + if not self.external: + # Now generate the conversion code + self.generate_error_convert_fn() + self.generate_comm_convert_fn() + self.generate_comm_convert_fn_intern_to_abi() + self.generate_info_convert_fn() + self.generate_file_convert_fn() + self.generate_datatype_convert_fn() + self.generate_op_convert_fn() + self.generate_win_convert_fn() + self.generate_request_convert_fn() + self.generate_status_convert_fn() + + self.dump(""" +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif +""") + self.dump(f'#endif /* {header_guard} */') + + +class Parameter: + + def __init__(self, text): + """Parse a parameter.""" + # parameter in the form "TYPE NAME" or "TYPE NAME:COUNT_VAR" + type_, namecount = text.split() + if ':' in namecount: + name, count_param = namecount.split(':') + else: + name, count_param = namecount, None + self.type_ = type_ + self.name = name + self.count_param = count_param + + def construct(self, abi_type, **kwargs): + """Construct the type parameter for the given ABI.""" + return Type.construct(abi_type, type_=self.type_, name=self.name, + count_param=self.count_param, **kwargs) + + +class ReturnType: + """Return type wrapper.""" + + def __init__(self, type_): + self.type_ = type_ + + def construct(self, abi_type, **kwargs): + """Construct the return type for the given ABI.""" + return Type.construct(abi_type, type_=self.type_, **kwargs) + + +class Type(ABC): + """Type representation.""" + + PARAMS_OMPI_ABI = {} + + PARAMS_STANDARD_ABI = {} + + def __init__(self, type_, name=None, + mangle_name=lambda name: abi_internal_name(name), + count_param=None, **kwargs): + self.type = type_ + self.name = name + self.count_param = count_param + self.mangle_name = mangle_name + + @staticmethod + def construct(abi_type, type_, **kwargs): + """Construct the parameter for the given ABI and type.""" + if abi_type == 'ompi': + return Type.PARAMS_OMPI_ABI[type_](type_, **kwargs) + elif abi_type == 'standard': + return Type.PARAMS_STANDARD_ABI[type_](type_, **kwargs) + else: + raise RuntimeError(f'invalid ABI type {abi_type}') + + @staticmethod + def add_type(type_name, abi_type=('ompi', 'standard')): + """Add a new class corresponding to a type.""" + def wrapper(class_): + if 'ompi' in abi_type: + Type.PARAMS_OMPI_ABI[type_name] = class_ + if 'standard' in abi_type: + Type.PARAMS_STANDARD_ABI[type_name] = class_ + # Parameter.TYPES[type_] = class_ + return class_ + return wrapper + + @property + def is_count(self): + """Return True if this parameter is a count (requiring bigcount API).""" + return False + + @property + def init_code(self): + """Return the initialization code needed for an ABI wrapper.""" + return [] + + @property + def final_code(self): + """Return the finalization code needed for an ABI wrapper.""" + return [] + + def return_code(self, name): + """Process a value and then build up a return statement.""" + return [f'return {name};'] + + @property + def argument(self): + """Return the argument text required for passing an argument to a function.""" + return self.name + + @abstractmethod + def type_text(self, count_type=None): + """Return the source text corresponding to a type definition.""" + + def tmp_type_text(self, count_type=None): + """Return source text corresponding to a temporary type definition before conversion.""" + return self.type_text(count_type=count_type) + + def parameter(self, count_type=None, **kwargs): + return f'{self.type_text(count_type)} {self.name}' + + +@Type.add_type('ERROR_CLASS') +class TypeErrorClass(Type): + + def type_text(self, count_type=None): + return 'int' + + def return_code(self, name): + return [f'return {ConvertFuncs.ERROR_CLASS}({name});'] + + +@Type.add_type('BUFFER') +class TypeBuffer(Type): + + def type_text(self, count_type=None): + return 'const void *' + + +@Type.add_type('BUFFER_OUT') +class TypeBufferOut(Type): + + def type_text(self, count_type=None): + return f'void *' + + +@Type.add_type('COUNT') +class TypeCount(Type): + + @property + def is_count(self): + return True + + def type_text(self, count_type=None): + return 'int' if count_type is None else count_type + + +@Type.add_type('INT') +class TypeBufferOut(Type): + + def type_text(self, count_type=None): + return 'int' + + +@Type.add_type('AINT') +class TypeBufferOut(Type): + + def type_text(self, count_type=None): + return 'MPI_Aint' + + +@Type.add_type('INT_OUT') +class TypeBufferOut(Type): + + def type_text(self, count_type=None): + return 'int *' + + def parameter(self, count_type=None, **kwargs): + if self.count_param is None: + return f'int *{self.name}' + else: + return f'int {self.name}[]' + + +@Type.add_type('DOUBLE') +class TypeDouble(Type): + + def type_text(self, count_type=None): + return 'double' + + +@Type.add_type('ARGV') +class TypeArgv(Type): + + def type_text(self, count_type=None): + return 'char ***' + + +@Type.add_type('DATATYPE', abi_type=['ompi']) +class TypeDatatype(Type): + + def type_text(self, count_type=None): + return 'MPI_Datatype' + + +class StandardABIType(Type): + + @property + def tmpname(self): + return f'{self.name}_tmp' + + @property + def argument(self): + return self.tmpname + + +@Type.add_type('DATATYPE', abi_type=['standard']) +class TypeDatatype(StandardABIType): + + @property + def init_code(self): + return [f'MPI_Datatype {self.tmpname} = {ConvertFuncs.DATATYPE}({self.name});'] + + def type_text(self, count_type=None): + return self.mangle_name('MPI_Datatype') + + +@Type.add_type('OP', abi_type=['ompi']) +class TypeDatatype(Type): + + def type_text(self, count_type=None): + return 'MPI_Op' + + +@Type.add_type('OP', abi_type=['standard']) +class TypeDatatype(StandardABIType): + + @property + def init_code(self): + return [f'MPI_Op {self.tmpname} = {ConvertFuncs.OP}({self.name});'] + + def type_text(self, count_type=None): + return self.mangle_name('MPI_Op') + + +@Type.add_type('RANK') +class TypeRank(Type): + + def type_text(self, count_type=None): + return 'int' + + +@Type.add_type('TAG') +class TypeRank(Type): + + def type_text(self, count_type=None): + return 'int' + + +@Type.add_type('COMM', abi_type=['ompi']) +class TypeCommunicator(Type): + + def type_text(self, count_type=None): + return 'MPI_Comm' + + +@Type.add_type('COMM', abi_type=['standard']) +class TypeCommunicatorStandard(StandardABIType): + + @property + def init_code(self): + return [f'MPI_Comm {self.tmpname} = {ConvertFuncs.COMM}({self.name});'] + + def tmp_type_text(self, count_type=None): + return 'MPI_Comm' + + def return_code(self, name): + return [f'return {ConvertOMPIToStandard.COMM}({name});'] + + def type_text(self, count_type=None): + return self.mangle_name('MPI_Comm') + + +@Type.add_type('COMM_OUT', abi_type=['ompi']) +class TypeCommunicator(Type): + + def type_text(self, count_type=None): + return 'MPI_Comm *' + + +@Type.add_type('COMM_OUT', abi_type=['standard']) +class TypeCommunicator(Type): + + @property + def final_code(self): + return [f'*{self.name} = {ConvertOMPIToStandard.COMM}((MPI_Comm) *{self.name});'] + + def type_text(self, count_type=None): + type_name = self.mangle_name('MPI_Comm') + return f'{type_name} *' + + @property + def argument(self): + return f'(MPI_Comm *) {self.name}' + + +@Type.add_type('WIN', abi_type=['ompi']) +class TypeWindow(Type): + + def type_text(self, count_type=None): + return 'MPI_Win' + + +@Type.add_type('WIN', abi_type=['standard']) +class TypeWindowStandard(StandardABIType): + + @property + def init_code(self): + return [f'MPI_Win {self.tmpname} = {ConvertFuncs.WIN}({self.name});'] + + def type_text(self, count_type=None): + return self.mangle_name('MPI_Win') + + +@Type.add_type('REQUEST', abi_type=['ompi']) +class TypeRequest(Type): + + def type_text(self, count_type=None): + return 'MPI_Request' + + +@Type.add_type('REQUEST', abi_type=['standard']) +class TypeRequestStandard(Type): + + def type_text(self, count_type=None): + return self.mangle_name('MPI_Request') + + @property + def argument(self): + return f'(MPI_Request) {self.name}' + + +@Type.add_type('REQUEST_INOUT', abi_type=['ompi']) +class TypeRequestInOut(Type): + + def type_text(self, count_type=None): + return 'MPI_Request *' + + +@Type.add_type('REQUEST_INOUT', abi_type=['standard']) +class TypeRequestInOutStandard(Type): + + @property + def final_code(self): + if self.count_param is None: + return [f'{ConvertFuncs.REQUEST}({self.name});'] + else: + return [ + 'for (int i = 0; i < %s; ++i) {' % (self.count_param,), + f'{ConvertFuncs.REQUEST}(&{self.name}[i]);', + '}', + ] + + @property + def argument(self): + return f'(MPI_Request *) {self.name}' + + def type_text(self, count_type=None): + type_name = self.mangle_name('MPI_Request') + return f'{type_name} *' + + def parameter(self, count_type=None, **kwargs): + type_name = self.mangle_name('MPI_Request') + if self.count_param is None: + return f'{type_name} *{self.name}' + else: + return f'{type_name} {self.name}[]' + + +@Type.add_type('STATUS_OUT', abi_type=['ompi']) +class TypeStatusOut(Type): + + def type_text(self, count_type=None): + return 'MPI_Status *' + + def parameter(self, count_type=None, **kwargs): + if self.count_param is None: + return f'MPI_Status *{self.name}' + else: + return f'MPI_Status {self.name}[]' + + +@Type.add_type('STATUS_OUT', abi_type=['standard']) +class TypeStausOutStandard(StandardABIType): + + def if_should_set_status(self): + """Generate the condition to check if the status(es) should be set.""" + condition = ' && '.join(f'{self.mangle_name(const)} != {self.name}' + for const in IGNORED_STATUS_HANDLES) + return 'if (%s) {' % (condition,) + + @property + def status_argument(self): + return f'{self.name}_arg' + + @property + def init_code(self): + code = [f'MPI_Status *{self.status_argument} = NULL;'] + if self.count_param is None: + code.append(f'MPI_Status {self.tmpname};') + else: + code.append(f'MPI_Status *{self.tmpname} = NULL;') + code.append(self.if_should_set_status()) + if self.count_param is not None: + code.append(f'{self.tmpname} = malloc({self.count_param} * sizeof(MPI_Status));') + code.append(f'{self.status_argument} = {self.tmpname};') + else: + code.append(f'{self.status_argument} = &{self.tmpname};') + code.append('} else {') + if self.count_param is not None: + code.append(f'{self.status_argument} = MPI_STATUSES_IGNORE;') + else: + code.append(f'{self.status_argument} = MPI_STATUS_IGNORE;') + code.append('}') + return code + + @property + def final_code(self): + code = [self.if_should_set_status()] + if self.count_param is None: + code.append(f'{ConvertFuncs.STATUS}({self.name}, &{self.tmpname});') + else: + code.extend([ + 'for (int i = 0; i < %s; ++i) {' % (self.count_param,), + f'{ConvertFuncs.STATUS}(&{self.name}[i], &{self.tmpname}[i]);', + '}', + f'free({self.tmpname});', + ]) + code.append('}') + return code + + @property + def argument(self): + return self.status_argument + + def type_text(self, count_type=None): + type_name = self.mangle_name('MPI_Status') + return f'{type_name} *' + + def parameter(self, count_type=None, **kwargs): + type_name = self.mangle_name('MPI_Status') + if self.count_param is None: + return f'{type_name} *{self.name}' + else: + return f'{type_name} {self.name}[]' + + +# For now this just assumes that MPI_Fint doesn't need any conversions +@Type.add_type('FINT') +class TypeFint(Type): + + def type_text(self, count_type=None): + return 'MPI_Fint' + + +@Type.add_type('STRING') +class TypeString(Type): + + def type_text(self, count_type=None): + return 'const char *' + + +@Type.add_type('STRING_OUT') +class TypeStringOut(Type): + + def type_text(self, count_type=None): + return 'char *' + + +@Type.add_type('INFO', abi_type=['ompi']) +class TypeInfo(Type): + + def type_text(self, count_type=None): + return 'MPI_Info' + + +@Type.add_type('INFO', abi_type=['standard']) +class TypeInfoStandard(StandardABIType): + + @property + def init_code(self): + return [f'MPI_Info {self.tmpname} = {ConvertFuncs.INFO}({self.name});'] + + def type_text(self, count_type=None): + return self.mangle_name('MPI_Info') + + +@Type.add_type('FILE_OUT', abi_type=['ompi']) +class TypeFileOut(Type): + + def type_text(self, count_type=None): + return 'MPI_File *' + + +@Type.add_type('FILE_OUT', abi_type=['standard']) +class TypeFileOutStandard(Type): + + @property + def argument(self): + return f'(MPI_File *) {self.name}' + + @property + def final_code(self): + return [f'{ConvertFuncs.FILE}({self.name});'] + + def type_text(self, count_type=None): + type_name = self.mangle_name('MPI_File') + return f'{type_name} *' + + +class Prototype: + """MPI function prototype.""" + + def __init__(self, name, return_type, params): + self.name = name + self.return_type = return_type + self.params = params + + def signature(self, abi_type, fn_name, count_type=None, **kwargs): + """Build a signature with the given name and count_type.""" + params = ', '.join(param.construct(abi_type, **kwargs).parameter(count_type=count_type, **kwargs) + for param in self.params) + if not params: + params = 'void' + return_type_text = self.return_type.construct(abi_type, **kwargs).type_text(count_type=count_type) + return f'{return_type_text} {fn_name}({params})' + + @property + def need_bigcount(self): + """Check if a bigcount interface is required for a prototype.""" + return any('COUNT' in param.type_ for param in self.params) + + +class TemplateParseError(Exception): + """Error raised during parsing.""" + pass + + +def validate_body(body): + """Validate the body of a template.""" + # Just do a simple bracket balance test to determine the bounds of the + # function body. All lines after the function body should be blank. There + # are cases where this will break, such as if someone puts code all on one + # line. + bracket_balance = 0 + line_count = 0 + for line in body: + line = line.strip() + if bracket_balance == 0 and line_count > 0 and line: + raise TemplateParseError('Extra code found in template; only one function body is allowed') + + update = line.count('{') - line.count('}') + bracket_balance += update + if bracket_balance != 0: + line_count += 1 + + if bracket_balance != 0: + raise TemplateParseError('Mismatched brackets found in template') + + +class SourceTemplate: + """Source template for a single API function.""" + + def __init__(self, prototype, header, body): + self.prototype = prototype + self.header = header + self.body = body + + @staticmethod + def load(fname, prefix=None): + """Load a template file and return the SourceTemplate.""" + if prefix is not None: + fname = os.path.join(prefix, fname) + with open(fname) as fp: + header = [] + prototype = [] + body = [] + + for line in fp: + line = line.rstrip() + if prototype and line.startswith('PROTOTYPE'): + raise TemplateParseError('more than one prototype found in template file') + elif ((prototype and not any(')' in s for s in prototype)) + or line.startswith('PROTOTYPE')): + prototype.append(line) + elif prototype: + # Validate bracket balance + body.append(line) + else: + header.append(line) + + if not prototype: + raise RuntimeError('missing prototype') + # Parse the prototype + prototype = ''.join(prototype) + prototype = prototype[len('PROTOTYPE'):] + i = prototype.index('(') + j = prototype.index(')') + return_type, name = prototype[:i].split() + return_type = ReturnType(return_type) + params = [param.strip() for param in prototype[i + 1:j].split(',') if param.strip()] + params = [Parameter(param) for param in params] + prototype = Prototype(name, return_type, params) + # Ensure the body contains only one function + validate_body(body) + return SourceTemplate(prototype, header, body) + + def print_header(self, file=sys.stdout): + """Print the source header.""" + for line in self.header: + print(line, file=file) + + def print_body(self, func_name, file=sys.stdout): + """Print the body.""" + for line in self.body: + # FUNC_NAME is used for error messages + line = line.replace('FUNC_NAME', f'"{func_name}"') + print(line, file=file) + + +def print_profiling_header(fn_name, file=sys.stdout): + """Print the profiling header code.""" + print('#if OMPI_BUILD_MPI_PROFILING') + print('#if OPAL_HAVE_WEAK_SYMBOLS', file=file) + print(f'#pragma weak {fn_name} = P{fn_name}', file=file) + print('#endif', file=file) + print(f'#define {fn_name} P{fn_name}', file=file) + print('#endif') + + +def ompi_abi(base_name, template): + """Generate the OMPI ABI functions.""" + template.print_header() + print_profiling_header(base_name) + print(template.prototype.signature('ompi', base_name)) + template.print_body(func_name=base_name) + # Check if we need to generate the bigcount interface + if template.prototype.need_bigcount: + base_name_c = f'{base_name}_c' + print_profiling_header(base_name_c) + print(template.prototype.signature('ompi', base_name_c, count_type='MPI_Count')) + template.print_body(func_name=base_name_c) + + +ABI_INTERNAL_HEADER = 'ompi/mpi/c/abi.h' + + +def indent_lines(lines, tab, start=0): + """Crude pretty-printing function.""" + new_lines = [] + indent_count = start + for line in lines: + # Closing bracket + if '}' in line: + indent_count -= 1 + + prefix = indent_count * tab + new_lines.append(f'{prefix}{line}') + + # Opening bracket + if '{' in line: + indent_count += 1 + return new_lines + + +def standard_abi(base_name, template): + """Generate the standard ABI functions.""" + template.print_header() + print(f'#include "{ABI_INTERNAL_HEADER}"') + + # Static internal function (add a random component to avoid conflicts) + internal_name = f'ompi_abi_{template.prototype.name}' + internal_sig = template.prototype.signature('ompi', internal_name, + count_type='MPI_Count') + print(INLINE_ATTRS, internal_sig) + template.print_body(func_name=base_name) + + def generate_function(prototype, fn_name, internal_fn, count_type='int'): + """Generate a function for the standard ABI.""" + print_profiling_header(fn_name) + + # Handle type conversions and arguments + params = [param.construct('standard') for param in prototype.params] + print(prototype.signature('standard', fn_name, count_type=count_type)) + print('{') + lines = [] + return_type = prototype.return_type.construct('standard') + lines.append(f'{return_type.tmp_type_text()} ret_value;') + for param in params: + if param.init_code: + lines.extend(param.init_code) + pass_args = ', '.join(param.argument for param in params) + lines.append(f'ret_value = {internal_fn}({pass_args});') + for param in params: + if param.final_code: + lines.extend(param.final_code) + lines.extend(return_type.return_code('ret_value')) + + # Indent the lines + lines = indent_lines(lines, 4 * ' ', start=1) + for line in lines: + print(line) + print('}') + + generate_function(template.prototype, base_name, internal_name) + if template.prototype.need_bigcount: + base_name_c = f'{base_name}_c' + generate_function(template.prototype, base_name_c, internal_name, + count_type='MPI_Count') + + +def gen_header(args): + """Generate an ABI header and conversion code.""" + prototypes = [SourceTemplate.load(file_, args.srcdir).prototype for file_ in args.file] + + builder = ABIHeaderBuilder(prototypes, external=args.external) + builder.dump_header() + + +def gen_source(args): + """Generate source file.""" + template = SourceTemplate.load(args.source_file) + + base_name = mpi_fn_name_from_base_fn_name(template.prototype.name) + if args.type == 'ompi': + ompi_abi(base_name, template) + else: + standard_abi(base_name, template) + + +def main(): + if len(sys.argv) < 2: + # Fix required for Python 3.6 + print('ERROR: missing subparser argument (see --help)') + sys.exit(1) + + parser = argparse.ArgumentParser(description='generate ABI header file and conversion code') + subparsers = parser.add_subparsers() + + parser_header = subparsers.add_parser('header') + parser_header.add_argument('file', nargs='+', help='list of template source files') + parser_header.add_argument('--external', action='store_true', help='generate external mpi.h header file') + parser_header.add_argument('--srcdir', help='source directory') + parser_header.set_defaults(func=gen_header) + + parser_gen = subparsers.add_parser('source') + # parser = argparse.ArgumentParser(description='C ABI binding generation code') + parser_gen.add_argument('type', choices=('ompi', 'standard'), + help='generate the OMPI ABI functions or the standard ABI functions') + parser_gen.add_argument('source_file', help='source template file') + parser_gen.set_defaults(func=gen_source) + + args = parser.parse_args() + + # Always add the header + print('/* THIS FILE WAS AUTOGENERATED BY ompi/mpi/c/abi.py. DO NOT EDIT BY HAND. */') + args.func(args) + + +if __name__ == '__main__': + main() diff --git a/ompi/mpi/c/abi_details.c b/ompi/mpi/c/abi_details.c new file mode 100644 index 00000000000..8dfc7b6e629 --- /dev/null +++ b/ompi/mpi/c/abi_details.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 Triad National Security, LLC. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include + +#include "opal/util/show_help.h" +#include "ompi/runtime/ompi_spc.h" +#include "ompi/mpi/c/bindings.h" +#include "ompi/communicator/communicator.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/constants.h" +#ifdef OMPI_NO_MPI_PROTOTYPES +#include "ompi/mpi/c/abi.h" +#endif + +static const char ABI_DETAILS[] = "Open MPI Standard ABI 0.1"; + +int MPI_Abi_details(int *buflen, char *details, MPI_Info *info) +{ + if (*buflen >= (int) sizeof(ABI_DETAILS)) { + strcpy(details, ABI_DETAILS); + *buflen = sizeof(ABI_DETAILS); + return MPI_SUCCESS; + } else { + *buflen = 0; + return MPI_ERR_BUFFER; + } +} diff --git a/ompi/mpi/c/abi_supported.c b/ompi/mpi/c/abi_supported.c new file mode 100644 index 00000000000..b8b977962ba --- /dev/null +++ b/ompi/mpi/c/abi_supported.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Triad National Security, LLC. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include + +#include "opal/util/show_help.h" +#include "ompi/runtime/ompi_spc.h" +#include "ompi/mpi/c/bindings.h" +#include "ompi/communicator/communicator.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/constants.h" +#ifdef OMPI_NO_MPI_PROTOTYPES +#include "ompi/mpi/c/abi.h" +#endif + +int MPI_Abi_supported(int *flag) +{ + *flag = 1; + return MPI_SUCCESS; +} diff --git a/ompi/mpi/c/abi_version.c b/ompi/mpi/c/abi_version.c new file mode 100644 index 00000000000..33d32854893 --- /dev/null +++ b/ompi/mpi/c/abi_version.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 Triad National Security, LLC. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include + +#include "opal/util/show_help.h" +#include "ompi/runtime/ompi_spc.h" +#include "ompi/mpi/c/bindings.h" +#include "ompi/communicator/communicator.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/constants.h" +#ifdef OMPI_NO_MPI_PROTOTYPES +#include "ompi/mpi/c/abi.h" +#endif + +int MPI_Abi_version(int *abi_major, int *abi_minor) +{ + /* 0.1 */ + *abi_major = 0; + *abi_minor = 1; + return MPI_SUCCESS; +} diff --git a/ompi/mpi/c/bindings.h b/ompi/mpi/c/bindings.h index 2a849feea8d..717fe79287f 100644 --- a/ompi/mpi/c/bindings.h +++ b/ompi/mpi/c/bindings.h @@ -116,6 +116,11 @@ BEGIN_C_DECLS } while (0) +int ompi_sendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag, + void * recvbuf, size_t recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status); +int ompi_isendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag, + void * recvbuf, size_t recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Request * request); + END_C_DECLS #endif /* OMPI_C_BINDINGS_H */ diff --git a/ompi/mpi/c/comm_spawn_multiple.c.in b/ompi/mpi/c/comm_spawn_multiple.c.in index a729df6dfd0..72b43a2dbc3 100644 --- a/ompi/mpi/c/comm_spawn_multiple.c.in +++ b/ompi/mpi/c/comm_spawn_multiple.c.in @@ -42,7 +42,7 @@ #include "ompi/memchecker.h" PROTOTYPE ERROR_CLASS comm_spawn_multiple(INT count, STRING_ARRAY array_of_commands, ARGV array_of_argv, - INT_ARRAY array_of_maxprocs, INFO_ARRAY array_of_info, + INT_ARRAY array_of_maxprocs, INFO_ARRAY array_of_info:count, INT root, COMM comm, COMM_OUT intercomm, INT_OUT array_of_errcodes) { diff --git a/ompi/mpi/c/file_close.c.in b/ompi/mpi/c/file_close.c.in index 4111c6a3026..19b844be21a 100644 --- a/ompi/mpi/c/file_close.c.in +++ b/ompi/mpi/c/file_close.c.in @@ -27,7 +27,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/file/file.h" -PROTOTYPE ERROR_CLASS file_close(FILE_OUT fh) +PROTOTYPE ERROR_CLASS file_close(FILE_INOUT fh) { int rc; diff --git a/ompi/mpi/c/isendrecv.c.in b/ompi/mpi/c/isendrecv.c.in index 39f410b6796..8bd8a75afa6 100644 --- a/ompi/mpi/c/isendrecv.c.in +++ b/ompi/mpi/c/isendrecv.c.in @@ -37,60 +37,12 @@ #include "ompi/runtime/ompi_spc.h" -struct ompi_isendrecv_context_t { - opal_object_t super; - int nreqs; - int source; - ompi_request_t *subreq[2]; -}; - -typedef struct ompi_isendrecv_context_t ompi_isendrecv_context_t; -#if OMPI_BUILD_MPI_PROFILING -OBJ_CLASS_INSTANCE(ompi_isendrecv_context_t, opal_object_t, NULL, NULL); -#else -OBJ_CLASS_DECLARATION(ompi_isendrecv_context_t); -#endif /* OMPI_BUILD_MPI_PROFILING */ - -static int ompi_isendrecv_complete_func (ompi_comm_request_t *request) -{ - ompi_isendrecv_context_t *context = - (ompi_isendrecv_context_t *) request->context; - - /* - * Copy the status from the receive side of the sendrecv request? - * But what if the send failed? - * - * Probably need to bring up in the MPI forum. - */ - - if (MPI_PROC_NULL != context->source) { - OMPI_COPY_STATUS(&request->super.req_status, - context->subreq[0]->req_status, false); - } else { - OMPI_COPY_STATUS(&request->super.req_status, - ompi_request_empty.req_status, false); - } - - if(NULL != context->subreq[0]) { - ompi_request_free(&context->subreq[0]); - } - if(NULL != context->subreq[1]) { - ompi_request_free(&context->subreq[1]); - } - - return OMPI_SUCCESS; -} - PROTOTYPE ERROR_CLASS isendrecv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtype, INT dest, INT sendtag, BUFFER_OUT recvbuf, COUNT recvcount, DATATYPE recvtype, INT source, INT recvtag, COMM comm, REQUEST_INOUT request) { - ompi_isendrecv_context_t *context = NULL; - ompi_comm_request_t *crequest; int rc = MPI_SUCCESS; - int nreqs = 0; - uint32_t flags; SPC_RECORD(OMPI_SPC_ISENDRECV, 1); @@ -125,64 +77,9 @@ PROTOTYPE ERROR_CLASS isendrecv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendty OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME); } - crequest = ompi_comm_request_get (); - if (NULL == crequest) { - return OMPI_ERR_OUT_OF_RESOURCE; - } - - context = OBJ_NEW(ompi_isendrecv_context_t); - if (NULL == context) { - ompi_comm_request_return (crequest); - return OMPI_ERR_OUT_OF_RESOURCE; - } - - crequest->context = &context->super; - context->subreq[0] = MPI_REQUEST_NULL; - context->subreq[1] = MPI_REQUEST_NULL; - context->source = source; - - if (source != MPI_PROC_NULL) { /* post recv */ - rc = MCA_PML_CALL(irecv(recvbuf, recvcount, recvtype, - source, recvtag, comm, &context->subreq[nreqs++])); - if (MPI_SUCCESS != rc) { - OBJ_RELEASE(context); - ompi_comm_request_return (crequest); - } - OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME); - } - - if (dest != MPI_PROC_NULL) { /* send */ - rc = MCA_PML_CALL(isend(sendbuf, sendcount, sendtype, dest, - sendtag, MCA_PML_BASE_SEND_STANDARD, comm, &context->subreq[nreqs++])); - if (MPI_SUCCESS != rc) { - OBJ_RELEASE(context); - ompi_comm_request_return (crequest); - } - OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME); - } - - /* - * schedule the operation - */ - - context->nreqs = nreqs; - assert(nreqs <= 2); - - flags = OMPI_COMM_REQ_FLAG_RETAIN_SUBREQ; - - rc = ompi_comm_request_schedule_append_w_flags(crequest, ompi_isendrecv_complete_func, - context->subreq, nreqs, flags); - if (MPI_SUCCESS != rc) { - OBJ_RELEASE(context); - ompi_comm_request_return (crequest); - } + rc = ompi_isendrecv(sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, recvcount, recvtype, source, recvtag, comm, request); OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME); - /* kick off the request */ - - ompi_comm_request_start (crequest); - *request = &crequest->super; - return rc; } diff --git a/ompi/mpi/c/isendrecv_replace.c.in b/ompi/mpi/c/isendrecv_replace.c.in index 2dad8a3078e..34077e25603 100644 --- a/ompi/mpi/c/isendrecv_replace.c.in +++ b/ompi/mpi/c/isendrecv_replace.c.in @@ -34,6 +34,10 @@ #include "ompi/proc/proc.h" #include "ompi/memchecker.h" #include "ompi/runtime/ompi_spc.h" +#include "opal/mca/mpool/mpool.h" +#ifdef OMPI_NO_MPI_PROTOTYPES +#include "ompi/mpi/c/abi.h" +#endif struct ompi_isendrecv_replace_context_t { opal_object_t super; @@ -58,7 +62,7 @@ static void ompi_isendrecv_context_constructor(ompi_isendrecv_replace_context_t static void ompi_isendrecv_context_destructor(ompi_isendrecv_replace_context_t *context) { if (context->packed_size > sizeof(context->packed_data)) { - PMPI_Free_mem(context->iov.iov_base); + mca_mpool_base_free(context->iov.iov_base); } OBJ_DESTRUCT(&context->convertor); } @@ -144,7 +148,7 @@ PROTOTYPE ERROR_CLASS isendrecv_replace(BUFFER_OUT buf, COUNT count, DATATYPE da /* simple case */ if ( source == MPI_PROC_NULL || dest == MPI_PROC_NULL || count == 0 ) { - rc = PMPI_Isendrecv(buf, count, datatype, dest, sendtag, buf, count, datatype, source, recvtag, comm, request); + rc = ompi_isendrecv(buf, count, datatype, dest, sendtag, buf, count, datatype, source, recvtag, comm, request); return rc; } @@ -181,8 +185,8 @@ PROTOTYPE ERROR_CLASS isendrecv_replace(BUFFER_OUT buf, COUNT count, DATATYPE da /* setup a buffer for recv */ opal_convertor_get_packed_size( &context->convertor, &context->packed_size ); if( context->packed_size > sizeof(context->packed_data) ) { - rc = PMPI_Alloc_mem(context->packed_size, MPI_INFO_NULL, &context->iov.iov_base); - if(OMPI_SUCCESS != rc) { + context->iov.iov_base = (void *)mca_mpool_base_alloc ((size_t)context->packed_size, NULL, NULL); + if(NULL == context->iov.iov_base) { OBJ_RELEASE(context); ompi_comm_request_return (crequest); OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); diff --git a/ompi/mpi/c/keyval_create.c.in b/ompi/mpi/c/keyval_create.c similarity index 76% rename from ompi/mpi/c/keyval_create.c.in rename to ompi/mpi/c/keyval_create.c index 8a318ad4da3..d802c257dc9 100644 --- a/ompi/mpi/c/keyval_create.c.in +++ b/ompi/mpi/c/keyval_create.c @@ -1,3 +1,4 @@ +/* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT BY HAND. */ /* * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology @@ -31,22 +32,26 @@ #include "ompi/attribute/attribute.h" #include "ompi/communicator/communicator.h" -PROTOTYPE ERROR_CLASS keyval_create(COPY_FUNCTION copy_attr_fn, - DELETE_FUNCTION delete_attr_fn, - INT_OUT keyval, BUFFER_OUT extra_state) +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_Keyval_create = PMPI_Keyval_create +#endif +#define MPI_Keyval_create PMPI_Keyval_create +#endif +int MPI_Keyval_create(MPI_Copy_function * copy_attr_fn, MPI_Delete_function * delete_attr_fn, int *keyval, void * extra_state) { int ret; ompi_attribute_fn_ptr_union_t copy_fn; ompi_attribute_fn_ptr_union_t del_fn; if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + OMPI_ERR_INIT_FINALIZE("MPI_Keyval_create"); if (NULL == keyval) { return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_KEYVAL, - FUNC_NAME); + "MPI_Keyval_create"); } else if ((NULL == copy_attr_fn) || (NULL == delete_attr_fn)) { return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, - FUNC_NAME); + "MPI_Keyval_create"); } } @@ -55,5 +60,5 @@ PROTOTYPE ERROR_CLASS keyval_create(COPY_FUNCTION copy_attr_fn, ret = ompi_attr_create_keyval(COMM_ATTR, copy_fn, del_fn, keyval, extra_state, 0, NULL); - OMPI_ERRHANDLER_NOHANDLE_RETURN(ret, MPI_ERR_OTHER, FUNC_NAME); + OMPI_ERRHANDLER_NOHANDLE_RETURN(ret, MPI_ERR_OTHER, "MPI_Keyval_create"); } diff --git a/ompi/mpi/c/keyval_free.c.in b/ompi/mpi/c/keyval_free.c similarity index 78% rename from ompi/mpi/c/keyval_free.c.in rename to ompi/mpi/c/keyval_free.c index 8705ada7a10..6b6ffa06b8a 100644 --- a/ompi/mpi/c/keyval_free.c.in +++ b/ompi/mpi/c/keyval_free.c @@ -1,3 +1,4 @@ +/* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT BY HAND. */ /* * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology @@ -28,7 +29,13 @@ #include "ompi/attribute/attribute.h" #include "ompi/communicator/communicator.h" -PROTOTYPE ERROR_CLASS keyval_free(INT_OUT keyval) +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_Keyval_free = PMPI_Keyval_free +#endif +#define MPI_Keyval_free PMPI_Keyval_free +#endif +int MPI_Keyval_free(int *keyval) { int ret; @@ -36,10 +43,10 @@ PROTOTYPE ERROR_CLASS keyval_free(INT_OUT keyval) if (MPI_PARAM_CHECK) { if (NULL == keyval) { return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_KEYVAL, - FUNC_NAME); + "MPI_Keyval_free"); } } ret = ompi_attr_free_keyval(COMM_ATTR, keyval, 0); - OMPI_ERRHANDLER_NOHANDLE_RETURN(ret, MPI_ERR_OTHER, FUNC_NAME); + OMPI_ERRHANDLER_NOHANDLE_RETURN(ret, MPI_ERR_OTHER, "MPI_Keyval_free"); } diff --git a/ompi/mpi/c/ompi_isendrecv.c b/ompi/mpi/c/ompi_isendrecv.c new file mode 100644 index 00000000000..13ce4ef631c --- /dev/null +++ b/ompi/mpi/c/ompi_isendrecv.c @@ -0,0 +1,147 @@ +/* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT BY HAND. */ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2022 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) 2010-2012 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2021 Nanook Consulting. All rights reserved. + * Copyright (c) 2021-2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +#include "ompi_config.h" + +#include "ompi/mpi/c/bindings.h" +#include "ompi/runtime/params.h" +#include "ompi/communicator/communicator.h" +#include "ompi/communicator/comm_request.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/mca/pml/pml.h" +#include "ompi/request/request.h" +#include "ompi/memchecker.h" +#include "ompi/runtime/ompi_spc.h" + + +struct ompi_isendrecv_context_t { + opal_object_t super; + int nreqs; + int source; + ompi_request_t *subreq[2]; +}; + +typedef struct ompi_isendrecv_context_t ompi_isendrecv_context_t; +OBJ_CLASS_INSTANCE(ompi_isendrecv_context_t, opal_object_t, NULL, NULL); + +static int ompi_isendrecv_complete_func (ompi_comm_request_t *request) +{ + ompi_isendrecv_context_t *context = + (ompi_isendrecv_context_t *) request->context; + + /* + * Copy the status from the receive side of the sendrecv request? + * But what if the send failed? + * + * Probably need to bring up in the MPI forum. + */ + + if (MPI_PROC_NULL != context->source) { + OMPI_COPY_STATUS(&request->super.req_status, + context->subreq[0]->req_status, false); + } else { + OMPI_COPY_STATUS(&request->super.req_status, + ompi_request_empty.req_status, false); + } + + if(NULL != context->subreq[0]) { + ompi_request_free(&context->subreq[0]); + } + if(NULL != context->subreq[1]) { + ompi_request_free(&context->subreq[1]); + } + + return OMPI_SUCCESS; +} + +int ompi_isendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag, void * recvbuf, size_t recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Request * request) +{ + ompi_isendrecv_context_t *context = NULL; + ompi_comm_request_t *crequest; + int rc = MPI_SUCCESS; + int nreqs = 0; + uint32_t flags; + + crequest = ompi_comm_request_get (); + if (NULL == crequest) { + return OMPI_ERR_OUT_OF_RESOURCE; + } + + context = OBJ_NEW(ompi_isendrecv_context_t); + if (NULL == context) { + ompi_comm_request_return (crequest); + return OMPI_ERR_OUT_OF_RESOURCE; + } + + crequest->context = &context->super; + context->subreq[0] = MPI_REQUEST_NULL; + context->subreq[1] = MPI_REQUEST_NULL; + context->source = source; + + if (source != MPI_PROC_NULL) { /* post recv */ + rc = MCA_PML_CALL(irecv(recvbuf, recvcount, recvtype, + source, recvtag, comm, &context->subreq[nreqs++])); + if (MPI_SUCCESS != rc) { + OBJ_RELEASE(context); + ompi_comm_request_return (crequest); + } + OMPI_ERRHANDLER_CHECK(rc, comm, rc, "MPI_Isendrecv"); + } + + if (dest != MPI_PROC_NULL) { /* send */ + rc = MCA_PML_CALL(isend(sendbuf, sendcount, sendtype, dest, + sendtag, MCA_PML_BASE_SEND_STANDARD, comm, &context->subreq[nreqs++])); + if (MPI_SUCCESS != rc) { + OBJ_RELEASE(context); + ompi_comm_request_return (crequest); + } + OMPI_ERRHANDLER_CHECK(rc, comm, rc, "MPI_Isendrecv"); + } + + /* + * schedule the operation + */ + + context->nreqs = nreqs; + assert(nreqs <= 2); + + flags = OMPI_COMM_REQ_FLAG_RETAIN_SUBREQ; + + rc = ompi_comm_request_schedule_append_w_flags(crequest, ompi_isendrecv_complete_func, + context->subreq, nreqs, flags); + if (MPI_SUCCESS != rc) { + OBJ_RELEASE(context); + ompi_comm_request_return (crequest); + } + + /* kick off the request */ + + ompi_comm_request_start (crequest); + *request = &crequest->super; + + return rc; +} diff --git a/ompi/mpi/c/ompi_sendrecv.c b/ompi/mpi/c/ompi_sendrecv.c new file mode 100644 index 00000000000..0bcdc5ecce3 --- /dev/null +++ b/ompi/mpi/c/ompi_sendrecv.c @@ -0,0 +1,97 @@ +/* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT BY HAND. */ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2021 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) 2010-2012 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2021 Nanook Consulting. All rights reserved. + * Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved. + * Copyright (c) 2024 Triad National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +#include "ompi_config.h" + +#include "ompi/mpi/c/bindings.h" +#include "ompi/runtime/params.h" +#include "ompi/communicator/communicator.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/mca/pml/pml.h" +#include "ompi/request/request.h" +#include "ompi/memchecker.h" +#include "ompi/runtime/ompi_spc.h" + +int ompi_sendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag, void * recvbuf, size_t recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status) +{ + ompi_request_t* req = MPI_REQUEST_NULL; + int rc = MPI_SUCCESS; + int rcs = MPI_SUCCESS; + + if (source != MPI_PROC_NULL) { /* post recv */ + rc = MCA_PML_CALL(irecv(recvbuf, recvcount, recvtype, + source, recvtag, comm, &req)); + OMPI_ERRHANDLER_CHECK(rc, comm, rc, "MPI_Sendrecv"); + } + + if (dest != MPI_PROC_NULL) { /* send */ + rc = MCA_PML_CALL(send(sendbuf, sendcount, sendtype, dest, + sendtag, MCA_PML_BASE_SEND_STANDARD, comm)); + if (OPAL_UNLIKELY(MPI_SUCCESS != rc)) { + rcs = rc; +#if OPAL_ENABLE_FT_MPI + /* If this is a PROC_FAILED error, we still need to proceed with + * the receive, so that we do not propagate errors to the sender in + * the case src != dst, and only dst is dead. In this case the + * recv is guaranteed to complete (either in error if the source is + * dead, or successfully if the source is live). */ + if (OPAL_UNLIKELY(MPI_ERR_PROC_FAILED != rc)) + /* if intentionally spills outside ifdef */ +#endif + ompi_request_cancel(req); + } + } + + if (source != MPI_PROC_NULL) { /* wait for recv */ + rc = ompi_request_wait(&req, status); +#if OPAL_ENABLE_FT_MPI + /* Sendrecv never returns ERR_PROC_FAILED_PENDING because it is + * blocking. Lets cancel that irecv to complete it NOW and promote + * the error to ERR_PROC_FAILED */ + if( OPAL_UNLIKELY(MPI_ERR_PROC_FAILED_PENDING == rc) ) { + ompi_request_cancel(req); + ompi_request_wait(&req, MPI_STATUS_IGNORE); + rc = MPI_ERR_PROC_FAILED; + } +#endif + } else { + if (MPI_STATUS_IGNORE != status) { + OMPI_COPY_STATUS(status, ompi_request_empty.req_status, false); + /* + * Per MPI-1, the MPI_ERROR field is not defined for single-completion calls + */ + MEMCHECKER( + opal_memchecker_base_mem_undefined(&status->MPI_ERROR, sizeof(int)); + ); + } + rc = MPI_SUCCESS; + } + if( OPAL_UNLIKELY(MPI_SUCCESS != rcs && MPI_SUCCESS == rc) ) { + rc = rcs; + } +} diff --git a/ompi/mpi/c/sendrecv.c.in b/ompi/mpi/c/sendrecv.c.in index d6a30102a50..25167d2d857 100644 --- a/ompi/mpi/c/sendrecv.c.in +++ b/ompi/mpi/c/sendrecv.c.in @@ -41,9 +41,7 @@ PROTOTYPE ERROR_CLASS sendrecv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtyp DATATYPE recvtype, INT source, INT recvtag, COMM comm, STATUS_OUT status) { - ompi_request_t* req = MPI_REQUEST_NULL; int rc = MPI_SUCCESS; - int rcs = MPI_SUCCESS; SPC_RECORD(OMPI_SPC_SENDRECV, 1); @@ -75,57 +73,9 @@ PROTOTYPE ERROR_CLASS sendrecv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtyp OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME); } - if (source != MPI_PROC_NULL) { /* post recv */ - rc = MCA_PML_CALL(irecv(recvbuf, recvcount, recvtype, - source, recvtag, comm, &req)); - OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME); - } - - if (dest != MPI_PROC_NULL) { /* send */ - rc = MCA_PML_CALL(send(sendbuf, sendcount, sendtype, dest, - sendtag, MCA_PML_BASE_SEND_STANDARD, comm)); - if (OPAL_UNLIKELY(MPI_SUCCESS != rc)) { - rcs = rc; -#if OPAL_ENABLE_FT_MPI - /* If this is a PROC_FAILED error, we still need to proceed with - * the receive, so that we do not propagate errors to the sender in - * the case src != dst, and only dst is dead. In this case the - * recv is guaranteed to complete (either in error if the source is - * dead, or successfully if the source is live). */ - if (OPAL_UNLIKELY(MPI_ERR_PROC_FAILED != rc)) - /* if intentionally spills outside ifdef */ -#endif - ompi_request_cancel(req); - } - } + rc = ompi_sendrecv(sendbuf, sendcount, sendtype, dest, sendtag, + recvbuf, recvcount, recvtype, source, recvtag, comm, status); - if (source != MPI_PROC_NULL) { /* wait for recv */ - rc = ompi_request_wait(&req, status); -#if OPAL_ENABLE_FT_MPI - /* Sendrecv never returns ERR_PROC_FAILED_PENDING because it is - * blocking. Lets cancel that irecv to complete it NOW and promote - * the error to ERR_PROC_FAILED */ - if( OPAL_UNLIKELY(MPI_ERR_PROC_FAILED_PENDING == rc) ) { - ompi_request_cancel(req); - ompi_request_wait(&req, MPI_STATUS_IGNORE); - rc = MPI_ERR_PROC_FAILED; - } -#endif - } else { - if (MPI_STATUS_IGNORE != status) { - OMPI_COPY_STATUS(status, ompi_request_empty.req_status, false); - /* - * Per MPI-1, the MPI_ERROR field is not defined for single-completion calls - */ - MEMCHECKER( - opal_memchecker_base_mem_undefined(&status->MPI_ERROR, sizeof(int)); - ); - } - rc = MPI_SUCCESS; - } - if( OPAL_UNLIKELY(MPI_SUCCESS != rcs && MPI_SUCCESS == rc) ) { - rc = rcs; - } OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); } diff --git a/ompi/mpi/c/sendrecv_replace.c.in b/ompi/mpi/c/sendrecv_replace.c.in index 76aadb3ab30..7c8dba56a17 100644 --- a/ompi/mpi/c/sendrecv_replace.c.in +++ b/ompi/mpi/c/sendrecv_replace.c.in @@ -29,6 +29,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/datatype/ompi_datatype.h" #include "opal/datatype/opal_convertor.h" +#include "opal/mca/mpool/mpool.h" #include "ompi/mca/pml/pml.h" #include "ompi/proc/proc.h" #include "ompi/memchecker.h" @@ -80,7 +81,7 @@ PROTOTYPE ERROR_CLASS sendrecv_replace(BUFFER_OUT buf, COUNT count, DATATYPE dat /* simple case */ if ( source == MPI_PROC_NULL || dest == MPI_PROC_NULL || count == 0 ) { - rc = PMPI_Sendrecv(buf, count, datatype, dest, sendtag, buf, count, datatype, source, recvtag, comm, status); + rc = ompi_sendrecv(buf, count, datatype, dest, sendtag, buf, count, datatype, source, recvtag, comm, status); return rc; } @@ -113,8 +114,8 @@ PROTOTYPE ERROR_CLASS sendrecv_replace(BUFFER_OUT buf, COUNT count, DATATYPE dat /* setup a temporary buffer to send */ opal_convertor_get_packed_size( &convertor, &packed_size ); if( packed_size > sizeof(packed_data) ) { - rc = PMPI_Alloc_mem(packed_size, MPI_INFO_NULL, &iov.iov_base); - if(OMPI_SUCCESS != rc) { + iov.iov_base = (void *)mca_mpool_base_alloc (packed_size, NULL, NULL); + if(NULL == iov.iov_base) { rc = OMPI_ERR_OUT_OF_RESOURCE; goto cleanup_and_return; } @@ -166,7 +167,7 @@ PROTOTYPE ERROR_CLASS sendrecv_replace(BUFFER_OUT buf, COUNT count, DATATYPE dat /* release resources */ if(packed_size > sizeof(packed_data)) { - PMPI_Free_mem(iov.iov_base); + mca_mpool_base_free(iov.iov_base); } OBJ_DESTRUCT(&convertor); diff --git a/ompi/mpi/c/session_finalize.c.in b/ompi/mpi/c/session_finalize.c.in index 44e67abeb8e..90075d5a4c1 100644 --- a/ompi/mpi/c/session_finalize.c.in +++ b/ompi/mpi/c/session_finalize.c.in @@ -17,7 +17,7 @@ #include "ompi/memchecker.h" -PROTOTYPE ERROR_CLASS session_finalize (SESSION_OUT session) +PROTOTYPE ERROR_CLASS session_finalize (SESSION_INOUT session) { int rc; diff --git a/ompi/mpi/c/status_c2f.c.in b/ompi/mpi/c/status_c2f.c.in index d430bc7964f..9d4774a7cf7 100644 --- a/ompi/mpi/c/status_c2f.c.in +++ b/ompi/mpi/c/status_c2f.c.in @@ -33,11 +33,10 @@ #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/mpi/fortran/base/constants.h" #include "ompi/memchecker.h" +#include "ompi/util/status.h" PROTOTYPE ERROR_CLASS status_c2f(STATUS c_status, FINT_OUT f_status) { - const int *c_ints; - int i; MEMCHECKER( if(c_status != MPI_STATUSES_IGNORE) { /* @@ -61,33 +60,5 @@ PROTOTYPE ERROR_CLASS status_c2f(STATUS c_status, FINT_OUT f_status) MPI_ERR_IN_STATUS, FUNC_NAME); } } - - /* Note that MPI-2.2 16.3.5 states that even the hidden data in a - status must be converted (!). This is somewhat problematic - because the Fortran data is all INTEGERS while the C MPI_Status - contains a size_t. That being said, note 2 things: - - 1. The _ucount and _canceled members are never accessed from - Fortran. - 2. configure calculated a value of MPI_STATUS_SIZE to ensure - that the Fortran status is the Right size to hold the C - MPI_Status (including the size_t member). - - So for the purposes of this function, just copy over all the - data as if they were int's. This works because all OMPI - Fortran MPI API functions that take a status as an IN argument - first call MPI_Status_f2c on it before using it (in which case - we'll do the exact opposite copy, thereby rebuilding the size_t - value properly before it is accessed in C). - - Note that if sizeof(int) > sizeof(INTEGER), we're potentially - hosed anyway (i.e., even the public values in the status could - get truncated). But if sizeof(int) == sizeof(INTEGER) or - sizeof(int) < sizeof(INTEGER), everything should be kosher. */ - c_ints = (const int*)c_status; - for( i = 0; i < (int)(sizeof(MPI_Status) / sizeof(int)); i++ ) { - f_status[i] = OMPI_INT_2_FINT(c_ints[i]); - } - - return MPI_SUCCESS; + return ompi_status_c2f(c_status, f_status); } diff --git a/ompi/mpi/c/status_f2c.c.in b/ompi/mpi/c/status_f2c.c.in index 3216193e3e9..c7e6f7ac700 100644 --- a/ompi/mpi/c/status_f2c.c.in +++ b/ompi/mpi/c/status_f2c.c.in @@ -31,11 +31,10 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/mpi/fortran/base/fint_2_int.h" #include "ompi/mpi/fortran/base/constants.h" +#include "ompi/util/status.h" PROTOTYPE ERROR_CLASS status_f2c(FINT_CONST f_status, STATUS_OUT c_status) { - int i, *c_ints; - if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); @@ -57,17 +56,5 @@ PROTOTYPE ERROR_CLASS status_f2c(FINT_CONST f_status, STATUS_OUT c_status) } } - /* ***NOTE*** See huge comment in status_c2f.c (yes, I know - there's a size_t member in the C MPI_Status -- go - read that comment for an explanation why copying - everything as a bunch of int's is ok). - - We can't use OMPI_FINT_2_INT here because of some complications - with include files. :-( So just do the casting manually. */ - c_ints = (int*)c_status; - for( i = 0; i < (int)(sizeof(MPI_Status) / sizeof(int)); i++ ) { - c_ints[i] = (int)f_status[i]; - } - - return MPI_SUCCESS; + return ompi_status_f2c(f_status, c_status); } diff --git a/ompi/mpi/c/status_set_cancelled.c.in b/ompi/mpi/c/status_set_cancelled.c.in index 3c47560527c..960154e2d5a 100644 --- a/ompi/mpi/c/status_set_cancelled.c.in +++ b/ompi/mpi/c/status_set_cancelled.c.in @@ -28,7 +28,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -PROTOTYPE ERROR_CLASS status_set_cancelled(STATUS_OUT status, INT flag) +PROTOTYPE ERROR_CLASS status_set_cancelled(STATUS_INOUT status, INT flag) { MEMCHECKER( if(status != MPI_STATUSES_IGNORE) { diff --git a/ompi/mpi/c/status_set_elements.c.in b/ompi/mpi/c/status_set_elements.c.in index 953a7aef7d0..da3c85053e1 100644 --- a/ompi/mpi/c/status_set_elements.c.in +++ b/ompi/mpi/c/status_set_elements.c.in @@ -32,7 +32,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -PROTOTYPE ERROR_CLASS status_set_elements(STATUS_OUT status, DATATYPE datatype, COUNT count) +PROTOTYPE ERROR_CLASS status_set_elements(STATUS_INOUT status, DATATYPE datatype, COUNT count) { int rc = MPI_SUCCESS; size_t size; diff --git a/ompi/mpi/c/status_set_elements_x.c.in b/ompi/mpi/c/status_set_elements_x.c.in index c24b24f9c55..584035e8d53 100644 --- a/ompi/mpi/c/status_set_elements_x.c.in +++ b/ompi/mpi/c/status_set_elements_x.c.in @@ -32,7 +32,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/memchecker.h" -PROTOTYPE ERROR_CLASS status_set_elements_x(STATUS_OUT status, DATATYPE datatype, PARTITIONED_COUNT count) +PROTOTYPE ERROR_CLASS status_set_elements_x(STATUS_INOUT status, DATATYPE datatype, PARTITIONED_COUNT count) { int rc = MPI_SUCCESS; size_t size; diff --git a/ompi/mpi/c/status_set_error.c.in b/ompi/mpi/c/status_set_error.c.in index 30a667cd5a5..31eccfee732 100644 --- a/ompi/mpi/c/status_set_error.c.in +++ b/ompi/mpi/c/status_set_error.c.in @@ -17,7 +17,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -PROTOTYPE ERROR_CLASS status_set_error(STATUS_OUT status, INT error) +PROTOTYPE ERROR_CLASS status_set_error(STATUS_INOUT status, INT error) { MEMCHECKER( if(status != MPI_STATUSES_IGNORE) { diff --git a/ompi/mpi/c/status_set_source.c.in b/ompi/mpi/c/status_set_source.c.in index 46e1959bb85..b723a6bb3e6 100644 --- a/ompi/mpi/c/status_set_source.c.in +++ b/ompi/mpi/c/status_set_source.c.in @@ -17,7 +17,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -PROTOTYPE ERROR_CLASS status_set_source(STATUS_OUT status, INT source) +PROTOTYPE ERROR_CLASS status_set_source(STATUS_INOUT status, INT source) { MEMCHECKER( if(status != MPI_STATUSES_IGNORE) { diff --git a/ompi/mpi/c/status_set_tag.c.in b/ompi/mpi/c/status_set_tag.c.in index 2a85c3cb62f..beca885583b 100644 --- a/ompi/mpi/c/status_set_tag.c.in +++ b/ompi/mpi/c/status_set_tag.c.in @@ -18,7 +18,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/memchecker.h" -PROTOTYPE ERROR_CLASS status_set_tag(STATUS_OUT status, INT tag) +PROTOTYPE ERROR_CLASS status_set_tag(STATUS_INOUT status, INT tag) { MEMCHECKER( if(status != MPI_STATUSES_IGNORE) { diff --git a/ompi/mpi/c/type_create_struct.c.in b/ompi/mpi/c/type_create_struct.c.in index accea45f603..98e31f567a6 100644 --- a/ompi/mpi/c/type_create_struct.c.in +++ b/ompi/mpi/c/type_create_struct.c.in @@ -40,7 +40,7 @@ PROTOTYPE ERROR_CLASS type_create_struct(COUNT count, COUNT_ARRAY array_of_blocklengths, AINT_COUNT_ARRAY array_of_displacements, - DATATYPE_ARRAY array_of_types, + DATATYPE_ARRAY array_of_types:count, DATATYPE_OUT newtype) { int i, rc, icount = (int)count; diff --git a/ompi/mpi/c/win_create_errhandler.c.in b/ompi/mpi/c/win_create_errhandler.c.in index 27a48e33aa4..3391c643524 100644 --- a/ompi/mpi/c/win_create_errhandler.c.in +++ b/ompi/mpi/c/win_create_errhandler.c.in @@ -30,7 +30,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/win/win.h" -PROTOTYPE ERROR_CLASS win_create_errhandler(WIN_ERRHANLDER_FUNCTION function, +PROTOTYPE ERROR_CLASS win_create_errhandler(WIN_ERRHANDLER_FUNCTION function, ERRHANDLER_OUT errhandler) { int err = MPI_SUCCESS; diff --git a/ompi/mpi/c/win_f2c.c b/ompi/mpi/c/win_f2c.c.in similarity index 88% rename from ompi/mpi/c/win_f2c.c rename to ompi/mpi/c/win_f2c.c.in index 82bf2b9cc71..f7b979d80aa 100644 --- a/ompi/mpi/c/win_f2c.c +++ b/ompi/mpi/c/win_f2c.c.in @@ -27,16 +27,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/mpi/fortran/base/fint_2_int.h" -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_f2c = PMPI_Win_f2c -#endif -#define MPI_Win_f2c PMPI_Win_f2c -#endif - -static const char FUNC_NAME[] = "MPI_Win_f2c"; - -MPI_Win MPI_Win_f2c(MPI_Fint win) +PROTOTYPE WIN win_f2c(FINT win) { int o_index= OMPI_FINT_2_INT(win); diff --git a/ompi/mpiext/Makefile.am b/ompi/mpiext/Makefile.am index bbbdec3531c..e23729b2e91 100644 --- a/ompi/mpiext/Makefile.am +++ b/ompi/mpiext/Makefile.am @@ -16,5 +16,5 @@ headers += \ mpiext/mpiext.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ mpiext/mpiext.c diff --git a/ompi/op/Makefile.am b/ompi/op/Makefile.am index 5599c31311b..db4e92736a2 100644 --- a/ompi/op/Makefile.am +++ b/ompi/op/Makefile.am @@ -24,4 +24,4 @@ headers += op/op.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += op/op.c +libopen_mpi_la_SOURCES += op/op.c diff --git a/ompi/peruse/Makefile.am b/ompi/peruse/Makefile.am index 9b2d043ce43..aee74cc436c 100644 --- a/ompi/peruse/Makefile.am +++ b/ompi/peruse/Makefile.am @@ -21,7 +21,7 @@ if WANT_PERUSE # do NOT want this nobase - we want the peruse stripped off... include_HEADERS += peruse/peruse.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ peruse/peruse.c \ peruse/peruse_module.c endif diff --git a/ompi/proc/Makefile.am b/ompi/proc/Makefile.am index e9ad85d6f73..b10d46e37cf 100644 --- a/ompi/proc/Makefile.am +++ b/ompi/proc/Makefile.am @@ -23,5 +23,5 @@ headers += \ proc/proc.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ proc/proc.c diff --git a/ompi/request/Makefile.am b/ompi/request/Makefile.am index ab7bf73fe80..c30da608d08 100644 --- a/ompi/request/Makefile.am +++ b/ompi/request/Makefile.am @@ -34,18 +34,18 @@ headers += \ request/grequestx.h endif -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ request/grequest.c \ request/request.c \ request/req_test.c \ request/req_wait.c if WANT_FT_MPI -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ request/req_ft.c endif # WANT_FT_MPI if OMPI_ENABLE_GREQUEST_EXTENSIONS -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ request/grequestx.c endif diff --git a/ompi/request/grequest.c b/ompi/request/grequest.c index 6125d134a9c..2338f8e0e71 100644 --- a/ompi/request/grequest.c +++ b/ompi/request/grequest.c @@ -23,6 +23,7 @@ #include "ompi/communicator/communicator.h" #include "ompi/request/grequest.h" #include "ompi/mpi/fortran/base/fint_2_int.h" +#include "ompi/util/status.h" /** * Internal function to specialize the call to the user provided free_fn @@ -262,9 +263,9 @@ int ompi_grequest_invoke_query(ompi_request_t *request, */ MPI_Fint ierr; MPI_Fint fstatus[sizeof(MPI_Status) / sizeof(int)]; - MPI_Status_c2f(status, fstatus); + ompi_status_c2f(status, fstatus); g->greq_query.f_query((MPI_Aint*)g->greq_state, fstatus, &ierr); - MPI_Status_f2c(fstatus, status); + ompi_status_f2c(fstatus, status); rc = OMPI_FINT_2_INT(ierr); } } diff --git a/ompi/runtime/Makefile.am b/ompi/runtime/Makefile.am index 957045ed116..225284b6066 100644 --- a/ompi/runtime/Makefile.am +++ b/ompi/runtime/Makefile.am @@ -31,7 +31,7 @@ headers += \ runtime/ompi_spc.h \ runtime/ompi_rte.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ runtime/ompi_mpi_init.c \ runtime/ompi_mpi_abort.c \ runtime/ompi_mpi_dynamics.c \ diff --git a/ompi/tools/wrappers/Makefile.am b/ompi/tools/wrappers/Makefile.am index 1d5b24a9372..f1482ff4164 100644 --- a/ompi/tools/wrappers/Makefile.am +++ b/ompi/tools/wrappers/Makefile.am @@ -89,7 +89,7 @@ if OMPI_WANT_JAVA_BINDINGS bin_SCRIPTS = mpijavac.pl endif -nodist_ompidata_DATA = mpicc-wrapper-data.txt +nodist_ompidata_DATA = mpicc-wrapper-data.txt mpicc_abi-wrapper-data.txt if OMPI_HAVE_CXX_COMPILER nodist_ompidata_DATA += mpic++-wrapper-data.txt @@ -102,6 +102,7 @@ endif install-exec-hook-always: test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" (cd $(DESTDIR)$(bindir); rm -f mpicc$(EXEEXT); $(LN_S) opal_wrapper$(EXEEXT) mpicc$(EXEEXT)) + (cd $(DESTDIR)$(bindir); rm -f mpicc_abi$(EXEEXT); $(LN_S) opal_wrapper$(EXEEXT) mpicc_abi$(EXEEXT)) if OMPI_HAVE_CXX_COMPILER (cd $(DESTDIR)$(bindir); rm -f mpic++$(EXEEXT); $(LN_S) opal_wrapper$(EXEEXT) mpic++$(EXEEXT)) (cd $(DESTDIR)$(bindir); rm -f mpicxx$(EXEEXT); $(LN_S) opal_wrapper$(EXEEXT) mpicxx$(EXEEXT)) diff --git a/ompi/tools/wrappers/mpicc_abi-wrapper-data.txt.in b/ompi/tools/wrappers/mpicc_abi-wrapper-data.txt.in new file mode 100644 index 00000000000..916036f931e --- /dev/null +++ b/ompi/tools/wrappers/mpicc_abi-wrapper-data.txt.in @@ -0,0 +1,26 @@ +# There can be multiple blocks of configuration data, chosen by +# compiler flags (using the compiler_args key to chose which block +# should be activated. This can be useful for multilib builds. See the +# multilib page at: +# https://github.com/open-mpi/ompi/wiki/compilerwrapper3264 +# for more information. + +project=Open MPI +project_short=OMPI +version=@OMPI_VERSION@ +language=C +compiler_env=CC +compiler_flags_env=CFLAGS +compiler=@WRAPPER_CC@ +preprocessor_flags=-I${includedir}/standard_abi +compiler_flags_prefix=@OMPI_WRAPPER_CFLAGS_PREFIX@ +compiler_flags=@OMPI_WRAPPER_CFLAGS@ +linker_flags=@OMPI_WRAPPER_LDFLAGS@ +linker_flags_static=@OMPI_WRAPPER_LDFLAGS_STATIC@ +libs=-lmpi_abi +libs_static= +dyn_lib_file=libmpi_abi.@OPAL_DYN_LIB_SUFFIX@ +static_lib_file=libmpi_abi.a +required_file= +includedir=${includedir} +libdir=${libdir} diff --git a/ompi/util/Makefile.am b/ompi/util/Makefile.am index 53a89a074eb..70df3bed6a3 100644 --- a/ompi/util/Makefile.am +++ b/ompi/util/Makefile.am @@ -11,4 +11,5 @@ # Source code files headers += \ util/timings.h \ - util/count_disp_array.h + util/count_disp_array.h \ + util/status.h diff --git a/ompi/util/status.h b/ompi/util/status.h new file mode 100644 index 00000000000..c1089df5f5c --- /dev/null +++ b/ompi/util/status.h @@ -0,0 +1,56 @@ +#include "ompi/mpi/fortran/base/fint_2_int.h" +#include "ompi/mpi/fortran/base/constants.h" + +static inline int ompi_status_c2f(const MPI_Status *c_status, MPI_Fint *f_status) +{ + const int *c_ints; + int i; + + /* Note that MPI-2.2 16.3.5 states that even the hidden data in a + status must be converted (!). This is somewhat problematic + because the Fortran data is all INTEGERS while the C MPI_Status + contains a size_t. That being said, note 2 things: + + 1. The _ucount and _canceled members are never accessed from + Fortran. + 2. configure calculated a value of MPI_STATUS_SIZE to ensure + that the Fortran status is the Right size to hold the C + MPI_Status (including the size_t member). + + So for the purposes of this function, just copy over all the + data as if they were int's. This works because all OMPI + Fortran MPI API functions that take a status as an IN argument + first call MPI_Status_f2c on it before using it (in which case + we'll do the exact opposite copy, thereby rebuilding the size_t + value properly before it is accessed in C). + + Note that if sizeof(int) > sizeof(INTEGER), we're potentially + hosed anyway (i.e., even the public values in the status could + get truncated). But if sizeof(int) == sizeof(INTEGER) or + sizeof(int) < sizeof(INTEGER), everything should be kosher. */ + c_ints = (const int*)c_status; + for( i = 0; i < (int)(sizeof(MPI_Status) / sizeof(int)); i++ ) { + f_status[i] = OMPI_INT_2_FINT(c_ints[i]); + } + + return MPI_SUCCESS; +} + +static inline int ompi_status_f2c(const MPI_Fint *f_status, MPI_Status *c_status) +{ + int i, *c_ints; + + /* ***NOTE*** See huge comment in status_c2f.c (yes, I know + there's a size_t member in the C MPI_Status -- go + read that comment for an explanation why copying + everything as a bunch of int's is ok). + + We can't use OMPI_FINT_2_INT here because of some complications + with include files. :-( So just do the casting manually. */ + c_ints = (int*)c_status; + for( i = 0; i < (int)(sizeof(MPI_Status) / sizeof(int)); i++ ) { + c_ints[i] = (int)f_status[i]; + } + + return MPI_SUCCESS; +} diff --git a/ompi/win/Makefile.am b/ompi/win/Makefile.am index 67126c71ec0..8675e77b63e 100644 --- a/ompi/win/Makefile.am +++ b/ompi/win/Makefile.am @@ -23,5 +23,5 @@ headers += \ win/win.h -lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ +libopen_mpi_la_SOURCES += \ win/win.c