This source file includes following definitions.
- ompi_type_set_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/errhandler/errhandler.h"
27 #include "ompi/communicator/communicator.h"
28 #include "ompi/mpi/fortran/base/fortran_base_strings.h"
29
30 #if OMPI_BUILD_MPI_PROFILING
31 #if OPAL_HAVE_WEAK_SYMBOLS
32 #pragma weak PMPI_TYPE_SET_NAME = ompi_type_set_name_f
33 #pragma weak pmpi_type_set_name = ompi_type_set_name_f
34 #pragma weak pmpi_type_set_name_ = ompi_type_set_name_f
35 #pragma weak pmpi_type_set_name__ = ompi_type_set_name_f
36
37 #pragma weak PMPI_Type_set_name_f = ompi_type_set_name_f
38 #pragma weak PMPI_Type_set_name_f08 = ompi_type_set_name_f
39 #else
40 OMPI_GENERATE_F77_BINDINGS (PMPI_TYPE_SET_NAME,
41 pmpi_type_set_name,
42 pmpi_type_set_name_,
43 pmpi_type_set_name__,
44 pompi_type_set_name_f,
45 (MPI_Fint *type, char *type_name, MPI_Fint *ierr, int name_len),
46 (type, type_name, ierr, name_len) )
47 #endif
48 #endif
49
50 #if OPAL_HAVE_WEAK_SYMBOLS
51 #pragma weak MPI_TYPE_SET_NAME = ompi_type_set_name_f
52 #pragma weak mpi_type_set_name = ompi_type_set_name_f
53 #pragma weak mpi_type_set_name_ = ompi_type_set_name_f
54 #pragma weak mpi_type_set_name__ = ompi_type_set_name_f
55
56 #pragma weak MPI_Type_set_name_f = ompi_type_set_name_f
57 #pragma weak MPI_Type_set_name_f08 = ompi_type_set_name_f
58 #else
59 #if ! OMPI_BUILD_MPI_PROFILING
60 OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_SET_NAME,
61 mpi_type_set_name,
62 mpi_type_set_name_,
63 mpi_type_set_name__,
64 ompi_type_set_name_f,
65 (MPI_Fint *type, char *type_name, MPI_Fint *ierr, int name_len),
66 (type, type_name, ierr, name_len) )
67 #else
68 #define ompi_type_set_name_f pompi_type_set_name_f
69 #endif
70 #endif
71
72
73 void ompi_type_set_name_f(MPI_Fint *type, char *type_name, MPI_Fint *ierr,
74 int name_len)
75 {
76 int ret, c_ierr;
77 char *c_name;
78 MPI_Datatype c_type;
79
80 c_type = PMPI_Type_f2c(*type);
81
82
83
84 if (OMPI_SUCCESS != (ret = ompi_fortran_string_f2c(type_name, name_len,
85 &c_name))) {
86 c_ierr = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, ret,
87 "MPI_TYPE_SET_NAME");
88 if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
89 return;
90 }
91
92
93
94 c_ierr = PMPI_Type_set_name(c_type, c_name);
95 if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
96
97
98
99 free(c_name);
100 }