source: XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_alltoall.cpp @ 1196

Last change on this file since 1196 was 1147, checked in by yushan, 7 years ago

bug fixed in MPI_Gather(v)

File size: 705 bytes
RevLine 
[1134]1#include "ep_lib.hpp"
2#include <mpi.h>
3//#include "ep_declaration.hpp"
4
5namespace 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  {
[1146]12    assert(static_cast< ::MPI_Datatype>(sendtype) == static_cast< ::MPI_Datatype>(recvtype));
[1134]13    ::MPI_Aint typesize, llb;
14    ::MPI_Type_get_extent(static_cast< ::MPI_Datatype>(sendtype), &llb, &typesize);
[1146]15   
16    int ep_size;
17    MPI_Comm_size(comm, &ep_size);
[1147]18   
[1134]19
[1146]20    for(int i=0; i<ep_size; i++)
[1134]21    {
[1147]22      ep_lib::MPI_Gather(sendbuf+i*sendcount*typesize, sendcount, sendtype, recvbuf, recvcount, recvtype, i, comm);
[1134]23    }
[1147]24   
[1134]25
26    return 0;
27  }
28
29}
30
31
Note: See TracBrowser for help on using the repository browser.