This source file includes following definitions.
- mca_coll_basic_gather_inter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #include "ompi_config.h"
22 #include "coll_basic.h"
23
24 #include "mpi.h"
25 #include "ompi/constants.h"
26 #include "coll_basic.h"
27 #include "ompi/datatype/ompi_datatype.h"
28 #include "ompi/mca/coll/coll.h"
29 #include "ompi/mca/coll/base/coll_tags.h"
30 #include "ompi/mca/pml/pml.h"
31
32
33
34
35
36
37
38
39
40 int
41 mca_coll_basic_gather_inter(const void *sbuf, int scount,
42 struct ompi_datatype_t *sdtype,
43 void *rbuf, int rcount,
44 struct ompi_datatype_t *rdtype,
45 int root, struct ompi_communicator_t *comm,
46 mca_coll_base_module_t *module)
47 {
48 int i;
49 int err;
50 int size;
51 char *ptmp;
52 MPI_Aint incr;
53 MPI_Aint extent;
54 MPI_Aint lb;
55
56 size = ompi_comm_remote_size(comm);
57
58 if (MPI_PROC_NULL == root) {
59
60 err = OMPI_SUCCESS;
61 } else if (MPI_ROOT != root) {
62
63 err = MCA_PML_CALL(send(sbuf, scount, sdtype, root,
64 MCA_COLL_BASE_TAG_GATHER,
65 MCA_PML_BASE_SEND_STANDARD, comm));
66 } else {
67
68 err = ompi_datatype_get_extent(rdtype, &lb, &extent);
69 if (OMPI_SUCCESS != err) {
70 return OMPI_ERROR;
71 }
72
73 incr = extent * rcount;
74 for (i = 0, ptmp = (char *) rbuf; i < size; ++i, ptmp += incr) {
75 err = MCA_PML_CALL(recv(ptmp, rcount, rdtype, i,
76 MCA_COLL_BASE_TAG_GATHER,
77 comm, MPI_STATUS_IGNORE));
78 if (MPI_SUCCESS != err) {
79 return err;
80 }
81 }
82 }
83
84
85 return err;
86 }