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

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_type_set_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) 2011-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/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     /* Convert the fortran string */
  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     /* Call the C function */
  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     /* Free the C name */
  98 
  99     free(c_name);
 100 }

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