This source file includes following definitions.
- MPIX_Reduce_scatter_block_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
25 #include "ompi_config.h"
26 #include <stdio.h>
27
28 #include "ompi/mpi/c/bindings.h"
29 #include "ompi/runtime/params.h"
30 #include "ompi/communicator/communicator.h"
31 #include "ompi/errhandler/errhandler.h"
32 #include "ompi/datatype/ompi_datatype.h"
33 #include "ompi/op/op.h"
34 #include "ompi/memchecker.h"
35 #include "ompi/mpiext/pcollreq/c/mpiext_pcollreq_c.h"
36 #include "ompi/runtime/ompi_spc.h"
37
38 #if OMPI_BUILD_MPI_PROFILING
39 #if OPAL_HAVE_WEAK_SYMBOLS
40 #pragma weak MPIX_Reduce_scatter_block_init = PMPIX_Reduce_scatter_block_init
41 #endif
42 #define MPIX_Reduce_scatter_block_init PMPIX_Reduce_scatter_block_init
43 #endif
44
45 static const char FUNC_NAME[] = "MPIX_Reduce_scatter_block_init";
46
47
48 int MPIX_Reduce_scatter_block_init(const void *sendbuf, void *recvbuf, int recvcount,
49 MPI_Datatype datatype, MPI_Op op,
50 MPI_Comm comm, MPI_Info info, MPI_Request *request)
51 {
52 int err;
53
54 SPC_RECORD(OMPI_SPC_REDUCE_SCATTER_BLOCK_INIT, 1);
55
56 MEMCHECKER(
57 memchecker_comm(comm);
58 memchecker_datatype(datatype);
59
60
61 memchecker_call(&opal_memchecker_base_isaddressable, recvbuf,
62 recvcount, datatype);
63
64
65 if(MPI_IN_PLACE == sendbuf) {
66 memchecker_call(&opal_memchecker_base_isdefined, recvbuf, recvcount, datatype);
67 } else {
68 memchecker_call(&opal_memchecker_base_isdefined, sendbuf, recvcount, datatype);
69
70 }
71 );
72
73 if (MPI_PARAM_CHECK) {
74 char *msg;
75 err = MPI_SUCCESS;
76 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
77 if (ompi_comm_invalid(comm)) {
78 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
79 FUNC_NAME);
80 }
81
82
83
84
85 else if (MPI_OP_NULL == op || NULL == op) {
86 err = MPI_ERR_OP;
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 if (MPI_IN_PLACE == recvbuf) {
92 err = MPI_ERR_ARG;
93 }
94 OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
95
96 OMPI_CHECK_DATATYPE_FOR_SEND(err, datatype, recvcount);
97 OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
98 }
99
100 OPAL_CR_ENTER_LIBRARY();
101
102
103
104 OBJ_RETAIN(op);
105 err = comm->c_coll->coll_reduce_scatter_block_init(sendbuf, recvbuf, recvcount,
106 datatype, op, comm, info, request,
107 comm->c_coll->coll_reduce_scatter_block_init_module);
108 OBJ_RELEASE(op);
109 OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
110 }