This source file includes following definitions.
- MPI_Exscan
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
26 #include "ompi/mpi/c/bindings.h"
27 #include "ompi/runtime/params.h"
28 #include "ompi/communicator/communicator.h"
29 #include "ompi/errhandler/errhandler.h"
30 #include "ompi/datatype/ompi_datatype.h"
31 #include "ompi/op/op.h"
32 #include "ompi/memchecker.h"
33 #include "ompi/runtime/ompi_spc.h"
34
35 #if OMPI_BUILD_MPI_PROFILING
36 #if OPAL_HAVE_WEAK_SYMBOLS
37 #pragma weak MPI_Exscan = PMPI_Exscan
38 #endif
39 #define MPI_Exscan PMPI_Exscan
40 #endif
41
42 static const char FUNC_NAME[] = "MPI_Exscan";
43
44
45 int MPI_Exscan(const void *sendbuf, void *recvbuf, int count,
46 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
47 {
48 int err;
49
50 SPC_RECORD(OMPI_SPC_EXSCAN, 1);
51
52 MEMCHECKER(
53 memchecker_datatype(datatype);
54 memchecker_call(&opal_memchecker_base_isdefined, sendbuf, count, datatype);
55 memchecker_comm(comm);
56 );
57
58 if (MPI_PARAM_CHECK) {
59 char *msg;
60 err = MPI_SUCCESS;
61 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
62 if (ompi_comm_invalid(comm)) {
63 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
64 FUNC_NAME);
65 }
66
67
68
69 else if (MPI_OP_NULL == op) {
70 err = MPI_ERR_OP;
71 } else if (!ompi_op_is_valid(op, datatype, &msg, FUNC_NAME)) {
72 int ret = OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_OP, msg);
73 free(msg);
74 return ret;
75 } else {
76 OMPI_CHECK_DATATYPE_FOR_SEND(err, datatype, count);
77 }
78 OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
79 }
80
81
82
83
84
85 if (0 == count) {
86 return MPI_SUCCESS;
87 }
88
89 OPAL_CR_ENTER_LIBRARY();
90
91
92
93 OBJ_RETAIN(op);
94 err = comm->c_coll->coll_exscan(sendbuf, recvbuf, count,
95 datatype, op, comm,
96 comm->c_coll->coll_exscan_module);
97 OBJ_RELEASE(op);
98 OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
99 }