Loading source/adios2/engine/hdf5/HDF5ReaderP.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -331,9 +331,22 @@ void HDF5ReaderP::PerformGets() { \ GetSyncCommon(variable, data); \ } \ \ void HDF5ReaderP::DoGetDeferred(Variable<T> &variable, T *data) \ { \ GetDeferredCommon(variable, data); \ } \ \ std::map<size_t, std::vector<typename Variable<T>::Info>> \ HDF5ReaderP::DoAllStepsBlocksInfo(const Variable<T> &variable) const \ { \ return GetAllStepsBlocksInfo(variable); \ } \ \ std::vector<typename Variable<T>::Info> HDF5ReaderP::DoBlocksInfo( \ const Variable<T> &variable, const size_t step) const \ { \ return GetBlocksInfo(variable, step); \ } ADIOS2_FOREACH_TYPE_1ARG(declare_type) Loading source/adios2/engine/hdf5/HDF5ReaderP.h +21 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,9 @@ #include "adios2/core/IO.h" #include "adios2/toolkit/interop/hdf5/HDF5Common.h" #include <map> #include <vector> namespace adios2 { namespace core Loading Loading @@ -56,7 +59,12 @@ private: unsigned int m_StreamAt = 0; // stream step counter #define declare_type(T) \ void DoGetSync(Variable<T> &, T *) final; \ void DoGetDeferred(Variable<T> &, T *) final; void DoGetDeferred(Variable<T> &, T *) final; \ std::map<size_t, std::vector<typename Variable<T>::Info>> \ DoAllStepsBlocksInfo(const Variable<T> &variable) const final; \ \ std::vector<typename Variable<T>::Info> DoBlocksInfo( \ const Variable<T> &variable, const size_t step) const final; ADIOS2_FOREACH_TYPE_1ARG(declare_type) #undef declare_type Loading @@ -72,6 +80,18 @@ private: template <class T> void GetDeferredCommon(Variable<T> &variable, T *data); template <class T> std::map<size_t, std::vector<typename Variable<T>::Info>> GetAllStepsBlocksInfo(const Variable<T> &variable) const; template <class T> std::vector<typename Variable<T>::Info> GetBlocksInfo(const Variable<T> &variable, const size_t step) const; template <class T> std::vector<typename core::Variable<T>::Info> BlocksInfoCommon(const core::Variable<T> &variable) const; template <class T> void UseHDFRead(Variable<T> &variable, T *values, hid_t h5Type); Loading source/adios2/engine/hdf5/HDF5ReaderP.tcc +46 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,52 @@ void HDF5ReaderP::GetDeferredCommon(Variable<T> &variable, T *data) #endif } template <class T> std::vector<typename core::Variable<T>::Info> HDF5ReaderP::BlocksInfoCommon(const core::Variable<T> &variable) const { std::vector<typename core::Variable<T>::Info> blocksInfo; typename core::Variable<T>::Info blockInfo; blockInfo.Start = variable.m_Start; blockInfo.Count = variable.m_Shape; if (variable.m_ShapeID == ShapeID::GlobalValue || variable.m_ShapeID == ShapeID::LocalValue) { blockInfo.IsValue = true; } else { blockInfo.IsValue = false; } blocksInfo.push_back(blockInfo); return blocksInfo; } template <class T> std::map<size_t, std::vector<typename Variable<T>::Info>> HDF5ReaderP::GetAllStepsBlocksInfo(const Variable<T> &variable) const { std::map<size_t, std::vector<typename core::Variable<T>::Info>> allStepsBlocksInfo; for (size_t step = variable.m_AvailableStepsStart; step < variable.m_AvailableStepsCount; ++step) { allStepsBlocksInfo[step - variable.m_AvailableStepsStart] = BlocksInfoCommon(variable); } return allStepsBlocksInfo; } template <class T> std::vector<typename Variable<T>::Info> HDF5ReaderP::GetBlocksInfo(const Variable<T> &variable, const size_t step) const { BlocksInfoCommon(variable); } } // end namespace engine } // end namespace core } // end namespace adios2 Loading testing/utils/iotest/CMakeLists.txt +71 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ set(mpicmd ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG}) #------------------------------------------ # # Pipe2 InsituMPI version # Pipe2 BP version # set(WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/Pipe2.BP) file(MAKE_DIRECTORY ${WORKDIR}) Loading Loading @@ -83,6 +83,76 @@ set_property(TEST Utils.IOTest.Pipe2.BP.ValidateRead ) if (ADIOS2_HAVE_HDF5) # # Pipe2 HDF5 version # set(WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/Pipe2.HDF5) file(MAKE_DIRECTORY ${WORKDIR}) # HDF5 file version Write part add_test(NAME Utils.IOTest.Pipe2.HDF5.Write COMMAND ${mpicmd} 2 ${PROJECT_BINARY_DIR}/bin/adios_iotest -a 1 -c ${CMAKE_CURRENT_SOURCE_DIR}/pipe2-HDF5.txt -x ${CMAKE_CURRENT_SOURCE_DIR}/pipe2-HDF5.xml -d 2 1 --strong-scaling WORKING_DIRECTORY ${WORKDIR} ) add_test(NAME Utils.IOTest.Pipe2.HDF5.DumpWrite COMMAND ${CMAKE_COMMAND} -DARGS=-laD -DINPUT_FILE=pipe2_write.h5 -DOUTPUT_FILE=IOTest.Pipe2.HDF5.Write.bpls.txt -P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake" WORKING_DIRECTORY ${WORKDIR} ) set_property(TEST Utils.IOTest.Pipe2.HDF5.DumpWrite PROPERTY DEPENDS Utils.IOTest.Pipe2.HDF5.Write ) add_test(NAME Utils.IOTest.Pipe2.HDF5.ValidateWrite COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_CURRENT_SOURCE_DIR}/IOTest.Pipe2.HDF5.Write.bpls.txt ${WORKDIR}/IOTest.Pipe2.HDF5.Write.bpls.txt WORKING_DIRECTORY ${WORKDIR} ) set_property(TEST Utils.IOTest.Pipe2.HDF5.ValidateWrite PROPERTY DEPENDS Utils.IOTest.Pipe2.HDF5.DumpWrite ) # HDF5 file version Read part add_test(NAME Utils.IOTest.Pipe2.HDF5.Read COMMAND ${mpicmd} 2 ${PROJECT_BINARY_DIR}/bin/adios_iotest -a 2 -c ${CMAKE_CURRENT_SOURCE_DIR}/pipe2-HDF5.txt -x ${CMAKE_CURRENT_SOURCE_DIR}/pipe2-HDF5.xml -d 2 1 --strong-scaling WORKING_DIRECTORY ${WORKDIR} ) add_test(NAME Utils.IOTest.Pipe2.HDF5.DumpRead COMMAND ${CMAKE_COMMAND} -DARGS=-laD -DINPUT_FILE=pipe2_read.h5 -DOUTPUT_FILE=IOTest.Pipe2.HDF5.Read.bpls.txt -P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake" WORKING_DIRECTORY ${WORKDIR} ) set_property(TEST Utils.IOTest.Pipe2.HDF5.DumpRead PROPERTY DEPENDS Utils.IOTest.Pipe2.HDF5.Read ) add_test(NAME Utils.IOTest.Pipe2.HDF5.ValidateRead COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_CURRENT_SOURCE_DIR}/IOTest.Pipe2.HDF5.Read.bpls.txt ${WORKDIR}/IOTest.Pipe2.HDF5.Read.bpls.txt WORKING_DIRECTORY ${WORKDIR} ) set_property(TEST Utils.IOTest.Pipe2.HDF5.ValidateRead PROPERTY DEPENDS Utils.IOTest.Pipe2.HDF5.DumpRead ) endif (ADIOS2_HAVE_HDF5) # math(EXPR HAVE_2_PROCS "${MPIEXEC_MAX_NUMPROCS} - 1") if (${HAVE_2_PROCS}) Loading testing/utils/iotest/IOTest.Pipe2.HDF5.Read.bpls.txt 0 → 100644 +14 −0 Original line number Diff line number Diff line double a 3*{100, 200} = 0 / 0 step 0: block 0: [ 0:99, 0:199] = 0 / 0 step 1: block 0: [ 0:99, 0:199] = 0 / 0 step 2: block 0: [ 0:99, 0:199] = 0 / 0 float b 3*{100} = 0 / 0 step 0: block 0: [ 0:99] = 0 / 0 step 1: block 0: [ 0:99] = 0 / 0 step 2: block 0: [ 0:99] = 0 / 0 Loading
source/adios2/engine/hdf5/HDF5ReaderP.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -331,9 +331,22 @@ void HDF5ReaderP::PerformGets() { \ GetSyncCommon(variable, data); \ } \ \ void HDF5ReaderP::DoGetDeferred(Variable<T> &variable, T *data) \ { \ GetDeferredCommon(variable, data); \ } \ \ std::map<size_t, std::vector<typename Variable<T>::Info>> \ HDF5ReaderP::DoAllStepsBlocksInfo(const Variable<T> &variable) const \ { \ return GetAllStepsBlocksInfo(variable); \ } \ \ std::vector<typename Variable<T>::Info> HDF5ReaderP::DoBlocksInfo( \ const Variable<T> &variable, const size_t step) const \ { \ return GetBlocksInfo(variable, step); \ } ADIOS2_FOREACH_TYPE_1ARG(declare_type) Loading
source/adios2/engine/hdf5/HDF5ReaderP.h +21 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,9 @@ #include "adios2/core/IO.h" #include "adios2/toolkit/interop/hdf5/HDF5Common.h" #include <map> #include <vector> namespace adios2 { namespace core Loading Loading @@ -56,7 +59,12 @@ private: unsigned int m_StreamAt = 0; // stream step counter #define declare_type(T) \ void DoGetSync(Variable<T> &, T *) final; \ void DoGetDeferred(Variable<T> &, T *) final; void DoGetDeferred(Variable<T> &, T *) final; \ std::map<size_t, std::vector<typename Variable<T>::Info>> \ DoAllStepsBlocksInfo(const Variable<T> &variable) const final; \ \ std::vector<typename Variable<T>::Info> DoBlocksInfo( \ const Variable<T> &variable, const size_t step) const final; ADIOS2_FOREACH_TYPE_1ARG(declare_type) #undef declare_type Loading @@ -72,6 +80,18 @@ private: template <class T> void GetDeferredCommon(Variable<T> &variable, T *data); template <class T> std::map<size_t, std::vector<typename Variable<T>::Info>> GetAllStepsBlocksInfo(const Variable<T> &variable) const; template <class T> std::vector<typename Variable<T>::Info> GetBlocksInfo(const Variable<T> &variable, const size_t step) const; template <class T> std::vector<typename core::Variable<T>::Info> BlocksInfoCommon(const core::Variable<T> &variable) const; template <class T> void UseHDFRead(Variable<T> &variable, T *values, hid_t h5Type); Loading
source/adios2/engine/hdf5/HDF5ReaderP.tcc +46 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,52 @@ void HDF5ReaderP::GetDeferredCommon(Variable<T> &variable, T *data) #endif } template <class T> std::vector<typename core::Variable<T>::Info> HDF5ReaderP::BlocksInfoCommon(const core::Variable<T> &variable) const { std::vector<typename core::Variable<T>::Info> blocksInfo; typename core::Variable<T>::Info blockInfo; blockInfo.Start = variable.m_Start; blockInfo.Count = variable.m_Shape; if (variable.m_ShapeID == ShapeID::GlobalValue || variable.m_ShapeID == ShapeID::LocalValue) { blockInfo.IsValue = true; } else { blockInfo.IsValue = false; } blocksInfo.push_back(blockInfo); return blocksInfo; } template <class T> std::map<size_t, std::vector<typename Variable<T>::Info>> HDF5ReaderP::GetAllStepsBlocksInfo(const Variable<T> &variable) const { std::map<size_t, std::vector<typename core::Variable<T>::Info>> allStepsBlocksInfo; for (size_t step = variable.m_AvailableStepsStart; step < variable.m_AvailableStepsCount; ++step) { allStepsBlocksInfo[step - variable.m_AvailableStepsStart] = BlocksInfoCommon(variable); } return allStepsBlocksInfo; } template <class T> std::vector<typename Variable<T>::Info> HDF5ReaderP::GetBlocksInfo(const Variable<T> &variable, const size_t step) const { BlocksInfoCommon(variable); } } // end namespace engine } // end namespace core } // end namespace adios2 Loading
testing/utils/iotest/CMakeLists.txt +71 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ set(mpicmd ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG}) #------------------------------------------ # # Pipe2 InsituMPI version # Pipe2 BP version # set(WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/Pipe2.BP) file(MAKE_DIRECTORY ${WORKDIR}) Loading Loading @@ -83,6 +83,76 @@ set_property(TEST Utils.IOTest.Pipe2.BP.ValidateRead ) if (ADIOS2_HAVE_HDF5) # # Pipe2 HDF5 version # set(WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/Pipe2.HDF5) file(MAKE_DIRECTORY ${WORKDIR}) # HDF5 file version Write part add_test(NAME Utils.IOTest.Pipe2.HDF5.Write COMMAND ${mpicmd} 2 ${PROJECT_BINARY_DIR}/bin/adios_iotest -a 1 -c ${CMAKE_CURRENT_SOURCE_DIR}/pipe2-HDF5.txt -x ${CMAKE_CURRENT_SOURCE_DIR}/pipe2-HDF5.xml -d 2 1 --strong-scaling WORKING_DIRECTORY ${WORKDIR} ) add_test(NAME Utils.IOTest.Pipe2.HDF5.DumpWrite COMMAND ${CMAKE_COMMAND} -DARGS=-laD -DINPUT_FILE=pipe2_write.h5 -DOUTPUT_FILE=IOTest.Pipe2.HDF5.Write.bpls.txt -P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake" WORKING_DIRECTORY ${WORKDIR} ) set_property(TEST Utils.IOTest.Pipe2.HDF5.DumpWrite PROPERTY DEPENDS Utils.IOTest.Pipe2.HDF5.Write ) add_test(NAME Utils.IOTest.Pipe2.HDF5.ValidateWrite COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_CURRENT_SOURCE_DIR}/IOTest.Pipe2.HDF5.Write.bpls.txt ${WORKDIR}/IOTest.Pipe2.HDF5.Write.bpls.txt WORKING_DIRECTORY ${WORKDIR} ) set_property(TEST Utils.IOTest.Pipe2.HDF5.ValidateWrite PROPERTY DEPENDS Utils.IOTest.Pipe2.HDF5.DumpWrite ) # HDF5 file version Read part add_test(NAME Utils.IOTest.Pipe2.HDF5.Read COMMAND ${mpicmd} 2 ${PROJECT_BINARY_DIR}/bin/adios_iotest -a 2 -c ${CMAKE_CURRENT_SOURCE_DIR}/pipe2-HDF5.txt -x ${CMAKE_CURRENT_SOURCE_DIR}/pipe2-HDF5.xml -d 2 1 --strong-scaling WORKING_DIRECTORY ${WORKDIR} ) add_test(NAME Utils.IOTest.Pipe2.HDF5.DumpRead COMMAND ${CMAKE_COMMAND} -DARGS=-laD -DINPUT_FILE=pipe2_read.h5 -DOUTPUT_FILE=IOTest.Pipe2.HDF5.Read.bpls.txt -P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake" WORKING_DIRECTORY ${WORKDIR} ) set_property(TEST Utils.IOTest.Pipe2.HDF5.DumpRead PROPERTY DEPENDS Utils.IOTest.Pipe2.HDF5.Read ) add_test(NAME Utils.IOTest.Pipe2.HDF5.ValidateRead COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_CURRENT_SOURCE_DIR}/IOTest.Pipe2.HDF5.Read.bpls.txt ${WORKDIR}/IOTest.Pipe2.HDF5.Read.bpls.txt WORKING_DIRECTORY ${WORKDIR} ) set_property(TEST Utils.IOTest.Pipe2.HDF5.ValidateRead PROPERTY DEPENDS Utils.IOTest.Pipe2.HDF5.DumpRead ) endif (ADIOS2_HAVE_HDF5) # math(EXPR HAVE_2_PROCS "${MPIEXEC_MAX_NUMPROCS} - 1") if (${HAVE_2_PROCS}) Loading
testing/utils/iotest/IOTest.Pipe2.HDF5.Read.bpls.txt 0 → 100644 +14 −0 Original line number Diff line number Diff line double a 3*{100, 200} = 0 / 0 step 0: block 0: [ 0:99, 0:199] = 0 / 0 step 1: block 0: [ 0:99, 0:199] = 0 / 0 step 2: block 0: [ 0:99, 0:199] = 0 / 0 float b 3*{100} = 0 / 0 step 0: block 0: [ 0:99] = 0 / 0 step 1: block 0: [ 0:99] = 0 / 0 step 2: block 0: [ 0:99] = 0 / 0