Changeset 8180d8 for src/units/particle/comm_mpi_particle.cpp
- Timestamp:
- Apr 5, 2013, 12:39:30 PM (13 years ago)
- Children:
- 4a709e
- Parents:
- f57182
- File:
-
- 1 edited
-
src/units/particle/comm_mpi_particle.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/units/particle/comm_mpi_particle.cpp
rf57182 r8180d8 87 87 88 88 for (int i=0; i<num_particles_local; ++i) { 89 index = static_cast<Index>((Vector(&x[3*i]) - grid.Extent().Begin()) / grid.Extent().MeshWidth());89 index = grid.Global().GlobalBegin() + static_cast<Index>((Vector(&x[3*i]) - grid.Extent().Begin()) / grid.Extent().MeshWidth()); 90 90 for (int j=0; j<size; ++j) 91 91 if (index.IsInBounds(begin_remote[j], end_remote[j])) { 92 send_buffer_x[j].push_back(x[3*i+0]);93 send_buffer_x[j].push_back(x[3*i+1]);94 send_buffer_x[j].push_back(x[3*i+2]);95 send_buffer_q[j].push_back(q[i]);96 send_buffer_ind[j].push_back(i);97 break;92 send_buffer_x[j].push_back(x[3*i+0]); 93 send_buffer_x[j].push_back(x[3*i+1]); 94 send_buffer_x[j].push_back(x[3*i+2]); 95 send_buffer_q[j].push_back(q[i]); 96 send_buffer_ind[j].push_back(i); 97 break; 98 98 } 99 99 } … … 242 242 for (int j=0; j<3; ++j) 243 243 if ((types.Offset()[i][j] < 0 && lc.Global().LocalBegin()[j] == 0) || 244 (types.Offset()[i][j] > 0 && lc.Global().LocalEnd()[j] == lc.Global().Global Size()[j]))244 (types.Offset()[i][j] > 0 && lc.Global().LocalEnd()[j] == lc.Global().GlobalEnd()[j])) 245 245 offset[j] = -1.0 * types.Offset()[i][j] * lc.Extent().Size()[j]; 246 246 else … … 248 248 249 249 for (ind.X() = types.NB()[i].Starts().X(); ind.X() < types.NB()[i].Starts().X()+types.NB()[i].Subsizes().X(); ++ind.X()) 250 for (ind.Y() = types.NB()[i].Starts().Y(); ind.Y() < types.NB()[i].Starts().Y()+types.NB()[i].Subsizes().Y(); ++ind.Y())251 for (ind.Z() = types.NB()[i].Starts().Z(); ind.Z() < types.NB()[i].Starts().Z()+types.NB()[i].Subsizes().Z(); ++ind.Z())252 for (iter=lc(ind).begin(); iter!=lc(ind).end(); ++iter) {250 for (ind.Y() = types.NB()[i].Starts().Y(); ind.Y() < types.NB()[i].Starts().Y()+types.NB()[i].Subsizes().Y(); ++ind.Y()) 251 for (ind.Z() = types.NB()[i].Starts().Z(); ind.Z() < types.NB()[i].Starts().Z()+types.NB()[i].Subsizes().Z(); ++ind.Z()) 252 for (iter=lc(ind).begin(); iter!=lc(ind).end(); ++iter) { 253 253 254 254 for (int j=0; j<3; ++j) … … 260 260 assert(lc.Extent().Begin().IsComponentwiseLessOrEqual((*iter)->Pos() + offset + halo_length)); 261 261 assert(lc.Extent().End().IsComponentwiseGreaterOrEqual((*iter)->Pos() + offset - halo_length)); 262 }262 } 263 263 264 264 send_size[i] = types.NB()[i].Buffer().size(); … … 266 266 267 267 if (send_size[i] > 0) 268 MPI_Isend(&types.NB()[i].Buffer().front(), send_size[i], MPI_DOUBLE,269 types.NB()[i].Rank(), 4096+types.NB()[i].TagSend(),270 comm_global, &Request());268 MPI_Isend(&types.NB()[i].Buffer().front(), send_size[i], MPI_DOUBLE, 269 types.NB()[i].Rank(), 4096+types.NB()[i].TagSend(), 270 comm_global, &Request()); 271 271 } 272 272 … … 275 275 MPI_Recv(&recv_size, 1, MPI_INT, types.Halo()[i].Rank(), 2048+types.Halo()[i].TagReceive(), comm_global, MPI_STATUS_IGNORE); 276 276 if (recv_size > 0) { 277 types.Halo()[i].Buffer().resize(recv_size);278 MPI_Irecv(&types.Halo()[i].Buffer().front(), recv_size, MPI_DOUBLE,279 types.Halo()[i].Rank(), 4096+types.Halo()[i].TagReceive(),280 comm_global, &Request());277 types.Halo()[i].Buffer().resize(recv_size); 278 MPI_Irecv(&types.Halo()[i].Buffer().front(), recv_size, MPI_DOUBLE, 279 types.Halo()[i].Rank(), 4096+types.Halo()[i].TagReceive(), 280 comm_global, &Request()); 281 281 } 282 282 }
Note:
See TracChangeset
for help on using the changeset viewer.
