Permalink
Browse files

Merge pull request #2393 from fweik/dd_comm

core: dd: Slight improvement of communication pattern.
  • Loading branch information...
fweik committed Dec 4, 2018
2 parents 848a7a8 + 7b10e62 commit 563717b60e61eb9b07a1b3eaefc2c16f26f009d5
Showing with 17 additions and 12 deletions.
  1. +16 −11 src/core/domain_decomposition.cpp
  2. +1 −1 testsuite/python/CMakeLists.txt
@@ -808,29 +808,34 @@ void exchange_neighbors(ParticleList *pl) {
ParticleList send_buf, recv_buf;
move_left_or_right(*pl, send_buf, send_buf, dir);
Utils::Mpi::sendrecv(comm_cart, node_neighbors[2 * dir], 0xaa, send_buf,
node_neighbors[2 * dir], 0xaa, recv_buf);
Utils::Mpi::sendrecv(comm_cart, node_neighbors[2 * dir], 0, send_buf,
node_neighbors[2 * dir], 0, recv_buf);
realloc_particlelist(&send_buf, 0);
move_if_local(recv_buf, *pl);
} else {
using boost::mpi::request;
using Utils::Mpi::isendrecv;
ParticleList send_buf_l, send_buf_r, recv_buf_l, recv_buf_r;
move_left_or_right(*pl, send_buf_l, send_buf_r, dir);
auto reqs_l = Utils::Mpi::isendrecv(
comm_cart, node_neighbors[2 * dir], 0xaa, send_buf_l,
node_neighbors[2 * dir], 0xaa, recv_buf_l);
Utils::Mpi::sendrecv(comm_cart, node_neighbors[2 * dir + 1], 0xaa,
send_buf_r, node_neighbors[2 * dir + 1], 0xaa,
recv_buf_r);
boost::mpi::wait_all(reqs_l.begin(), reqs_l.end());
realloc_particlelist(&send_buf_l, 0);
realloc_particlelist(&send_buf_r, 0);
auto req_l = isendrecv(comm_cart, node_neighbors[2 * dir], 0, send_buf_l,
node_neighbors[2 * dir], 0, recv_buf_l);
auto req_r =
isendrecv(comm_cart, node_neighbors[2 * dir + 1], 0, send_buf_r,
node_neighbors[2 * dir + 1], 0, recv_buf_r);
std::array<request, 4> reqs{{req_l[0], req_l[1], req_r[0], req_r[1]}};
boost::mpi::wait_all(reqs.begin(), reqs.end());
move_if_local(recv_buf_l, *pl);
move_if_local(recv_buf_r, *pl);
realloc_particlelist(&send_buf_l, 0);
realloc_particlelist(&send_buf_r, 0);
}
}
}
@@ -93,7 +93,7 @@ python_test(FILE reaction_ensemble.py MAX_NUM_PROC 4)
python_test(FILE constant_pH.py MAX_NUM_PROC 4)
python_test(FILE swimmer_reaction.py MAX_NUM_PROC 1)
python_test(FILE writevtf.py MAX_NUM_PROC 4)
python_test(FILE lb_stokes_sphere.py MAX_NUM_PROC 1)
python_test(FILE lb_stokes_sphere.py MAX_NUM_PROC 2)
python_test(FILE ek_eof_one_species_x.py MAX_NUM_PROC 1)
python_test(FILE ek_eof_one_species_y.py MAX_NUM_PROC 1)
python_test(FILE ek_eof_one_species_z.py MAX_NUM_PROC 1)

0 comments on commit 563717b

Please sign in to comment.