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

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_add_error_string_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/mpi/fortran/base/constants.h"
  26 #include "ompi/mpi/fortran/base/fortran_base_strings.h"
  27 #include "ompi/communicator/communicator.h"
  28 
  29 #if OMPI_BUILD_MPI_PROFILING
  30 #if OPAL_HAVE_WEAK_SYMBOLS
  31 #pragma weak PMPI_ADD_ERROR_STRING = ompi_add_error_string_f
  32 #pragma weak pmpi_add_error_string = ompi_add_error_string_f
  33 #pragma weak pmpi_add_error_string_ = ompi_add_error_string_f
  34 #pragma weak pmpi_add_error_string__ = ompi_add_error_string_f
  35 
  36 #pragma weak PMPI_Add_error_string_f = ompi_add_error_string_f
  37 #pragma weak PMPI_Add_error_string_f08 = ompi_add_error_string_f
  38 #else
  39 OMPI_GENERATE_F77_BINDINGS (PMPI_ADD_ERROR_STRING,
  40                            pmpi_add_error_string,
  41                            pmpi_add_error_string_,
  42                            pmpi_add_error_string__,
  43                            pompi_add_error_string_f,
  44                            (MPI_Fint *errorcode, char *string, MPI_Fint *ierr,int l),
  45                            (errorcode, string, ierr, l) )
  46 #endif
  47 #endif
  48 
  49 #if OPAL_HAVE_WEAK_SYMBOLS
  50 #pragma weak MPI_ADD_ERROR_STRING = ompi_add_error_string_f
  51 #pragma weak mpi_add_error_string = ompi_add_error_string_f
  52 #pragma weak mpi_add_error_string_ = ompi_add_error_string_f
  53 #pragma weak mpi_add_error_string__ = ompi_add_error_string_f
  54 
  55 #pragma weak MPI_Add_error_string_f = ompi_add_error_string_f
  56 #pragma weak MPI_Add_error_string_f08 = ompi_add_error_string_f
  57 #else
  58 #if ! OMPI_BUILD_MPI_PROFILING
  59 OMPI_GENERATE_F77_BINDINGS (MPI_ADD_ERROR_STRING,
  60                            mpi_add_error_string,
  61                            mpi_add_error_string_,
  62                            mpi_add_error_string__,
  63                            ompi_add_error_string_f,
  64                            (MPI_Fint *errorcode, char *string, MPI_Fint *ierr, int l),
  65                            (errorcode, string, ierr, l) )
  66 #else
  67 #define ompi_add_error_string_f pompi_add_error_string_f
  68 #endif
  69 #endif
  70 
  71 
  72 void ompi_add_error_string_f(MPI_Fint *errorcode, char *string,
  73                             MPI_Fint *ierr, int len)
  74 {
  75     char *c_string;
  76     int ierr_c;
  77 
  78     if (len > MPI_MAX_ERROR_STRING) {
  79             ierr_c = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
  80                                             "MPI_ADD_ERROR_STRING");
  81             if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
  82             return;
  83     }
  84 
  85     ompi_fortran_string_f2c(string, len, &c_string);
  86     ierr_c = PMPI_Add_error_string(OMPI_FINT_2_INT(*errorcode), c_string);
  87     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
  88     free(c_string);
  89 }

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