Changeset 1500 for XIOS/dev/branch_openmp/extern/ep_dev/ep_bcast.cpp
- Timestamp:
- 05/28/18 09:54:32 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/ep_dev/ep_bcast.cpp
r1381 r1500 20 20 assert(valid_type(datatype)); 21 21 22 int ep_rank_loc = comm .ep_comm_ptr->size_rank_info[1].first;22 int ep_rank_loc = comm->ep_comm_ptr->size_rank_info[1].first; 23 23 24 24 ::MPI_Aint datasize, lb; … … 28 28 if(ep_rank_loc == local_root) 29 29 { 30 comm .my_buffer->void_buffer[local_root] = buffer;30 comm->my_buffer->void_buffer[local_root] = buffer; 31 31 } 32 32 … … 36 36 { 37 37 #pragma omp critical (_bcast) 38 memcpy(buffer, comm .my_buffer->void_buffer[local_root], datasize * count);38 memcpy(buffer, comm->my_buffer->void_buffer[local_root], datasize * count); 39 39 } 40 40 … … 45 45 { 46 46 47 if(!comm .is_ep)47 if(!comm->is_ep) 48 48 { 49 49 #pragma omp single nowait 50 ::MPI_Bcast(buffer, count, to_mpi_type(datatype), root, to_mpi_comm(comm .mpi_comm));50 ::MPI_Bcast(buffer, count, to_mpi_type(datatype), root, to_mpi_comm(comm->mpi_comm)); 51 51 return 0; 52 52 } 53 53 54 54 55 int ep_rank = comm .ep_comm_ptr->size_rank_info[0].first;56 int ep_rank_loc = comm .ep_comm_ptr->size_rank_info[1].first;57 int mpi_rank = comm .ep_comm_ptr->size_rank_info[2].first;55 int ep_rank = comm->ep_comm_ptr->size_rank_info[0].first; 56 int ep_rank_loc = comm->ep_comm_ptr->size_rank_info[1].first; 57 int mpi_rank = comm->ep_comm_ptr->size_rank_info[2].first; 58 58 59 int root_mpi_rank = comm .rank_map->at(root).second;60 int root_ep_rank_loc = comm .rank_map->at(root).first;59 int root_mpi_rank = comm->rank_map->at(root).second; 60 int root_ep_rank_loc = comm->rank_map->at(root).first; 61 61 62 62 63 63 if((ep_rank_loc==0 && mpi_rank != root_mpi_rank ) || ep_rank == root) 64 64 { 65 ::MPI_Bcast(buffer, count, to_mpi_type(datatype), root_mpi_rank, to_mpi_comm(comm .mpi_comm));65 ::MPI_Bcast(buffer, count, to_mpi_type(datatype), root_mpi_rank, to_mpi_comm(comm->mpi_comm)); 66 66 } 67 67
Note: See TracChangeset
for help on using the changeset viewer.