Changeset 9fc7e1
- Timestamp:
- Feb 10, 2012, 3:19:51 PM (14 years ago)
- Children:
- 322469
- Parents:
- 32ff22
- Location:
- src/comm
- Files:
-
- 2 edited
-
comm_mpi.cpp (modified) (2 diffs)
-
mpi/settings.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/comm/comm_mpi.cpp
r32ff22 r9fc7e1 400 400 401 401 Index index; 402 int global_extent[6*size], send_sizes[size], recv_sizes[size]; 403 Index begin_remote[size], end_remote[size]; 404 std::vector<int> pos_indices[size], charge_indices[size]; 405 MPI_Datatype dt_temp; 402 std::vector<int> global_extent, send_sizes, recv_sizes; 403 std::vector<Index> begin_remote, end_remote; 404 std::vector< std::vector<int> > pos_indices, charge_indices; 406 405 std::vector<vmg_float> buffer_x, buffer_q; 407 406 std::vector<vmg_int> buffer_ind; 407 MPI_Datatype dt_temp; 408 409 global_extent.resize(6*size); 410 send_sizes.resize(size); 411 recv_sizes.resize(size); 412 begin_remote.resize(size); 413 end_remote.resize(size); 414 pos_indices.resize(size); 415 charge_indices.resize(size); 408 416 409 417 std::memcpy(&global_extent[6*rank], grid.Global().BeginLocal().vec(), 3*sizeof(int)); 410 418 std::memcpy(&global_extent[6*rank+3], grid.Global().EndLocal().vec(), 3*sizeof(int)); 411 419 412 MPI_Allgather(MPI_IN_PLACE, 6, MPI_INT, global_extent, 6, MPI_INT, MPI_COMM_WORLD);420 MPI_Allgather(MPI_IN_PLACE, 6, MPI_INT, &global_extent.front(), 6, MPI_INT, MPI_COMM_WORLD); 413 421 414 422 for (int i=0; i<size; ++i) { … … 433 441 send_sizes[i] = charge_indices[i].size(); 434 442 435 MPI_Alltoall( send_sizes, 1, MPI_INT, recv_sizes, 1, MPI_INT, comm_global);443 MPI_Alltoall(&send_sizes.front(), 1, MPI_INT, &recv_sizes.front(), 1, MPI_INT, comm_global); 436 444 437 445 /* -
src/comm/mpi/settings.cpp
r32ff22 r9fc7e1 287 287 MPI_Comm_size(comm, &size); 288 288 289 int buffer[6*size]; 289 std::vector<int> buffer; 290 buffer.resize(6*size); 290 291 291 292 // Compute local offset for ghost cells … … 306 307 } 307 308 308 MPI_Allgather(MPI_IN_PLACE, 6, MPI_INT, buffer, 6, MPI_INT, comm);309 MPI_Allgather(MPI_IN_PLACE, 6, MPI_INT, &buffer.front(), 6, MPI_INT, comm); 309 310 310 311 if (insert_result.second) { … … 341 342 } 342 343 343 MPI_Allgather(MPI_IN_PLACE, 6, MPI_INT, buffer, 6, MPI_INT, comm);344 MPI_Allgather(MPI_IN_PLACE, 6, MPI_INT, &buffer.front(), 6, MPI_INT, comm); 344 345 345 346 if (insert_result.second) {
Note:
See TracChangeset
for help on using the changeset viewer.
