Skip to content

Commit 069bf94

Browse files
hzhouraffenet
authored andcommitted
mpi.h: adding back f2c/c2f macros
MPI 4.1 requires the f2c/c2f apis as real functions -- symbols in libmpi.so. However, they are macros in the current MPICH ABI. Adding these macros back into mpi.h allows the appliation build with MPICH to be backward ABI compatible. Meantime, the real symbols are available for applications that needs them.
1 parent e88b197 commit 069bf94

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

src/include/mpi.h.in

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,56 @@ typedef struct MPIX_Iov {
10281028
#include <mpi_proto.h>
10291029

10301030
@HAVE_ROMIO@
1031+
1032+
/* The f2c and c2f APIs exist as real functions, but these macros allows
1033+
* for backward MPICH ABI compatibility.
1034+
*/
1035+
/* exclude these macros from MPICH internal */
1036+
#ifndef MPICHCONF_H_INCLUDED
1037+
#define MPI_Comm_c2f(comm) (MPI_Fint)(comm)
1038+
#define MPI_Comm_f2c(comm) (MPI_Comm)(comm)
1039+
#define MPI_Type_c2f(datatype) (MPI_Fint)(datatype)
1040+
#define MPI_Type_f2c(datatype) (MPI_Datatype)(datatype)
1041+
#define MPI_Group_c2f(group) (MPI_Fint)(group)
1042+
#define MPI_Group_f2c(group) (MPI_Group)(group)
1043+
#define MPI_Info_c2f(info) (MPI_Fint)(info)
1044+
#define MPI_Info_f2c(info) (MPI_Info)(info)
1045+
#define MPI_Request_f2c(request) (MPI_Request)(request)
1046+
#define MPI_Request_c2f(request) (MPI_Fint)(request)
1047+
#define MPI_Op_c2f(op) (MPI_Fint)(op)
1048+
#define MPI_Op_f2c(op) (MPI_Op)(op)
1049+
#define MPI_Errhandler_c2f(errhandler) (MPI_Fint)(errhandler)
1050+
#define MPI_Errhandler_f2c(errhandler) (MPI_Errhandler)(errhandler)
1051+
#define MPI_Win_c2f(win) (MPI_Fint)(win)
1052+
#define MPI_Win_f2c(win) (MPI_Win)(win)
1053+
#define MPI_Message_c2f(msg) ((MPI_Fint)(msg))
1054+
#define MPI_Message_f2c(msg) ((MPI_Message)(msg))
1055+
#define MPI_Session_c2f(session) (MPI_Fint)(session)
1056+
#define MPI_Session_f2c(session) (MPI_Session)(session)
1057+
1058+
/* PMPI versions of the handle transfer functions. See section 4.17 */
1059+
#define PMPI_Comm_c2f(comm) (MPI_Fint)(comm)
1060+
#define PMPI_Comm_f2c(comm) (MPI_Comm)(comm)
1061+
#define PMPI_Type_c2f(datatype) (MPI_Fint)(datatype)
1062+
#define PMPI_Type_f2c(datatype) (MPI_Datatype)(datatype)
1063+
#define PMPI_Group_c2f(group) (MPI_Fint)(group)
1064+
#define PMPI_Group_f2c(group) (MPI_Group)(group)
1065+
#define PMPI_Info_c2f(info) (MPI_Fint)(info)
1066+
#define PMPI_Info_f2c(info) (MPI_Info)(info)
1067+
#define PMPI_Request_f2c(request) (MPI_Request)(request)
1068+
#define PMPI_Request_c2f(request) (MPI_Fint)(request)
1069+
#define PMPI_Op_c2f(op) (MPI_Fint)(op)
1070+
#define PMPI_Op_f2c(op) (MPI_Op)(op)
1071+
#define PMPI_Errhandler_c2f(errhandler) (MPI_Fint)(errhandler)
1072+
#define PMPI_Errhandler_f2c(errhandler) (MPI_Errhandler)(errhandler)
1073+
#define PMPI_Win_c2f(win) (MPI_Fint)(win)
1074+
#define PMPI_Win_f2c(win) (MPI_Win)(win)
1075+
#define PMPI_Message_c2f(msg) ((MPI_Fint)(msg))
1076+
#define PMPI_Message_f2c(msg) ((MPI_Message)(msg))
1077+
#define PMPI_Session_c2f(session) (MPI_Fint)(session)
1078+
#define PMPI_Session_f2c(session) (MPI_Session)(session)
1079+
#endif
1080+
10311081
#endif /* BUILD_MPI_ABI */
10321082

10331083
#if defined(__cplusplus)

0 commit comments

Comments
 (0)