Skip to content

Commit ff26f79

Browse files
committed
fortran: add the MPI_Abi entry points
Signed-off-by: Howard Pritchard <[email protected]>
1 parent ca05d9d commit ff26f79

17 files changed

+660
-0
lines changed

ompi/mpi/fortran/mpif-h/Makefile.am

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ sizeof_f.f90:
133133

134134
if BUILD_MPI_FORTRAN_MPIFH_BINDINGS_LAYER
135135
lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
136+
abi_get_fortran_booleans_f.c \
137+
abi_get_fortran_info_f.c \
138+
abi_get_info_f.c \
139+
abi_get_version_f.c \
140+
abi_set_fortran_booleans_f.c \
141+
abi_set_fortran_info_f.c \
136142
abort_f.c \
137143
add_error_class_f.c \
138144
add_error_code_f.c \
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2015-2017 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
15+
* $COPYRIGHT$
16+
*
17+
* Additional copyrights may follow
18+
*
19+
* $HEADER$
20+
*/
21+
22+
#include "ompi_config.h"
23+
24+
#include "ompi/mpi/fortran/mpif-h/bindings.h"
25+
#include "ompi/attribute/attribute.h"
26+
#include "ompi/communicator/communicator.h"
27+
28+
#if OMPI_BUILD_MPI_PROFILING
29+
#if OPAL_HAVE_WEAK_SYMBOLS
30+
#pragma weak PMPI_ABI_GET_FOTRAN_BOOLEANS = ompi_abi_get_fortran_booleans_f
31+
#pragma weak pmpi_abi_get_fortran_booleans = ompi_abi_get_fortran_booleans_f
32+
#pragma weak pmpi_abi_get_fortran_booleans_ = ompi_abi_get_fortran_booleans_f
33+
#pragma weak pmpi_abi_get_fortran_booleans__ = ompi_abi_get_fortran_booleans_f
34+
35+
#pragma weak PMPI_Abi_get_fortran_booleans_f = ompi_abi_get_fortran_booleans_f
36+
#pragma weak PMPI_Abi_get_fortran_booleans_f08 = ompi_abi_get_fortran_booleans_f
37+
#else
38+
OMPI_GENERATE_F77_BINDINGS (PMPI_ABI_GET_FOTRAN_BOOLEANS,
39+
pmpi_abi_get_fortran_booleans,
40+
pmpi_abi_get_fortran_booleans_,
41+
pmpi_abi_get_fortran_booleans__,
42+
pompi_abi_get_fortran_booleans_f,
43+
(MPI_Fint *comm, MPI_Fint *keyval, MPI_Fint *attribute_val, ompi_fortran_logical_t *flag, MPI_Fint *ierr),
44+
(comm, keyval, attribute_val, flag, ierr) )
45+
#endif
46+
#endif
47+
48+
#if OPAL_HAVE_WEAK_SYMBOLS
49+
#pragma weak MPI_ABI_GET_FOTRAN_BOOLEANS = ompi_abi_get_fortran_booleans_f
50+
#pragma weak mpi_abi_get_fortran_booleans = ompi_abi_get_fortran_booleans_f
51+
#pragma weak mpi_abi_get_fortran_booleans_ = ompi_abi_get_fortran_booleans_f
52+
#pragma weak mpi_abi_get_fortran_booleans__ = ompi_abi_get_fortran_booleans_f
53+
54+
#pragma weak MPI_Abi_get_fortran_booleans_f = ompi_abi_get_fortran_booleans_f
55+
#pragma weak MPI_Abi_get_fortran_booleans_f08 = ompi_abi_get_fortran_booleans_f
56+
#else
57+
#if ! OMPI_BUILD_MPI_PROFILING
58+
OMPI_GENERATE_F77_BINDINGS (MPI_ABI_GET_FOTRAN_BOOLEANS,
59+
mpi_abi_get_fortran_booleans,
60+
mpi_abi_get_fortran_booleans_,
61+
mpi_abi_get_fortran_booleans__,
62+
ompi_abi_get_fortran_booleans_f,
63+
(MPI_Fint *comm, MPI_Fint *keyval, MPI_Fint *attribute_val, ompi_fortran_logical_t *flag, MPI_Fint *ierr),
64+
(comm, keyval, attribute_val, flag, ierr) )
65+
#else
66+
#define ompi_abi_get_fortran_booleans_f pompi_abi_get_fortran_booleans_f
67+
#endif
68+
#endif
69+
70+
void ompi_abi_get_fortran_booleans_f(MPI_Fint *logical_size,
71+
ompi_fortran_logical_t *logical_true,
72+
ompi_fortran_logical_t *logical_false,
73+
ompi_fortran_logical_t *is_set,
74+
MPI_Fint *ierr)
75+
{
76+
int c_ierr;
77+
OMPI_LOGICAL_NAME_DECL(logical_true);
78+
OMPI_LOGICAL_NAME_DECL(logical_false);
79+
OMPI_LOGICAL_NAME_DECL(is_set);
80+
81+
c_ierr = PMPI_Abi_get_fortran_booleans(OMPI_FINT_2_INT(*logical_size),
82+
OMPI_LOGICAL_SINGLE_NAME_CONVERT(logical_true),
83+
OMPI_LOGICAL_SINGLE_NAME_CONVERT(logical_false),
84+
OMPI_LOGICAL_SINGLE_NAME_CONVERT(is_set));
85+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
86+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
87+
88+
OMPI_SINGLE_INT_2_LOGICAL(logical_true);
89+
OMPI_SINGLE_INT_2_LOGICAL(logical_false);
90+
OMPI_SINGLE_INT_2_LOGICAL(is_set);
91+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved.
3+
* Copyright (c) 2015 Research Organization for Information Science
4+
* and Technology (RIST). All rights reserved.
5+
* $COPYRIGHT$
6+
*
7+
* Additional copyrights may follow
8+
*
9+
* $HEADER$
10+
*/
11+
12+
#include "ompi_config.h"
13+
14+
#include "ompi/mpi/fortran/mpif-h/bindings.h"
15+
#include "ompi/attribute/attribute.h"
16+
17+
#if OMPI_BUILD_MPI_PROFILING
18+
#if OPAL_HAVE_WEAK_SYMBOLS
19+
#pragma weak PMPI_ABI_GET_FORTRAN_INFO = ompi_abi_get_fortran_info_f
20+
#pragma weak pmpi_abi_get_fortran_info = ompi_abi_get_fortran_info_f
21+
#pragma weak pmpi_abi_get_fortran_info_ = ompi_abi_get_fortran_info_f
22+
#pragma weak pmpi_abi_get_fortran_info__ = ompi_abi_get_fortran_info_f
23+
24+
#pragma weak PMPI_Abi_get_fortran_info_f = ompi_abi_get_fortran_info_f
25+
#pragma weak PMPI_Abi_get_fortran_info_f08 = ompi_abi_get_fortran_info_f
26+
#else
27+
OMPI_GENERATE_F77_BINDINGS (PMPI_ABI_GET_FORTRAN_INFO,
28+
pmpi_abi_get_fortran_info,
29+
pmpi_abi_get_fortran_info_,
30+
pmpi_abi_get_fortran_info__,
31+
pompi_abi_get_fortran_info_f,
32+
(MPI_Fint *info, MPI_Fint *ierr),
33+
(info, ierr) )
34+
#endif
35+
#endif
36+
37+
#if OPAL_HAVE_WEAK_SYMBOLS
38+
#pragma weak MPI_ABI_GET_FORTRAN_INFO = ompi_abi_get_fortran_info_f
39+
#pragma weak mpi_abi_get_fortran_info = ompi_abi_get_fortran_info_f
40+
#pragma weak mpi_abi_get_fortran_info_ = ompi_abi_get_fortran_info_f
41+
#pragma weak mpi_abi_get_fortran_info__ = ompi_abi_get_fortran_info_f
42+
43+
#pragma weak MPI_Abi_get_fortran_info_f = ompi_abi_get_fortran_info_f
44+
#pragma weak MPI_Abi_get_fortran_info_f08 = ompi_abi_get_fortran_info_f
45+
#else
46+
#if ! OMPI_BUILD_MPI_PROFILING
47+
OMPI_GENERATE_F77_BINDINGS (MPI_ABI_GET_FORTRAN_INFO,
48+
mpi_abi_get_fortran_info,
49+
mpi_abi_get_fortran_info_,
50+
mpi_abi_get_fortran_info__,
51+
ompi_abi_get_fortran_info_f,
52+
(MPI_Fint *info, MPI_Fint *ierr),
53+
(info, ierr) )
54+
#else
55+
#define ompi_abi_get_fortran_info_f pompi_abi_get_fortran_info_f
56+
#endif
57+
#endif
58+
59+
60+
void ompi_abi_get_fortran_info_f(MPI_Fint *info, MPI_Fint *ierr)
61+
{
62+
int c_ierr;
63+
MPI_Info c_info;
64+
65+
c_ierr = PMPI_Abi_get_fortran_info(&c_info);
66+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
67+
68+
if (MPI_SUCCESS == c_ierr) {
69+
*info = PMPI_Info_c2f(c_info);
70+
}
71+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved.
3+
* Copyright (c) 2015 Research Organization for Information Science
4+
* and Technology (RIST). All rights reserved.
5+
* $COPYRIGHT$
6+
*
7+
* Additional copyrights may follow
8+
*
9+
* $HEADER$
10+
*/
11+
12+
#include "ompi_config.h"
13+
14+
#include "ompi/mpi/fortran/mpif-h/bindings.h"
15+
#include "ompi/attribute/attribute.h"
16+
17+
#if OMPI_BUILD_MPI_PROFILING
18+
#if OPAL_HAVE_WEAK_SYMBOLS
19+
#pragma weak PMPI_ABI_GET_INFO = ompi_abi_get_info_f
20+
#pragma weak pmpi_abi_get_info = ompi_abi_get_info_f
21+
#pragma weak pmpi_abi_get_info_ = ompi_abi_get_info_f
22+
#pragma weak pmpi_abi_get_info__ = ompi_abi_get_info_f
23+
24+
#pragma weak PMPI_Abi_get_info_f = ompi_abi_get_info_f
25+
#pragma weak PMPI_Abi_get_info_f08 = ompi_abi_get_info_f
26+
#else
27+
OMPI_GENERATE_F77_BINDINGS (PMPI_ABI_GET_INFO,
28+
pmpi_abi_get_info,
29+
pmpi_abi_get_info_,
30+
pmpi_abi_get_info__,
31+
pompi_abi_get_info_f,
32+
(MPI_Fint *info, MPI_Fint *ierr),
33+
(info, ierr) )
34+
#endif
35+
#endif
36+
37+
#if OPAL_HAVE_WEAK_SYMBOLS
38+
#pragma weak MPI_ABI_GET_INFO = ompi_abi_get_info_f
39+
#pragma weak mpi_abi_get_info = ompi_abi_get_info_f
40+
#pragma weak mpi_abi_get_info_ = ompi_abi_get_info_f
41+
#pragma weak mpi_abi_get_info__ = ompi_abi_get_info_f
42+
43+
#pragma weak MPI_Abi_get_info_f = ompi_abi_get_info_f
44+
#pragma weak MPI_Abi_get_info_f08 = ompi_abi_get_info_f
45+
#else
46+
#if ! OMPI_BUILD_MPI_PROFILING
47+
OMPI_GENERATE_F77_BINDINGS (MPI_ABI_GET_INFO,
48+
mpi_abi_get_info,
49+
mpi_abi_get_info_,
50+
mpi_abi_get_info__,
51+
ompi_abi_get_info_f,
52+
(MPI_Fint *info, MPI_Fint *ierr),
53+
(info, ierr) )
54+
#else
55+
#define ompi_abi_get_info_f pompi_abi_get_info_f
56+
#endif
57+
#endif
58+
59+
60+
void ompi_abi_get_info_f(MPI_Fint *info, MPI_Fint *ierr)
61+
{
62+
int c_ierr;
63+
MPI_Info c_info;
64+
65+
c_ierr = PMPI_Abi_get_info(&c_info);
66+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
67+
68+
if (MPI_SUCCESS == c_ierr) {
69+
*info = PMPI_Info_c2f(c_info);
70+
}
71+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
15+
* $COPYRIGHT$
16+
*
17+
* Additional copyrights may follow
18+
*
19+
* $HEADER$
20+
*/
21+
22+
#include "ompi_config.h"
23+
24+
#include "ompi/mpi/fortran/mpif-h/bindings.h"
25+
26+
#if OMPI_BUILD_MPI_PROFILING
27+
#if OPAL_HAVE_WEAK_SYMBOLS
28+
#pragma weak PMPI_ABI_GET_VERSION = ompi_abi_get_version_f
29+
#pragma weak pmpi_abi_get_version = ompi_abi_get_version_f
30+
#pragma weak pmpi_abi_get_version_ = ompi_abi_get_version_f
31+
#pragma weak pmpi_abi_get_version__ = ompi_abi_get_version_f
32+
33+
#pragma weak PMPI_Abi_get_version_f = ompi_abi_get_version_f
34+
#pragma weak PMPI_Abi_get_version_f08 = ompi_abi_get_version_f
35+
#else
36+
OMPI_GENERATE_F77_BINDINGS (PMPI_ABI_GET_VERSION,
37+
pmpi_abi_get_version,
38+
pmpi_abi_get_version_,
39+
pmpi_abi_get_version__,
40+
pompi_abi_get_version_f,
41+
(MPI_Fint *abi_major, MPI_Fint *abi_minor, MPI_Fint *ierr),
42+
(abi_major, abi_minor, ierr) )
43+
#endif
44+
#endif
45+
46+
#if OPAL_HAVE_WEAK_SYMBOLS
47+
#pragma weak MPI_ABI_GET_VERSION = ompi_abi_get_version_f
48+
#pragma weak mpi_abi_get_version = ompi_abi_get_version_f
49+
#pragma weak mpi_abi_get_version_ = ompi_abi_get_version_f
50+
#pragma weak mpi_abi_get_version__ = ompi_abi_get_version_f
51+
52+
#pragma weak MPI_Abi_get_version_f = ompi_abi_get_version_f
53+
#pragma weak MPI_Abi_get_version_f08 = ompi_abi_get_version_f
54+
#else
55+
#if ! OMPI_BUILD_MPI_PROFILING
56+
OMPI_GENERATE_F77_BINDINGS (MPI_ABI_GET_VERSION,
57+
mpi_abi_get_version,
58+
mpi_abi_get_version_,
59+
mpi_abi_get_version__,
60+
ompi_abi_get_version_f,
61+
(MPI_Fint *abi_major, MPI_Fint *abi_minor, MPI_Fint *ierr),
62+
(abi_major, abi_minor, ierr) )
63+
#else
64+
#define ompi_abi_get_version_f pompi_abi_get_version_f
65+
#endif
66+
#endif
67+
68+
69+
void ompi_abi_get_version_f(MPI_Fint *abi_major, MPI_Fint *abi_minor, MPI_Fint *ierr)
70+
{
71+
int c_ierr;
72+
OMPI_SINGLE_NAME_DECL(abi_major);
73+
OMPI_SINGLE_NAME_DECL(abi_minor);
74+
75+
c_ierr = PMPI_Abi_get_version(OMPI_SINGLE_NAME_CONVERT(abi_major),
76+
OMPI_SINGLE_NAME_CONVERT(abi_minor));
77+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
78+
79+
if (MPI_SUCCESS == c_ierr) {
80+
OMPI_SINGLE_INT_2_FINT(abi_major);
81+
OMPI_SINGLE_INT_2_FINT(abi_minor);
82+
}
83+
}

0 commit comments

Comments
 (0)