This source file includes following definitions.
- MPI_Comm_get_errhandler
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include "ompi_config.h"
25 #include <stdio.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/memchecker.h"
32
33 #if OMPI_BUILD_MPI_PROFILING
34 #if OPAL_HAVE_WEAK_SYMBOLS
35 #pragma weak MPI_Comm_get_errhandler = PMPI_Comm_get_errhandler
36 #endif
37 #define MPI_Comm_get_errhandler PMPI_Comm_get_errhandler
38 #endif
39
40
41 static const char FUNC_NAME[] = "MPI_Comm_get_errhandler";
42
43
44 int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler)
45 {
46
47 MEMCHECKER(
48 memchecker_comm(comm);
49 );
50
51 OPAL_CR_NOOP_PROGRESS();
52
53
54
55 if (MPI_PARAM_CHECK) {
56 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
57 if (ompi_comm_invalid(comm)) {
58 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
59 FUNC_NAME);
60 } else if (NULL == errhandler) {
61 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
62 FUNC_NAME);
63 }
64 }
65
66 OPAL_THREAD_LOCK(&(comm->c_lock));
67
68
69 OBJ_RETAIN(comm->error_handler);
70 *errhandler = comm->error_handler;
71 OPAL_THREAD_UNLOCK(&(comm->c_lock));
72
73
74
75 return MPI_SUCCESS;
76 }