diff --git a/testing/adios2/engine/bp/CMakeLists.txt b/testing/adios2/engine/bp/CMakeLists.txt index 5237281f43..196126d30a 100644 --- a/testing/adios2/engine/bp/CMakeLists.txt +++ b/testing/adios2/engine/bp/CMakeLists.txt @@ -108,7 +108,7 @@ bp_gtest_add_tests_helper(WriteReadAsStreamADIOS2 MPI_ALLOW) bp_gtest_add_tests_helper(WriteReadAsStreamADIOS2_Threads MPI_ALLOW) bp_gtest_add_tests_helper(WriteReadAttributes MPI_ALLOW) bp_gtest_add_tests_helper(FStreamWriteReadHighLevelAPI MPI_ALLOW) -bp3_bp4_gtest_add_tests_helper(WriteFlushRead MPI_ALLOW) +bp_gtest_add_tests_helper(WriteFlushRead MPI_ALLOW) bp_gtest_add_tests_helper(WriteMultiblockRead MPI_ALLOW) bp_gtest_add_tests_helper(WriteReadMultiblock MPI_ALLOW) bp_gtest_add_tests_helper(WriteReadVector MPI_ALLOW) diff --git a/testing/adios2/engine/bp/TestBPWriteFlushRead.cpp b/testing/adios2/engine/bp/TestBPWriteFlushRead.cpp index e35fbd3adb..d73843e0cf 100644 --- a/testing/adios2/engine/bp/TestBPWriteFlushRead.cpp +++ b/testing/adios2/engine/bp/TestBPWriteFlushRead.cpp @@ -162,100 +162,100 @@ TEST_F(BPWriteFlushRead, ADIOS2BPWrite1D2D) adios2::Engine bpReader = io.Open("Flush1D.bp", adios2::Mode::Read); - auto var_i8 = io.InquireVariable("i8"); - EXPECT_TRUE(var_i8); - ASSERT_EQ(var_i8.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i8.Steps(), NSteps / 2); - ASSERT_EQ(var_i8.Shape()[0], mpiSize * Nx1D); - - auto var_i16 = io.InquireVariable("i16"); - EXPECT_TRUE(var_i16); - ASSERT_EQ(var_i16.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i16.Steps(), NSteps / 2); - ASSERT_EQ(var_i16.Shape()[0], mpiSize * Nx1D); - - auto var_i32 = io.InquireVariable("i32"); - EXPECT_TRUE(var_i32); - ASSERT_EQ(var_i32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i32.Steps(), NSteps / 2); - ASSERT_EQ(var_i32.Shape()[0], mpiSize * Nx1D); - - auto var_i64 = io.InquireVariable("i64"); - EXPECT_TRUE(var_i64); - ASSERT_EQ(var_i64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i64.Steps(), NSteps / 2); - ASSERT_EQ(var_i64.Shape()[0], mpiSize * Nx1D); - - auto var_u8 = io.InquireVariable("u8"); - EXPECT_TRUE(var_u8); - ASSERT_EQ(var_u8.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u8.Steps(), NSteps / 2); - ASSERT_EQ(var_u8.Shape()[0], mpiSize * Nx1D); - - auto var_u16 = io.InquireVariable("u16"); - EXPECT_TRUE(var_u16); - ASSERT_EQ(var_u16.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u16.Steps(), NSteps / 2); - ASSERT_EQ(var_u16.Shape()[0], mpiSize * Nx1D); - - auto var_u32 = io.InquireVariable("u32"); - EXPECT_TRUE(var_u32); - ASSERT_EQ(var_u32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u32.Steps(), NSteps / 2); - ASSERT_EQ(var_u32.Shape()[0], mpiSize * Nx1D); - - auto var_u64 = io.InquireVariable("u64"); - EXPECT_TRUE(var_u64); - ASSERT_EQ(var_u64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u64.Steps(), NSteps / 2); - ASSERT_EQ(var_u64.Shape()[0], mpiSize * Nx1D); - - auto var_r32 = io.InquireVariable("r32"); - EXPECT_TRUE(var_r32); - ASSERT_EQ(var_r32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_r32.Steps(), NSteps / 2); - ASSERT_EQ(var_r32.Shape()[0], mpiSize * Nx1D); - - auto var_r64 = io.InquireVariable("r64"); - EXPECT_TRUE(var_r64); - ASSERT_EQ(var_r64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_r64.Steps(), NSteps / 2); - ASSERT_EQ(var_r64.Shape()[0], mpiSize * Nx1D); - - std::string IString; - std::array I8; - std::array I16; - std::array I32; - std::array I64; - std::array U8; - std::array U16; - std::array U32; - std::array U64; - std::array R32; - std::array R64; - - const adios2::Dims start{mpiRank * Nx1D}; - const adios2::Dims count{Nx1D}; - - const adios2::Box sel(start, count); - - var_i8.SetSelection(sel); - var_i16.SetSelection(sel); - var_i32.SetSelection(sel); - var_i64.SetSelection(sel); - - var_u8.SetSelection(sel); - var_u16.SetSelection(sel); - var_u32.SetSelection(sel); - var_u64.SetSelection(sel); - - var_r32.SetSelection(sel); - var_r64.SetSelection(sel); - unsigned int t = 0; while (bpReader.BeginStep(adios2::StepMode::Read, 0.0) == adios2::StepStatus::OK) { + auto var_i8 = io.InquireVariable("i8"); + EXPECT_TRUE(var_i8); + ASSERT_EQ(var_i8.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i8.Steps(), NSteps / 2); + ASSERT_EQ(var_i8.Shape()[0], mpiSize * Nx1D); + + auto var_i16 = io.InquireVariable("i16"); + EXPECT_TRUE(var_i16); + ASSERT_EQ(var_i16.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i16.Steps(), NSteps / 2); + ASSERT_EQ(var_i16.Shape()[0], mpiSize * Nx1D); + + auto var_i32 = io.InquireVariable("i32"); + EXPECT_TRUE(var_i32); + ASSERT_EQ(var_i32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i32.Steps(), NSteps / 2); + ASSERT_EQ(var_i32.Shape()[0], mpiSize * Nx1D); + + auto var_i64 = io.InquireVariable("i64"); + EXPECT_TRUE(var_i64); + ASSERT_EQ(var_i64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i64.Steps(), NSteps / 2); + ASSERT_EQ(var_i64.Shape()[0], mpiSize * Nx1D); + + auto var_u8 = io.InquireVariable("u8"); + EXPECT_TRUE(var_u8); + ASSERT_EQ(var_u8.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u8.Steps(), NSteps / 2); + ASSERT_EQ(var_u8.Shape()[0], mpiSize * Nx1D); + + auto var_u16 = io.InquireVariable("u16"); + EXPECT_TRUE(var_u16); + ASSERT_EQ(var_u16.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u16.Steps(), NSteps / 2); + ASSERT_EQ(var_u16.Shape()[0], mpiSize * Nx1D); + + auto var_u32 = io.InquireVariable("u32"); + EXPECT_TRUE(var_u32); + ASSERT_EQ(var_u32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u32.Steps(), NSteps / 2); + ASSERT_EQ(var_u32.Shape()[0], mpiSize * Nx1D); + + auto var_u64 = io.InquireVariable("u64"); + EXPECT_TRUE(var_u64); + ASSERT_EQ(var_u64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u64.Steps(), NSteps / 2); + ASSERT_EQ(var_u64.Shape()[0], mpiSize * Nx1D); + + auto var_r32 = io.InquireVariable("r32"); + EXPECT_TRUE(var_r32); + ASSERT_EQ(var_r32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_r32.Steps(), NSteps / 2); + ASSERT_EQ(var_r32.Shape()[0], mpiSize * Nx1D); + + auto var_r64 = io.InquireVariable("r64"); + EXPECT_TRUE(var_r64); + ASSERT_EQ(var_r64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_r64.Steps(), NSteps / 2); + ASSERT_EQ(var_r64.Shape()[0], mpiSize * Nx1D); + + std::string IString; + std::array I8; + std::array I16; + std::array I32; + std::array I64; + std::array U8; + std::array U16; + std::array U32; + std::array U64; + std::array R32; + std::array R64; + + const adios2::Dims start{mpiRank * Nx1D}; + const adios2::Dims count{Nx1D}; + + const adios2::Box sel(start, count); + + var_i8.SetSelection(sel); + var_i16.SetSelection(sel); + var_i32.SetSelection(sel); + var_i64.SetSelection(sel); + + var_u8.SetSelection(sel); + var_u16.SetSelection(sel); + var_u32.SetSelection(sel); + var_u64.SetSelection(sel); + + var_r32.SetSelection(sel); + var_r64.SetSelection(sel); + const size_t currentStep = bpReader.CurrentStep(); EXPECT_EQ(currentStep, static_cast(t)); @@ -314,109 +314,120 @@ TEST_F(BPWriteFlushRead, ADIOS2BPWrite1D2D) adios2::Engine bpReader = io.Open("Flush2D.bp", adios2::Mode::Read); - auto var_i8 = io.InquireVariable("i8"); - EXPECT_TRUE(var_i8); - ASSERT_EQ(var_i8.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i8.Steps(), NSteps / 2); - ASSERT_EQ(var_i8.Shape()[0], Ny2D); - ASSERT_EQ(var_i8.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_i16 = io.InquireVariable("i16"); - EXPECT_TRUE(var_i16); - ASSERT_EQ(var_i16.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i16.Steps(), NSteps / 2); - ASSERT_EQ(var_i16.Shape()[0], Ny2D); - ASSERT_EQ(var_i16.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_i32 = io.InquireVariable("i32"); - EXPECT_TRUE(var_i32); - ASSERT_EQ(var_i32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i32.Steps(), NSteps / 2); - ASSERT_EQ(var_i32.Shape()[0], Ny2D); - ASSERT_EQ(var_i32.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_i64 = io.InquireVariable("i64"); - EXPECT_TRUE(var_i64); - ASSERT_EQ(var_i64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i64.Steps(), NSteps / 2); - ASSERT_EQ(var_i64.Shape()[0], Ny2D); - ASSERT_EQ(var_i64.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_u8 = io.InquireVariable("u8"); - EXPECT_TRUE(var_u8); - ASSERT_EQ(var_u8.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u8.Steps(), NSteps / 2); - ASSERT_EQ(var_u8.Shape()[0], Ny2D); - ASSERT_EQ(var_u8.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_u16 = io.InquireVariable("u16"); - EXPECT_TRUE(var_u16); - ASSERT_EQ(var_u16.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u16.Steps(), NSteps / 2); - ASSERT_EQ(var_u16.Shape()[0], Ny2D); - ASSERT_EQ(var_u16.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_u32 = io.InquireVariable("u32"); - EXPECT_TRUE(var_u32); - ASSERT_EQ(var_u32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u32.Steps(), NSteps / 2); - ASSERT_EQ(var_u32.Shape()[0], Ny2D); - ASSERT_EQ(var_u32.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_u64 = io.InquireVariable("u64"); - EXPECT_TRUE(var_u64); - ASSERT_EQ(var_u64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u64.Steps(), NSteps / 2); - ASSERT_EQ(var_u64.Shape()[0], Ny2D); - ASSERT_EQ(var_u64.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_r32 = io.InquireVariable("r32"); - EXPECT_TRUE(var_r32); - ASSERT_EQ(var_r32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_r32.Steps(), NSteps / 2); - ASSERT_EQ(var_r32.Shape()[0], Ny2D); - ASSERT_EQ(var_r32.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_r64 = io.InquireVariable("r64"); - EXPECT_TRUE(var_r64); - ASSERT_EQ(var_r64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_r64.Steps(), NSteps / 2); - ASSERT_EQ(var_r64.Shape()[0], Ny2D); - ASSERT_EQ(var_r64.Shape()[1], static_cast(mpiSize * Nx2D)); - - std::array I8; - std::array I16; - std::array I32; - std::array I64; - std::array U8; - std::array U16; - std::array U32; - std::array U64; - std::array R32; - std::array R64; - - const adios2::Dims start{0, static_cast(mpiRank * Nx2D)}; - const adios2::Dims count{Ny2D, Nx2D}; - - const adios2::Box sel(start, count); - - var_i8.SetSelection(sel); - var_i16.SetSelection(sel); - var_i32.SetSelection(sel); - var_i64.SetSelection(sel); - - var_u8.SetSelection(sel); - var_u16.SetSelection(sel); - var_u32.SetSelection(sel); - var_u64.SetSelection(sel); - - var_r32.SetSelection(sel); - var_r64.SetSelection(sel); - unsigned int t = 0; while (bpReader.BeginStep(adios2::StepMode::Read, 0.0) == adios2::StepStatus::OK) { + auto var_i8 = io.InquireVariable("i8"); + EXPECT_TRUE(var_i8); + ASSERT_EQ(var_i8.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i8.Steps(), NSteps / 2); + ASSERT_EQ(var_i8.Shape()[0], Ny2D); + ASSERT_EQ(var_i8.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_i16 = io.InquireVariable("i16"); + EXPECT_TRUE(var_i16); + ASSERT_EQ(var_i16.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i16.Steps(), NSteps / 2); + ASSERT_EQ(var_i16.Shape()[0], Ny2D); + ASSERT_EQ(var_i16.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_i32 = io.InquireVariable("i32"); + EXPECT_TRUE(var_i32); + ASSERT_EQ(var_i32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i32.Steps(), NSteps / 2); + ASSERT_EQ(var_i32.Shape()[0], Ny2D); + ASSERT_EQ(var_i32.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_i64 = io.InquireVariable("i64"); + EXPECT_TRUE(var_i64); + ASSERT_EQ(var_i64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i64.Steps(), NSteps / 2); + ASSERT_EQ(var_i64.Shape()[0], Ny2D); + ASSERT_EQ(var_i64.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_u8 = io.InquireVariable("u8"); + EXPECT_TRUE(var_u8); + ASSERT_EQ(var_u8.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u8.Steps(), NSteps / 2); + ASSERT_EQ(var_u8.Shape()[0], Ny2D); + ASSERT_EQ(var_u8.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_u16 = io.InquireVariable("u16"); + EXPECT_TRUE(var_u16); + ASSERT_EQ(var_u16.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u16.Steps(), NSteps / 2); + ASSERT_EQ(var_u16.Shape()[0], Ny2D); + ASSERT_EQ(var_u16.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_u32 = io.InquireVariable("u32"); + EXPECT_TRUE(var_u32); + ASSERT_EQ(var_u32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u32.Steps(), NSteps / 2); + ASSERT_EQ(var_u32.Shape()[0], Ny2D); + ASSERT_EQ(var_u32.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_u64 = io.InquireVariable("u64"); + EXPECT_TRUE(var_u64); + ASSERT_EQ(var_u64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u64.Steps(), NSteps / 2); + ASSERT_EQ(var_u64.Shape()[0], Ny2D); + ASSERT_EQ(var_u64.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_r32 = io.InquireVariable("r32"); + EXPECT_TRUE(var_r32); + ASSERT_EQ(var_r32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_r32.Steps(), NSteps / 2); + ASSERT_EQ(var_r32.Shape()[0], Ny2D); + ASSERT_EQ(var_r32.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_r64 = io.InquireVariable("r64"); + EXPECT_TRUE(var_r64); + ASSERT_EQ(var_r64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_r64.Steps(), NSteps / 2); + ASSERT_EQ(var_r64.Shape()[0], Ny2D); + ASSERT_EQ(var_r64.Shape()[1], + static_cast(mpiSize * Nx2D)); + + std::array I8; + std::array I16; + std::array I32; + std::array I64; + std::array U8; + std::array U16; + std::array U32; + std::array U64; + std::array R32; + std::array R64; + + const adios2::Dims start{0, + static_cast(mpiRank * Nx2D)}; + const adios2::Dims count{Ny2D, Nx2D}; + + const adios2::Box sel(start, count); + + var_i8.SetSelection(sel); + var_i16.SetSelection(sel); + var_i32.SetSelection(sel); + var_i64.SetSelection(sel); + + var_u8.SetSelection(sel); + var_u16.SetSelection(sel); + var_u32.SetSelection(sel); + var_u64.SetSelection(sel); + + var_r32.SetSelection(sel); + var_r64.SetSelection(sel); + const size_t currentStep = bpReader.CurrentStep(); EXPECT_EQ(currentStep, static_cast(t)); @@ -604,100 +615,100 @@ TEST_F(BPWriteFlushRead, ADIOS2BPWrite1D2Dstdio) adios2::Engine bpReader = io.Open("Flush1Dstdio.bp", adios2::Mode::Read); - auto var_i8 = io.InquireVariable("i8"); - EXPECT_TRUE(var_i8); - ASSERT_EQ(var_i8.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i8.Steps(), NSteps / 2); - ASSERT_EQ(var_i8.Shape()[0], mpiSize * Nx1D); - - auto var_i16 = io.InquireVariable("i16"); - EXPECT_TRUE(var_i16); - ASSERT_EQ(var_i16.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i16.Steps(), NSteps / 2); - ASSERT_EQ(var_i16.Shape()[0], mpiSize * Nx1D); - - auto var_i32 = io.InquireVariable("i32"); - EXPECT_TRUE(var_i32); - ASSERT_EQ(var_i32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i32.Steps(), NSteps / 2); - ASSERT_EQ(var_i32.Shape()[0], mpiSize * Nx1D); - - auto var_i64 = io.InquireVariable("i64"); - EXPECT_TRUE(var_i64); - ASSERT_EQ(var_i64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i64.Steps(), NSteps / 2); - ASSERT_EQ(var_i64.Shape()[0], mpiSize * Nx1D); - - auto var_u8 = io.InquireVariable("u8"); - EXPECT_TRUE(var_u8); - ASSERT_EQ(var_u8.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u8.Steps(), NSteps / 2); - ASSERT_EQ(var_u8.Shape()[0], mpiSize * Nx1D); - - auto var_u16 = io.InquireVariable("u16"); - EXPECT_TRUE(var_u16); - ASSERT_EQ(var_u16.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u16.Steps(), NSteps / 2); - ASSERT_EQ(var_u16.Shape()[0], mpiSize * Nx1D); - - auto var_u32 = io.InquireVariable("u32"); - EXPECT_TRUE(var_u32); - ASSERT_EQ(var_u32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u32.Steps(), NSteps / 2); - ASSERT_EQ(var_u32.Shape()[0], mpiSize * Nx1D); - - auto var_u64 = io.InquireVariable("u64"); - EXPECT_TRUE(var_u64); - ASSERT_EQ(var_u64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u64.Steps(), NSteps / 2); - ASSERT_EQ(var_u64.Shape()[0], mpiSize * Nx1D); - - auto var_r32 = io.InquireVariable("r32"); - EXPECT_TRUE(var_r32); - ASSERT_EQ(var_r32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_r32.Steps(), NSteps / 2); - ASSERT_EQ(var_r32.Shape()[0], mpiSize * Nx1D); - - auto var_r64 = io.InquireVariable("r64"); - EXPECT_TRUE(var_r64); - ASSERT_EQ(var_r64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_r64.Steps(), NSteps / 2); - ASSERT_EQ(var_r64.Shape()[0], mpiSize * Nx1D); - - std::string IString; - std::array I8; - std::array I16; - std::array I32; - std::array I64; - std::array U8; - std::array U16; - std::array U32; - std::array U64; - std::array R32; - std::array R64; - - const adios2::Dims start{mpiRank * Nx1D}; - const adios2::Dims count{Nx1D}; - - const adios2::Box sel(start, count); - - var_i8.SetSelection(sel); - var_i16.SetSelection(sel); - var_i32.SetSelection(sel); - var_i64.SetSelection(sel); - - var_u8.SetSelection(sel); - var_u16.SetSelection(sel); - var_u32.SetSelection(sel); - var_u64.SetSelection(sel); - - var_r32.SetSelection(sel); - var_r64.SetSelection(sel); - unsigned int t = 0; while (bpReader.BeginStep(adios2::StepMode::Read, 0.0) == adios2::StepStatus::OK) { + auto var_i8 = io.InquireVariable("i8"); + EXPECT_TRUE(var_i8); + ASSERT_EQ(var_i8.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i8.Steps(), NSteps / 2); + ASSERT_EQ(var_i8.Shape()[0], mpiSize * Nx1D); + + auto var_i16 = io.InquireVariable("i16"); + EXPECT_TRUE(var_i16); + ASSERT_EQ(var_i16.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i16.Steps(), NSteps / 2); + ASSERT_EQ(var_i16.Shape()[0], mpiSize * Nx1D); + + auto var_i32 = io.InquireVariable("i32"); + EXPECT_TRUE(var_i32); + ASSERT_EQ(var_i32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i32.Steps(), NSteps / 2); + ASSERT_EQ(var_i32.Shape()[0], mpiSize * Nx1D); + + auto var_i64 = io.InquireVariable("i64"); + EXPECT_TRUE(var_i64); + ASSERT_EQ(var_i64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i64.Steps(), NSteps / 2); + ASSERT_EQ(var_i64.Shape()[0], mpiSize * Nx1D); + + auto var_u8 = io.InquireVariable("u8"); + EXPECT_TRUE(var_u8); + ASSERT_EQ(var_u8.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u8.Steps(), NSteps / 2); + ASSERT_EQ(var_u8.Shape()[0], mpiSize * Nx1D); + + auto var_u16 = io.InquireVariable("u16"); + EXPECT_TRUE(var_u16); + ASSERT_EQ(var_u16.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u16.Steps(), NSteps / 2); + ASSERT_EQ(var_u16.Shape()[0], mpiSize * Nx1D); + + auto var_u32 = io.InquireVariable("u32"); + EXPECT_TRUE(var_u32); + ASSERT_EQ(var_u32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u32.Steps(), NSteps / 2); + ASSERT_EQ(var_u32.Shape()[0], mpiSize * Nx1D); + + auto var_u64 = io.InquireVariable("u64"); + EXPECT_TRUE(var_u64); + ASSERT_EQ(var_u64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u64.Steps(), NSteps / 2); + ASSERT_EQ(var_u64.Shape()[0], mpiSize * Nx1D); + + auto var_r32 = io.InquireVariable("r32"); + EXPECT_TRUE(var_r32); + ASSERT_EQ(var_r32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_r32.Steps(), NSteps / 2); + ASSERT_EQ(var_r32.Shape()[0], mpiSize * Nx1D); + + auto var_r64 = io.InquireVariable("r64"); + EXPECT_TRUE(var_r64); + ASSERT_EQ(var_r64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_r64.Steps(), NSteps / 2); + ASSERT_EQ(var_r64.Shape()[0], mpiSize * Nx1D); + + std::string IString; + std::array I8; + std::array I16; + std::array I32; + std::array I64; + std::array U8; + std::array U16; + std::array U32; + std::array U64; + std::array R32; + std::array R64; + + const adios2::Dims start{mpiRank * Nx1D}; + const adios2::Dims count{Nx1D}; + + const adios2::Box sel(start, count); + + var_i8.SetSelection(sel); + var_i16.SetSelection(sel); + var_i32.SetSelection(sel); + var_i64.SetSelection(sel); + + var_u8.SetSelection(sel); + var_u16.SetSelection(sel); + var_u32.SetSelection(sel); + var_u64.SetSelection(sel); + + var_r32.SetSelection(sel); + var_r64.SetSelection(sel); + const size_t currentStep = bpReader.CurrentStep(); EXPECT_EQ(currentStep, static_cast(t)); @@ -756,109 +767,120 @@ TEST_F(BPWriteFlushRead, ADIOS2BPWrite1D2Dstdio) adios2::Engine bpReader = io.Open("Flush2Dstdio.bp", adios2::Mode::Read); - auto var_i8 = io.InquireVariable("i8"); - EXPECT_TRUE(var_i8); - ASSERT_EQ(var_i8.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i8.Steps(), NSteps / 2); - ASSERT_EQ(var_i8.Shape()[0], Ny2D); - ASSERT_EQ(var_i8.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_i16 = io.InquireVariable("i16"); - EXPECT_TRUE(var_i16); - ASSERT_EQ(var_i16.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i16.Steps(), NSteps / 2); - ASSERT_EQ(var_i16.Shape()[0], Ny2D); - ASSERT_EQ(var_i16.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_i32 = io.InquireVariable("i32"); - EXPECT_TRUE(var_i32); - ASSERT_EQ(var_i32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i32.Steps(), NSteps / 2); - ASSERT_EQ(var_i32.Shape()[0], Ny2D); - ASSERT_EQ(var_i32.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_i64 = io.InquireVariable("i64"); - EXPECT_TRUE(var_i64); - ASSERT_EQ(var_i64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i64.Steps(), NSteps / 2); - ASSERT_EQ(var_i64.Shape()[0], Ny2D); - ASSERT_EQ(var_i64.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_u8 = io.InquireVariable("u8"); - EXPECT_TRUE(var_u8); - ASSERT_EQ(var_u8.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u8.Steps(), NSteps / 2); - ASSERT_EQ(var_u8.Shape()[0], Ny2D); - ASSERT_EQ(var_u8.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_u16 = io.InquireVariable("u16"); - EXPECT_TRUE(var_u16); - ASSERT_EQ(var_u16.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u16.Steps(), NSteps / 2); - ASSERT_EQ(var_u16.Shape()[0], Ny2D); - ASSERT_EQ(var_u16.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_u32 = io.InquireVariable("u32"); - EXPECT_TRUE(var_u32); - ASSERT_EQ(var_u32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u32.Steps(), NSteps / 2); - ASSERT_EQ(var_u32.Shape()[0], Ny2D); - ASSERT_EQ(var_u32.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_u64 = io.InquireVariable("u64"); - EXPECT_TRUE(var_u64); - ASSERT_EQ(var_u64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u64.Steps(), NSteps / 2); - ASSERT_EQ(var_u64.Shape()[0], Ny2D); - ASSERT_EQ(var_u64.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_r32 = io.InquireVariable("r32"); - EXPECT_TRUE(var_r32); - ASSERT_EQ(var_r32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_r32.Steps(), NSteps / 2); - ASSERT_EQ(var_r32.Shape()[0], Ny2D); - ASSERT_EQ(var_r32.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_r64 = io.InquireVariable("r64"); - EXPECT_TRUE(var_r64); - ASSERT_EQ(var_r64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_r64.Steps(), NSteps / 2); - ASSERT_EQ(var_r64.Shape()[0], Ny2D); - ASSERT_EQ(var_r64.Shape()[1], static_cast(mpiSize * Nx2D)); - - std::array I8; - std::array I16; - std::array I32; - std::array I64; - std::array U8; - std::array U16; - std::array U32; - std::array U64; - std::array R32; - std::array R64; - - const adios2::Dims start{0, static_cast(mpiRank * Nx2D)}; - const adios2::Dims count{Ny2D, Nx2D}; - - const adios2::Box sel(start, count); - - var_i8.SetSelection(sel); - var_i16.SetSelection(sel); - var_i32.SetSelection(sel); - var_i64.SetSelection(sel); - - var_u8.SetSelection(sel); - var_u16.SetSelection(sel); - var_u32.SetSelection(sel); - var_u64.SetSelection(sel); - - var_r32.SetSelection(sel); - var_r64.SetSelection(sel); - unsigned int t = 0; while (bpReader.BeginStep(adios2::StepMode::Read, 0.0) == adios2::StepStatus::OK) { + auto var_i8 = io.InquireVariable("i8"); + EXPECT_TRUE(var_i8); + ASSERT_EQ(var_i8.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i8.Steps(), NSteps / 2); + ASSERT_EQ(var_i8.Shape()[0], Ny2D); + ASSERT_EQ(var_i8.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_i16 = io.InquireVariable("i16"); + EXPECT_TRUE(var_i16); + ASSERT_EQ(var_i16.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i16.Steps(), NSteps / 2); + ASSERT_EQ(var_i16.Shape()[0], Ny2D); + ASSERT_EQ(var_i16.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_i32 = io.InquireVariable("i32"); + EXPECT_TRUE(var_i32); + ASSERT_EQ(var_i32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i32.Steps(), NSteps / 2); + ASSERT_EQ(var_i32.Shape()[0], Ny2D); + ASSERT_EQ(var_i32.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_i64 = io.InquireVariable("i64"); + EXPECT_TRUE(var_i64); + ASSERT_EQ(var_i64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i64.Steps(), NSteps / 2); + ASSERT_EQ(var_i64.Shape()[0], Ny2D); + ASSERT_EQ(var_i64.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_u8 = io.InquireVariable("u8"); + EXPECT_TRUE(var_u8); + ASSERT_EQ(var_u8.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u8.Steps(), NSteps / 2); + ASSERT_EQ(var_u8.Shape()[0], Ny2D); + ASSERT_EQ(var_u8.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_u16 = io.InquireVariable("u16"); + EXPECT_TRUE(var_u16); + ASSERT_EQ(var_u16.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u16.Steps(), NSteps / 2); + ASSERT_EQ(var_u16.Shape()[0], Ny2D); + ASSERT_EQ(var_u16.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_u32 = io.InquireVariable("u32"); + EXPECT_TRUE(var_u32); + ASSERT_EQ(var_u32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u32.Steps(), NSteps / 2); + ASSERT_EQ(var_u32.Shape()[0], Ny2D); + ASSERT_EQ(var_u32.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_u64 = io.InquireVariable("u64"); + EXPECT_TRUE(var_u64); + ASSERT_EQ(var_u64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u64.Steps(), NSteps / 2); + ASSERT_EQ(var_u64.Shape()[0], Ny2D); + ASSERT_EQ(var_u64.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_r32 = io.InquireVariable("r32"); + EXPECT_TRUE(var_r32); + ASSERT_EQ(var_r32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_r32.Steps(), NSteps / 2); + ASSERT_EQ(var_r32.Shape()[0], Ny2D); + ASSERT_EQ(var_r32.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_r64 = io.InquireVariable("r64"); + EXPECT_TRUE(var_r64); + ASSERT_EQ(var_r64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_r64.Steps(), NSteps / 2); + ASSERT_EQ(var_r64.Shape()[0], Ny2D); + ASSERT_EQ(var_r64.Shape()[1], + static_cast(mpiSize * Nx2D)); + + std::array I8; + std::array I16; + std::array I32; + std::array I64; + std::array U8; + std::array U16; + std::array U32; + std::array U64; + std::array R32; + std::array R64; + + const adios2::Dims start{0, + static_cast(mpiRank * Nx2D)}; + const adios2::Dims count{Ny2D, Nx2D}; + + const adios2::Box sel(start, count); + + var_i8.SetSelection(sel); + var_i16.SetSelection(sel); + var_i32.SetSelection(sel); + var_i64.SetSelection(sel); + + var_u8.SetSelection(sel); + var_u16.SetSelection(sel); + var_u32.SetSelection(sel); + var_u64.SetSelection(sel); + + var_r32.SetSelection(sel); + var_r64.SetSelection(sel); + const size_t currentStep = bpReader.CurrentStep(); EXPECT_EQ(currentStep, static_cast(t)); @@ -1046,100 +1068,100 @@ TEST_F(BPWriteFlushRead, ADIOS2BPWrite1D2Dfstream) adios2::Engine bpReader = io.Open("Flush1Dfstream.bp", adios2::Mode::Read); - auto var_i8 = io.InquireVariable("i8"); - EXPECT_TRUE(var_i8); - ASSERT_EQ(var_i8.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i8.Steps(), NSteps / 2); - ASSERT_EQ(var_i8.Shape()[0], mpiSize * Nx1D); - - auto var_i16 = io.InquireVariable("i16"); - EXPECT_TRUE(var_i16); - ASSERT_EQ(var_i16.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i16.Steps(), NSteps / 2); - ASSERT_EQ(var_i16.Shape()[0], mpiSize * Nx1D); - - auto var_i32 = io.InquireVariable("i32"); - EXPECT_TRUE(var_i32); - ASSERT_EQ(var_i32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i32.Steps(), NSteps / 2); - ASSERT_EQ(var_i32.Shape()[0], mpiSize * Nx1D); - - auto var_i64 = io.InquireVariable("i64"); - EXPECT_TRUE(var_i64); - ASSERT_EQ(var_i64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i64.Steps(), NSteps / 2); - ASSERT_EQ(var_i64.Shape()[0], mpiSize * Nx1D); - - auto var_u8 = io.InquireVariable("u8"); - EXPECT_TRUE(var_u8); - ASSERT_EQ(var_u8.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u8.Steps(), NSteps / 2); - ASSERT_EQ(var_u8.Shape()[0], mpiSize * Nx1D); - - auto var_u16 = io.InquireVariable("u16"); - EXPECT_TRUE(var_u16); - ASSERT_EQ(var_u16.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u16.Steps(), NSteps / 2); - ASSERT_EQ(var_u16.Shape()[0], mpiSize * Nx1D); - - auto var_u32 = io.InquireVariable("u32"); - EXPECT_TRUE(var_u32); - ASSERT_EQ(var_u32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u32.Steps(), NSteps / 2); - ASSERT_EQ(var_u32.Shape()[0], mpiSize * Nx1D); - - auto var_u64 = io.InquireVariable("u64"); - EXPECT_TRUE(var_u64); - ASSERT_EQ(var_u64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u64.Steps(), NSteps / 2); - ASSERT_EQ(var_u64.Shape()[0], mpiSize * Nx1D); - - auto var_r32 = io.InquireVariable("r32"); - EXPECT_TRUE(var_r32); - ASSERT_EQ(var_r32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_r32.Steps(), NSteps / 2); - ASSERT_EQ(var_r32.Shape()[0], mpiSize * Nx1D); - - auto var_r64 = io.InquireVariable("r64"); - EXPECT_TRUE(var_r64); - ASSERT_EQ(var_r64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_r64.Steps(), NSteps / 2); - ASSERT_EQ(var_r64.Shape()[0], mpiSize * Nx1D); - - std::string IString; - std::array I8; - std::array I16; - std::array I32; - std::array I64; - std::array U8; - std::array U16; - std::array U32; - std::array U64; - std::array R32; - std::array R64; - - const adios2::Dims start{mpiRank * Nx1D}; - const adios2::Dims count{Nx1D}; - - const adios2::Box sel(start, count); - - var_i8.SetSelection(sel); - var_i16.SetSelection(sel); - var_i32.SetSelection(sel); - var_i64.SetSelection(sel); - - var_u8.SetSelection(sel); - var_u16.SetSelection(sel); - var_u32.SetSelection(sel); - var_u64.SetSelection(sel); - - var_r32.SetSelection(sel); - var_r64.SetSelection(sel); - unsigned int t = 0; while (bpReader.BeginStep(adios2::StepMode::Read, 0.0) == adios2::StepStatus::OK) { + auto var_i8 = io.InquireVariable("i8"); + EXPECT_TRUE(var_i8); + ASSERT_EQ(var_i8.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i8.Steps(), NSteps / 2); + ASSERT_EQ(var_i8.Shape()[0], mpiSize * Nx1D); + + auto var_i16 = io.InquireVariable("i16"); + EXPECT_TRUE(var_i16); + ASSERT_EQ(var_i16.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i16.Steps(), NSteps / 2); + ASSERT_EQ(var_i16.Shape()[0], mpiSize * Nx1D); + + auto var_i32 = io.InquireVariable("i32"); + EXPECT_TRUE(var_i32); + ASSERT_EQ(var_i32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i32.Steps(), NSteps / 2); + ASSERT_EQ(var_i32.Shape()[0], mpiSize * Nx1D); + + auto var_i64 = io.InquireVariable("i64"); + EXPECT_TRUE(var_i64); + ASSERT_EQ(var_i64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i64.Steps(), NSteps / 2); + ASSERT_EQ(var_i64.Shape()[0], mpiSize * Nx1D); + + auto var_u8 = io.InquireVariable("u8"); + EXPECT_TRUE(var_u8); + ASSERT_EQ(var_u8.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u8.Steps(), NSteps / 2); + ASSERT_EQ(var_u8.Shape()[0], mpiSize * Nx1D); + + auto var_u16 = io.InquireVariable("u16"); + EXPECT_TRUE(var_u16); + ASSERT_EQ(var_u16.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u16.Steps(), NSteps / 2); + ASSERT_EQ(var_u16.Shape()[0], mpiSize * Nx1D); + + auto var_u32 = io.InquireVariable("u32"); + EXPECT_TRUE(var_u32); + ASSERT_EQ(var_u32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u32.Steps(), NSteps / 2); + ASSERT_EQ(var_u32.Shape()[0], mpiSize * Nx1D); + + auto var_u64 = io.InquireVariable("u64"); + EXPECT_TRUE(var_u64); + ASSERT_EQ(var_u64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u64.Steps(), NSteps / 2); + ASSERT_EQ(var_u64.Shape()[0], mpiSize * Nx1D); + + auto var_r32 = io.InquireVariable("r32"); + EXPECT_TRUE(var_r32); + ASSERT_EQ(var_r32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_r32.Steps(), NSteps / 2); + ASSERT_EQ(var_r32.Shape()[0], mpiSize * Nx1D); + + auto var_r64 = io.InquireVariable("r64"); + EXPECT_TRUE(var_r64); + ASSERT_EQ(var_r64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_r64.Steps(), NSteps / 2); + ASSERT_EQ(var_r64.Shape()[0], mpiSize * Nx1D); + + std::string IString; + std::array I8; + std::array I16; + std::array I32; + std::array I64; + std::array U8; + std::array U16; + std::array U32; + std::array U64; + std::array R32; + std::array R64; + + const adios2::Dims start{mpiRank * Nx1D}; + const adios2::Dims count{Nx1D}; + + const adios2::Box sel(start, count); + + var_i8.SetSelection(sel); + var_i16.SetSelection(sel); + var_i32.SetSelection(sel); + var_i64.SetSelection(sel); + + var_u8.SetSelection(sel); + var_u16.SetSelection(sel); + var_u32.SetSelection(sel); + var_u64.SetSelection(sel); + + var_r32.SetSelection(sel); + var_r64.SetSelection(sel); + const size_t currentStep = bpReader.CurrentStep(); EXPECT_EQ(currentStep, static_cast(t)); @@ -1198,109 +1220,120 @@ TEST_F(BPWriteFlushRead, ADIOS2BPWrite1D2Dfstream) adios2::Engine bpReader = io.Open("Flush2Dfstream.bp", adios2::Mode::Read); - auto var_i8 = io.InquireVariable("i8"); - EXPECT_TRUE(var_i8); - ASSERT_EQ(var_i8.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i8.Steps(), NSteps / 2); - ASSERT_EQ(var_i8.Shape()[0], Ny2D); - ASSERT_EQ(var_i8.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_i16 = io.InquireVariable("i16"); - EXPECT_TRUE(var_i16); - ASSERT_EQ(var_i16.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i16.Steps(), NSteps / 2); - ASSERT_EQ(var_i16.Shape()[0], Ny2D); - ASSERT_EQ(var_i16.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_i32 = io.InquireVariable("i32"); - EXPECT_TRUE(var_i32); - ASSERT_EQ(var_i32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i32.Steps(), NSteps / 2); - ASSERT_EQ(var_i32.Shape()[0], Ny2D); - ASSERT_EQ(var_i32.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_i64 = io.InquireVariable("i64"); - EXPECT_TRUE(var_i64); - ASSERT_EQ(var_i64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_i64.Steps(), NSteps / 2); - ASSERT_EQ(var_i64.Shape()[0], Ny2D); - ASSERT_EQ(var_i64.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_u8 = io.InquireVariable("u8"); - EXPECT_TRUE(var_u8); - ASSERT_EQ(var_u8.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u8.Steps(), NSteps / 2); - ASSERT_EQ(var_u8.Shape()[0], Ny2D); - ASSERT_EQ(var_u8.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_u16 = io.InquireVariable("u16"); - EXPECT_TRUE(var_u16); - ASSERT_EQ(var_u16.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u16.Steps(), NSteps / 2); - ASSERT_EQ(var_u16.Shape()[0], Ny2D); - ASSERT_EQ(var_u16.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_u32 = io.InquireVariable("u32"); - EXPECT_TRUE(var_u32); - ASSERT_EQ(var_u32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u32.Steps(), NSteps / 2); - ASSERT_EQ(var_u32.Shape()[0], Ny2D); - ASSERT_EQ(var_u32.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_u64 = io.InquireVariable("u64"); - EXPECT_TRUE(var_u64); - ASSERT_EQ(var_u64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_u64.Steps(), NSteps / 2); - ASSERT_EQ(var_u64.Shape()[0], Ny2D); - ASSERT_EQ(var_u64.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_r32 = io.InquireVariable("r32"); - EXPECT_TRUE(var_r32); - ASSERT_EQ(var_r32.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_r32.Steps(), NSteps / 2); - ASSERT_EQ(var_r32.Shape()[0], Ny2D); - ASSERT_EQ(var_r32.Shape()[1], static_cast(mpiSize * Nx2D)); - - auto var_r64 = io.InquireVariable("r64"); - EXPECT_TRUE(var_r64); - ASSERT_EQ(var_r64.ShapeID(), adios2::ShapeID::GlobalArray); - ASSERT_EQ(var_r64.Steps(), NSteps / 2); - ASSERT_EQ(var_r64.Shape()[0], Ny2D); - ASSERT_EQ(var_r64.Shape()[1], static_cast(mpiSize * Nx2D)); - - std::array I8; - std::array I16; - std::array I32; - std::array I64; - std::array U8; - std::array U16; - std::array U32; - std::array U64; - std::array R32; - std::array R64; - - const adios2::Dims start{0, static_cast(mpiRank * Nx2D)}; - const adios2::Dims count{Ny2D, Nx2D}; - - const adios2::Box sel(start, count); - - var_i8.SetSelection(sel); - var_i16.SetSelection(sel); - var_i32.SetSelection(sel); - var_i64.SetSelection(sel); - - var_u8.SetSelection(sel); - var_u16.SetSelection(sel); - var_u32.SetSelection(sel); - var_u64.SetSelection(sel); - - var_r32.SetSelection(sel); - var_r64.SetSelection(sel); - unsigned int t = 0; while (bpReader.BeginStep(adios2::StepMode::Read, 0.0) == adios2::StepStatus::OK) { + auto var_i8 = io.InquireVariable("i8"); + EXPECT_TRUE(var_i8); + ASSERT_EQ(var_i8.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i8.Steps(), NSteps / 2); + ASSERT_EQ(var_i8.Shape()[0], Ny2D); + ASSERT_EQ(var_i8.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_i16 = io.InquireVariable("i16"); + EXPECT_TRUE(var_i16); + ASSERT_EQ(var_i16.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i16.Steps(), NSteps / 2); + ASSERT_EQ(var_i16.Shape()[0], Ny2D); + ASSERT_EQ(var_i16.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_i32 = io.InquireVariable("i32"); + EXPECT_TRUE(var_i32); + ASSERT_EQ(var_i32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i32.Steps(), NSteps / 2); + ASSERT_EQ(var_i32.Shape()[0], Ny2D); + ASSERT_EQ(var_i32.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_i64 = io.InquireVariable("i64"); + EXPECT_TRUE(var_i64); + ASSERT_EQ(var_i64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_i64.Steps(), NSteps / 2); + ASSERT_EQ(var_i64.Shape()[0], Ny2D); + ASSERT_EQ(var_i64.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_u8 = io.InquireVariable("u8"); + EXPECT_TRUE(var_u8); + ASSERT_EQ(var_u8.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u8.Steps(), NSteps / 2); + ASSERT_EQ(var_u8.Shape()[0], Ny2D); + ASSERT_EQ(var_u8.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_u16 = io.InquireVariable("u16"); + EXPECT_TRUE(var_u16); + ASSERT_EQ(var_u16.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u16.Steps(), NSteps / 2); + ASSERT_EQ(var_u16.Shape()[0], Ny2D); + ASSERT_EQ(var_u16.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_u32 = io.InquireVariable("u32"); + EXPECT_TRUE(var_u32); + ASSERT_EQ(var_u32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u32.Steps(), NSteps / 2); + ASSERT_EQ(var_u32.Shape()[0], Ny2D); + ASSERT_EQ(var_u32.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_u64 = io.InquireVariable("u64"); + EXPECT_TRUE(var_u64); + ASSERT_EQ(var_u64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_u64.Steps(), NSteps / 2); + ASSERT_EQ(var_u64.Shape()[0], Ny2D); + ASSERT_EQ(var_u64.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_r32 = io.InquireVariable("r32"); + EXPECT_TRUE(var_r32); + ASSERT_EQ(var_r32.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_r32.Steps(), NSteps / 2); + ASSERT_EQ(var_r32.Shape()[0], Ny2D); + ASSERT_EQ(var_r32.Shape()[1], + static_cast(mpiSize * Nx2D)); + + auto var_r64 = io.InquireVariable("r64"); + EXPECT_TRUE(var_r64); + ASSERT_EQ(var_r64.ShapeID(), adios2::ShapeID::GlobalArray); + ASSERT_EQ(var_r64.Steps(), NSteps / 2); + ASSERT_EQ(var_r64.Shape()[0], Ny2D); + ASSERT_EQ(var_r64.Shape()[1], + static_cast(mpiSize * Nx2D)); + + std::array I8; + std::array I16; + std::array I32; + std::array I64; + std::array U8; + std::array U16; + std::array U32; + std::array U64; + std::array R32; + std::array R64; + + const adios2::Dims start{0, + static_cast(mpiRank * Nx2D)}; + const adios2::Dims count{Ny2D, Nx2D}; + + const adios2::Box sel(start, count); + + var_i8.SetSelection(sel); + var_i16.SetSelection(sel); + var_i32.SetSelection(sel); + var_i64.SetSelection(sel); + + var_u8.SetSelection(sel); + var_u16.SetSelection(sel); + var_u32.SetSelection(sel); + var_u64.SetSelection(sel); + + var_r32.SetSelection(sel); + var_r64.SetSelection(sel); + const size_t currentStep = bpReader.CurrentStep(); EXPECT_EQ(currentStep, static_cast(t));