openmpi  3.1.6
About: Open MPI is a high performance Message Passing Interface (MPI) library project combining technologies and resources from several other projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) in order to build the best MPI library available. 3.x series.
  Fossies Dox: openmpi-3.1.6.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

add_error_string.c
Go to the documentation of this file.
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$
16  *
17  * Additional copyrights may follow
18  *
19  * $HEADER$
20  */
21 #include "ompi_config.h"
22 #include <stdio.h>
23 #include <string.h>
24 
25 #include "ompi/mpi/c/bindings.h"
26 #include "ompi/runtime/params.h"
30 
31 #if OMPI_BUILD_MPI_PROFILING
32 #if OPAL_HAVE_WEAK_SYMBOLS
33 #pragma weak MPI_Add_error_string = PMPI_Add_error_string
34 #endif
35 #define MPI_Add_error_string PMPI_Add_error_string
36 #endif
37 
38 static const char FUNC_NAME[] = "MPI_Add_error_string";
39 
40 
41 int MPI_Add_error_string(int errorcode, const char *string)
42 {
43  int rc;
44 
46 
47  if ( MPI_PARAM_CHECK ) {
49 
51  return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
52  FUNC_NAME);
53 
55  return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
56  FUNC_NAME);
57 
58  if ( MPI_MAX_ERROR_STRING < (strlen(string)+1) )
59  return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
60  FUNC_NAME);
61  }
62 
63  rc = ompi_mpi_errnum_add_string (errorcode, string, (int)(strlen(string)+1));
64  if ( OMPI_SUCCESS != rc ) {
65  return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN,
66  FUNC_NAME);
67  }
68 
69  return MPI_SUCCESS;
70 }
MPI_Add_error_string
int MPI_Add_error_string(int errorcode, const char *string)
Definition: add_error_string.c:28
errcode.h
FUNC_NAME
static const char FUNC_NAME[]
Definition: add_error_string.c:38
OMPI_SUCCESS
@ OMPI_SUCCESS
Definition: constants.h:35
errhandler.h
OMPI_ERR_INIT_FINALIZE
#define OMPI_ERR_INIT_FINALIZE(name)
This is the macro to check the state of MPI and determine whether it was properly initialized and not...
Definition: errhandler.h:204
bindings.h
OPAL_CR_NOOP_PROGRESS
#define OPAL_CR_NOOP_PROGRESS()
Definition: opal_cr.h:205
params.h
ompi_mpi_errcode_is_invalid
static bool ompi_mpi_errcode_is_invalid(int errcode)
Check for a valid error code.
Definition: errcode.h:61
errorcode
*fortran ! University of Stuttgart All rights reserved Inc All rights reserved errorcode
Definition: mpi-f90-file-interfaces.h:25
OMPI_ERRHANDLER_INVOKE
#define OMPI_ERRHANDLER_INVOKE(mpi_object, err_code, message)
This is the macro to invoke to directly invoke an MPI error handler.
Definition: errhandler.h:228
communicator.h
ompi_config.h
ompi_mpi_errnum_add_string
int ompi_mpi_errnum_add_string(int errnum, const char *errstring, int len)
Add an error string to an error code.
Definition: errcode.c:343
ompi_mpi_errcode_is_predefined
static int ompi_mpi_errcode_is_predefined(int errcode)
Definition: errcode.h:89