Skip to content

Commit c4bb634

Browse files
committed
abi_get_version/get_info add to ompi abi lib
and correction major/minor versoin returned from the ABI build. Signed-off-by: Howard Pritchard <[email protected]>
1 parent f7a2c6d commit c4bb634

File tree

5 files changed

+24
-38
lines changed

5 files changed

+24
-38
lines changed

ompi/include/mpi.h.in

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,9 +1453,8 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub;
14531453
/*
14541454
* MPI API
14551455
*/
1456-
OMPI_DECLSPEC int MPI_Abi_supported(int *flag);
1457-
OMPI_DECLSPEC int MPI_Abi_version(int *abi_major, int *abi_minor);
1458-
OMPI_DECLSPEC int MPI_Abi_details(int *buflen, char *details, MPI_Info *info);
1456+
OMPI_DECLSPEC int MPI_Abi_get_version(int *abi_major, int *abi_minor);
1457+
OMPI_DECLSPEC int MPI_Abi_get_info(MPI_Info *info);
14591458
OMPI_DECLSPEC int MPI_Abi_get_fortran_info(MPI_Info *info);
14601459
OMPI_DECLSPEC int MPI_Abi_set_fortran_info(MPI_Info info);
14611460
OMPI_DECLSPEC int MPI_Abi_get_fortran_booleans(int logical_size, void *logical_true, void *logical_false, int *is_set);
@@ -2656,9 +2655,8 @@ OMPI_DECLSPEC double MPI_Wtime(void);
26562655
/*
26572656
* Profiling MPI API
26582657
*/
2659-
OMPI_DECLSPEC int PMPI_Abi_supported(int *flag);
2660-
OMPI_DECLSPEC int PMPI_Abi_version(int *abi_major, int *abi_minor);
2661-
OMPI_DECLSPEC int PMPI_Abi_details(int *buflen, char *details, MPI_Info *info);
2658+
OMPI_DECLSPEC int PMPI_Abi_get_version(int *abi_major, int *abi_minor);
2659+
OMPI_DECLSPEC int PMPI_Abi_get_info(MPI_Info *info);
26622660
OMPI_DECLSPEC int PMPI_Abi_get_fortran_info(MPI_Info *info);
26632661
OMPI_DECLSPEC int PMPI_Abi_set_fortran_info(MPI_Info info);
26642662
OMPI_DECLSPEC int PMPI_Abi_get_fortran_booleans(int logical_size, void *logical_true, void *logical_false, int *is_set);

ompi/mpi/c/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ prototype_sources = \
5555
abi_set_fortran_info.c.in \
5656
abi_get_fortran_booleans.c.in \
5757
abi_set_fortran_booleans.c.in \
58+
abi_get_info.c.in \
59+
abi_get_version.c.in \
5860
abort.c.in \
5961
accumulate.c.in \
6062
add_error_class.c.in \

ompi/mpi/c/Makefile_abi.include

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ libmpi_c_abi_la_SOURCES = \
4545
ompi_abi_fortran.c
4646

4747
extra_abi_fns = \
48-
abi_get_info.c \
49-
abi_get_version.c \
5048
aint_add_abi.c \
5149
aint_diff_abi.c \
5250
comm_fromint_abi.c \
@@ -75,16 +73,6 @@ extra_abi_fns = \
7573
wtick.c
7674

7775

78-
abi_get_info.c: abi_get_info.c.in
79-
$(OMPI_V_GEN) $(PYTHON) $(top_srcdir)/ompi/mpi/bindings/bindings.py \
80-
--builddir $(abs_top_builddir) \
81-
--srcdir $(abs_top_srcdir) \
82-
--output $@ \
83-
c \
84-
source \
85-
standard \
86-
$<
87-
8876
libmpi_c_abi_la_CPPFLAGS = -DOMPI_NO_MPI_PROTOTYPES -DOMPI_BUILD_MPI_PROFILING=0 -DOMPI_BUILD_STANDARD_ABI
8977
libmpi_c_abi_la_LIBADD = libmpi_c_abi_profile.la
9078
if BUILD_MPI_BINDINGS_LAYER

ompi/mpi/c/abi_get_info.c.in

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@
1717
#include "ompi/communicator/communicator.h"
1818
#include "ompi/errhandler/errhandler.h"
1919
#include "ompi/constants.h"
20-
#ifdef OMPI_NO_MPI_PROTOTYPES
21-
#include "ompi/mpi/c/abi.h"
22-
#endif
2320

2421
PROTOTYPE ERROR_CLASS abi_get_info(INFO_OUT info)
2522
{
2623
int ret = OMPI_SUCCESS;
24+
25+
#if OMPI_ABI_SRC
2726
ompi_info_t *newinfo = NULL;
2827
char tmp[16];
29-
3028
newinfo = ompi_info_allocate();
3129
if (NULL == newinfo) {
3230
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM,
@@ -52,10 +50,12 @@ PROTOTYPE ERROR_CLASS abi_get_info(INFO_OUT info)
5250
}
5351

5452
*info = newinfo;
55-
return ret;
56-
5753
err_cleanup:
5854
ompi_info_free(&newinfo);
5955
return ret;
60-
56+
57+
#else
58+
*info = MPI_INFO_NULL;
59+
#endif
60+
return ret;
6161
}

ompi/mpi/c/abi_get_version.c renamed to ompi/mpi/c/abi_get_version.c.in

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,19 @@
1717
#include "ompi/communicator/communicator.h"
1818
#include "ompi/errhandler/errhandler.h"
1919
#include "ompi/constants.h"
20-
#ifdef OMPI_NO_MPI_PROTOTYPES
21-
#include "ompi/mpi/c/abi.h"
22-
#endif
23-
24-
#if OMPI_BUILD_MPI_PROFILING
25-
#if OPAL_HAVE_WEAK_SYMBOLS
26-
#pragma weak MPI_Abi_get_version = PMPI_Abi_get_version
27-
#endif
28-
#define MPI_Abi_get_version PMPI_Abi_get_version
29-
#endif
3020

31-
int MPI_Abi_get_version(int *abi_major, int *abi_minor)
21+
PROTOTYPE ERROR_CLASS abi_get_version(INT_OUT abi_major, INT_OUT abi_minor)
3222
{
23+
/*
24+
* For the curious see Chapter 20 section 2 of the MPI 5 standard
25+
*/
26+
#if OMPI_ABI_SRC
3327
/* 0.1 */
34-
*abi_major = 0;
35-
*abi_minor = 1;
28+
*abi_major = 1;
29+
*abi_minor = 0;
30+
#else
31+
*abi_major = -1;
32+
*abi_minor = -1;
33+
#endif
3634
return MPI_SUCCESS;
3735
}

0 commit comments

Comments
 (0)