Skip to content

Commit

Permalink
format and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lroberts36 committed Nov 1, 2024
1 parent 9bb4747 commit cef604f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/bvals/comms/combined_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ void CombinedBuffersRankPartition::AddVarBoundary(
//----------------------------------------------------------------------------------------
CombinedBuffersRank::CombinedBuffersRank(int o_rank, BoundaryType b_type, bool send,
mpi_comm_t comm, Mesh *pmesh)
: other_rank(o_rank), b_type(b_type), sender(send), buffers_built(false),
comm_(comm), pmesh(pmesh) {
: other_rank(o_rank), b_type(b_type), sender(send), buffers_built(false), comm_(comm),
pmesh(pmesh) {

int tag = 1234 + static_cast<int>(GetAssociatedSender(b_type));
if (sender) {
Expand Down Expand Up @@ -314,9 +314,10 @@ void CombinedBuffers::AddSendBuffer(int partition, MeshBlock *pmb,
const std::shared_ptr<Variable<Real>> &var,
BoundaryType b_type) {
if (combined_send_buffers.count({nb.rank, b_type}) == 0)
combined_send_buffers.emplace(std::make_pair(
std::make_pair(nb.rank, b_type),
CombinedBuffersRank(nb.rank, b_type, true, comms_[GetAssociatedSender(b_type)], pmesh)));
combined_send_buffers.emplace(
std::make_pair(std::make_pair(nb.rank, b_type),
CombinedBuffersRank(nb.rank, b_type, true,
comms_[GetAssociatedSender(b_type)], pmesh)));
combined_send_buffers.at({nb.rank, b_type}).AddSendBuffer(partition, pmb, nb, var);
}

Expand Down
7 changes: 4 additions & 3 deletions src/bvals/comms/combined_buffers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ struct CombinedBuffersRank {
Mesh *pmesh;
bool sender{true};

CombinedBuffersRank(int o_rank, BoundaryType b_type, bool send, mpi_comm_t comm, Mesh *pmesh);
explicit CombinedBuffersRank(int o_rank, BoundaryType b_type, bool send,
mpi_comm_t comm, Mesh *pmesh);

void AddSendBuffer(int partition, MeshBlock *pmb, const NeighborBlock &nb,
const std::shared_ptr<Variable<Real>> &var);
Expand All @@ -131,9 +132,9 @@ struct CombinedBuffers {

std::map<BoundaryType, mpi_comm_t> comms_;

Mesh *pmesh;
Mesh *pmesh;

CombinedBuffers(Mesh *pmesh) : pmesh(pmesh) {
explicit CombinedBuffers(Mesh *pmesh) : pmesh(pmesh) {
#ifdef MPI_PARALLEL
// TODO(LFR): Switch to a different communicator for each BoundaryType pair
for (auto b_type :
Expand Down

0 comments on commit cef604f

Please sign in to comment.