This source file includes following definitions.
- ompi_comm_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/mpi/fortran/base/fortran_base_strings.h"
  26 #include "ompi/constants.h"
  27 #include "ompi/communicator/communicator.h"
  28 
  29 #if OMPI_BUILD_MPI_PROFILING
  30 #if OPAL_HAVE_WEAK_SYMBOLS
  31 #pragma weak PMPI_COMM_GET_NAME = ompi_comm_get_name_f
  32 #pragma weak pmpi_comm_get_name = ompi_comm_get_name_f
  33 #pragma weak pmpi_comm_get_name_ = ompi_comm_get_name_f
  34 #pragma weak pmpi_comm_get_name__ = ompi_comm_get_name_f
  35 
  36 #pragma weak PMPI_Comm_get_name_f = ompi_comm_get_name_f
  37 #pragma weak PMPI_Comm_get_name_f08 = ompi_comm_get_name_f
  38 #else
  39 OMPI_GENERATE_F77_BINDINGS (PMPI_COMM_GET_NAME,
  40                             pmpi_comm_get_name,
  41                             pmpi_comm_get_name_,
  42                             pmpi_comm_get_name__,
  43                             pompi_comm_get_name_f,
  44                             (MPI_Fint *comm, char *comm_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len),
  45                             (comm, comm_name, resultlen, ierr, name_len) )
  46 #endif
  47 #endif
  48 
  49 #if OPAL_HAVE_WEAK_SYMBOLS
  50 #pragma weak MPI_COMM_GET_NAME = ompi_comm_get_name_f
  51 #pragma weak mpi_comm_get_name = ompi_comm_get_name_f
  52 #pragma weak mpi_comm_get_name_ = ompi_comm_get_name_f
  53 #pragma weak mpi_comm_get_name__ = ompi_comm_get_name_f
  54 
  55 #pragma weak MPI_Comm_get_name_f = ompi_comm_get_name_f
  56 #pragma weak MPI_Comm_get_name_f08 = ompi_comm_get_name_f
  57 #else
  58 #if ! OMPI_BUILD_MPI_PROFILING
  59 OMPI_GENERATE_F77_BINDINGS (MPI_COMM_GET_NAME,
  60                             mpi_comm_get_name,
  61                             mpi_comm_get_name_,
  62                             mpi_comm_get_name__,
  63                             ompi_comm_get_name_f,
  64                             (MPI_Fint *comm, char *comm_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len),
  65                             (comm, comm_name, resultlen, ierr, name_len) )
  66 #else
  67 #define ompi_comm_get_name_f pompi_comm_get_name_f
  68 #endif
  69 #endif
  70 
  71 
  72 void ompi_comm_get_name_f(MPI_Fint *comm, char *comm_name,
  73                           MPI_Fint *resultlen, MPI_Fint *ierr,
  74                           int name_len)
  75 {
  76     int c_ierr, c_len;
  77     MPI_Comm c_comm = PMPI_Comm_f2c(*comm);
  78     char c_name[MPI_MAX_OBJECT_NAME];
  79 
  80     c_ierr = PMPI_Comm_get_name(c_comm, c_name, &c_len);
  81     if (MPI_SUCCESS == c_ierr) {
  82         ompi_fortran_string_c2f(c_name, comm_name, name_len);
  83         *resultlen = OMPI_INT_2_FINT(c_len);
  84         if (NULL != ierr) *ierr = OMPI_INT_2_FINT(MPI_SUCCESS);
  85     } else {
  86         if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
  87     }
  88 }