This source file includes following definitions.
- MPI_Error_string
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 }