From 3b557a5f4deacb7c6b04f9bdbd8b318c5aaa89ff Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Wed, 11 Aug 2021 16:15:41 -0400 Subject: [PATCH] make sure mhs tests use sirius operator --- source/adios2/engine/mhs/MhsReader.cpp | 2 +- source/adios2/engine/mhs/MhsWriter.cpp | 21 ++++++------------- .../adios2/engine/mhs/TestMhsMultiRank.cpp | 6 ++++-- .../adios2/engine/mhs/TestMhsSingleRank.cpp | 4 +++- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/source/adios2/engine/mhs/MhsReader.cpp b/source/adios2/engine/mhs/MhsReader.cpp index 33941796c3..b4dc5573ae 100644 --- a/source/adios2/engine/mhs/MhsReader.cpp +++ b/source/adios2/engine/mhs/MhsReader.cpp @@ -21,7 +21,7 @@ MhsReader::MhsReader(IO &io, const std::string &name, const Mode mode, helper::Comm comm) : Engine("MhsReader", io, name, mode, std::move(comm)) { - helper::GetParameter(io.m_Parameters, "tiers", m_Tiers); + helper::GetParameter(io.m_Parameters, "Tiers", m_Tiers); Params params = {{"tiers", std::to_string(m_Tiers)}}; m_Compressor = std::make_shared(params); io.SetEngine(""); diff --git a/source/adios2/engine/mhs/MhsWriter.cpp b/source/adios2/engine/mhs/MhsWriter.cpp index 9c7cd864c1..3077a9983b 100644 --- a/source/adios2/engine/mhs/MhsWriter.cpp +++ b/source/adios2/engine/mhs/MhsWriter.cpp @@ -35,7 +35,7 @@ MhsWriter::MhsWriter(IO &io, const std::string &name, const Mode mode, helper::Comm comm) : Engine("MhsWriter", io, name, mode, std::move(comm)) { - helper::GetParameter(io.m_Parameters, "tiers", m_Tiers); + helper::GetParameter(io.m_Parameters, "Tiers", m_Tiers); for (const auto &transportParams : io.m_TransportsParameters) { auto itVar = transportParams.find("variable"); @@ -113,21 +113,12 @@ MhsWriter::MhsWriter(IO &io, const std::string &name, const Mode mode, throw("invalid operator"); } } - if (m_Tiers > 1) - { - for (int i = 0; i < m_Tiers; ++i) - { - m_SubIOs.emplace_back( - &io.m_ADIOS.DeclareIO("SubIO" + std::to_string(i))); - m_SubEngines.emplace_back(&m_SubIOs.back()->Open( - m_Name + ".tier" + std::to_string(i), adios2::Mode::Write)); - } - } - else + for (int i = 0; i < m_Tiers; ++i) { - m_SubIOs.emplace_back(&io.m_ADIOS.DeclareIO("SubIO")); - m_SubEngines.emplace_back( - &m_SubIOs.back()->Open(m_Name, adios2::Mode::Write)); + m_SubIOs.emplace_back( + &io.m_ADIOS.DeclareIO("SubIO" + std::to_string(i))); + m_SubEngines.emplace_back(&m_SubIOs.back()->Open( + m_Name + ".tier" + std::to_string(i), adios2::Mode::Write)); } } diff --git a/testing/adios2/engine/mhs/TestMhsMultiRank.cpp b/testing/adios2/engine/mhs/TestMhsMultiRank.cpp index 9a19696c5b..17bc76e6f3 100644 --- a/testing/adios2/engine/mhs/TestMhsMultiRank.cpp +++ b/testing/adios2/engine/mhs/TestMhsMultiRank.cpp @@ -85,6 +85,7 @@ void Reader(const Dims &shape, const Dims &start, const Dims &count, { adios2::ADIOS adios(MPI_COMM_WORLD); adios2::IO io = adios.DeclareIO("ms"); + io.SetEngine("mhs"); io.SetParameters(engineParams); adios2::Engine readerEngine = io.Open(name, adios2::Mode::Read); size_t datasize = 1; @@ -180,6 +181,7 @@ void Writer(const Dims &shape, const Dims &start, const Dims &count, adios2::IO io = adios.DeclareIO("ms"); io.SetEngine("mhs"); io.SetParameters(engineParams); + io.AddTransport("sirius", {{"variable", "bpFloats"}}); std::vector myChars(datasize); std::vector myUChars(datasize); std::vector myShorts(datasize); @@ -250,9 +252,9 @@ void Writer(const Dims &shape, const Dims &start, const Dims &count, TEST_F(MhsEngineTest, TestMhsMultiRank) { std::string filename = "TestMhsMultiRank"; - adios2::Params engineParams = {{"Verbose", "0"}}; + adios2::Params engineParams = {{"Verbose", "0"}, {"Tiers", "1"}}; - size_t rows = 800; + size_t rows = 80; Dims shape = {rows, 8, 64}; Dims start = {0, 0, 0}; Dims count = {1, 8, 64}; diff --git a/testing/adios2/engine/mhs/TestMhsSingleRank.cpp b/testing/adios2/engine/mhs/TestMhsSingleRank.cpp index ec0c5f6c67..ef2d719c9b 100644 --- a/testing/adios2/engine/mhs/TestMhsSingleRank.cpp +++ b/testing/adios2/engine/mhs/TestMhsSingleRank.cpp @@ -88,6 +88,7 @@ void Reader(const Dims &shape, const Dims &start, const Dims &count, adios2::ADIOS adios; #endif adios2::IO io = adios.DeclareIO("ms"); + io.SetEngine("mhs"); io.SetParameters(engineParams); adios2::Engine readerEngine = io.Open(name, adios2::Mode::Read); size_t datasize = 1; @@ -186,6 +187,7 @@ void Writer(const Dims &shape, const Dims &start, const Dims &count, adios2::IO io = adios.DeclareIO("ms"); io.SetEngine("mhs"); io.SetParameters(engineParams); + io.AddTransport("sirius", {{"variable", "bpFloats"}}); std::vector myChars(datasize); std::vector myUChars(datasize); std::vector myShorts(datasize); @@ -256,7 +258,7 @@ void Writer(const Dims &shape, const Dims &start, const Dims &count, TEST_F(MhsEngineTest, TestMhsSingleRank) { std::string filename = "TestMhsSingleRank"; - adios2::Params engineParams = {{"Verbose", "0"}}; + adios2::Params engineParams = {{"Verbose", "0"}, {"Tiers", "1"}}; size_t rows = 1000; Dims shape = {rows, 1, 128};