This source file includes following definitions.
- ompi_comm_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/communicator/communicator.h"
27 #include "ompi/mpi/fortran/base/fortran_base_strings.h"
28
29 #if OMPI_BUILD_MPI_PROFILING
30 #if OPAL_HAVE_WEAK_SYMBOLS
31 #pragma weak PMPI_COMM_SET_NAME = ompi_comm_set_name_f
32 #pragma weak pmpi_comm_set_name = ompi_comm_set_name_f
33 #pragma weak pmpi_comm_set_name_ = ompi_comm_set_name_f
34 #pragma weak pmpi_comm_set_name__ = ompi_comm_set_name_f
35
36 #pragma weak PMPI_Comm_set_name_f = ompi_comm_set_name_f
37 #pragma weak PMPI_Comm_set_name_f08 = ompi_comm_set_name_f
38 #else
39 OMPI_GENERATE_F77_BINDINGS (PMPI_COMM_SET_NAME,
40 pmpi_comm_set_name,
41 pmpi_comm_set_name_,
42 pmpi_comm_set_name__,
43 pompi_comm_set_name_f,
44 (MPI_Fint *comm, char *comm_name, MPI_Fint *ierr, int name_len),
45 (comm, comm_name, ierr, name_len) )
46 #endif
47 #endif
48
49 #if OPAL_HAVE_WEAK_SYMBOLS
50 #pragma weak MPI_COMM_SET_NAME = ompi_comm_set_name_f
51 #pragma weak mpi_comm_set_name = ompi_comm_set_name_f
52 #pragma weak mpi_comm_set_name_ = ompi_comm_set_name_f
53 #pragma weak mpi_comm_set_name__ = ompi_comm_set_name_f
54
55 #pragma weak MPI_Comm_set_name_f = ompi_comm_set_name_f
56 #pragma weak MPI_Comm_set_name_f08 = ompi_comm_set_name_f
57 #else
58 #if ! OMPI_BUILD_MPI_PROFILING
59 OMPI_GENERATE_F77_BINDINGS (MPI_COMM_SET_NAME,
60 mpi_comm_set_name,
61 mpi_comm_set_name_,
62 mpi_comm_set_name__,
63 ompi_comm_set_name_f,
64 (MPI_Fint *comm, char *comm_name, MPI_Fint *ierr, int name_len),
65 (comm, comm_name, ierr, name_len) )
66 #else
67 #define ompi_comm_set_name_f pompi_comm_set_name_f
68 #endif
69 #endif
70
71
72 void ompi_comm_set_name_f(MPI_Fint *comm, char *comm_name, MPI_Fint *ierr,
73 int name_len)
74 {
75 int ret, c_ierr;
76 char *c_name;
77 MPI_Comm c_comm = PMPI_Comm_f2c(*comm);
78
79
80
81 if (OMPI_SUCCESS != (ret = ompi_fortran_string_f2c(comm_name, name_len,
82 &c_name))) {
83 c_ierr = OMPI_ERRHANDLER_INVOKE(c_comm, ret,
84 "MPI_COMM_SET_NAME");
85 if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
86 return;
87 }
88
89
90
91 c_ierr = PMPI_Comm_set_name(c_comm, c_name);
92 if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
93
94
95
96 free(c_name);
97 }