This source file includes following definitions.
- ompi_type_get_name_f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #include "ompi_config.h"
23
24 #include "ompi/mpi/fortran/mpif-h/bindings.h"
25 #include "ompi/constants.h"
26 #include "ompi/mpi/fortran/base/fortran_base_strings.h"
27
28 #if OMPI_BUILD_MPI_PROFILING
29 #if OPAL_HAVE_WEAK_SYMBOLS
30 #pragma weak PMPI_TYPE_GET_NAME = ompi_type_get_name_f
31 #pragma weak pmpi_type_get_name = ompi_type_get_name_f
32 #pragma weak pmpi_type_get_name_ = ompi_type_get_name_f
33 #pragma weak pmpi_type_get_name__ = ompi_type_get_name_f
34
35 #pragma weak PMPI_Type_get_name_f = ompi_type_get_name_f
36 #pragma weak PMPI_Type_get_name_f08 = ompi_type_get_name_f
37 #else
38 OMPI_GENERATE_F77_BINDINGS (PMPI_TYPE_GET_NAME,
39 pmpi_type_get_name,
40 pmpi_type_get_name_,
41 pmpi_type_get_name__,
42 pompi_type_get_name_f,
43 (MPI_Fint *type, char *type_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len),
44 (type, type_name, resultlen, ierr, name_len) )
45 #endif
46 #endif
47
48 #if OPAL_HAVE_WEAK_SYMBOLS
49 #pragma weak MPI_TYPE_GET_NAME = ompi_type_get_name_f
50 #pragma weak mpi_type_get_name = ompi_type_get_name_f
51 #pragma weak mpi_type_get_name_ = ompi_type_get_name_f
52 #pragma weak mpi_type_get_name__ = ompi_type_get_name_f
53
54 #pragma weak MPI_Type_get_name_f = ompi_type_get_name_f
55 #pragma weak MPI_Type_get_name_f08 = ompi_type_get_name_f
56 #else
57 #if ! OMPI_BUILD_MPI_PROFILING
58 OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_GET_NAME,
59 mpi_type_get_name,
60 mpi_type_get_name_,
61 mpi_type_get_name__,
62 ompi_type_get_name_f,
63 (MPI_Fint *type, char *type_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len),
64 (type, type_name, resultlen, ierr, name_len) )
65 #else
66 #define ompi_type_get_name_f pompi_type_get_name_f
67 #endif
68 #endif
69
70
71 void ompi_type_get_name_f(MPI_Fint *type, char *type_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len)
72 {
73 int c_ierr, c_len;
74 MPI_Datatype c_type = PMPI_Type_f2c(*type);
75 char c_name[MPI_MAX_OBJECT_NAME];
76
77 c_ierr = PMPI_Type_get_name(c_type, c_name, &c_len);
78 if (MPI_SUCCESS == c_ierr) {
79 ompi_fortran_string_c2f(c_name, type_name, name_len);
80 *resultlen = OMPI_INT_2_FINT(c_len);
81 c_ierr = MPI_SUCCESS;
82 }
83 if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
84 }