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