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