Skip to content

Commit

Permalink
cpp-py-formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
par-hermes committed Dec 5, 2023
1 parent efbd0a1 commit 54a18f9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/bvals/comms/tag_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,23 @@ template void TagMap::AddMeshDataToMap<BoundaryType::gmg_restrict_recv>(
std::shared_ptr<MeshData<Real>> &md);

void TagMap::ResolveMap() {
#ifdef MPI_PARALLEL
#ifdef MPI_PARALLEL
int flag;
void *max_tag; // largest supported MPI tag value
PARTHENON_MPI_CHECK (MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_TAG_UB, &max_tag, &flag));
PARTHENON_MPI_CHECK(MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_TAG_UB, &max_tag, &flag));
if (!flag) {
PARTHENON_FAIL("MPI error, cannot query largest supported MPI tag value.");
}
#endif
#endif
for (auto it = map_.begin(); it != map_.end(); ++it) {
auto &pair_map = it->second;
int idx = 0;
std::for_each(pair_map.begin(), pair_map.end(),
[&idx](auto &pair) { pair.second = idx++; });
#ifdef MPI_PARALLEL
if (idx > (*reinterpret_cast<int*>(max_tag)) && it->first != Globals::my_rank)
#ifdef MPI_PARALLEL
if (idx > (*reinterpret_cast<int *>(max_tag)) && it->first != Globals::my_rank)
PARTHENON_FAIL("Number of tags exceeds the maximum allowed by this MPI version.");
#endif
#endif
}
}

Expand Down

0 comments on commit 54a18f9

Please sign in to comment.