Ignore:
Timestamp:
06/12/18 11:54:13 (6 years ago)
Author:
yushan
Message:

update intercomm_merge and remove redundant files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_scatterv.cpp

    r1520 r1539  
    4545                   MPI_Datatype recvtype, int root, MPI_Comm comm) 
    4646  { 
    47     if(!comm->is_ep) 
    48     { 
    49       return ::MPI_Scatterv(sendbuf, sendcounts, displs, to_mpi_type(sendtype), recvbuf, recvcount, to_mpi_type(recvtype), root, to_mpi_comm(comm->mpi_comm)); 
    50     } 
     47    if(!comm->is_ep) return ::MPI_Scatterv(sendbuf, sendcounts, displs, to_mpi_type(sendtype), recvbuf, recvcount, to_mpi_type(recvtype), root, to_mpi_comm(comm->mpi_comm)); 
     48    if(comm->is_intercomm) return MPI_Scatterv_intercomm(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm); 
    5149    
    5250    assert(sendtype == recvtype); 
     
    105103      for(int i=0; i<ep_size; i++) 
    106104      { 
    107         //printf("i=%d : start from %d, src displs = %d, count = %d\n ", i, local_displs/datasize, displs[ranks[i]], sendcounts[ranks[i]]); 
    108105        memcpy(tmp_sendbuf+local_displs, sendbuf + displs[ranks[i]]*datasize, sendcounts[ranks[i]]*datasize); 
    109106        local_displs += sendcounts[ranks[i]]*datasize; 
    110107      } 
    111        
    112       //for(int i=0; i<ep_size*2; i++) printf("%d\t", static_cast<int*>(const_cast<void*>(tmp_sendbuf))[i]); 
    113108    } 
    114109 
     
    129124 
    130125      ::MPI_Scatterv(tmp_sendbuf, recvcounts.data(), my_displs.data(), to_mpi_type(sendtype), local_sendbuf, num_ep*count, to_mpi_type(recvtype), root_mpi_rank, to_mpi_comm(comm->mpi_comm)); 
    131  
    132       // printf("my_displs = %d %d %d %d\n", my_displs[0], my_displs[1], my_displs[2], my_displs[3] ); 
    133  
    134       // printf("%d %d %d %d %d %d %d %d\n", static_cast<int*>(local_sendbuf)[0], static_cast<int*>(local_sendbuf)[1], static_cast<int*>(local_sendbuf)[2], static_cast<int*>(local_sendbuf)[3], 
    135       //                                     static_cast<int*>(local_sendbuf)[4], static_cast<int*>(local_sendbuf)[5], static_cast<int*>(local_sendbuf)[6], static_cast<int*>(local_sendbuf)[7]); 
    136126    } 
    137127 
     
    154144 
    155145 
     146  int MPI_Scatterv_intercomm(const void *sendbuf, const int sendcounts[], const int displs[], MPI_Datatype sendtype, void *recvbuf, int recvcount, 
     147                   MPI_Datatype recvtype, int root, MPI_Comm comm) 
     148  { 
     149    printf("MPI_Scatterv_intercomm not yet implemented\n"); 
     150    MPI_Abort(comm, 0); 
     151  } 
     152 
     153 
    156154} 
Note: See TracChangeset for help on using the changeset viewer.