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 #include "ompi/communicator/communicator.h"
17 
18 #if OMPI_BUILD_MPI_PROFILING
19 #if OPAL_HAVE_WEAK_SYMBOLS
20 #pragma weak PMPI_COMM_SET_INFO = ompi_comm_set_info_f
21 #pragma weak pmpi_comm_set_info = ompi_comm_set_info_f
22 #pragma weak pmpi_comm_set_info_ = ompi_comm_set_info_f
23 #pragma weak pmpi_comm_set_info__ = ompi_comm_set_info_f
24 
25 #pragma weak PMPI_Comm_set_info_f = ompi_comm_set_info_f
26 #pragma weak PMPI_Comm_set_info_f08 = ompi_comm_set_info_f
27 #else
28 OMPI_GENERATE_F77_BINDINGS (PMPI_COMM_SET_INFO,
29                            pmpi_comm_set_info,
30                            pmpi_comm_set_info_,
31                            pmpi_comm_set_info__,
32                            pompi_comm_set_info_f,
33                            (MPI_Fint *comm, MPI_Fint *info, MPI_Fint *ierr),
34                            (comm, info, ierr) )
35 #endif
36 #endif
37 
38 #if OPAL_HAVE_WEAK_SYMBOLS
39 #pragma weak MPI_COMM_SET_INFO = ompi_comm_set_info_f
40 #pragma weak mpi_comm_set_info = ompi_comm_set_info_f
41 #pragma weak mpi_comm_set_info_ = ompi_comm_set_info_f
42 #pragma weak mpi_comm_set_info__ = ompi_comm_set_info_f
43 
44 #pragma weak MPI_Comm_set_info_f = ompi_comm_set_info_f
45 #pragma weak MPI_Comm_set_info_f08 = ompi_comm_set_info_f
46 #else
47 #if ! OMPI_BUILD_MPI_PROFILING
48 OMPI_GENERATE_F77_BINDINGS (MPI_COMM_SET_INFO,
49                            mpi_comm_set_info,
50                            mpi_comm_set_info_,
51                            mpi_comm_set_info__,
52                            ompi_comm_set_info_f,
53                            (MPI_Fint *comm, MPI_Fint *info, MPI_Fint *ierr),
54                            (comm, info, ierr) )
55 #else
56 #define ompi_comm_set_info_f pompi_comm_set_info_f
57 #endif
58 #endif
59 
60 
ompi_comm_set_info_f(MPI_Fint * comm,MPI_Fint * info,MPI_Fint * ierr)61 void ompi_comm_set_info_f(MPI_Fint *comm, MPI_Fint *info, MPI_Fint *ierr)
62 {
63     int c_ierr;
64     MPI_Comm c_comm = PMPI_Comm_f2c(*comm);
65     MPI_Info c_info = PMPI_Info_f2c(*info);
66 
67     c_ierr = PMPI_Comm_set_info(c_comm, c_info);
68     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
69 }
70