From c23b428a978b32521f0a84d9b73e54ad20a16d6f Mon Sep 17 00:00:00 2001 From: Vicente Adolfo Bolea Sanchez Date: Wed, 23 Oct 2024 21:48:02 -0400 Subject: [PATCH] Revert "Backport #3759 to Release 2.10 branch. (cherry-picked from master branch #4340) (#4341)" This reverts commit 5283b271792874848c48e2450c394d3431e05e14. --- source/adios2/engine/bp5/BP5Writer.cpp | 37 +++++++++----------------- source/adios2/engine/bp5/BP5Writer.h | 5 ---- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/source/adios2/engine/bp5/BP5Writer.cpp b/source/adios2/engine/bp5/BP5Writer.cpp index b9e185ad97..19c2f1aba0 100644 --- a/source/adios2/engine/bp5/BP5Writer.cpp +++ b/source/adios2/engine/bp5/BP5Writer.cpp @@ -617,13 +617,13 @@ void BP5Writer::EndStep() MetaBuffer = m_BP5Serializer.CopyMetadataToContiguous( TSInfo.NewMetaMetaBlocks, {m}, {a}, {m_ThisTimestepDataSize}, {m_StartDataPos}); - if (m_AggregatorMetadata.m_Comm.Size() > 1) + if (m_Aggregator->m_Comm.Size() > 1) { // level 1 m_Profiler.Start("ES_meta1_gather"); size_t LocalSize = MetaBuffer.size(); - std::vector RecvCounts = m_AggregatorMetadata.m_Comm.GatherValues(LocalSize, 0); + std::vector RecvCounts = m_Aggregator->m_Comm.GatherValues(LocalSize, 0); std::vector RecvBuffer; - if (m_AggregatorMetadata.m_Comm.Rank() == 0) + if (m_Aggregator->m_Comm.Rank() == 0) { uint64_t TotalSize = 0; for (auto &n : RecvCounts) @@ -633,10 +633,10 @@ void BP5Writer::EndStep() << TotalSize << " bytes from aggregator group" << std::endl;*/ } - m_AggregatorMetadata.m_Comm.GathervArrays(MetaBuffer.data(), LocalSize, RecvCounts.data(), - RecvCounts.size(), RecvBuffer.data(), 0); + m_Aggregator->m_Comm.GathervArrays(MetaBuffer.data(), LocalSize, RecvCounts.data(), + RecvCounts.size(), RecvBuffer.data(), 0); m_Profiler.Stop("ES_meta1_gather"); - if (m_AggregatorMetadata.m_Comm.Rank() == 0) + if (m_Aggregator->m_Comm.Rank() == 0) { std::vector UniqueMetaMetaBlocks; std::vector DataSizes; @@ -654,17 +654,17 @@ void BP5Writer::EndStep() m_Profiler.Stop("ES_meta1"); m_Profiler.Start("ES_meta2"); // level 2 - if (m_AggregatorMetadata.m_Comm.Rank() == 0) + if (m_Aggregator->m_Comm.Rank() == 0) { std::vector RecvBuffer; std::vector *buf; std::vector RecvCounts; size_t LocalSize = MetaBuffer.size(); - if (m_CommMetadataAggregators.Size() > 1) + if (m_CommAggregators.Size() > 1) { m_Profiler.Start("ES_meta2_gather"); - RecvCounts = m_CommMetadataAggregators.GatherValues(LocalSize, 0); - if (m_CommMetadataAggregators.Rank() == 0) + RecvCounts = m_CommAggregators.GatherValues(LocalSize, 0); + if (m_CommAggregators.Rank() == 0) { uint64_t TotalSize = 0; for (auto &n : RecvCounts) @@ -675,8 +675,8 @@ void BP5Writer::EndStep() << std::endl;*/ } - m_CommMetadataAggregators.GathervArrays(MetaBuffer.data(), LocalSize, RecvCounts.data(), - RecvCounts.size(), RecvBuffer.data(), 0); + m_CommAggregators.GathervArrays(MetaBuffer.data(), LocalSize, RecvCounts.data(), + RecvCounts.size(), RecvBuffer.data(), 0); buf = &RecvBuffer; m_Profiler.Stop("ES_meta2_gather"); } @@ -686,7 +686,7 @@ void BP5Writer::EndStep() RecvCounts.push_back(LocalSize); } - if (m_CommMetadataAggregators.Rank() == 0) + if (m_CommAggregators.Rank() == 0) { std::vector UniqueMetaMetaBlocks; std::vector DataSizes; @@ -1072,17 +1072,6 @@ void BP5Writer::InitAggregator() */ int color = m_Aggregator->m_Comm.Rank(); m_CommAggregators = m_Comm.Split(color, 0, "creating level 2 chain of aggregators at Open"); - - /* Metadata aggregator for two-level metadata aggregation */ - { - size_t n = static_cast(m_Comm.Size()); - size_t a = (int)floor(sqrt((double)n)); - m_AggregatorMetadata.Init(a, a, m_Comm); - /* chain of rank 0s form the second level of aggregation */ - int color = m_AggregatorMetadata.m_Comm.Rank(); - m_CommMetadataAggregators = - m_Comm.Split(color, 0, "creating level 2 chain of aggregators at Open"); - } } void BP5Writer::InitTransports() diff --git a/source/adios2/engine/bp5/BP5Writer.h b/source/adios2/engine/bp5/BP5Writer.h index 41aa5e3e8b..e8cc9d496b 100644 --- a/source/adios2/engine/bp5/BP5Writer.h +++ b/source/adios2/engine/bp5/BP5Writer.h @@ -203,11 +203,6 @@ class BP5Writer : public BP5Engine, public core::Engine helper::Comm *DataWritingComm; // processes that write the same data file // aggregators only (valid if m_Aggregator->m_Comm.Rank() == 0) helper::Comm m_CommAggregators; - - /* two-level metadata aggregation */ - aggregator::MPIChain m_AggregatorMetadata; // first level - helper::Comm m_CommMetadataAggregators; // second level - adios2::profiling::JSONProfiler m_Profiler; protected: