root/ompi/mpi/c/error_string.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Error_string

   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      University of Houston. All rights reserved.
  13  * Copyright (c) 2015      Research Organization for Information Science
  14  *                         and Technology (RIST). All rights reserved.
  15  * Copyright (c) 2018      Cisco Systems, Inc.  All rights reserved
  16  * $COPYRIGHT$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 #include "ompi_config.h"
  23 #include <string.h>
  24 
  25 #include "opal/util/string_copy.h"
  26 
  27 #include "ompi/mpi/c/bindings.h"
  28 #include "ompi/runtime/params.h"
  29 #include "ompi/communicator/communicator.h"
  30 #include "ompi/errhandler/errhandler.h"
  31 #include "ompi/errhandler/errcode.h"
  32 
  33 #if OMPI_BUILD_MPI_PROFILING
  34 #if OPAL_HAVE_WEAK_SYMBOLS
  35 #pragma weak MPI_Error_string = PMPI_Error_string
  36 #endif
  37 #define MPI_Error_string PMPI_Error_string
  38 #endif
  39 
  40 static const char FUNC_NAME[] = "MPI_Error_string";
  41 
  42 
  43 int MPI_Error_string(int errorcode, char *string, int *resultlen)
  44 {
  45     char *tmpstring;
  46 
  47     OPAL_CR_NOOP_PROGRESS();
  48 
  49     if ( MPI_PARAM_CHECK ) {
  50         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  51 
  52         if ( ompi_mpi_errcode_is_invalid(errorcode)) {
  53             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
  54                                           FUNC_NAME);
  55         }
  56     }
  57 
  58     tmpstring = ompi_mpi_errnum_get_string (errorcode);
  59     opal_string_copy(string, tmpstring, MPI_MAX_ERROR_STRING);
  60     *resultlen = (int)strlen(string);
  61 
  62     return MPI_SUCCESS;
  63 }

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