Changeset 1520 for XIOS/dev/branch_openmp/extern/src_ep_dev/ep_size.cpp
- Timestamp:
- 06/04/18 19:25:08 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_size.cpp
r1354 r1520 7 7 { 8 8 9 10 11 12 9 int MPI_Comm_size(MPI_Comm comm, int* size) 13 10 { 14 15 if(comm.is_ep) 11 if(comm->is_ep) 16 12 { 17 if(!comm.is_intercomm) 18 { 19 *size = comm.ep_comm_ptr->size_rank_info[0].second; 20 21 return 0; 22 } 23 else 24 { 25 *size = comm.ep_comm_ptr->intercomm->size_rank_info[0].second; 26 27 return 0; 28 } 29 13 Debug("MPI_Comm_size with EP"); 14 return *size = comm->ep_comm_ptr->size_rank_info[0].second; 30 15 } 31 16 32 Debug("Calling EP_Comm_size\n"); 33 34 if(comm.mpi_comm != static_cast< ::MPI_Comm*>(MPI_COMM_NULL.mpi_comm)) 35 { 36 ::MPI_Comm mpi_comm = to_mpi_comm(comm.mpi_comm); 37 int mpi_size; 38 39 ::MPI_Comm_size(mpi_comm, &mpi_size); 40 printf("============ ep comm size called for non ep comm, %d\n", mpi_size); 41 *size = mpi_size; 42 return 0; 43 } 44 45 else 46 { 47 *size = MPI_UNDEFINED; 48 printf("============ ep comm size called for non ep comm not defined\n"); 49 return 0; 50 } 17 return MPI_Comm_size_mpi(comm, size); 51 18 } 52 19 53 20 int MPI_Comm_remote_size(MPI_Comm comm, int *size) 54 21 { 55 if( !comm.is_ep)22 if(comm->is_ep) 56 23 { 57 if(comm .mpi_comm != static_cast< ::MPI_Comm*>(MPI_COMM_NULL.mpi_comm))24 if(comm->is_intercomm) 58 25 { 59 ::MPI_Comm mpi_comm = to_mpi_comm(comm.mpi_comm); 60 ::MPI_Comm_remote_size(mpi_comm, size); 61 return 0; 26 Debug("MPI_Comm_remote_size with EP_intercomm"); 27 return *size = comm->ep_comm_ptr->intercomm->intercomm_rank_map->size(); 62 28 } 63 64 29 else 65 30 { 66 *size = MPI_UNDEFINED;67 return 0;31 Debug("MPI_Comm_remote_size with EP_intracomm"); 32 return *size=0; 68 33 } 69 34 } 70 71 if(comm.is_intercomm) 72 { 73 *size = comm.ep_comm_ptr->intercomm->remote_rank_map->size(); 74 return 0; 75 } 76 *size = MPI_UNDEFINED; 77 return 0; 35 return MPI_Comm_remote_size_mpi(comm, size); 78 36 } 37 38 39 int MPI_Comm_size_mpi(MPI_Comm comm, int* size) 40 { 41 Debug("MPI_Comm_size with MPI"); 42 return ::MPI_Comm_size(to_mpi_comm(comm->mpi_comm), size); 43 } 44 45 int MPI_Comm_remote_size_mpi(MPI_Comm comm, int *size) 46 { 47 Debug("MPI_Comm_remote_size with MPI"); 48 return ::MPI_Comm_remote_size(to_mpi_comm(comm->mpi_comm), size); 49 } 50 51 79 52 } 80 53
Note: See TracChangeset
for help on using the changeset viewer.