root/ompi/mpi/fortran/mpif-h/type_get_name_f.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. ompi_type_get_name_f

   1 /*
   2  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2005 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2006-2012 Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2015-2017 Research Organization for Information Science
  14  *                         and Technology (RIST). All rights reserved.
  15  * $COPYRIGHT$
  16  *
  17  * Additional copyrights may follow
  18  *
  19  * $HEADER$
  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 }

/* [<][>][^][v][top][bottom][index][help] */