Line | |
---|
1 | #include "ep_lib.hpp" |
---|
2 | #include <mpi.h> |
---|
3 | //#include "ep_declaration.hpp" |
---|
4 | |
---|
5 | namespace ep_lib |
---|
6 | { |
---|
7 | |
---|
8 | |
---|
9 | |
---|
10 | int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) |
---|
11 | { |
---|
12 | assert(static_cast< ::MPI_Datatype>(sendtype) == static_cast< ::MPI_Datatype>(recvtype)); |
---|
13 | ::MPI_Aint typesize, llb; |
---|
14 | ::MPI_Type_get_extent(static_cast< ::MPI_Datatype>(sendtype), &llb, &typesize); |
---|
15 | |
---|
16 | int ep_size; |
---|
17 | MPI_Comm_size(comm, &ep_size); |
---|
18 | |
---|
19 | |
---|
20 | for(int i=0; i<ep_size; i++) |
---|
21 | { |
---|
22 | ep_lib::MPI_Gather(sendbuf+i*sendcount*typesize, sendcount, sendtype, recvbuf, recvcount, recvtype, i, comm); |
---|
23 | } |
---|
24 | |
---|
25 | |
---|
26 | return 0; |
---|
27 | } |
---|
28 | |
---|
29 | } |
---|
30 | |
---|
31 | |
---|
Note: See
TracBrowser
for help on using the repository browser.