Skip to content

Commit b8819d4

Browse files
committed
distcheck fix and more
Signed-off-by: Howard Pritchard <howardp@lanl.gov>
1 parent d5663f7 commit b8819d4

File tree

8 files changed

+115
-72
lines changed

8 files changed

+115
-72
lines changed

ompi/mpi/bindings/c_header.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ def output_constant(const, use_enum: bool, mangle_name: bool):
221221

222222
# ================================ Final Output ================================
223223
output.append("#endif /* _ABI_INTERNAL_ */")
224+
# === some compilers are finicky about not having empy line at end of include file =====
225+
output.append("\n")
224226

225227
for i, line in enumerate(output):
226228
line = line.replace(r"\ldots", "...")

ompi/mpi/c/Makefile.am

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,18 +477,17 @@ prototype_sources = \
477477
win_wait.c.in \
478478
wtime.c.in
479479

480-
EXTRA_DIST = $(prototype_sources)
480+
EXTRA_DIST = $(prototype_sources) \
481+
abi_converters.h \
482+
abi_get_info.c.in
481483

482484
# attr_fn.c contains attribute manipulation functions which do not
483485
# profiling implications, and so are always built.
484486
libmpi_c_la_SOURCES = \
485487
attr_fn.c
486488

487-
# The MPI_Abi_* functions do not require profiling implementations.
489+
# functions that do not require profiling implementations.
488490
libmpi_c_la_SOURCES += \
489-
abi_details.c \
490-
abi_supported.c \
491-
abi_version.c \
492491
ompi_isendrecv.c \
493492
ompi_sendrecv.c
494493

ompi/mpi/c/Makefile_abi.include

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,20 @@ BUILT_SOURCES = abi.h standard_abi/mpi.h
4040

4141
libmpi_c_abi_la_SOURCES = \
4242
attr_fn.c \
43-
abi_details.c \
44-
abi_supported.c \
45-
abi_version.c
43+
abi_get_info.c \
44+
abi_get_version.c
4645

47-
libmpi_c_abi_la_CPPFLAGS = -DOMPI_NO_MPI_PROTOTYPES
46+
abi_get_info.c: abi_get_info.c.in
47+
$(OMPI_V_GEN) $(PYTHON) $(top_srcdir)/ompi/mpi/bindings/bindings.py \
48+
--builddir $(abs_top_builddir) \
49+
--srcdir $(abs_top_srcdir) \
50+
--output $@ \
51+
c \
52+
source \
53+
standard \
54+
$<
55+
56+
libmpi_c_abi_la_CPPFLAGS = -DOMPI_NO_MPI_PROTOTYPES -DOMPI_BUILD_MPI_PROFILING=0 -DOMPI_BUILD_STANDARD_ABI
4857
libmpi_c_abi_la_LIBADD = libmpi_c_abi_profile.la
4958
if BUILD_MPI_BINDINGS_LAYER
5059
libmpi_c_abi_la_LIBADD += libmpi_c_abi_noprofile.la

ompi/mpi/c/abi.h.in

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include "stddef.h"
1414
#include "stdint.h"
1515

16-
/* #include <stdint.h> */
17-
16+
#undef MPI_VERSION
1817
#define MPI_VERSION 5
18+
#undef MPI_SUBVERSION
1919
#define MPI_SUBVERSION 0
2020

2121
#define MPI_ABI_VERSION 1
@@ -34,29 +34,29 @@ typedef struct MPI_ABI_Request * MPI_Request;
3434
typedef struct MPI_ABI_Session * MPI_Session;
3535
typedef struct MPI_ABI_Win * MPI_Win;
3636

37-
/* /\* MPI_Aint is defined to be intptr_t (or equivalent to it, if compiler support is absent). */
38-
/* * The only acceptable alternative to intptr_t is the C89 type equivalent to it. *\/ */
39-
/* #if !defined(MPI_ABI_Aint) */
40-
/* #define MPI_ABI_Aint intptr_t */
41-
/* #endif */
42-
/* typedef MPI_ABI_Aint MPI_Aint; */
43-
/* #undef MPI_ABI_Aint */
44-
45-
/* /\* MPI_Offset will be 64b on all relevant systems. */
46-
/* * We allow for MPI implementations supporting for 128b filesystems. *\/ */
47-
/* #if !defined(MPI_ABI_Offset) */
48-
/* #define MPI_ABI_Offset int64_t */
49-
/* #endif */
50-
/* typedef MPI_ABI_Offset MPI_Offset; */
51-
/* #undef MPI_ABI_Offset */
52-
53-
/* /\* MPI_Count must be large enough to hold the larger of MPI_Aint and MPI_Offset. */
54-
/* * Platforms where MPI_Aint is larger than MPI_Offset are extremely rare. *\/ */
55-
/* #if !defined(MPI_ABI_Count) */
56-
/* #define MPI_ABI_Count MPI_Offset */
57-
/* #endif */
58-
/* typedef MPI_ABI_Count MPI_Count; */
59-
/* #undef MPI_ABI_Count */
37+
/* MPI_Aint is defined to be intptr_t (or equivalent to it, if compiler support is absent).
38+
* The only acceptable alternative to intptr_t is the C89 type equivalent to it. */
39+
#if !defined(MPI_ABI_Aint)
40+
#define MPI_ABI_Aint intptr_t
41+
#endif
42+
typedef MPI_ABI_Aint MPI_Aint;
43+
#undef MPI_ABI_Aint
44+
45+
/* MPI_Offset will be 64b on all relevant systems.
46+
* We allow for MPI implementations supporting for 128b filesystems. */
47+
#if !defined(MPI_ABI_Offset)
48+
#define MPI_ABI_Offset int64_t
49+
#endif
50+
typedef MPI_ABI_Offset MPI_Offset;
51+
#undef MPI_ABI_Offset
52+
53+
/* MPI_Count must be large enough to hold the larger of MPI_Aint and MPI_Offset.
54+
* Platforms where MPI_Aint is larger than MPI_Offset are extremely rare. */
55+
#if !defined(MPI_ABI_Count)
56+
#define MPI_ABI_Count MPI_Offset
57+
#endif
58+
typedef MPI_ABI_Count MPI_Count;
59+
#undef MPI_ABI_Count
6060

6161
typedef struct {
6262
int MPI_SOURCE;
@@ -211,3 +211,4 @@ $CATEGORY:TOOL_INFO_IFACE_SOURCE_ORDERINGS$
211211
* Callback safety requirement levels used in the MPI tool information interface
212212
*/
213213
$CATEGORY:TOOL_INFO_IFACE_CB_SAFETY_REQ_LEVELS$
214+

ompi/mpi/c/abi_details.c

Lines changed: 0 additions & 36 deletions
This file was deleted.

ompi/mpi/c/abi_get_info.c.in

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright (c) 2023-2025 Triad National Security, LLC. All rights reserved.
3+
* $COPYRIGHT$
4+
*
5+
* Additional copyrights may follow
6+
*
7+
* $HEADER$
8+
*/
9+
10+
#include "ompi_config.h"
11+
12+
#include <stdlib.h>
13+
14+
#include "opal/util/show_help.h"
15+
#include "ompi/runtime/ompi_spc.h"
16+
#include "ompi/mpi/c/bindings.h"
17+
#include "ompi/communicator/communicator.h"
18+
#include "ompi/errhandler/errhandler.h"
19+
#include "ompi/constants.h"
20+
#ifdef OMPI_NO_MPI_PROTOTYPES
21+
#include "ompi/mpi/c/abi.h"
22+
#endif
23+
24+
PROTOTYPE ERROR_CLASS abi_get_info(INFO_OUT info)
25+
{
26+
int ret = OMPI_SUCCESS;
27+
ompi_info_t *newinfo = NULL;
28+
char tmp[16];
29+
30+
newinfo = ompi_info_allocate();
31+
if (NULL == newinfo) {
32+
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM,
33+
"MPI_Info_dup");
34+
}
35+
36+
/* TODO: need to set aint_size, count_size, offset_size */
37+
38+
snprintf(tmp, 16, "%" PRIsize_t, sizeof(MPI_Aint));
39+
ret = opal_info_set(&newinfo->super, "mpi_aint_size", tmp);
40+
if (OPAL_SUCCESS != ret) {
41+
goto err_cleanup;
42+
}
43+
snprintf(tmp, 16, "%" PRIsize_t, sizeof(MPI_Count));
44+
ret = opal_info_set(&newinfo->super, "mpi_count_size", tmp);
45+
if (OPAL_SUCCESS != ret) {
46+
goto err_cleanup;
47+
}
48+
snprintf(tmp, 16, "%" PRIsize_t, sizeof(MPI_Offset));
49+
ret = opal_info_set(&newinfo->super, "mpi_offset_size", tmp);
50+
if (OPAL_SUCCESS != ret) {
51+
goto err_cleanup;
52+
}
53+
54+
*info = newinfo;
55+
return ret;
56+
57+
err_cleanup:
58+
ompi_info_free(&newinfo);
59+
return ret;
60+
61+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023 Triad National Security, LLC. All rights reserved.
2+
* Copyright (c) 2023-2025 Triad National Security, LLC. All rights reserved.
33
* $COPYRIGHT$
44
*
55
* Additional copyrights may follow
@@ -21,7 +21,7 @@
2121
#include "ompi/mpi/c/abi.h"
2222
#endif
2323

24-
int MPI_Abi_version(int *abi_major, int *abi_minor)
24+
int MPI_Abi_get_version(int *abi_major, int *abi_minor)
2525
{
2626
/* 0.1 */
2727
*abi_major = 0;

ompi/mpi/c/attr_fn.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ int OMPI_C_MPI_COMM_DUP_FN( MPI_Comm comm, int comm_keyval, void* extra_state,
133133
return MPI_SUCCESS;
134134
}
135135

136+
/*
137+
* Following are not part of the standard ABI
138+
*/
139+
140+
#ifndef OMPI_BUILD_STANDARD_ABI
141+
136142
int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval,
137143
void* attribute_val_out,
138144
void* extra_state )
@@ -156,3 +162,4 @@ int OMPI_C_MPI_DUP_FN( MPI_Comm comm, int comm_keyval, void* extra_state,
156162
*(void**)attribute_val_out = attribute_val_in;
157163
return MPI_SUCCESS;
158164
}
165+
#endif

0 commit comments

Comments
 (0)