Skip to content

Commit f12c656

Browse files
committed
Add initial ABI generation code and new libraries
Two external MPI libraries are now created: libmpi.la and libmpi_abi.la. Backend code that was originally in libmpi.la has been extracted into libopen-mpi.la to be linked into both libraries. Parts of the Open MPI C interface are now being generated by a python script (abi.py) from modified source files (named with *.in). This script generates files for both the ompi ABI and the standard ABI from the same source file, also including new bigcount interfaces. To compile standard ABI code, there's a new mpicc_abi compiler wrapper. The standard ABI does not yet include all functions or symbols, so more complicated source files will not compile. ROMIO must be disabled for the code to link, since it's relying on the external MPI interface.
1 parent 2ebdfbb commit f12c656

File tree

101 files changed

+1671
-393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1671
-393
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,3 +534,9 @@ docs/_templates
534534
# Common Python virtual environment directory names
535535
venv
536536
py??
537+
538+
# Generated C Bindings
539+
ompi/mpi/c/ompi_*.c
540+
ompi/mpi/c/standard_*.c
541+
ompi/mpi/c/abi.h
542+
ompi/mpi/c/standard_abi

ompi/Makefile.am

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

129-
# Build the main MPI library
129+
noinst_LTLIBRARIES = libopen-mpi.la
130+
lib_LTLIBRARIES = lib@[email protected] libmpi_abi.la
130131

131-
lib_LTLIBRARIES = lib@[email protected]
132-
lib@OMPI_LIBMPI_NAME@_la_SOURCES =
133-
lib@OMPI_LIBMPI_NAME@_la_LIBADD = \
132+
# Build the Open MPI internal library
133+
libopen_mpi_la_SOURCES =
134+
libopen_mpi_la_LIBADD = \
134135
datatype/libdatatype.la \
135136
debuggers/libdebuggers.la \
137+
$(OMPI_TOP_BUILDDIR)/opal/lib@[email protected] \
138+
$(MCA_ompi_FRAMEWORK_LIBS) \
139+
$(OMPI_LIBMPI_EXTRA_LIBS)
140+
libopen_mpi_la_DEPENDENCIES = $(libopen_mpi_la_LIBADD)
141+
142+
# Build the main MPI library
143+
lib@OMPI_LIBMPI_NAME@_la_SOURCES =
144+
lib@OMPI_LIBMPI_NAME@_la_LIBADD = \
145+
libopen-mpi.la \
136146
mpi/c/libmpi_c.la \
137147
mpi/tool/libmpi_mpit.la \
138148
$(c_mpi_lib) \
139149
$(c_pmpi_lib) \
140-
$(mpi_fortran_base_lib) \
141-
$(MCA_ompi_FRAMEWORK_LIBS) \
142150
$(OMPI_MPIEXT_C_LIBS) \
143-
$(OMPI_LIBMPI_EXTRA_LIBS)
144-
151+
$(mpi_fortran_base_lib)
145152

146-
lib@OMPI_LIBMPI_NAME@_la_LIBADD += \
147-
$(OMPI_TOP_BUILDDIR)/opal/lib@[email protected]
148-
lib@OMPI_LIBMPI_NAME@_la_DEPENDENCIES = $(lib@OMPI_LIBMPI_NAME@_la_LIBADD)
149153
lib@OMPI_LIBMPI_NAME@_la_LDFLAGS = \
150154
-version-info $(libmpi_so_version) \
151155
$(OMPI_LIBMPI_EXTRA_LDFLAGS)
152156

157+
# Build the MPI Standard ABI library
158+
libmpi_abi_la_SOURCES =
159+
libmpi_abi_la_LIBADD = \
160+
libopen-mpi.la \
161+
mpi/c/libmpi_c_abi.la
162+
153163
# included subdirectory Makefile.am's and appended-to variables
154164
headers =
155-
noinst_LTLIBRARIES =
156165
include_HEADERS =
157166
dist_ompidata_DATA =
158-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += $(headers)
167+
libopen_mpi_la_SOURCES += $(headers)
159168

160169
# Conditionally install the header files
161170

ompi/attribute/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
headers += \
2323
attribute/attribute.h
2424

25-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
25+
libopen_mpi_la_SOURCES += \
2626
attribute/attribute.c \
2727
attribute/attribute_predefined.c

ompi/class/Makefile.am

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@
2323
headers += \
2424
class/ompi_seq_tracker.h
2525

26-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
26+
libopen_mpi_la_SOURCES += \
2727
class/ompi_seq_tracker.c
28-

ompi/communicator/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ headers += \
2828
communicator/communicator.h \
2929
communicator/comm_request.h
3030

31-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
31+
libopen_mpi_la_SOURCES += \
3232
communicator/comm_init.c \
3333
communicator/comm.c \
3434
communicator/comm_cid.c \
3535
communicator/comm_request.c
3636

3737
if WANT_FT_MPI
38-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
38+
libopen_mpi_la_SOURCES += \
3939
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
4040
endif # WANT_FT_MPI
4141

ompi/dpm/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ dist_ompidata_DATA += dpm/help-dpm.txt
1616
headers += \
1717
dpm/dpm.h
1818

19-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
19+
libopen_mpi_la_SOURCES += \
2020
dpm/dpm.c
2121

ompi/errhandler/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ headers += \
2929
errhandler/errhandler.h \
3030
errhandler/errhandler_predefined.h
3131

32-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
32+
libopen_mpi_la_SOURCES += \
3333
errhandler/errhandler.c \
3434
errhandler/errhandler_invoke.c \
3535
errhandler/errhandler_predefined.c \

ompi/file/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
headers += \
2323
file/file.h
2424

25-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
25+
libopen_mpi_la_SOURCES += \
2626
file/file.c

ompi/group/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ headers += \
2525
group/group.h \
2626
group/group_dbg.h
2727

28-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
28+
libopen_mpi_la_SOURCES += \
2929
group/group.c \
3030
group/group_init.c \
3131
group/group_set_rank.c \

ompi/include/mpi.h.in

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,10 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub;
13881388
/*
13891389
* MPI API
13901390
*/
1391-
1391+
#ifndef OMPI_NO_MPI_PROTOTYPES
1392+
OMPI_DECLSPEC int MPI_Abi_supported(int *flag);
1393+
OMPI_DECLSPEC int MPI_Abi_version(int *abi_major, int *abi_minor);
1394+
OMPI_DECLSPEC int MPI_Abi_details(int *buflen, char *details, MPI_Info *info);
13921395
OMPI_DECLSPEC int MPI_Abort(MPI_Comm comm, int errorcode);
13931396
OMPI_DECLSPEC int MPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
13941397
int target_rank, MPI_Aint target_disp, int target_count,
@@ -1418,6 +1421,8 @@ OMPI_DECLSPEC int MPI_Alloc_mem(MPI_Aint size, MPI_Info info,
14181421
void *baseptr);
14191422
OMPI_DECLSPEC int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
14201423
MPI_Op op, MPI_Comm comm);
1424+
OMPI_DECLSPEC int MPI_Allreduce_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype,
1425+
MPI_Op op, MPI_Comm comm);
14211426
OMPI_DECLSPEC int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
14221427
MPI_Op op, MPI_Comm comm, MPI_Request *request);
14231428
OMPI_DECLSPEC int MPI_Allreduce_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
@@ -1773,10 +1778,14 @@ OMPI_DECLSPEC int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag,
17731778
MPI_Status *status);
17741779
OMPI_DECLSPEC int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
17751780
int tag, MPI_Comm comm, MPI_Request *request);
1781+
OMPI_DECLSPEC int MPI_Irecv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source,
1782+
int tag, MPI_Comm comm, MPI_Request *request);
17761783
OMPI_DECLSPEC int MPI_Irsend(const void *buf, int count, MPI_Datatype datatype, int dest,
17771784
int tag, MPI_Comm comm, MPI_Request *request);
17781785
OMPI_DECLSPEC int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest,
17791786
int tag, MPI_Comm comm, MPI_Request *request);
1787+
OMPI_DECLSPEC int MPI_Isend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest,
1788+
int tag, MPI_Comm comm, MPI_Request *request);
17801789
OMPI_DECLSPEC int MPI_Isendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
17811790
int dest, int sendtag, void *recvbuf, int recvcount,
17821791
MPI_Datatype recvtype, int source, int recvtag,
@@ -1881,6 +1890,8 @@ OMPI_DECLSPEC int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, in
18811890
int tag, MPI_Comm comm, MPI_Request *request);
18821891
OMPI_DECLSPEC int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source,
18831892
int tag, MPI_Comm comm, MPI_Status *status);
1893+
OMPI_DECLSPEC int MPI_Recv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source,
1894+
int tag, MPI_Comm comm, MPI_Status *status);
18841895
OMPI_DECLSPEC int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
18851896
MPI_Op op, int root, MPI_Comm comm);
18861897
OMPI_DECLSPEC int MPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
@@ -1956,6 +1967,8 @@ OMPI_DECLSPEC int MPI_Send_init(const void *buf, int count, MPI_Datatype dataty
19561967
MPI_Request *request);
19571968
OMPI_DECLSPEC int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest,
19581969
int tag, MPI_Comm comm);
1970+
OMPI_DECLSPEC int MPI_Send_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest,
1971+
int tag, MPI_Comm comm);
19591972
OMPI_DECLSPEC int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
19601973
int dest, int sendtag, void *recvbuf, int recvcount,
19611974
MPI_Datatype recvtype, int source, int recvtag,
@@ -2152,6 +2165,9 @@ OMPI_DECLSPEC int PMPI_Abort(MPI_Comm comm, int errorcode);
21522165
OMPI_DECLSPEC int PMPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
21532166
int target_rank, MPI_Aint target_disp, int target_count,
21542167
MPI_Datatype target_datatype, MPI_Op op, MPI_Win win);
2168+
OMPI_DECLSPEC int PMPI_Accumulate_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype,
2169+
int target_rank, MPI_Aint target_disp, MPI_Count target_count,
2170+
MPI_Datatype target_datatype, MPI_Op op, MPI_Win win);
21552171
OMPI_DECLSPEC int PMPI_Add_error_class(int *errorclass);
21562172
OMPI_DECLSPEC int PMPI_Add_error_code(int errorclass, int *errorcode);
21572173
OMPI_DECLSPEC int PMPI_Add_error_string(int errorcode, const char *string);
@@ -2177,6 +2193,8 @@ OMPI_DECLSPEC int PMPI_Alloc_mem(MPI_Aint size, MPI_Info info,
21772193
void *baseptr);
21782194
OMPI_DECLSPEC int PMPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
21792195
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
2196+
OMPI_DECLSPEC int PMPI_Allreduce_c(const void *sendbuf, void *recvbuf, MPI_Count count,
2197+
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
21802198
OMPI_DECLSPEC int PMPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
21812199
MPI_Op op, MPI_Comm comm, MPI_Request *request);
21822200
OMPI_DECLSPEC int PMPI_Allreduce_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
@@ -2534,10 +2552,14 @@ OMPI_DECLSPEC int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag,
25342552
MPI_Status *status);
25352553
OMPI_DECLSPEC int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
25362554
int tag, MPI_Comm comm, MPI_Request *request);
2555+
OMPI_DECLSPEC int PMPI_Irecv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source,
2556+
int tag, MPI_Comm comm, MPI_Request *request);
25372557
OMPI_DECLSPEC int PMPI_Irsend(const void *buf, int count, MPI_Datatype datatype, int dest,
25382558
int tag, MPI_Comm comm, MPI_Request *request);
25392559
OMPI_DECLSPEC int PMPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest,
25402560
int tag, MPI_Comm comm, MPI_Request *request);
2561+
OMPI_DECLSPEC int PMPI_Isend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest,
2562+
int tag, MPI_Comm comm, MPI_Request *request);
25412563
OMPI_DECLSPEC int PMPI_Isendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
25422564
int dest, int sendtag, void *recvbuf, int recvcount,
25432565
MPI_Datatype recvtype, int source, int recvtag,
@@ -2642,6 +2664,8 @@ OMPI_DECLSPEC int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, i
26422664
int tag, MPI_Comm comm, MPI_Request *request);
26432665
OMPI_DECLSPEC int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int source,
26442666
int tag, MPI_Comm comm, MPI_Status *status);
2667+
OMPI_DECLSPEC int PMPI_Recv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source,
2668+
int tag, MPI_Comm comm, MPI_Status *status);
26452669
OMPI_DECLSPEC int PMPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
26462670
MPI_Op op, int root, MPI_Comm comm);
26472671
OMPI_DECLSPEC int PMPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
@@ -2717,6 +2741,8 @@ OMPI_DECLSPEC int PMPI_Send_init(const void *buf, int count, MPI_Datatype datat
27172741
MPI_Request *request);
27182742
OMPI_DECLSPEC int PMPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest,
27192743
int tag, MPI_Comm comm);
2744+
OMPI_DECLSPEC int PMPI_Send_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest,
2745+
int tag, MPI_Comm comm);
27202746
OMPI_DECLSPEC int PMPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
27212747
int dest, int sendtag, void *recvbuf, int recvcount,
27222748
MPI_Datatype recvtype, int source, int recvtag,
@@ -3175,6 +3201,8 @@ OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub)
31753201
#define MPI_Type_ub(...) THIS_FUNCTION_WAS_REMOVED_IN_MPI30(MPI_Type_ub, MPI_Type_get_extent)
31763202
#endif
31773203

3204+
#endif /* OMPI_NO_MPI_PROTOTYPES */
3205+
31783206
#if defined(c_plusplus) || defined(__cplusplus)
31793207
}
31803208
#endif

0 commit comments

Comments
 (0)