From 20e97651c6a846938e77afda2cdb9298505f1a61 Mon Sep 17 00:00:00 2001 From: Luke Roberts Date: Thu, 31 Oct 2024 15:44:52 -0600 Subject: [PATCH] remove unused stuff --- src/bvals/comms/combined_buffers.cpp | 67 ---------------------------- src/bvals/comms/combined_buffers.hpp | 12 ----- 2 files changed, 79 deletions(-) diff --git a/src/bvals/comms/combined_buffers.cpp b/src/bvals/comms/combined_buffers.cpp index d1a4fc646da9..d4424f31c80b 100644 --- a/src/bvals/comms/combined_buffers.cpp +++ b/src/bvals/comms/combined_buffers.cpp @@ -200,21 +200,6 @@ void CombinedBuffersRank::PackAndSend(int partition) { buf->Stale(); } -bool CombinedBuffersRank::AllReceived() { - bool all_received{true}; - for (auto &[partition, buf] : combined_buffers) { - bool received = buf.GetState() == BufferState::received; - all_received = all_received && received; - } - return all_received; -} - -void CombinedBuffersRank::StaleAllReceives() { - for (auto &[partition, buf] : combined_buffers) { - buf.Stale(); - } -} - bool CombinedBuffersRank::IsAvailableForWrite(int partition) { if (combined_buffers.count(partition) == 0) return true; return combined_buffers[partition].IsAvailableForWrite(); @@ -262,31 +247,6 @@ bool CombinedBuffersRank::TryReceiveAndUnpack(Mesh *pmesh, int partition, return true; } -void CombinedBuffersRank::CompareReceivedBuffers(int partition) { - if (Globals::my_rank != 0) return; // don't crush us with output - PARTHENON_REQUIRE(buffers_built, - "Trying to recv combined buffers before they have been built") - if (combined_info_device.count(partition) == 0) return; - auto &comb_info = combined_info_device[partition]; - Kokkos::parallel_for( - PARTHENON_AUTO_LABEL, - Kokkos::TeamPolicy<>(parthenon::DevExecSpace(), combined_info[partition].size(), - Kokkos::AUTO), - KOKKOS_LAMBDA(parthenon::team_mbr_t team_member) { - const int b = team_member.league_rank(); - const int buf_size = comb_info[b].size(); - Real *com_buf = &(comb_info[b].combined_buf(comb_info[b].start_idx())); - Real *buf = &(comb_info[b].buf(0)); - printf("Buffer [%i] start = %i size = %i\n", b, comb_info[b].start_idx(), - buf_size); - Kokkos::parallel_for(Kokkos::TeamThreadRange<>(team_member, buf_size), - [&](const int idx) { - if (buf[idx] != com_buf[idx]) - printf(" [%i] %e %e\n", idx, buf[idx], com_buf[idx]); - }); - }); -} - void CombinedBuffers::AddSendBuffer(int partition, MeshBlock *pmb, const NeighborBlock &nb, const std::shared_ptr> &var, @@ -446,31 +406,4 @@ void CombinedBuffers::TryReceiveAny(Mesh *pmesh, BoundaryType b_type) { } #endif } - -bool CombinedBuffers::AllReceived(BoundaryType b_type) { - bool all_received{true}; - for (auto &[tag, bufs] : combined_recv_buffers) { - if (std::get<1>(tag) == b_type) { - all_received = all_received && bufs.AllReceived(); - } - } - return all_received; -} - -void CombinedBuffers::StaleAllReceives(BoundaryType b_type) { - for (auto &[tag, bufs] : combined_recv_buffers) { - if (std::get<1>(tag) == b_type) { - bufs.StaleAllReceives(); - } - } -} - -void CombinedBuffers::CompareReceivedBuffers(BoundaryType b_type) { - for (auto &[tag, bufs] : combined_recv_buffers) { - if (std::get<1>(tag) == b_type) { - bufs.CompareReceivedBuffers(0); - } - } -} - } // namespace parthenon diff --git a/src/bvals/comms/combined_buffers.hpp b/src/bvals/comms/combined_buffers.hpp index fb0e1ce42610..e7f454d3cd62 100644 --- a/src/bvals/comms/combined_buffers.hpp +++ b/src/bvals/comms/combined_buffers.hpp @@ -74,12 +74,6 @@ struct CombinedBuffersRank { void RepointBuffers(Mesh *pmesh, int partition); - bool AllReceived(); - - void StaleAllReceives(); - - void CompareReceivedBuffers(int partition); - bool IsAvailableForWrite(int partition); }; @@ -137,12 +131,6 @@ struct CombinedBuffers { void TryReceiveAny(Mesh *pmesh, BoundaryType b_type); - bool AllReceived(BoundaryType b_type); - - void StaleAllReceives(BoundaryType b_type); - - void CompareReceivedBuffers(BoundaryType b_type); - bool IsAvailableForWrite(int partition, BoundaryType b_type); };