Skip to content

Commit 9466f42

Browse files
hppritchajtronge
andcommitted
ABI: Move ABI support into big count binding code
Implement lots of missing functionality in the original api.py script. The functionality is now part of the bindings generation framework used for Big Count. Number of todos still to do, in particular provide support for wrapping user supplied callback functions. Also, the sendrecv_replace, etc. code needs to be refactored to work with the bindings framework. to heed the --enable-abi-standard config option Additional initial fixes to merging ABI support into big count framework. Co-authored-by: Jake Tronge <[email protected]> Signed-off-by: Howard Pritchard <[email protected]>
1 parent c14c64c commit 9466f42

40 files changed

+1735
-1643
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,6 @@ docs/man
535535

536536
# Generated C Bindings
537537
ompi/mpi/c/*_generated*.c
538-
ompi/mpi/c/ompi_*.c
539538
ompi/mpi/c/standard_*.c
540539
ompi/mpi/c/abi.h
541540
ompi/mpi/c/standard_abi

config/ompi_configure_options.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,12 @@ AM_CONDITIONAL(OMPI_OMPIO_SUPPORT, test "$ompi_want_ompio" = "1")
256256
AC_ARG_ENABLE([deprecate-mpif-h],
257257
[AS_HELP_STRING([--enable-deprecate-mpif-h],
258258
[Mark the mpif.h bindings as deprecated (default: enabled)])])
259+
# If the binding source files don't exist, then we need Python to generate them
260+
AM_PATH_PYTHON([3.6],,[:])
261+
binding_file="${srcdir}/ompi/mpi/c/ompi_send_generated.c"
262+
AS_IF([! test -e "$binding_file" && test "$PYTHON" = ":"],
263+
[AC_MSG_ERROR([Open MPI requires Python >=3.6 for generating the bindings. Aborting])])
264+
AM_CONDITIONAL(OMPI_GENERATE_BINDINGS,[test "$PYTHON" != ":"])
259265

260266
AC_MSG_CHECKING([if want to enable standard ABI library])
261267
AC_ARG_ENABLE([standard-abi],

ompi/Makefile.am

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ DIST_SUBDIRS = \
126126
$(MCA_ompi_FRAMEWORKS_SUBDIRS) \
127127
$(MCA_ompi_FRAMEWORK_COMPONENT_ALL_SUBDIRS)
128128

129-
noinst_LTLIBRARIES = libopen-mpi.la
129+
noinst_LTLIBRARIES = libopen_mpi.la
130130
lib_LTLIBRARIES = lib@[email protected]
131131
if OMPI_STANDARD_ABI
132132
lib_LTLIBRARIES += libmpi_abi.la
@@ -142,14 +142,14 @@ endif
142142
# +----------------------+----------------------+
143143
# | libmpi_abi.la | libmpi.la |
144144
# +----------------------+----------------------+
145-
# | libopen-mpi.la |
145+
# | libopen_mpi.la |
146146
# +----------------------+----------------------+
147147
#
148-
# This includes a new library, libopen-mpi.la, that links in all backend code
148+
# This includes a new library, libopen_mpi.la, that links in all backend code
149149
# built in this directory or SUBDIRs of this directory. Previously everything
150150
# was just linked directly into libmpi.la (lib@[email protected]).
151151
#
152-
# libmpi_abi.la and libmpi.la both now link in libopen-mpi.la, the only
152+
# libmpi_abi.la and libmpi.la both now link in libopen_mpi.la, the only
153153
# difference between them being that one includes the standard ABI functions
154154
# and the other the ompi-specific versions of those.
155155
#
@@ -167,7 +167,7 @@ libopen_mpi_la_DEPENDENCIES = $(libopen_mpi_la_LIBADD)
167167
# Build the main MPI library
168168
lib@OMPI_LIBMPI_NAME@_la_SOURCES =
169169
lib@OMPI_LIBMPI_NAME@_la_LIBADD = \
170-
libopen-mpi.la \
170+
libopen_mpi.la \
171171
mpi/c/libmpi_c.la \
172172
mpi/tool/libmpi_mpit.la \
173173
$(c_mpi_lib) \
@@ -182,16 +182,16 @@ lib@OMPI_LIBMPI_NAME@_la_LDFLAGS = \
182182
# The MPI Standard ABI library
183183
libmpi_abi_la_SOURCES =
184184
libmpi_abi_la_LIBADD = \
185-
libopen-mpi.la \
185+
libopen_mpi.la \
186186
mpi/c/libmpi_c_abi.la
187187

188188
# included subdirectory Makefile.am's and appended-to variables
189189
headers =
190-
noinst_LTLIBRARIES =
191190
include_HEADERS =
192191
EXTRA_DIST =
193192
lib@OMPI_LIBMPI_NAME@_la_SOURCES += $(headers)
194193
dist_ompidata_DATA =
194+
libopen_mpi_la_SOURCES += $(headers)
195195

196196
# Conditionally install the header files
197197

ompi/attribute/attribute.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ do { \
322322
/* C style */ \
323323
else { \
324324
void *attr_val = translate_to_c(attribute); \
325+
/* TODO: NEED SUPPORT FOR ABI */ \
325326
err = (*((keyval_obj->delete_attr_fn).attr_##type##_delete_fn)) \
326327
((ompi_##type##_t *)object, \
327328
key, attr_val, \
@@ -381,6 +382,7 @@ do { \
381382
else { \
382383
void *in, *out; \
383384
in = translate_to_c(in_attr); \
385+
/* TODO: NEED SUPPORT FOR ABI */ \
384386
if ((err = (*((keyval_obj->copy_attr_fn).attr_##type##_copy_fn)) \
385387
((ompi_##type##_t *)old_object, key, keyval_obj->extra_state.c_ptr, \
386388
in, &out, &flag)) == MPI_SUCCESS) { \

ompi/attribute/attribute.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#define OMPI_KEYVAL_PREDEFINED 0x0001
5151
#define OMPI_KEYVAL_F77 0x0002
5252
#define OMPI_KEYVAL_F77_INT 0x0004
53+
#define OMPI_KEYVAL_ABI 0x0008
5354

5455

5556
BEGIN_C_DECLS
@@ -136,7 +137,7 @@ struct ompi_attribute_keyval_t {
136137
copy/delete attribute functions
137138
properly and error checking */
138139
int attr_flag; /**< flag field: contains "OMPI_KEYVAL_PREDEFINED",
139-
"OMPI_KEYVAL_F77" */
140+
"OMPI_KEYVAL_F77", "OMPI_KEYVAL_ABI", etc. */
140141
ompi_attribute_fn_ptr_union_t copy_attr_fn; /**< Copy function for the
141142
attribute */
142143
ompi_attribute_fn_ptr_union_t delete_attr_fn; /**< Delete function for the

ompi/include/mpi.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,6 +1451,7 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub;
14511451
/*
14521452
* MPI API
14531453
*/
1454+
#ifndef OMPI_NO_MPI_PROTOTYPES
14541455
OMPI_DECLSPEC int MPI_Abi_supported(int *flag);
14551456
OMPI_DECLSPEC int MPI_Abi_version(int *abi_major, int *abi_minor);
14561457
OMPI_DECLSPEC int MPI_Abi_details(int *buflen, char *details, MPI_Info *info);
@@ -4172,6 +4173,7 @@ OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub)
41724173

41734174
#endif /* OMPI_NO_MPI_PROTOTYPES */
41744175

4176+
41754177
#if defined(c_plusplus) || defined(__cplusplus)
41764178
}
41774179
#endif

0 commit comments

Comments
 (0)