From c788f1ec74d42f178e78fbaa9ed8157270c9c85b Mon Sep 17 00:00:00 2001 From: Greg Eisenhauer Date: Wed, 23 Feb 2022 16:17:57 -0500 Subject: [PATCH 1/3] Trying NdCopy in BP5 --- .../toolkit/format/bp5/BP5Deserializer.cpp | 33 +++++++++++-------- testing/adios2/engine/bp/CMakeLists.txt | 4 +-- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/source/adios2/toolkit/format/bp5/BP5Deserializer.cpp b/source/adios2/toolkit/format/bp5/BP5Deserializer.cpp index 864dde677a..72fdb31b3d 100644 --- a/source/adios2/toolkit/format/bp5/BP5Deserializer.cpp +++ b/source/adios2/toolkit/format/bp5/BP5Deserializer.cpp @@ -1230,20 +1230,25 @@ void BP5Deserializer::FinalizeGets(std::vector Requests) GlobalDimensions[i] = RankSize[i]; } } - if (m_ReaderIsRowMajor) - { - ExtractSelectionFromPartialRM( - ElementSize, DimCount, GlobalDimensions, RankOffset, - RankSize, SelOffset, SelSize, IncomingData, - (char *)Req.Data, Req.MemSpace); - } - else - { - ExtractSelectionFromPartialCM( - ElementSize, DimCount, GlobalDimensions, RankOffset, - RankSize, SelOffset, SelSize, IncomingData, - (char *)Req.Data, Req.MemSpace); - } + helper::NdCopy(IncomingData, adios2::Dims(RankOffset, RankOffset+DimCount), adios2::Dims(RankSize, RankSize+DimCount), + true /* m_WriterIsRowMajor */, false /*WriterIsLittleEndian*/, + (char*)Req.Data, adios2::Dims(SelOffset, SelOffset+DimCount), adios2::Dims(SelSize, SelSize+DimCount), true /*m_ReaderIsRowMajor */, + false /*m_ReaderIsLittleEndian*/, ElementSize); + + // if (m_ReaderIsRowMajor) + // { + // ExtractSelectionFromPartialRM( + // ElementSize, DimCount, GlobalDimensions, RankOffset, + // RankSize, SelOffset, SelSize, IncomingData, + // (char *)Req.Data, Req.MemSpace); + // } + // else + // { + // ExtractSelectionFromPartialCM( + // ElementSize, DimCount, GlobalDimensions, RankOffset, + // RankSize, SelOffset, SelSize, IncomingData, + // (char *)Req.Data, Req.MemSpace); + // } } } } diff --git a/testing/adios2/engine/bp/CMakeLists.txt b/testing/adios2/engine/bp/CMakeLists.txt index bf9b2e68eb..f3a76e61f1 100644 --- a/testing/adios2/engine/bp/CMakeLists.txt +++ b/testing/adios2/engine/bp/CMakeLists.txt @@ -109,8 +109,8 @@ bp_gtest_add_tests_helper(StepsFileGlobalArray MPI_ALLOW) bp_gtest_add_tests_helper(StepsFileLocalArray MPI_ALLOW) bp_gtest_add_tests_helper(SelectSteps MPI_ALLOW) -bp3_bp4_gtest_add_tests_helper(SelectionsOnRowMajorData MPI_NONE) -bp3_bp4_gtest_add_tests_helper(SelectionsOnColumnMajorData MPI_NONE) +bp_gtest_add_tests_helper(SelectionsOnRowMajorData MPI_NONE) +bp_gtest_add_tests_helper(SelectionsOnColumnMajorData MPI_NONE) if(NOT MSVC) bp_gtest_add_tests_helper(BufferSize MPI_NONE) From 39b95083053dc31d6212e31860961c0be0feb81d Mon Sep 17 00:00:00 2001 From: Greg Eisenhauer Date: Wed, 23 Feb 2022 16:20:49 -0500 Subject: [PATCH 2/3] clang-format --- .../toolkit/format/bp5/BP5Deserializer.cpp | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/source/adios2/toolkit/format/bp5/BP5Deserializer.cpp b/source/adios2/toolkit/format/bp5/BP5Deserializer.cpp index 72fdb31b3d..e331a3ee94 100644 --- a/source/adios2/toolkit/format/bp5/BP5Deserializer.cpp +++ b/source/adios2/toolkit/format/bp5/BP5Deserializer.cpp @@ -1230,24 +1230,30 @@ void BP5Deserializer::FinalizeGets(std::vector Requests) GlobalDimensions[i] = RankSize[i]; } } - helper::NdCopy(IncomingData, adios2::Dims(RankOffset, RankOffset+DimCount), adios2::Dims(RankSize, RankSize+DimCount), - true /* m_WriterIsRowMajor */, false /*WriterIsLittleEndian*/, - (char*)Req.Data, adios2::Dims(SelOffset, SelOffset+DimCount), adios2::Dims(SelSize, SelSize+DimCount), true /*m_ReaderIsRowMajor */, - false /*m_ReaderIsLittleEndian*/, ElementSize); + helper::NdCopy( + IncomingData, + adios2::Dims(RankOffset, RankOffset + DimCount), + adios2::Dims(RankSize, RankSize + DimCount), + true /* m_WriterIsRowMajor */, + false /*WriterIsLittleEndian*/, (char *)Req.Data, + adios2::Dims(SelOffset, SelOffset + DimCount), + adios2::Dims(SelSize, SelSize + DimCount), + true /*m_ReaderIsRowMajor */, + false /*m_ReaderIsLittleEndian*/, ElementSize); // if (m_ReaderIsRowMajor) // { // ExtractSelectionFromPartialRM( - // ElementSize, DimCount, GlobalDimensions, RankOffset, - // RankSize, SelOffset, SelSize, IncomingData, - // (char *)Req.Data, Req.MemSpace); + // ElementSize, DimCount, GlobalDimensions, + // RankOffset, RankSize, SelOffset, SelSize, + // IncomingData, (char *)Req.Data, Req.MemSpace); // } // else // { // ExtractSelectionFromPartialCM( - // ElementSize, DimCount, GlobalDimensions, RankOffset, - // RankSize, SelOffset, SelSize, IncomingData, - // (char *)Req.Data, Req.MemSpace); + // ElementSize, DimCount, GlobalDimensions, + // RankOffset, RankSize, SelOffset, SelSize, + // IncomingData, (char *)Req.Data, Req.MemSpace); // } } } From e780c8570301a18b98fcb374636a32e2ca9484fb Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Fri, 25 Feb 2022 13:41:06 -0500 Subject: [PATCH 3/3] fix BP5 NdCopy dimensions for column major read --- .../toolkit/format/bp5/BP5Deserializer.cpp | 44 ++++++++----------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/source/adios2/toolkit/format/bp5/BP5Deserializer.cpp b/source/adios2/toolkit/format/bp5/BP5Deserializer.cpp index e331a3ee94..b4d5e79296 100644 --- a/source/adios2/toolkit/format/bp5/BP5Deserializer.cpp +++ b/source/adios2/toolkit/format/bp5/BP5Deserializer.cpp @@ -1230,31 +1230,25 @@ void BP5Deserializer::FinalizeGets(std::vector Requests) GlobalDimensions[i] = RankSize[i]; } } - helper::NdCopy( - IncomingData, - adios2::Dims(RankOffset, RankOffset + DimCount), - adios2::Dims(RankSize, RankSize + DimCount), - true /* m_WriterIsRowMajor */, - false /*WriterIsLittleEndian*/, (char *)Req.Data, - adios2::Dims(SelOffset, SelOffset + DimCount), - adios2::Dims(SelSize, SelSize + DimCount), - true /*m_ReaderIsRowMajor */, - false /*m_ReaderIsLittleEndian*/, ElementSize); - - // if (m_ReaderIsRowMajor) - // { - // ExtractSelectionFromPartialRM( - // ElementSize, DimCount, GlobalDimensions, - // RankOffset, RankSize, SelOffset, SelSize, - // IncomingData, (char *)Req.Data, Req.MemSpace); - // } - // else - // { - // ExtractSelectionFromPartialCM( - // ElementSize, DimCount, GlobalDimensions, - // RankOffset, RankSize, SelOffset, SelSize, - // IncomingData, (char *)Req.Data, Req.MemSpace); - // } + + auto inStart = + adios2::Dims(RankOffset, RankOffset + DimCount); + auto inCount = adios2::Dims(RankSize, RankSize + DimCount); + auto outStart = + adios2::Dims(SelOffset, SelOffset + DimCount); + auto outCount = adios2::Dims(SelSize, SelSize + DimCount); + + if (!m_ReaderIsRowMajor) + { + std::reverse(inStart.begin(), inStart.end()); + std::reverse(inCount.begin(), inCount.end()); + std::reverse(outStart.begin(), outStart.end()); + std::reverse(outCount.begin(), outCount.end()); + } + + helper::NdCopy(IncomingData, inStart, inCount, true, true, + (char *)Req.Data, outStart, outCount, true, + true, ElementSize); } } }