From 667835db1e7fac95ef924e0c6ea719aa84b21d47 Mon Sep 17 00:00:00 2001 From: Junmin Gu Date: Tue, 23 Feb 2021 16:29:57 -0500 Subject: [PATCH] Address compile warnings across the project - Add multiple EXPECT_THROW in tests - Corrects a integer overflow in InSituMPISchedules.cpp - Corrects a printf modifier in H5VolUtil.cpp - Enforce coding style across the project Co-authored-by: Chuck Atkins Co-authored-by: Vicente Adolfo Bolea Sanchez --- CMakeLists.txt | 20 ++ bindings/CXX11/adios2/cxx11/Engine.tcc | 1 - examples/heatTransfer/write/IO_ph5.cpp | 4 + .../hdf5Writer/helloHDF5Writer_nompi.cpp | 2 +- examples/query/test.cpp | 3 + scripts/ci/cmake/ci-el7-intel18-ohpc.cmake | 32 --- .../cmake/ci-el7-intel18-openmpi-ohpc.cmake | 42 ---- source/adios2/core/ADIOS.cpp | 4 +- source/adios2/core/Attribute.cpp | 52 +--- source/adios2/core/Attribute.tcc | 64 ++++- source/adios2/core/IO.cpp | 6 +- source/adios2/core/Stream.cpp | 10 +- source/adios2/engine/bp4/BP4Reader.cpp | 1 - .../adios2/engine/dataman/DataManReader.cpp | 4 +- .../adios2/engine/dataman/DataManWriter.cpp | 4 +- source/adios2/engine/hdf5/HDF5ReaderP.cpp | 9 +- .../engine/insitumpi/InSituMPISchedules.cpp | 26 +- source/adios2/engine/mixer/HDFMixerWriter.cpp | 4 +- source/adios2/engine/sst/SstWriter.tcc | 5 + .../toolkit/format/bp/bp3/BP3Serializer.cpp | 2 +- .../toolkit/format/bp/bp4/BP4Serializer.cpp | 4 +- .../format/dataman/DataManSerializer.cpp | 4 +- .../toolkit/interop/hdf5/HDF5Common.cpp | 29 +-- source/adios2/toolkit/query/BlockIndex.h | 2 +- source/adios2/toolkit/query/Query.cpp | 44 ++++ source/adios2/toolkit/query/Query.h | 44 +--- source/adios2/toolkit/query/Util.h | 72 ++---- source/adios2/toolkit/query/Worker.cpp | 45 ++++ source/adios2/toolkit/query/Worker.h | 27 +- source/adios2/toolkit/sst/dp/rdma_dp.c | 26 +- source/h5vol/CMakeLists.txt | 1 + source/h5vol/H5VolError.h | 60 +---- source/h5vol/H5VolUtil.c | 231 ++++++++++++++++++ source/h5vol/H5VolUtil.h | 176 +------------ source/h5vol/H5Vol_attr.c | 1 - source/h5vol/H5Vol_link.c | 1 - source/utils/adios_iotest/hdf5Stream.cpp | 10 +- source/utils/adios_iotest/hdf5Stream.h | 2 +- source/utils/adios_iotest/processConfig.cpp | 12 +- source/utils/bpls/bpls.cpp | 1 - .../adios2/engine/bp/TestBPChangingShape.cpp | 1 - .../engine/bp/TestBPTimeAggregation.cpp | 22 ++ .../engine/bp/TestBPWriteMultiblockRead.cpp | 43 ++++ testing/adios2/engine/bp/TestBPWriteNull.cpp | 50 ++++ .../engine/bp/TestBPWriteReadADIOS2.cpp | 55 +++++ .../bp/TestBPWriteReadADIOS2fstream.cpp | 60 +++++ .../engine/bp/TestBPWriteReadADIOS2stdio.cpp | 60 +++++ .../engine/bp/TestBPWriteReadMultiblock.cpp | 38 +++ .../engine/bp/TestBPWriteReadVector.cpp | 42 ++++ testing/adios2/engine/hdf5/TestHDF5Append.cpp | 11 + .../engine/hdf5/TestHDF5WriteReadAsStream.cpp | 29 ++- .../engine/hdf5/TestNativeHDF5WriteRead.cpp | 56 ++++- .../engine/inline/TestInlineWriteRead.cpp | 32 +++ .../adios2/engine/null/TestNullWriteRead.cpp | 11 + .../engine/nullcore/TestNullCoreWrite.cpp | 31 +++ .../engine/staging-common/TestCommonRead.cpp | 2 + testing/adios2/helper/TestDivideBlock.cpp | 1 - testing/adios2/helper/TestMinMaxs.cpp | 1 - .../adios2/interface/TestADIOSSelection.cpp | 1 - .../adios2/performance/query/TestBPQuery.cpp | 2 + testing/h5vol/TestH5VolWriteReadBPFile.cpp | 4 + 61 files changed, 1075 insertions(+), 564 deletions(-) delete mode 100644 scripts/ci/cmake/ci-el7-intel18-ohpc.cmake delete mode 100644 scripts/ci/cmake/ci-el7-intel18-openmpi-ohpc.cmake create mode 100644 source/h5vol/H5VolUtil.c diff --git a/CMakeLists.txt b/CMakeLists.txt index a95caff5ce..080de52965 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,26 @@ if(MSVC) ) endif() +function(append_str_list_once var x) + foreach(item IN ITEMS ${${var}}) + if(item STREQUAL x) + return() + endif() + endforeach() + set(out ${${var}} ${x}) + string(REPLACE ";" " " out "${out}") + set(${var} "${out}" PARENT_SCOPE) +endfunction() + +if(NOT MSVC) + set(CMAKE_C_COMPILER_FLAGS_DEBUG "${CMAKE_C_COMPILER_FLAGS_DEBUG}" + CACHE STRING "" FORCE + ) + set(CMAKE_CXX_COMPILER_FLAGS_DEBUG "${CMAKE_CXX_COMPILER_FLAGS_DEBUG}" + CACHE STRING "" FORCE + ) +endif() + #------------------------------------------------------------------------------# # Deal with any pre-installation cleanup tasks #------------------------------------------------------------------------------# diff --git a/bindings/CXX11/adios2/cxx11/Engine.tcc b/bindings/CXX11/adios2/cxx11/Engine.tcc index fb68a13a6a..24bed4ebf0 100644 --- a/bindings/CXX11/adios2/cxx11/Engine.tcc +++ b/bindings/CXX11/adios2/cxx11/Engine.tcc @@ -237,7 +237,6 @@ template void Engine::Get(Variable variable, typename Variable::Info &info, const Mode launch) { - using IOType = typename TypeInfo::IOType; adios2::helper::CheckForNullptr(m_Engine, "in call to Engine::Get"); if (m_Engine->m_EngineType == "NULL") { diff --git a/examples/heatTransfer/write/IO_ph5.cpp b/examples/heatTransfer/write/IO_ph5.cpp index a8b37d5daa..6a013d25c3 100644 --- a/examples/heatTransfer/write/IO_ph5.cpp +++ b/examples/heatTransfer/write/IO_ph5.cpp @@ -176,6 +176,10 @@ void HDF5NativeWriter::WriteScalar(const std::string &varName, const void *data, herr_t status = H5Dwrite(dsetID, h5Type, H5S_ALL, H5S_ALL, plistID, data); + if (status < 0) + { + std::cerr << " Write failed. " << std::endl; + } H5Sclose(filespaceID); H5Dclose(dsetID); } diff --git a/examples/hello/hdf5Writer/helloHDF5Writer_nompi.cpp b/examples/hello/hdf5Writer/helloHDF5Writer_nompi.cpp index 82c957e9c6..e435648293 100644 --- a/examples/hello/hdf5Writer/helloHDF5Writer_nompi.cpp +++ b/examples/hello/hdf5Writer/helloHDF5Writer_nompi.cpp @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) hdf5IO.Open("myVector.h5", adios2::Mode::Write); /** Write variable for buffering */ - hdf5Writer.Get(bpFloats, myFloats.data()); + hdf5Writer.Put(bpFloats, myFloats.data()); /** Create bp file, engine becomes unreachable after this*/ hdf5Writer.Close(); diff --git a/examples/query/test.cpp b/examples/query/test.cpp index 9e0baa03bd..927d3347d7 100644 --- a/examples/query/test.cpp +++ b/examples/query/test.cpp @@ -125,6 +125,9 @@ bool testMe(std::string &queryConfigFile, std::string const &doubleVarName, adios2::IO inIO = ad.DeclareIO("query"); adios2::Engine reader = inIO.Open(dataFileName, adios2::Mode::Read, comm); + // to be continued + if (!reader) + return false; // std::vector dataOutput; // std::vector coordinateOutput; diff --git a/scripts/ci/cmake/ci-el7-intel18-ohpc.cmake b/scripts/ci/cmake/ci-el7-intel18-ohpc.cmake deleted file mode 100644 index 6aec07e815..0000000000 --- a/scripts/ci/cmake/ci-el7-intel18-ohpc.cmake +++ /dev/null @@ -1,32 +0,0 @@ -# Client maintainer: chuck.atkins@kitware.com - -find_package(EnvModules REQUIRED) - -env_module(purge) -env_module(load intel) -env_module(load py3-numpy) -env_module(load hdf5) - -set(ENV{CC} icc) -set(ENV{CXX} icpc) -set(ENV{FC} ifort) -set(ENV{CFLAGS} -Werror) -set(ENV{CXXFLAGS} -Werror) -set(ENV{FFLAGS} "-warn errors") - -set(dashboard_cache " -ADIOS2_USE_BZip2:BOOL=ON -ADIOS2_USE_Blosc:BOOL=ON -ADIOS2_USE_DataMan:BOOL=ON -ADIOS2_USE_Fortran:BOOL=ON -ADIOS2_USE_HDF5:BOOL=ON -ADIOS2_USE_MPI:BOOL=OFF -ADIOS2_USE_Python:BOOL=ON -ADIOS2_USE_SZ:BOOL=ON -ADIOS2_USE_ZeroMQ:STRING=ON -ADIOS2_USE_ZFP:STRING=ON -") - -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") -list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") -include(${CMAKE_CURRENT_LIST_DIR}/ci-common.cmake) diff --git a/scripts/ci/cmake/ci-el7-intel18-openmpi-ohpc.cmake b/scripts/ci/cmake/ci-el7-intel18-openmpi-ohpc.cmake deleted file mode 100644 index 696ca55aad..0000000000 --- a/scripts/ci/cmake/ci-el7-intel18-openmpi-ohpc.cmake +++ /dev/null @@ -1,42 +0,0 @@ -# Client maintainer: chuck.atkins@kitware.com - -include(ProcessorCount) -ProcessorCount(NCPUS) -math(EXPR N2CPUS "${NCPUS}*2") - -find_package(EnvModules REQUIRED) - -env_module(purge) -env_module(load intel) -env_module(load py3-numpy) -env_module(load openmpi3) -env_module(load phdf5) -env_module(load py3-mpi4py) - -set(ENV{CC} icc) -set(ENV{CXX} icpc) -set(ENV{FC} ifort) -set(ENV{CFLAGS} -Werror) -set(ENV{CXXFLAGS} -Werror) -set(ENV{FFLAGS} "-warn errors") - -set(dashboard_cache " -ADIOS2_USE_BZip2:BOOL=ON -ADIOS2_USE_Blosc:BOOL=ON -ADIOS2_USE_DataMan:BOOL=ON -ADIOS2_USE_Fortran:BOOL=ON -ADIOS2_USE_HDF5:BOOL=ON -ADIOS2_USE_MPI:BOOL=ON -ADIOS2_USE_Python:BOOL=ON -ADIOS2_USE_SZ:BOOL=ON -ADIOS2_USE_ZeroMQ:STRING=ON -ADIOS2_USE_ZFP:STRING=ON - -MPIEXEC_EXTRA_FLAGS:STRING=--allow-run-as-root --oversubscribe -MPIEXEC_MAX_NUMPROCS:STRING=${N2CPUS} -") - -set(CTEST_TEST_ARGS PARALLEL_LEVEL 1) -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") -list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") -include(${CMAKE_CURRENT_LIST_DIR}/ci-common.cmake) diff --git a/source/adios2/core/ADIOS.cpp b/source/adios2/core/ADIOS.cpp index 4c66c22da6..7fe16eaa7b 100644 --- a/source/adios2/core/ADIOS.cpp +++ b/source/adios2/core/ADIOS.cpp @@ -65,8 +65,8 @@ namespace core ADIOS::ADIOS(const std::string configFile, helper::Comm comm, const std::string hostLanguage) -: m_ConfigFile(configFile), m_HostLanguage(hostLanguage), - m_Comm(std::move(comm)) +: m_HostLanguage(hostLanguage), m_Comm(std::move(comm)), + m_ConfigFile(configFile) { if (!configFile.empty()) { diff --git a/source/adios2/core/Attribute.cpp b/source/adios2/core/Attribute.cpp index 5a087435ce..e635b4ed4c 100644 --- a/source/adios2/core/Attribute.cpp +++ b/source/adios2/core/Attribute.cpp @@ -12,61 +12,15 @@ #include "Attribute.tcc" #include "adios2/common/ADIOSMacros.h" -#include "adios2/helper/adiosFunctions.h" //GetDataType - -#include namespace adios2 { namespace core { -namespace // anonymous -{ - -template -struct RequiresZeroPadding : std::false_type -{ -}; - -template <> -struct RequiresZeroPadding : std::true_type -{ -}; -} - -#define declare_type(T) \ - \ - template <> \ - Attribute::Attribute(const Attribute &other) \ - : AttributeBase(other), m_DataArray(other.m_DataArray) \ - { \ - if (RequiresZeroPadding::value) \ - std::memset(&m_DataSingleValue, 0, sizeof(m_DataSingleValue)); \ - m_DataSingleValue = other.m_DataSingleValue; \ - } \ - \ - template <> \ - Attribute::Attribute(const std::string &name, const T *array, \ - const size_t elements) \ - : AttributeBase(name, helper::GetDataType(), elements) \ - { \ - if (RequiresZeroPadding::value) \ - std::memset(&m_DataSingleValue, 0, sizeof(m_DataSingleValue)); \ - m_DataArray = std::vector(array, array + elements); \ - } \ - \ - template <> \ - Attribute::Attribute(const std::string &name, const T &value) \ - : AttributeBase(name, helper::GetDataType()) \ - { \ - if (RequiresZeroPadding::value) \ - std::memset(&m_DataSingleValue, 0, sizeof(m_DataSingleValue)); \ - m_DataSingleValue = value; \ - } - -ADIOS2_FOREACH_ATTRIBUTE_STDTYPE_1ARG(declare_type) -#undef declare_type +#define declare_template_instantiation(T) template class Attribute; +ADIOS2_FOREACH_ATTRIBUTE_STDTYPE_1ARG(declare_template_instantiation) +#undef declare_template_instantiation } // end namespace core } // end namespace adios2 diff --git a/source/adios2/core/Attribute.tcc b/source/adios2/core/Attribute.tcc index a047f64f96..3097815e80 100644 --- a/source/adios2/core/Attribute.tcc +++ b/source/adios2/core/Attribute.tcc @@ -13,14 +13,76 @@ #include "Attribute.h" +#include "adios2/helper/adiosFunctions.h" //GetDataType #include "adios2/helper/adiosType.h" +#include + +#include + namespace adios2 { namespace core { -template +namespace // anonymous +{ +template +struct Pad; + +template +struct Pad +{ + static void Zero(T &arg) {} +}; + +template +struct Pad::value>::type> +{ + static void Zero(T &arg) { std::memset(&arg, 0, sizeof(arg)); } +}; + +template +struct Pad>::value>::type> +{ + static void Zero(T &arg) + { + Pad::Zero( + reinterpret_cast(arg)[0]); + Pad::Zero( + reinterpret_cast(arg)[1]); + } +}; + +} + +template +Attribute::Attribute(const Attribute &other) +: AttributeBase(other), m_DataArray(other.m_DataArray) +{ + Pad::Zero(m_DataSingleValue); + m_DataSingleValue = other.m_DataSingleValue; +} + +template +Attribute::Attribute(const std::string &name, const T *array, + const size_t elements) +: AttributeBase(name, helper::GetDataType(), elements) +{ + Pad::Zero(m_DataSingleValue); + m_DataArray = std::vector(array, array + elements); +} + +template +Attribute::Attribute(const std::string &name, const T &value) +: AttributeBase(name, helper::GetDataType()) +{ + Pad::Zero(m_DataSingleValue); + m_DataSingleValue = value; +} + +template std::string Attribute::DoGetInfoValue() const noexcept { std::string value; diff --git a/source/adios2/core/IO.cpp b/source/adios2/core/IO.cpp index ad951f35a8..a6e05bf7ee 100644 --- a/source/adios2/core/IO.cpp +++ b/source/adios2/core/IO.cpp @@ -187,8 +187,8 @@ void IO::RegisterEngine(const std::string &engineType, EngineFactoryEntry entry) IO::IO(ADIOS &adios, const std::string name, const bool inConfigFile, const std::string hostLanguage) -: m_ADIOS(adios), m_Name(name), m_InConfigFile(inConfigFile), - m_HostLanguage(hostLanguage) +: m_ADIOS(adios), m_Name(name), m_HostLanguage(hostLanguage), + m_InConfigFile(inConfigFile) { } @@ -716,7 +716,6 @@ void IO::ResetVariablesStepSelection(const bool zeroStart, for (auto itVariable = m_Variables.begin(); itVariable != m_Variables.end(); ++itVariable) { - const std::string &name = itVariable->first; const DataType type = InquireVariableType(itVariable); if (type == DataType::None) @@ -745,7 +744,6 @@ void IO::SetPrefixedNames(const bool isStep) noexcept for (auto itVariable = m_Variables.begin(); itVariable != m_Variables.end(); ++itVariable) { - const std::string &name = itVariable->first; // if for each step (BP4), check if variable type is not empty (means // variable exist in that step) const DataType type = isStep ? InquireVariableType(itVariable) diff --git a/source/adios2/core/Stream.cpp b/source/adios2/core/Stream.cpp index cec5b67176..46de64c69d 100644 --- a/source/adios2/core/Stream.cpp +++ b/source/adios2/core/Stream.cpp @@ -20,8 +20,9 @@ namespace core Stream::Stream(const std::string &name, const Mode mode, helper::Comm comm, const std::string engineType, const std::string hostLanguage) -: m_Name(name), m_ADIOS(std::make_shared(std::move(comm), hostLanguage)), - m_IO(&m_ADIOS->DeclareIO(name)), m_Mode(mode), m_EngineType(engineType) +: m_ADIOS(std::make_shared(std::move(comm), hostLanguage)), + m_IO(&m_ADIOS->DeclareIO(name)), m_Name(name), m_Mode(mode), + m_EngineType(engineType) { if (mode == adios2::Mode::Read) { @@ -38,9 +39,8 @@ Stream::Stream(const std::string &name, const Mode mode, Stream::Stream(const std::string &name, const Mode mode, helper::Comm comm, const std::string configFile, const std::string ioInConfigFile, const std::string hostLanguage) -: m_Name(name), - m_ADIOS(std::make_shared(configFile, std::move(comm), hostLanguage)), - m_IO(&m_ADIOS->DeclareIO(ioInConfigFile)), m_Mode(mode) +: m_ADIOS(std::make_shared(configFile, std::move(comm), hostLanguage)), + m_IO(&m_ADIOS->DeclareIO(ioInConfigFile)), m_Name(name), m_Mode(mode) { if (mode == adios2::Mode::Read) { diff --git a/source/adios2/engine/bp4/BP4Reader.cpp b/source/adios2/engine/bp4/BP4Reader.cpp index 050a28b7e4..8e7f45a7d4 100644 --- a/source/adios2/engine/bp4/BP4Reader.cpp +++ b/source/adios2/engine/bp4/BP4Reader.cpp @@ -561,7 +561,6 @@ size_t BP4Reader::UpdateBuffer(const TimePoint &timeoutInstant, * Those steps are read again here, starting in the beginning of * the buffer now. */ - const size_t fileSize = m_MDFileManager.GetFileSize(0); const size_t newMDSize = expectedMinFileSize - m_MDFileAlreadyReadSize; if (m_BP4Deserializer.m_Metadata.m_Buffer.size() < newMDSize) diff --git a/source/adios2/engine/dataman/DataManReader.cpp b/source/adios2/engine/dataman/DataManReader.cpp index 60c79aebc3..e205c4a72a 100644 --- a/source/adios2/engine/dataman/DataManReader.cpp +++ b/source/adios2/engine/dataman/DataManReader.cpp @@ -21,9 +21,9 @@ namespace engine DataManReader::DataManReader(IO &io, const std::string &name, const Mode openMode, helper::Comm comm) : Engine("DataManReader", io, name, openMode, std::move(comm)), + m_FinalStep(std::numeric_limits::max()), m_Serializer(m_Comm, helper::IsRowMajor(io.m_HostLanguage)), - m_RequesterThreadActive(true), m_SubscriberThreadActive(true), - m_FinalStep(std::numeric_limits::max()) + m_RequesterThreadActive(true), m_SubscriberThreadActive(true) { m_MpiRank = m_Comm.Rank(); m_MpiSize = m_Comm.Size(); diff --git a/source/adios2/engine/dataman/DataManWriter.cpp b/source/adios2/engine/dataman/DataManWriter.cpp index e8c1223582..e270311594 100644 --- a/source/adios2/engine/dataman/DataManWriter.cpp +++ b/source/adios2/engine/dataman/DataManWriter.cpp @@ -19,8 +19,8 @@ namespace engine DataManWriter::DataManWriter(IO &io, const std::string &name, const Mode openMode, helper::Comm comm) -: Engine("DataManWriter", io, name, openMode, std::move(comm)), - m_Serializer(m_Comm, helper::IsRowMajor(io.m_HostLanguage)), m_SentSteps(0), +: Engine("DataManWriter", io, name, openMode, std::move(comm)), m_SentSteps(0), + m_Serializer(m_Comm, helper::IsRowMajor(io.m_HostLanguage)), m_ReplyThreadActive(true), m_PublishThreadActive(true) { diff --git a/source/adios2/engine/hdf5/HDF5ReaderP.cpp b/source/adios2/engine/hdf5/HDF5ReaderP.cpp index e733a5eb01..25bafada34 100644 --- a/source/adios2/engine/hdf5/HDF5ReaderP.cpp +++ b/source/adios2/engine/hdf5/HDF5ReaderP.cpp @@ -22,6 +22,12 @@ namespace core namespace engine { +#define CHECK_H5_RETURN(returnCode, reason) \ + { \ + if (returnCode < 0) \ + throw std::runtime_error((reason)); \ + } + HDF5ReaderP::HDF5ReaderP(IO &io, const std::string &name, const Mode openMode, helper::Comm comm) : Engine("HDF5Reader", io, name, openMode, std::move(comm)) @@ -138,7 +144,7 @@ size_t HDF5ReaderP::ReadDataset(hid_t dataSetId, hid_t h5Type, size_t ndims = std::max(variable.m_Shape.size(), variable.m_Count.size()); if (0u == ndims) { // is scalar - hid_t myclass = H5Tget_class(h5Type); + // hid_t myclass = H5Tget_class(h5Type); if (H5Tget_class(h5Type) == H5T_STRING) { m_H5File.ReadStringScalarDataset(dataSetId, *(std::string *)values); @@ -147,6 +153,7 @@ size_t HDF5ReaderP::ReadDataset(hid_t dataSetId, hid_t h5Type, { hid_t ret = H5Dread(dataSetId, h5Type, H5S_ALL, H5S_ALL, H5P_DEFAULT, values); + CHECK_H5_RETURN(ret, "ReadDataset, H5Dread"); } } else diff --git a/source/adios2/engine/insitumpi/InSituMPISchedules.cpp b/source/adios2/engine/insitumpi/InSituMPISchedules.cpp index a656549fa9..7c92c7e26a 100644 --- a/source/adios2/engine/insitumpi/InSituMPISchedules.cpp +++ b/source/adios2/engine/insitumpi/InSituMPISchedules.cpp @@ -35,14 +35,17 @@ int GetNumberOfRequests(const std::map // > but there is only one step for (const auto &stepPair : subFileIndexPair.second) { - // - for (const auto &sfi : stepPair.second) - { - n++; - } + n += static_cast(stepPair.second.size()); } } } + + // Prevent integer overflow + if (n < 0) + { + n = std::numeric_limits::max(); + } + return n; } @@ -175,13 +178,16 @@ int GetNumberOfRequestsInWriteScheduleMap(WriteScheduleMap &map) noexcept // > for (auto &readerPair : variableNamePair.second) { - // - for (auto &sfi : readerPair.second) - { - n++; - } + n += static_cast(readerPair.second.size()); } } + + // Prevent integer overflow + if (n < 0) + { + n = std::numeric_limits::max(); + } + return n; } diff --git a/source/adios2/engine/mixer/HDFMixerWriter.cpp b/source/adios2/engine/mixer/HDFMixerWriter.cpp index 8fb4f79b85..8ece096a93 100644 --- a/source/adios2/engine/mixer/HDFMixerWriter.cpp +++ b/source/adios2/engine/mixer/HDFMixerWriter.cpp @@ -24,7 +24,7 @@ namespace engine { HDFVDSWriter::HDFVDSWriter(helper::Comm const &comm) -: m_SubfileComm(comm), m_VDSFile(), m_Rank(-1) +: m_VDSFile(), m_Rank(-1), m_SubfileComm(comm) { m_NumSubFiles = m_SubfileComm.Size(); m_Rank = m_SubfileComm.Rank(); @@ -231,7 +231,7 @@ void HDFVDSWriter::Close(const int transportIndex) // class HDFSerialWriter // HDFSerialWriter::HDFSerialWriter(helper::Comm const &comm) -: m_LocalComm(comm), m_H5File() +: m_H5File(), m_LocalComm(comm) { } diff --git a/source/adios2/engine/sst/SstWriter.tcc b/source/adios2/engine/sst/SstWriter.tcc index 35ef060940..7cf5de9ac4 100644 --- a/source/adios2/engine/sst/SstWriter.tcc +++ b/source/adios2/engine/sst/SstWriter.tcc @@ -88,6 +88,11 @@ void SstWriter::PutSyncCommon(Variable &variable, const T *values) m_BP3Serializer->ResizeBuffer( dataSize, "in call to variable " + variable.m_Name + " Put adios2::Mode::Sync"); + if (resizeResult == format::BP3Base::ResizeResult::Failure) + { + throw std::runtime_error("Failed to resize BP3 serializer buffer"); + } + const bool sourceRowMajor = helper::IsRowMajor(m_IO.m_HostLanguage); m_BP3Serializer->PutVariableMetadata(variable, blockInfo, sourceRowMajor); diff --git a/source/adios2/toolkit/format/bp/bp3/BP3Serializer.cpp b/source/adios2/toolkit/format/bp/bp3/BP3Serializer.cpp index 7f921a09ca..686b77db90 100644 --- a/source/adios2/toolkit/format/bp/bp3/BP3Serializer.cpp +++ b/source/adios2/toolkit/format/bp/bp3/BP3Serializer.cpp @@ -29,7 +29,7 @@ namespace format { BP3Serializer::BP3Serializer(helper::Comm const &comm) -: BPSerializer(comm, 3), BP3Base(comm), BPBase(comm) +: BPBase(comm), BP3Base(comm), BPSerializer(comm, 3) { } diff --git a/source/adios2/toolkit/format/bp/bp4/BP4Serializer.cpp b/source/adios2/toolkit/format/bp/bp4/BP4Serializer.cpp index 882f245006..51dfcf2744 100644 --- a/source/adios2/toolkit/format/bp/bp4/BP4Serializer.cpp +++ b/source/adios2/toolkit/format/bp/bp4/BP4Serializer.cpp @@ -31,7 +31,7 @@ namespace format { BP4Serializer::BP4Serializer(helper::Comm const &comm) -: BPSerializer(comm, 4), BP4Base(comm), BPBase(comm) +: BPBase(comm), BP4Base(comm), BPSerializer(comm, 4) { } @@ -518,7 +518,6 @@ void BP4Serializer::AggregateCollectiveMetadataIndices(helper::Comm const &comm, BufferSTL &outBufferSTL) { int rank = comm.Rank(); - int size = comm.Size(); BufferSTL inBufferSTL; @@ -929,7 +928,6 @@ void BP4Serializer::AggregateCollectiveMetadataIndices(helper::Comm const &comm, auto &position = outBufferSTL.m_Position; auto &buffer = outBufferSTL.m_Buffer; - size_t totalStep = pgIndicesInfo.size(); std::vector timeSteps; timeSteps.reserve(pgIndicesInfo.size()); for (auto const &pair : pgIndicesInfo) diff --git a/source/adios2/toolkit/format/dataman/DataManSerializer.cpp b/source/adios2/toolkit/format/dataman/DataManSerializer.cpp index f20528a891..cad869b92f 100644 --- a/source/adios2/toolkit/format/dataman/DataManSerializer.cpp +++ b/source/adios2/toolkit/format/dataman/DataManSerializer.cpp @@ -20,8 +20,8 @@ namespace format DataManSerializer::DataManSerializer(helper::Comm const &comm, const bool isRowMajor) -: m_Comm(comm), m_IsRowMajor(isRowMajor), - m_IsLittleEndian(helper::IsLittleEndian()) +: m_IsRowMajor(isRowMajor), m_IsLittleEndian(helper::IsLittleEndian()), + m_Comm(comm) { m_MpiRank = m_Comm.Rank(); m_MpiSize = m_Comm.Size(); diff --git a/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp b/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp index 6d96094290..450d8c94b8 100644 --- a/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp +++ b/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp @@ -49,6 +49,11 @@ const std::string HDF5Common::PARAMETER_CHUNK_FLAG = "H5ChunkDim"; const std::string HDF5Common::PARAMETER_CHUNK_VARS = "H5ChunkVars"; const std::string HDF5Common::PARAMETER_HAS_IDLE_WRITER_RANK = "IdleH5Writer"; +#define CHECK_H5_RETURN(returnCode, reason) \ + { \ + if (returnCode < 0) \ + throw std::runtime_error((reason)); \ + } /* //need to know ndim before defining this. //inconvenient @@ -935,6 +940,7 @@ void HDF5Common::ReadStringScalarDataset(hid_t dataSetId, std::string &result) char *val = (char *)(calloc(typesize, sizeof(char))); hid_t ret2 = H5Dread(dataSetId, h5Type, H5S_ALL, H5S_ALL, H5P_DEFAULT, val); + CHECK_H5_RETURN(ret2, "ReadStringScalarDataset"); result.assign(val, typesize); free(val); @@ -947,9 +953,9 @@ hid_t HDF5Common::GetTypeStringScalar(const std::string &input) /* Create a datatype to refer to. */ hid_t type = H5Tcopy(H5T_C_S1); hid_t ret = H5Tset_size(type, input.size()); - + CHECK_H5_RETURN(ret, "GetTypeStringScalar, H5Tset_size"); ret = H5Tset_strpad(type, H5T_STR_NULLTERM); - + CHECK_H5_RETURN(ret, "GetTypeStringScalar, H5Tset_strpad"); return type; } @@ -1020,10 +1026,6 @@ void HDF5Common::CreateDataset(const std::string &varName, hid_t h5Type, dsetID = H5Dopen(topId, list.back().c_str(), H5P_DEFAULT); datasetChain.push_back(dsetID); - - hid_t dspace = H5Dget_space(dsetID); - const int ndims = H5Sget_simple_extent_ndims(dspace); - // return dsetID; } void HDF5Common::StoreADIOSName(const std::string adiosName, hid_t dsetID) @@ -1065,6 +1067,7 @@ void HDF5Common::ReadADIOSName(hid_t dsetID, std::string &adiosName) H5Tclose(attrType); H5Aclose(attrID); + CHECK_H5_RETURN(ret2, "ReadADIOSName"); adiosName.assign(val, typeSize); free(val); } @@ -1166,7 +1169,7 @@ void HDF5Common::RemoveEmptyDataset(const std::string &varName) H5D_space_status_t status; herr_t s1 = H5Dget_space_status(dsetID, &status); - + CHECK_H5_RETURN(s1, "RemoveEmptyDataset"); if (0 == H5Dget_storage_size(dsetID)) /*nothing is written */ H5Ldelete(m_GroupId, list[0].c_str(), H5P_DEFAULT); } @@ -1241,7 +1244,7 @@ void HDF5Common::ReadInStringAttr(core::IO &io, const std::string &attrName, // ndims must be 1 hsize_t dims[1]; hid_t ret = H5Sget_simple_extent_dims(sid, dims, NULL); - + CHECK_H5_RETURN(ret, "ReadInStringAttr"); auto val = std::unique_ptr(new char[typeSize * dims[0]]); H5Aread(attrId, h5Type, val.get()); @@ -1281,10 +1284,7 @@ void HDF5Common::AddNonStringAttribute(core::IO &io, void HDF5Common::ReadInNonStringAttr(core::IO &io, const std::string &attrName, hid_t attrId, hid_t h5Type, hid_t sid) { - H5S_class_t stype = H5Sget_simple_extent_type(sid); - hsize_t ndims = H5Sget_simple_extent_ndims(sid); - size_t typesize = H5Tget_size(h5Type); if (ndims > 1) { @@ -1294,7 +1294,10 @@ void HDF5Common::ReadInNonStringAttr(core::IO &io, const std::string &attrName, hsize_t dims[1]; dims[0] = 0; if (ndims == 1) + { hid_t ret = H5Sget_simple_extent_dims(sid, dims, NULL); + CHECK_H5_RETURN(ret, "ReadInNonStringAttr"); + } if (H5Tequal(H5T_NATIVE_INT8, h5Type)) { @@ -1640,7 +1643,7 @@ void HDF5Common::ReadAttrToIO(core::IO &io) hid_t sid = H5Aget_space(attrId); HDF5TypeGuard sg(sid, E_H5_SPACE); - H5S_class_t stype = H5Sget_simple_extent_type(sid); + // H5S_class_t stype = H5Sget_simple_extent_type(sid); hid_t attrType = H5Aget_type(attrId); bool isString = (H5Tget_class(attrType) == H5T_STRING); @@ -1701,8 +1704,6 @@ void HDF5Common::ReadNativeAttrToIO(core::IO &io, hid_t datasetId, hid_t sid = H5Aget_space(attrId); HDF5TypeGuard sg(sid, E_H5_SPACE); - H5S_class_t stype = H5Sget_simple_extent_type(sid); - hid_t attrType = H5Aget_type(attrId); bool isString = (H5Tget_class(attrType) == H5T_STRING); diff --git a/source/adios2/toolkit/query/BlockIndex.h b/source/adios2/toolkit/query/BlockIndex.h index b36c5b6c73..e1eb96bb55 100644 --- a/source/adios2/toolkit/query/BlockIndex.h +++ b/source/adios2/toolkit/query/BlockIndex.h @@ -128,8 +128,8 @@ class BlockIndex // blockid <=> vector of subcontents // // std::string& m_DataFileName; - adios2::core::Engine &m_IdxReader; adios2::core::IO &m_IdxIO; + adios2::core::Engine &m_IdxReader; }; // class blockIndex diff --git a/source/adios2/toolkit/query/Query.cpp b/source/adios2/toolkit/query/Query.cpp index d82e6a6f0c..21844cb7a0 100644 --- a/source/adios2/toolkit/query/Query.cpp +++ b/source/adios2/toolkit/query/Query.cpp @@ -10,6 +10,50 @@ namespace adios2 namespace query { +adios2::query::Relation strToRelation(std::string relationStr) noexcept +{ + if ((relationStr.compare("or") == 0) || (relationStr.compare("OR") == 0)) + return adios2::query::Relation::OR; + + return adios2::query::Relation::AND; // default +} + +adios2::query::Op strToQueryOp(std::string opStr) noexcept +{ + if ((opStr.compare("lt") == 0) || (opStr.compare("LT") == 0)) + return adios2::query::Op::LT; + if ((opStr.compare("gt") == 0) || (opStr.compare("GT") == 0)) + return adios2::query::Op::GT; + if ((opStr.compare("ge") == 0) || (opStr.compare("GE") == 0)) + return adios2::query::Op::GE; + if ((opStr.compare("le") == 0) || (opStr.compare("LE") == 0)) + return adios2::query::Op::LE; + if ((opStr.compare("eq") == 0) || (opStr.compare("EQ") == 0)) + return adios2::query::Op::EQ; + if ((opStr.compare("ne") == 0) || (opStr.compare("NE") == 0)) + return adios2::query::Op::NE; + + return adios2::query::Op::EQ; // default +} + +adios2::Dims split(const std::string &s, char delim) +{ + adios2::Dims dim; + + std::stringstream ss(s); + std::string item; + + while (getline(ss, item, delim)) + { + std::stringstream curr(item); + size_t val; + curr >> val; + dim.push_back(val); + } + + return dim; +} + void QueryBase::ApplyOutputRegion(std::vector> &touchedBlocks, const adios2::Box &referenceRegion) { diff --git a/source/adios2/toolkit/query/Query.h b/source/adios2/toolkit/query/Query.h index 01060612f2..364e447762 100644 --- a/source/adios2/toolkit/query/Query.h +++ b/source/adios2/toolkit/query/Query.h @@ -35,49 +35,11 @@ enum Relation NOT }; -static adios2::query::Relation strToRelation(std::string relationStr) noexcept -{ - if ((relationStr.compare("or") == 0) || (relationStr.compare("OR") == 0)) - return adios2::query::Relation::OR; - - return adios2::query::Relation::AND; // default -} - -static adios2::query::Op strToQueryOp(std::string opStr) noexcept -{ - if ((opStr.compare("lt") == 0) || (opStr.compare("LT") == 0)) - return adios2::query::Op::LT; - if ((opStr.compare("gt") == 0) || (opStr.compare("GT") == 0)) - return adios2::query::Op::GT; - if ((opStr.compare("ge") == 0) || (opStr.compare("GE") == 0)) - return adios2::query::Op::GE; - if ((opStr.compare("le") == 0) || (opStr.compare("LE") == 0)) - return adios2::query::Op::LE; - if ((opStr.compare("eq") == 0) || (opStr.compare("EQ") == 0)) - return adios2::query::Op::EQ; - if ((opStr.compare("ne") == 0) || (opStr.compare("NE") == 0)) - return adios2::query::Op::NE; - - return adios2::query::Op::EQ; // default -} - -static adios2::Dims split(const std::string &s, char delim) -{ - adios2::Dims dim; - - std::stringstream ss(s); - std::string item; +adios2::query::Relation strToRelation(std::string relationStr) noexcept; - while (getline(ss, item, delim)) - { - std::stringstream curr(item); - size_t val; - curr >> val; - dim.push_back(val); - } +adios2::query::Op strToQueryOp(std::string opStr) noexcept; - return dim; -} +adios2::Dims split(const std::string &s, char delim); // // classes diff --git a/source/adios2/toolkit/query/Util.h b/source/adios2/toolkit/query/Util.h index 6d224f1b46..cc5f7d96ac 100644 --- a/source/adios2/toolkit/query/Util.h +++ b/source/adios2/toolkit/query/Util.h @@ -12,61 +12,33 @@ namespace adios2 { namespace query { +/* static size_t ToUIntValue(const adios2::Params ¶ms, const std::string &key, - size_t defaultValue) + size_t defaultValue) { - auto it = params.find(key); - if (it != params.end()) - { - try - { - auto value = (size_t)(std::stoul(it->second)); - return value; - } - catch (std::exception &e) - { - std::cout << e.what() << std::endl; - return defaultValue; - } - } - return defaultValue; + auto it = params.find(key); + if (it != params.end()) + { + try + { + auto value = (size_t)(std::stoul(it->second)); + return value; + } + catch (std::exception &e) + { + std::cout << e.what() << std::endl; + return defaultValue; + } + } + return defaultValue; } +*/ -static bool ToBoolValue(const adios2::Params ¶ms, const std::string &key) -{ - auto keyPair = params.find(key); - if (keyPair != params.end()) - { - std::string value = keyPair->second; - std::transform(value.begin(), value.end(), value.begin(), - [](unsigned char c) { return std::tolower(c); }); - if (value == "yes" || value == "true") - { - return true; - } - } - return false; -} - -static bool EndsWith(const std::string &hostStr, const std::string &fileTag) -{ - if (hostStr.size() >= fileTag.size() && - hostStr.compare(hostStr.size() - fileTag.size(), fileTag.size(), - fileTag) == 0) - return true; - else - return false; -} +// The next three are implemented in Worker.cpp +bool EndsWith(const std::string &hostStr, const std::string &fileTag); +bool IsFileNameXML(const std::string &filename); +bool IsFileNameJSON(const std::string &filename); -static bool IsFileNameXML(const std::string &filename) -{ - return EndsWith(filename, ".xml"); -} - -static bool IsFileNameJSON(const std::string &filename) -{ - return EndsWith(filename, ".json"); -} }; // namespace query }; // name space adios2 diff --git a/source/adios2/toolkit/query/Worker.cpp b/source/adios2/toolkit/query/Worker.cpp index defcb42da6..f7e8972d82 100644 --- a/source/adios2/toolkit/query/Worker.cpp +++ b/source/adios2/toolkit/query/Worker.cpp @@ -5,6 +5,25 @@ namespace adios2 { namespace query { +bool EndsWith(const std::string &hostStr, const std::string &fileTag) +{ + if (hostStr.size() >= fileTag.size() && + hostStr.compare(hostStr.size() - fileTag.size(), fileTag.size(), + fileTag) == 0) + return true; + else + return false; +} + +bool IsFileNameXML(const std::string &filename) +{ + return EndsWith(filename, ".xml"); +} + +bool IsFileNameJSON(const std::string &filename) +{ + return EndsWith(filename, ".json"); +} Worker::Worker(const std::string &queryFile, adios2::core::Engine *adiosEngine) : m_QueryFile(queryFile), m_SourceReader(adiosEngine) @@ -17,6 +36,32 @@ Worker::~Worker() delete m_Query; } +Worker *GetWorker(const std::string &configFile, + adios2::core::Engine *adiosEngine) +{ + std::ifstream fileStream(configFile); + + if (!fileStream) + { + throw std::ios_base::failure("ERROR: file " + configFile + + " not found. "); + } + + if (adios2::query::IsFileNameXML(configFile)) + { + return new XmlWorker(configFile, adiosEngine); + } + +#ifdef ADIOS2_HAVE_DATAMAN // so json is included + if (adios2::query::IsFileNameJSON(configFile)) + { + return new JsonWorker(configFile, adiosEngine); + } +#endif + throw std::invalid_argument("ERROR: Unable to construct xml query."); + // return nullptr; +} + QueryVar *Worker::GetBasicVarQuery(adios2::core::IO ¤tIO, const std::string &variableName) { diff --git a/source/adios2/toolkit/query/Worker.h b/source/adios2/toolkit/query/Worker.h index 8ed63ef75a..4b82bf7008 100644 --- a/source/adios2/toolkit/query/Worker.h +++ b/source/adios2/toolkit/query/Worker.h @@ -97,31 +97,8 @@ class XmlWorker : public Worker }; // XmlWorker -static Worker *GetWorker(const std::string &configFile, - adios2::core::Engine *adiosEngine) -{ - std::ifstream fileStream(configFile); - - if (!fileStream) - { - throw std::ios_base::failure("ERROR: file " + configFile + - " not found. "); - } - - if (adios2::query::IsFileNameXML(configFile)) - { - return new XmlWorker(configFile, adiosEngine); - } - -#ifdef ADIOS2_HAVE_DATAMAN // so json is included - if (adios2::query::IsFileNameJSON(configFile)) - { - return new JsonWorker(configFile, adiosEngine); - } -#endif - throw std::invalid_argument("ERROR: Unable to construct xml query."); - // return nullptr; -} +Worker *GetWorker(const std::string &configFile, + adios2::core::Engine *adiosEngine); } // namespace query } // name space adios2 diff --git a/source/adios2/toolkit/sst/dp/rdma_dp.c b/source/adios2/toolkit/sst/dp/rdma_dp.c index 149b24539e..9459a443ed 100644 --- a/source/adios2/toolkit/sst/dp/rdma_dp.c +++ b/source/adios2/toolkit/sst/dp/rdma_dp.c @@ -618,13 +618,11 @@ static DP_RS_Stream RdmaInitReader(CP_Services Svcs, void *CP_Stream, attr_list WriterContact, SstStats Stats) { Rdma_RS_Stream Stream = malloc(sizeof(struct _Rdma_RS_Stream)); - CManager cm = Svcs->getCManager(CP_Stream); SMPI_Comm comm = Svcs->getMPIComm(CP_Stream); RdmaReaderContactInfo ContactInfo = malloc(sizeof(struct _RdmaReaderContactInfo)); FabricState Fabric; char *PreloadEnv = NULL; - int rc; memset(Stream, 0, sizeof(*Stream)); Stream->Fabric = calloc(1, sizeof(*Fabric)); @@ -664,7 +662,7 @@ static DP_RS_Stream RdmaInitReader(CP_Services Svcs, void *CP_Stream, } #ifdef SST_HAVE_CRAY_DRC - int attr_cred, try_left; + int attr_cred, try_left, rc; if (!get_int_attr(WriterContact, attr_atom_from_string("RDMA_DRC_KEY"), &attr_cred)) { @@ -778,12 +776,9 @@ static DP_WS_Stream RdmaInitWriter(CP_Services Svcs, void *CP_Stream, SstStats Stats) { Rdma_WS_Stream Stream = malloc(sizeof(struct _Rdma_WS_Stream)); - CManager cm = Svcs->getCManager(CP_Stream); SMPI_Comm comm = Svcs->getMPIComm(CP_Stream); char *PreloadEnv; FabricState Fabric; - int rc; - int try_left; memset(Stream, 0, sizeof(struct _Rdma_WS_Stream)); @@ -810,6 +805,7 @@ static DP_WS_Stream RdmaInitWriter(CP_Services Svcs, void *CP_Stream, Stream->Fabric = calloc(1, sizeof(struct fabric_state)); Fabric = Stream->Fabric; #ifdef SST_HAVE_CRAY_DRC + int try_left, rc; if (Stream->Rank == 0) { rc = drc_acquire(&Fabric->credential, DRC_FLAGS_FLEX_CREDENTIAL); @@ -902,7 +898,6 @@ static DP_WSR_Stream RdmaInitWriterPerReader(CP_Services Svcs, RdmaWriterContactInfo ContactInfo; RdmaReaderContactInfo *providedReaderInfo = (RdmaReaderContactInfo *)providedReaderInfo_v; - SMPI_Comm comm = Svcs->getMPIComm(WS_Stream->CP_Stream); RdmaBufferHandle ReaderRollHandle; int i; @@ -978,9 +973,6 @@ static void RdmaProvideWriterDataToReader(CP_Services Svcs, FabricState Fabric = RS_Stream->Fabric; RdmaWriterContactInfo *providedWriterInfo = (RdmaWriterContactInfo *)providedWriterInfo_v; - void *CP_Stream = RS_Stream->CP_Stream; - int try_left; - int rc; RS_Stream->PeerCohort = PeerCohort; RS_Stream->WriterCohortSize = writerCohortSize; @@ -1245,16 +1237,13 @@ static void *RdmaReadRemoteMemory(CP_Services Svcs, DP_RS_Stream Stream_v, static void RdmaNotifyConnFailure(CP_Services Svcs, DP_RS_Stream Stream_v, int FailedPeerRank) { - Rdma_RS_Stream Stream = (Rdma_RS_Stream) - Stream_v; /* DP_RS_Stream is the return from InitReader */ - CManager cm = Svcs->getCManager(Stream->CP_Stream); + /* DP_RS_Stream is the return from InitReader */ + Rdma_RS_Stream Stream = (Rdma_RS_Stream)Stream_v; Svcs->verbose(Stream->CP_Stream, DPTraceVerbose, "received notification that writer peer " "%d has failed, failing any pending " "requests\n", FailedPeerRank); - // This is what EVPath does... - // FailRequestsToRank(Svcs, cm, Stream, FailedPeerRank); } /* We still have to handle Pull completions while waiting for push to complete @@ -1265,7 +1254,6 @@ static int DoPushWait(CP_Services Svcs, Rdma_RS_Stream Stream, FabricState Fabric = Stream->Fabric; RdmaStepLogEntry StepLog = Stream->PreloadStepLog; RdmaRankReqLog RankLog; - RdmaBuffer Req; RdmaCompletionHandle Handle_t; struct fi_cq_data_entry CQEntry = {0}; int WRank, WRidx; @@ -1453,11 +1441,9 @@ static void RdmaReleaseTimestep(CP_Services Svcs, DP_WS_Stream Stream_v, long Timestep) { Rdma_WS_Stream Stream = (Rdma_WS_Stream)Stream_v; - Rdma_WSR_Stream WSR_Stream; TimestepList *List = &Stream->Timesteps; TimestepList ReleaseTSL; RdmaBufferHandle Info; - int i; Svcs->verbose(Stream->CP_Stream, DPTraceVerbose, "Releasing timestep %ld\n", Timestep); @@ -1498,7 +1484,6 @@ static void RdmaReleaseTimestep(CP_Services Svcs, DP_WS_Stream Stream_v, static void RdmaDestroyRankReqLog(Rdma_RS_Stream RS_Stream, RdmaRankReqLog RankReqLog) { - RdmaReqLogEntry tmp; int i; for (i = 0; i < RS_Stream->WriterCohortSize; i++) @@ -1702,7 +1687,7 @@ static struct _CP_DP_Interface RdmaDPInterface = {0}; static int RdmaGetPriority(CP_Services Svcs, void *CP_Stream, struct _SstParams *Params) { - struct fi_info *hints, *info, *originfo, *useinfo; + struct fi_info *hints, *info, *originfo; char *ifname; char *forkunsafe; int Ret = -1; @@ -1807,7 +1792,6 @@ static void PushData(CP_Services Svcs, Rdma_WSR_Stream Stream, FabricState Fabric = WS_Stream->Fabric; RdmaRankReqLog RankReq = Stream->PreloadReq; RdmaBuffer Req, ReaderRoll, RollBuffer; - uint64_t RecvCounter; uint8_t *StepBuffer; int i, rc; diff --git a/source/h5vol/CMakeLists.txt b/source/h5vol/CMakeLists.txt index 45f6863f01..4c32d6b23e 100644 --- a/source/h5vol/CMakeLists.txt +++ b/source/h5vol/CMakeLists.txt @@ -6,6 +6,7 @@ add_library(adios2_h5vol SHARED H5VolReadWrite.c H5Vol.c + H5VolUtil.c H5Vol_attr.c H5Vol_dataset.c H5Vol_file.c diff --git a/source/h5vol/H5VolError.h b/source/h5vol/H5VolError.h index e409784fa1..1437bac82a 100644 --- a/source/h5vol/H5VolError.h +++ b/source/h5vol/H5VolError.h @@ -4,68 +4,16 @@ #include #include -static void *safe_calloc(size_t n, size_t s, unsigned long line) -{ - if (n == 0) - { - return NULL; - } - - void *p = calloc(n, s); - if (!p) - { - fprintf(stderr, "[%s:%ld]Out of memory at calloc (%ld, %ld)\n", - __FILE__, line, (unsigned long)n, (unsigned long)s); - exit(EXIT_FAILURE); - } - return p; -} - +void *safe_calloc(size_t n, size_t s, unsigned long line); #define SAFE_CALLOC(n, s) safe_calloc(n, s, __LINE__) -static void *safe_malloc(size_t n, unsigned long line) -{ - if (n == 0) - { - return NULL; - } - - void *p = malloc(n); - if (!p) - { - fprintf(stderr, "[%s:%ld]Out of memory at malloc (%ld bytes)\n", - __FILE__, line, (unsigned long)n); - exit(EXIT_FAILURE); - } - return p; -} - +void *safe_malloc(size_t n, unsigned long line); #define SAFE_MALLOC(n) safe_malloc(n, __LINE__) -static void safe_free(void *p) -{ - if (p == NULL) - { - return; - } - free(p); - p = NULL; -} - +void safe_free(void *p); #define SAFE_FREE(ptr) safe_free(ptr) -static void *safe_ralloc(void *ptr, size_t newsize, unsigned long line) -{ - void *p = realloc(ptr, newsize); - if (!p) - { - fprintf(stderr, "[%s:%ld]Out of memory at ralloc to (%ld bytes)\n", - __FILE__, line, (unsigned long)newsize); - exit(EXIT_FAILURE); - } - return p; -} - +void *safe_ralloc(void *ptr, size_t newsize, unsigned long line); #define SAFE_REALLOC(ptr, newsize) safe_ralloc(ptr, newsize, __LINE__) #define ADIOS_VOL_LOG_ERR(...) \ diff --git a/source/h5vol/H5VolUtil.c b/source/h5vol/H5VolUtil.c new file mode 100644 index 0000000000..6f44a18c70 --- /dev/null +++ b/source/h5vol/H5VolUtil.c @@ -0,0 +1,231 @@ +#include "H5VolUtil.h" +#include "H5VolError.h" + +void *safe_calloc(size_t n, size_t s, unsigned long line) +{ + if (n == 0) + { + return NULL; + } + + void *p = calloc(n, s); + if (!p) + { + fprintf(stderr, "[%s:%ld]Out of memory at calloc (%ld, %ld)\n", + __FILE__, line, (unsigned long)n, (unsigned long)s); + exit(EXIT_FAILURE); + } + return p; +} + +void *safe_malloc(size_t n, unsigned long line) +{ + if (n == 0) + { + return NULL; + } + + void *p = malloc(n); + if (!p) + { + fprintf(stderr, "[%s:%ld]Out of memory at malloc (%zu bytes)\n", + __FILE__, line, n); + exit(EXIT_FAILURE); + } + return p; +} + +void safe_free(void *p) +{ + if (p) + { + free(p); + p = NULL; + } +} + +void *safe_ralloc(void *ptr, size_t newsize, unsigned long line) +{ + void *p = realloc(ptr, newsize); + if (!p) + { + fprintf(stderr, "[%s:%ld]Out of memory at ralloc to (%ld bytes)\n", + __FILE__, line, (unsigned long)newsize); + exit(EXIT_FAILURE); + } + return p; +} + +void gUtilConvert(hsize_t *fromH5, size_t *to, uint ndims) +{ + uint i = 0; + for (i = 0; i < ndims; i++) + { + to[i] = fromH5[i]; + } +} + +int gUtilADIOS2GetShape(hid_t space_id, size_t *shape, uint ndims) +{ + if (gUtilADIOS2IsScalar(space_id)) + { + // nothing to do + return H5VL_CODE_SUCC; + } + + // get num dimensions + hsize_t h5Shape[ndims]; + H5Sget_simple_extent_dims(space_id, h5Shape, NULL); + + gUtilConvert(h5Shape, shape, ndims); + return H5VL_CODE_SUCC; +} + +int gUtilADIOS2GetBlockInfo(hid_t hyperSlab_id, size_t *start, size_t *count, + hsize_t ndims) +{ + hsize_t npts = H5Sget_select_npoints(hyperSlab_id); + + if (0 == npts) + return npts; + else + { + hsize_t s[ndims], e[ndims]; + + H5Sget_select_bounds(hyperSlab_id, s, e); + + hsize_t numElements = 1; + hsize_t k = 0; + for (k = 0; k < ndims; k++) + { + start[k] = s[k]; + count[k] = (e[k] - s[k]) + 1; + numElements *= count[k]; + } + + if (npts == numElements) + return npts; // ok got block + } + return H5VL_CODE_FAIL; // slab has many blocks + + /* + NOTE: this is a well wish segment. Reality is hdf5 returns numBlocks = + numPts; 1 pt per block. so cann't apply this method!! hsize_t numBlocks = + H5Sget_select_hyper_nblocks(hyperSlab_id); REQUIRE_SUCC_MSG((1 == numBlocks), + H5VL_CODE_FAIL, "Currently not able to support strides != 1 %ld", numBlocks); + + // now numBlocks = 1 + hsize_t *blockinfo = (hsize_t *)SAFE_MALLOC(sizeof(hsize_t) * 2 * ndims * + numBlocks); herr_t status = H5Sget_select_hyper_blocklist(hyperSlab_id, + (hsize_t)0, numBlocks, blockinfo); + + int i=0; + for (i = 0; i < ndims; i++) { + start[i] = blockinfo[i]; + count[i] = blockinfo[ndims + i] - start[i] + 1; + } + */ +} + +int gUtilADIOS2IsScalar(hid_t space_id) +{ + H5S_class_t stype = H5Sget_simple_extent_type(space_id); + + if (H5S_SCALAR == stype) + return H5VL_CODE_SUCC; + + return H5VL_CODE_FAIL; +} + +int gUtilADIOS2GetDim(hid_t space_id) +{ + return H5Sget_simple_extent_ndims(space_id); +} + +hid_t gUtilHDF5Type(adios2_type adios2Type) +{ + if (adios2Type == adios2_type_int8_t) + return H5T_NATIVE_INT8; + if (adios2Type == adios2_type_int16_t) + return H5T_NATIVE_INT16; + if (adios2Type == adios2_type_int32_t) + return H5T_NATIVE_INT32; + if (adios2Type == adios2_type_int64_t) + return H5T_NATIVE_INT64; + if (adios2Type == adios2_type_uint8_t) + return H5T_NATIVE_UINT8; + if (adios2Type == adios2_type_uint16_t) + return H5T_NATIVE_UINT16; + if (adios2Type == adios2_type_uint32_t) + return H5T_NATIVE_UINT32; + if (adios2Type == adios2_type_uint64_t) + return H5T_NATIVE_UINT64; + + if (adios2Type == adios2_type_float) + return H5T_NATIVE_FLOAT; + + if (adios2Type == adios2_type_double) + return H5T_NATIVE_DOUBLE; + + if (adios2Type == adios2_type_long_double) + return H5T_NATIVE_LDOUBLE; + + if (adios2Type == adios2_type_string) + { + hid_t string_t_id = H5Tcopy(H5T_C_S1); + H5Tset_size(string_t_id, + 30); // limiting each string to be less than 30 char long + return string_t_id; + } + + // unknown types + return -1; +} + +adios2_type gUtilADIOS2Type(hid_t h5Type) +{ + if (H5Tequal(H5T_NATIVE_INT8, h5Type)) + return adios2_type_int8_t; + + if (H5Tequal(H5T_NATIVE_INT16, h5Type)) + return adios2_type_int16_t; + + if (H5Tequal(H5T_NATIVE_INT32, h5Type)) + return adios2_type_int32_t; + + if (H5Tequal(H5T_NATIVE_INT64, h5Type)) + return adios2_type_int64_t; + + if (H5Tequal(H5T_NATIVE_UINT8, h5Type)) + return adios2_type_uint8_t; + + if (H5Tequal(H5T_NATIVE_UINT16, h5Type)) + return adios2_type_uint16_t; + + if (H5Tequal(H5T_NATIVE_UINT32, h5Type)) + return adios2_type_uint32_t; + + if (H5Tequal(H5T_NATIVE_UINT64, h5Type)) + return adios2_type_uint64_t; + + if (H5Tequal(H5T_NATIVE_FLOAT, h5Type)) + return adios2_type_float; + + if (H5Tequal(H5T_NATIVE_DOUBLE, h5Type)) + return adios2_type_double; + + if (H5Tequal(H5T_NATIVE_LDOUBLE, h5Type)) + return adios2_type_long_double; + + if (H5Tget_class(h5Type) == H5T_NATIVE_CHAR) + return adios2_type_string; + + if (H5Tget_class(h5Type) == H5T_STRING) + return adios2_type_string; + + if (H5Tget_class(h5Type) == H5T_ENUM) // + return adios2_type_uint8_t; + // complex types are not supported in adios2_types + // so return unknown + return adios2_type_unknown; +} diff --git a/source/h5vol/H5VolUtil.h b/source/h5vol/H5VolUtil.h index 6926879331..305e6ab695 100644 --- a/source/h5vol/H5VolUtil.h +++ b/source/h5vol/H5VolUtil.h @@ -7,93 +7,9 @@ #define H5VL_CODE_SUCC 1 #define H5VL_CODE_FAIL 0 -static hid_t gUtilHDF5Type(adios2_type adios2Type) -{ - if (adios2Type == adios2_type_int8_t) - return H5T_NATIVE_INT8; - if (adios2Type == adios2_type_int16_t) - return H5T_NATIVE_INT16; - if (adios2Type == adios2_type_int32_t) - return H5T_NATIVE_INT32; - if (adios2Type == adios2_type_int64_t) - return H5T_NATIVE_INT64; - if (adios2Type == adios2_type_uint8_t) - return H5T_NATIVE_UINT8; - if (adios2Type == adios2_type_uint16_t) - return H5T_NATIVE_UINT16; - if (adios2Type == adios2_type_uint32_t) - return H5T_NATIVE_UINT32; - if (adios2Type == adios2_type_uint64_t) - return H5T_NATIVE_UINT64; - - if (adios2Type == adios2_type_float) - return H5T_NATIVE_FLOAT; - - if (adios2Type == adios2_type_double) - return H5T_NATIVE_DOUBLE; - - if (adios2Type == adios2_type_long_double) - return H5T_NATIVE_LDOUBLE; - - if (adios2Type == adios2_type_string) - { - hid_t string_t_id = H5Tcopy(H5T_C_S1); - H5Tset_size(string_t_id, - 30); // limiting each string to be less than 30 char long - return string_t_id; - } - - // unknown types - return -1; -} - -static adios2_type gUtilADIOS2Type(hid_t h5Type) -{ - if (H5Tequal(H5T_NATIVE_INT8, h5Type)) - return adios2_type_int8_t; - - if (H5Tequal(H5T_NATIVE_INT16, h5Type)) - return adios2_type_int16_t; - - if (H5Tequal(H5T_NATIVE_INT32, h5Type)) - return adios2_type_int32_t; - - if (H5Tequal(H5T_NATIVE_INT64, h5Type)) - return adios2_type_int64_t; +hid_t gUtilHDF5Type(adios2_type adios2Type); - if (H5Tequal(H5T_NATIVE_UINT8, h5Type)) - return adios2_type_uint8_t; - - if (H5Tequal(H5T_NATIVE_UINT16, h5Type)) - return adios2_type_uint16_t; - - if (H5Tequal(H5T_NATIVE_UINT32, h5Type)) - return adios2_type_uint32_t; - - if (H5Tequal(H5T_NATIVE_UINT64, h5Type)) - return adios2_type_uint64_t; - - if (H5Tequal(H5T_NATIVE_FLOAT, h5Type)) - return adios2_type_float; - - if (H5Tequal(H5T_NATIVE_DOUBLE, h5Type)) - return adios2_type_double; - - if (H5Tequal(H5T_NATIVE_LDOUBLE, h5Type)) - return adios2_type_long_double; - - if (H5Tget_class(h5Type) == H5T_NATIVE_CHAR) - return adios2_type_string; - - if (H5Tget_class(h5Type) == H5T_STRING) - return adios2_type_string; - - if (H5Tget_class(h5Type) == H5T_ENUM) // - return adios2_type_uint8_t; - // complex types are not supported in adios2_types - // so return unknown - return adios2_type_unknown; -} +adios2_type gUtilADIOS2Type(hid_t h5Type); /* int gUtilADIOS2IsNone(hid_t space_id) @@ -114,94 +30,18 @@ int gUtilADIOS2IsNone(hid_t space_id) } */ -static int gUtilADIOS2IsScalar(hid_t space_id) -{ - H5S_class_t stype = H5Sget_simple_extent_type(space_id); - - if (H5S_SCALAR == stype) - return H5VL_CODE_SUCC; - - return H5VL_CODE_FAIL; -} - -static int gUtilADIOS2GetDim(hid_t space_id) -{ - return H5Sget_simple_extent_ndims(space_id); -} +int gUtilADIOS2IsScalar(hid_t space_id); +int gUtilADIOS2GetDim(hid_t space_id); // // h5 uses hsize_t for dimensions (unsigned long long) // adios uses size_t // -static void gUtilConvert(hsize_t *fromH5, size_t *to, uint ndims) -{ - uint i = 0; - for (i = 0; i < ndims; i++) - { - to[i] = fromH5[i]; - } -} - -static int gUtilADIOS2GetShape(hid_t space_id, size_t *shape, uint ndims) -{ - if (gUtilADIOS2IsScalar(space_id)) - { - // nothing to do - return H5VL_CODE_SUCC; - } - - // get num dimensions - hsize_t h5Shape[ndims]; - H5Sget_simple_extent_dims(space_id, h5Shape, NULL); +void gUtilConvert(hsize_t *fromH5, size_t *to, uint ndims); - gUtilConvert(h5Shape, shape, ndims); - return H5VL_CODE_SUCC; -} - -static int gUtilADIOS2GetBlockInfo(hid_t hyperSlab_id, size_t *start, - size_t *count, hsize_t ndims) -{ - hsize_t npts = H5Sget_select_npoints(hyperSlab_id); - - if (0 == npts) - return npts; - else - { - hsize_t s[ndims], e[ndims]; - - H5Sget_select_bounds(hyperSlab_id, s, e); +int gUtilADIOS2GetShape(hid_t space_id, size_t *shape, uint ndims); - hsize_t numElements = 1; - hsize_t k = 0; - for (k = 0; k < ndims; k++) - { - start[k] = s[k]; - count[k] = (e[k] - s[k]) + 1; - numElements *= count[k]; - } - - if (npts == numElements) - return npts; // ok got block - } - return H5VL_CODE_FAIL; // slab has many blocks - - /* - NOTE: this is a well wish segment. Reality is hdf5 returns numBlocks = - numPts; 1 pt per block. so cann't apply this method!! hsize_t numBlocks = - H5Sget_select_hyper_nblocks(hyperSlab_id); REQUIRE_SUCC_MSG((1 == numBlocks), - H5VL_CODE_FAIL, "Currently not able to support strides != 1 %ld", numBlocks); - - // now numBlocks = 1 - hsize_t *blockinfo = (hsize_t *)SAFE_MALLOC(sizeof(hsize_t) * 2 * ndims * - numBlocks); herr_t status = H5Sget_select_hyper_blocklist(hyperSlab_id, - (hsize_t)0, numBlocks, blockinfo); - - int i=0; - for (i = 0; i < ndims; i++) { - start[i] = blockinfo[i]; - count[i] = blockinfo[ndims + i] - start[i] + 1; - } - */ -} +int gUtilADIOS2GetBlockInfo(hid_t hyperSlab_id, size_t *start, size_t *count, + hsize_t ndims); #endif diff --git a/source/h5vol/H5Vol_attr.c b/source/h5vol/H5Vol_attr.c index 9eea11bdc2..76550f75df 100644 --- a/source/h5vol/H5Vol_attr.c +++ b/source/h5vol/H5Vol_attr.c @@ -175,7 +175,6 @@ herr_t H5VL_adios2_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, { case H5VL_ATTR_GET_NAME: { - size_t buf_size = va_arg(arguments, size_t); char *buf = va_arg(arguments, char *); ssize_t *ret_val = va_arg(arguments, ssize_t *); diff --git a/source/h5vol/H5Vol_link.c b/source/h5vol/H5Vol_link.c index 3414fa6482..c0169f74c0 100644 --- a/source/h5vol/H5Vol_link.c +++ b/source/h5vol/H5Vol_link.c @@ -66,7 +66,6 @@ herr_t H5VL_adios2_link_get(void *obj, const H5VL_loc_params_t *loc_params, case H5VL_LINK_GET_NAME: { char *name = va_arg(arguments, char *); - size_t size = va_arg(arguments, size_t); ssize_t *ret = va_arg(arguments, ssize_t *); if ((GROUP == vol->m_ObjType) || (ROOT == vol->m_ObjType)) diff --git a/source/utils/adios_iotest/hdf5Stream.cpp b/source/utils/adios_iotest/hdf5Stream.cpp index a71e9237e7..6408837309 100644 --- a/source/utils/adios_iotest/hdf5Stream.cpp +++ b/source/utils/adios_iotest/hdf5Stream.cpp @@ -23,6 +23,10 @@ hdf5Stream::hdf5Stream(const std::string &streamName, const adios2::Mode mode, MPI_Info info = MPI_INFO_NULL; herr_t ret = H5Pset_fapl_mpio(acc_tpl, comm, info); + if (ret < 0) + { + throw std::runtime_error("Unable to call set_fapl_mpio"); + } // int myRank; // MPI_Comm_rank(comm, &myRank); // double timeStart, timeEnd; @@ -56,6 +60,10 @@ hdf5Stream::hdf5Stream(const std::string &streamName, const adios2::Mode mode, // open_perf_log.close(); // } ret = H5Pclose(acc_tpl); + if (ret < 0) + { + throw std::runtime_error("Unable to call set_fapl_mpio"); + } } hdf5Stream::~hdf5Stream() {} @@ -321,9 +329,7 @@ adios2::StepStatus hdf5Stream::Read(CommandRead *cmdR, Config &cfg, hid_t dataset = H5Dopen2(h5file, var->name.c_str(), H5P_DEFAULT); hid_t filespace = H5Dget_space(dataset); std::vector dims(var->ndim + 1); - int ndim = H5Sget_simple_extent_ndims(filespace); H5Sget_simple_extent_dims(filespace, dims.data(), NULL); - /* ndim == var->ndim+1 */ nSteps = dims[0]; if (!settings.myRank && settings.verbose) { diff --git a/source/utils/adios_iotest/hdf5Stream.h b/source/utils/adios_iotest/hdf5Stream.h index 97cd0e9ed8..e05640acf4 100644 --- a/source/utils/adios_iotest/hdf5Stream.h +++ b/source/utils/adios_iotest/hdf5Stream.h @@ -19,7 +19,7 @@ struct hdf5VarInfo hid_t dataspace; hid_t dataset; hdf5VarInfo(hid_t dataset, hid_t dataspace) - : dataset(dataset), dataspace(dataspace){}; + : dataspace(dataspace), dataset(dataset){}; }; using H5VarMap = std::map; diff --git a/source/utils/adios_iotest/processConfig.cpp b/source/utils/adios_iotest/processConfig.cpp index 1938cabc0c..f3e69ae3c2 100644 --- a/source/utils/adios_iotest/processConfig.cpp +++ b/source/utils/adios_iotest/processConfig.cpp @@ -395,11 +395,7 @@ void globalChecks(const Config &cfg, const Settings &settings) { if (!cmd->conditionalStream.empty()) { - try - { - const auto f = cfg.condMap.at(cmd->conditionalStream); - } - catch (std::exception &) + if (cfg.condMap.find(cmd->conditionalStream) == cfg.condMap.end()) { throw std::invalid_argument( "Name used in conditional is not a read stream: '" + @@ -409,11 +405,7 @@ void globalChecks(const Config &cfg, const Settings &settings) } for (const auto &it : cfg.stepOverStreams) { - try - { - const auto f = cfg.condMap.at(it.first); - } - catch (std::exception &) + if (cfg.condMap.find(it.first) == cfg.condMap.end()) { throw std::invalid_argument( "Name used in step over command is not a read stream: '" + diff --git a/source/utils/bpls/bpls.cpp b/source/utils/bpls/bpls.cpp index 68273fab85..61c070a7be 100644 --- a/source/utils/bpls/bpls.cpp +++ b/source/utils/bpls/bpls.cpp @@ -3319,7 +3319,6 @@ void print_decomp_singlestep(core::Engine *fp, core::IO *io, } size_t stepRelative = 0; - size_t stepAbsolute = fp->CurrentStep(); for (size_t j = 0; j < blocksSize; j++) { diff --git a/testing/adios2/engine/bp/TestBPChangingShape.cpp b/testing/adios2/engine/bp/TestBPChangingShape.cpp index 76e7788777..2f9c8446fa 100644 --- a/testing/adios2/engine/bp/TestBPChangingShape.cpp +++ b/testing/adios2/engine/bp/TestBPChangingShape.cpp @@ -274,7 +274,6 @@ TEST_F(BPChangingShape, MultiBlock) break; } - size_t engineStep = reader.CurrentStep(); size_t expected_shape = nblocks[step]; auto var = inIO.InquireVariable("v"); diff --git a/testing/adios2/engine/bp/TestBPTimeAggregation.cpp b/testing/adios2/engine/bp/TestBPTimeAggregation.cpp index b0ebe23b36..29a90a03f4 100644 --- a/testing/adios2/engine/bp/TestBPTimeAggregation.cpp +++ b/testing/adios2/engine/bp/TestBPTimeAggregation.cpp @@ -58,23 +58,34 @@ void TimeAggregation1D8(const std::string flushstepscount) const adios2::Dims count{Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); io.DefineAttribute("TestName", TestName); } @@ -384,23 +395,34 @@ void TimeAggregation2D4x2(const std::string flushstepscount) const adios2::Dims count{Ny, Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); io.DefineAttribute("TestName", TestName); } diff --git a/testing/adios2/engine/bp/TestBPWriteMultiblockRead.cpp b/testing/adios2/engine/bp/TestBPWriteMultiblockRead.cpp index 56f1b1469d..ed11883911 100644 --- a/testing/adios2/engine/bp/TestBPWriteMultiblockRead.cpp +++ b/testing/adios2/engine/bp/TestBPWriteMultiblockRead.cpp @@ -65,23 +65,34 @@ TEST_F(BPWriteMultiblockReadTest, ADIOS2BPWriteMultiblockRead1D8) const adios2::Dims count{Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) @@ -402,23 +413,34 @@ TEST_F(BPWriteMultiblockReadTest, ADIOS2BPWriteMultiblockRead2D2x4) const adios2::Dims count{Ny, Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) @@ -741,22 +763,32 @@ TEST_F(BPWriteMultiblockReadTest, ADIOS2BPWriteMultiblockRead2D4x2) adios2::Dims count{static_cast(Ny), static_cast(Nx)}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) @@ -1063,23 +1095,34 @@ TEST_F(BPWriteMultiblockReadTest, ADIOS2BPWriteRead1D8ZeroBlock) const adios2::Dims count{Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) diff --git a/testing/adios2/engine/bp/TestBPWriteNull.cpp b/testing/adios2/engine/bp/TestBPWriteNull.cpp index 46148e8e77..68c3b47c9b 100644 --- a/testing/adios2/engine/bp/TestBPWriteNull.cpp +++ b/testing/adios2/engine/bp/TestBPWriteNull.cpp @@ -72,27 +72,40 @@ TEST_F(BPWriteNullTest, BPWrite1D1x8) const adios2::Dims count{Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); @@ -214,27 +227,40 @@ TEST_F(BPWriteNullTest, BPWrite2D2x4) const adios2::Dims count{Ny, Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); @@ -354,26 +380,38 @@ TEST_F(BPWriteNullTest, BPWrite2D4x2) adios2::Dims count{static_cast(Ny), static_cast(Nx)}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); @@ -482,26 +520,38 @@ TEST_F(BPWriteNullTest, BPWrite2D4x2_MultiSteps) adios2::Dims start{0, static_cast(mpiRank * Nx)}; adios2::Dims count{Ny, Nx}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); diff --git a/testing/adios2/engine/bp/TestBPWriteReadADIOS2.cpp b/testing/adios2/engine/bp/TestBPWriteReadADIOS2.cpp index 646d0ed4db..5ba96201cd 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadADIOS2.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadADIOS2.cpp @@ -95,24 +95,36 @@ TEST_F(BPWriteReadTestADIOS2, ADIOS2BPWriteRead1D8) // auto var_bool = io.DefineVariable("tf", shape, start, // count); auto var_char = io.DefineVariable("ch", shape, start, count); + EXPECT_TRUE(var_char); auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) @@ -445,23 +457,34 @@ TEST_F(BPWriteReadTestADIOS2, ADIOS2BPWriteRead2D2x4) const adios2::Dims count{Ny, Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) @@ -756,22 +779,32 @@ TEST_F(BPWriteReadTestADIOS2, ADIOS2BPWriteRead2D4x2) adios2::Dims count{static_cast(Ny), static_cast(Nx)}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) @@ -1050,8 +1083,10 @@ TEST_F(BPWriteReadTestADIOS2, ADIOS2BPWriteRead10D2x2) { auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_c64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_c64); } if (!engineName.empty()) @@ -1227,22 +1262,32 @@ TEST_F(BPWriteReadTestADIOS2, ADIOS2BPWriteRead2D4x2_ReadMultiSteps) adios2::Dims start{0, static_cast(mpiRank * Nx)}; adios2::Dims count{Ny, Nx}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) @@ -1524,22 +1569,32 @@ TEST_F(BPWriteReadTestADIOS2, ADIOS2BPWriteRead2D4x2_MultiStepsOverflow) adios2::Dims start{0, static_cast(mpiRank * Nx)}; adios2::Dims count{Ny, Nx}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) diff --git a/testing/adios2/engine/bp/TestBPWriteReadADIOS2fstream.cpp b/testing/adios2/engine/bp/TestBPWriteReadADIOS2fstream.cpp index 70a72b9aeb..35657be2fb 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadADIOS2fstream.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadADIOS2fstream.cpp @@ -72,27 +72,40 @@ TEST_F(BPWriteReadTestADIOS2fstream, ADIOS2BPWriteRead1D8) const adios2::Dims count{Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); @@ -408,27 +421,40 @@ TEST_F(BPWriteReadTestADIOS2fstream, ADIOS2BPWriteRead2D2x4) const adios2::Dims count{Ny, Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); @@ -748,26 +774,38 @@ TEST_F(BPWriteReadTestADIOS2fstream, ADIOS2BPWriteRead2D4x2) adios2::Dims count{static_cast(Ny), static_cast(Nx)}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); @@ -1072,26 +1110,38 @@ TEST_F(BPWriteReadTestADIOS2fstream, ADIOS2BPWriteRead2D4x2_ReadMultiSteps) adios2::Dims start{0, static_cast(mpiRank * Nx)}; adios2::Dims count{Ny, Nx}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); @@ -1397,22 +1447,32 @@ TEST_F(BPWriteReadTestADIOS2fstream, ADIOS2BPWriteRead2D4x2_MultiStepsOverflow) adios2::Dims start{0, static_cast(mpiRank * Nx)}; adios2::Dims count{Ny, Nx}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); diff --git a/testing/adios2/engine/bp/TestBPWriteReadADIOS2stdio.cpp b/testing/adios2/engine/bp/TestBPWriteReadADIOS2stdio.cpp index 5a507df7f3..977d54a70e 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadADIOS2stdio.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadADIOS2stdio.cpp @@ -71,27 +71,40 @@ TEST_F(BPWriteReadTestADIOS2stdio, ADIOS2BPWriteRead1D8) const adios2::Dims count{Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); @@ -407,27 +420,40 @@ TEST_F(BPWriteReadTestADIOS2stdio, ADIOS2BPWriteRead2D2x4) const adios2::Dims count{Ny, Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); @@ -747,26 +773,38 @@ TEST_F(BPWriteReadTestADIOS2stdio, ADIOS2BPWriteRead2D4x2) adios2::Dims count{static_cast(Ny), static_cast(Nx)}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); @@ -1071,26 +1109,38 @@ TEST_F(BPWriteReadTestADIOS2stdio, ADIOS2BPWriteRead2D4x2_ReadMultiSteps) adios2::Dims start{0, static_cast(mpiRank * Nx)}; adios2::Dims count{Ny, Nx}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); @@ -1396,22 +1446,32 @@ TEST_F(BPWriteReadTestADIOS2stdio, ADIOS2BPWriteRead2D4x2_MultiStepsOverflow) adios2::Dims start{0, static_cast(mpiRank * Nx)}; adios2::Dims count{Ny, Nx}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); diff --git a/testing/adios2/engine/bp/TestBPWriteReadMultiblock.cpp b/testing/adios2/engine/bp/TestBPWriteReadMultiblock.cpp index e8f679ba7c..5eff727e94 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadMultiblock.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadMultiblock.cpp @@ -72,27 +72,40 @@ TEST_F(BPWriteReadMultiblockTest, ADIOS2BPWriteReadMultiblock1D8) const adios2::Dims count{Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } if (!engineName.empty()) @@ -859,27 +872,40 @@ TEST_F(BPWriteReadMultiblockTest, ADIOS2BPWriteReadMultiblock2D2x4) const adios2::Dims count{Ny, Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } if (!engineName.empty()) @@ -1253,26 +1279,38 @@ TEST_F(BPWriteReadMultiblockTest, ADIOS2BPWriteReadMultiblock2D4x2) adios2::Dims count{static_cast(Ny), static_cast(Nx)}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } if (!engineName.empty()) diff --git a/testing/adios2/engine/bp/TestBPWriteReadVector.cpp b/testing/adios2/engine/bp/TestBPWriteReadVector.cpp index c7ae9cefaa..371a203145 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadVector.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadVector.cpp @@ -65,23 +65,34 @@ TEST_F(BPWriteReadVector, ADIOS2BPWriteRead1D8) const adios2::Dims count{Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) @@ -376,23 +387,34 @@ TEST_F(BPWriteReadVector, ADIOS2BPWriteRead2D2x4) const adios2::Dims count{Ny, Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) @@ -688,22 +710,32 @@ TEST_F(BPWriteReadVector, ADIOS2BPWriteRead2D4x2) adios2::Dims count{static_cast(Ny), static_cast(Nx)}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) @@ -982,22 +1014,32 @@ TEST_F(BPWriteReadVector, ADIOS2BPWriteReadVector2D4x2_MultiSteps) adios2::Dims start{0, static_cast(mpiRank * Nx)}; adios2::Dims count{Ny, Nx}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) diff --git a/testing/adios2/engine/hdf5/TestHDF5Append.cpp b/testing/adios2/engine/hdf5/TestHDF5Append.cpp index caec6045ae..141a048e20 100644 --- a/testing/adios2/engine/hdf5/TestHDF5Append.cpp +++ b/testing/adios2/engine/hdf5/TestHDF5Append.cpp @@ -66,23 +66,34 @@ TEST_F(AppendTimeStepTest, ADIOS2HDF5WriteAppendRead) adios2::Dims count{static_cast(Nx)}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) diff --git a/testing/adios2/engine/hdf5/TestHDF5WriteReadAsStream.cpp b/testing/adios2/engine/hdf5/TestHDF5WriteReadAsStream.cpp index 869065f1d0..27e33670ed 100644 --- a/testing/adios2/engine/hdf5/TestHDF5WriteReadAsStream.cpp +++ b/testing/adios2/engine/hdf5/TestHDF5WriteReadAsStream.cpp @@ -344,35 +344,60 @@ TEST_F(HDF5WriteReadAsStreamTestADIOS2, ADIOS2HDF5WriteRead1D8) std::string msg = ss.str(); if (var_i8) + { EXPECT_EQ(I8[i], currentTestData.I8[i]) << msg; + } if (var_i16) + { EXPECT_EQ(I16[i], currentTestData.I16[i]) << msg; + } if (var_i32) + { EXPECT_EQ(I32[i], currentTestData.I32[i]) << msg; + } if (var_i64) + { EXPECT_EQ(I64[i], currentTestData.I64[i]) << msg; - + } if (var_u8) + { EXPECT_EQ(U8[i], currentTestData.U8[i]) << msg; + } if (var_u16) + { EXPECT_EQ(U16[i], currentTestData.U16[i]) << msg; + } if (var_u32) + { EXPECT_EQ(U32[i], currentTestData.U32[i]) << msg; + } if (var_u64) + { EXPECT_EQ(U64[i], currentTestData.U64[i]) << msg; + } if (var_r32) + { EXPECT_EQ(R32[i], currentTestData.R32[i]) << msg; + } if (var_r64) + { EXPECT_EQ(R64[i], currentTestData.R64[i]) << msg; + } if (var_ch) + { EXPECT_EQ(static_cast(CHAR[i]), currentTestData.CHAR[i]) << msg; + } if (var_cr32) + { EXPECT_EQ(CR32[i], currentTestData.CR32[i]) << msg; + } if (var_cr64) + { EXPECT_EQ(CR64[i], currentTestData.CR64[i]) << msg; + } } ++t; } @@ -981,7 +1006,7 @@ TEST_F(HDF5WriteReadAsStreamTestADIOS2, ReaderWriterDefineVariable) adios2::Variable varR32 = io.InquireVariable("r32"); EXPECT_TRUE(varR32); adios2::Variable varR64 = io.InquireVariable("r64"); - EXPECT_TRUE(varR32); + EXPECT_TRUE(varR64); reader.EndStep(); } reader.Close(); diff --git a/testing/adios2/engine/hdf5/TestNativeHDF5WriteRead.cpp b/testing/adios2/engine/hdf5/TestNativeHDF5WriteRead.cpp index 132f72c882..606a32c75a 100644 --- a/testing/adios2/engine/hdf5/TestNativeHDF5WriteRead.cpp +++ b/testing/adios2/engine/hdf5/TestNativeHDF5WriteRead.cpp @@ -194,6 +194,7 @@ void HDF5NativeWriter::CreateAndStoreScalar(std::string const &variableName, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); herr_t status = H5Dwrite(dsetID, h5Type, H5S_ALL, H5S_ALL, plistID, values); + EXPECT_TRUE(status >= 0); } else { @@ -201,15 +202,15 @@ void HDF5NativeWriter::CreateAndStoreScalar(std::string const &variableName, hid_t type = H5Tcopy(H5T_C_S1); char *strval = (char *)values; hid_t ret = H5Tset_size(type, strlen(strval)); - + EXPECT_TRUE(ret >= 0); ret = H5Tset_strpad(type, H5T_STR_NULLTERM); - + EXPECT_TRUE(ret >= 0); /* Test creating a "normal" sized string attribute */ dsetID = H5Dcreate(m_GroupId, variableName.c_str(), type, filespaceID, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dsetID, type, H5S_ALL, H5S_ALL, plistID, values); - + EXPECT_TRUE(ret >= 0); #ifdef DOUBLECHECK size_t typesize = H5Tget_size(type); char *val = (char *)(calloc(typesize, sizeof(char))); @@ -410,7 +411,7 @@ void HDF5NativeReader::ReadString(const std::string varName, char *val = (char *)(calloc(typesize, sizeof(char))); hid_t ret2 = H5Dread(dataSetId, h5Type, H5S_ALL, H5S_ALL, H5P_DEFAULT, val); - + EXPECT_TRUE(ret2 >= 0); result.assign(val, typesize); free(val); @@ -464,11 +465,13 @@ void HDF5NativeReader::ReadVar(const std::string varName, void *dataArray, hid_t ret = H5Dread(dataSetId, h5type, memspace, dataspace, H5P_DEFAULT, dataArray); + EXPECT_TRUE(ret >= 0); } else { hid_t ret = H5Dread(dataSetId, h5type, H5S_ALL, H5S_ALL, H5P_DEFAULT, dataArray); + EXPECT_TRUE(ret >= 0); } H5Sclose(fileSpace); @@ -1307,23 +1310,34 @@ TEST_F(HDF5WriteReadTest, ADIOS2HDF5WriteHDF5Read2D2x4) adios2::Dims count{static_cast(Ny), static_cast(Nx)}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } // Create the HDF5 Engine @@ -1571,24 +1585,34 @@ TEST_F(HDF5WriteReadTest, ADIOS2HDF5WriteADIOS2HDF5Read2D2x4) static_cast(Nx)}; auto var_iString = io.DefineVariable("iString"); - + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } // Create the HDF5 Engine @@ -2128,23 +2152,34 @@ TEST_F(HDF5WriteReadTest, ADIOS2HDF5WriteHDF5Read2D4x2) static_cast(Nx)}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } // Create the HDF5 Engine @@ -2388,23 +2423,34 @@ TEST_F(HDF5WriteReadTest, ADIOS2HDF5WriteADIOS2HDF5Read2D4x2) adios2::Dims count{static_cast(Ny), static_cast(Nx)}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } // Create the HDF5 Engine diff --git a/testing/adios2/engine/inline/TestInlineWriteRead.cpp b/testing/adios2/engine/inline/TestInlineWriteRead.cpp index 2f53469fb9..66577d9d0f 100644 --- a/testing/adios2/engine/inline/TestInlineWriteRead.cpp +++ b/testing/adios2/engine/inline/TestInlineWriteRead.cpp @@ -83,27 +83,40 @@ TEST_F(InlineWriteRead, InlineWriteRead1D8) const adios2::Dims count{Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } // Create the Engine @@ -368,27 +381,40 @@ TEST_F(InlineWriteRead, InlineWriteRead2D2x4) const adios2::Dims count{Ny, Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); auto var_cr32 = io.DefineVariable>( "cr32", shape, start, count); + EXPECT_TRUE(var_cr32); auto var_cr64 = io.DefineVariable>( "cr64", shape, start, count); + EXPECT_TRUE(var_cr64); } // Create the Engine @@ -636,8 +662,10 @@ TEST_F(InlineWriteRead, InlineWriteReadContracts) const adios2::Dims count{Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); } // Create the Engine @@ -758,8 +786,10 @@ TEST_F(InlineWriteRead, InlineWriteReadContracts2) const adios2::Dims count{Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); } // Create the Engine @@ -852,12 +882,14 @@ TEST_F(InlineWriteRead, IOInvariants) io.SetEngine("Inline"); adios2::Engine inlineWriter = io.Open("writer", adios2::Mode::Write); + EXPECT_TRUE(inlineWriter); // The inline engine does not support multiple writers: EXPECT_THROW(io.Open("another_writer", adios2::Mode::Write), std::exception); // The inline engine does not support append mode: EXPECT_THROW(io.Open("append_mode", adios2::Mode::Append), std::exception); adios2::Engine inlineReader = io.Open("reader", adios2::Mode::Read); + EXPECT_TRUE(inlineReader); // The inline engine does not support more than 2 writers or readers: EXPECT_THROW(io.Open("reader2", adios2::Mode::Read), std::exception); } diff --git a/testing/adios2/engine/null/TestNullWriteRead.cpp b/testing/adios2/engine/null/TestNullWriteRead.cpp index 8326e18e2d..45ab8d7e80 100644 --- a/testing/adios2/engine/null/TestNullWriteRead.cpp +++ b/testing/adios2/engine/null/TestNullWriteRead.cpp @@ -52,23 +52,34 @@ TEST_F(NullWriteReadTests, NullWriteRead1D8) const adios2::Dims count{Nx}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } io.SetEngine("NULL"); diff --git a/testing/adios2/engine/nullcore/TestNullCoreWrite.cpp b/testing/adios2/engine/nullcore/TestNullCoreWrite.cpp index 897f8fbdba..bd4b835660 100644 --- a/testing/adios2/engine/nullcore/TestNullCoreWrite.cpp +++ b/testing/adios2/engine/nullcore/TestNullCoreWrite.cpp @@ -61,23 +61,34 @@ TEST_F(NullCoreWriteTest, ADIOS2NullCoreWrite1D8) adios2::Dims count{static_cast(Nx)}; auto var_iString = io.DefineVariable("iString"); + EXPECT_TRUE(var_iString); auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } io.SetEngine("NullCore"); @@ -180,22 +191,32 @@ TEST_F(NullCoreWriteTest, ADIOS2NullCoreWrite2D2x4) adios2::Dims count{static_cast(Ny), static_cast(Nx)}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } io.SetEngine("NullCore"); @@ -298,22 +319,32 @@ TEST_F(NullCoreWriteTest, ADIOS2NullCoreWrite2D4x2) adios2::Dims count{static_cast(Ny), static_cast(Nx)}; auto var_i8 = io.DefineVariable("i8", shape, start, count); + EXPECT_TRUE(var_i8); auto var_i16 = io.DefineVariable("i16", shape, start, count); + EXPECT_TRUE(var_i16); auto var_i32 = io.DefineVariable("i32", shape, start, count); + EXPECT_TRUE(var_i32); auto var_i64 = io.DefineVariable("i64", shape, start, count); + EXPECT_TRUE(var_i64); auto var_u8 = io.DefineVariable("u8", shape, start, count); + EXPECT_TRUE(var_u8); auto var_u16 = io.DefineVariable("u16", shape, start, count); + EXPECT_TRUE(var_u16); auto var_u32 = io.DefineVariable("u32", shape, start, count); + EXPECT_TRUE(var_u32); auto var_u64 = io.DefineVariable("u64", shape, start, count); + EXPECT_TRUE(var_u64); auto var_r32 = io.DefineVariable("r32", shape, start, count); + EXPECT_TRUE(var_r32); auto var_r64 = io.DefineVariable("r64", shape, start, count); + EXPECT_TRUE(var_r64); } io.SetEngine("NullCore"); diff --git a/testing/adios2/engine/staging-common/TestCommonRead.cpp b/testing/adios2/engine/staging-common/TestCommonRead.cpp index 1abb1067f0..89c23b7123 100644 --- a/testing/adios2/engine/staging-common/TestCommonRead.cpp +++ b/testing/adios2/engine/staging-common/TestCommonRead.cpp @@ -401,9 +401,11 @@ TEST_F(CommonReadTest, ADIOS2CommonRead1D8) else { if (NoDataNode != -1) + { EXPECT_EQ( validateCommonTestDataR64(myStart, myLength, t, !var_c32), 0); + } } ++t; } diff --git a/testing/adios2/helper/TestDivideBlock.cpp b/testing/adios2/helper/TestDivideBlock.cpp index 535810f66c..fdb8533133 100644 --- a/testing/adios2/helper/TestDivideBlock.cpp +++ b/testing/adios2/helper/TestDivideBlock.cpp @@ -98,7 +98,6 @@ void assert_block(const adios2::Box &block, ASSERT_EQ(block_start[d], expected_start[d]); } ASSERT_EQ(block_count.size(), expected_count.size()); - const size_t ncount = expected_count.size(); for (size_t d = 0; d < nstart; ++d) { ASSERT_EQ(block_count[d], expected_count[d]); diff --git a/testing/adios2/helper/TestMinMaxs.cpp b/testing/adios2/helper/TestMinMaxs.cpp index e9c8ce17e8..91d45d41bc 100644 --- a/testing/adios2/helper/TestMinMaxs.cpp +++ b/testing/adios2/helper/TestMinMaxs.cpp @@ -110,7 +110,6 @@ void assert_block(const adios2::Box &block, const int blockID, ASSERT_EQ(block_start[d], expected_start[d]); } ASSERT_EQ(block_count.size(), expected_count.size()); - const size_t ncount = expected_count.size(); for (size_t d = 0; d < nstart; ++d) { ASSERT_EQ(block_count[d], expected_count[d]); diff --git a/testing/adios2/interface/TestADIOSSelection.cpp b/testing/adios2/interface/TestADIOSSelection.cpp index c63eca0708..26dc829d16 100644 --- a/testing/adios2/interface/TestADIOSSelection.cpp +++ b/testing/adios2/interface/TestADIOSSelection.cpp @@ -132,7 +132,6 @@ MultiArray makeArray(std::initializer_list> t) TEST(MultiArray, Constructor) { using MultiArrayT = MultiArray; - using MultiIndex = MultiArrayT::Index; auto arr = MultiArrayT({2, 3, 4, 5}); } diff --git a/testing/adios2/performance/query/TestBPQuery.cpp b/testing/adios2/performance/query/TestBPQuery.cpp index 9222c427fa..a1b348a487 100644 --- a/testing/adios2/performance/query/TestBPQuery.cpp +++ b/testing/adios2/performance/query/TestBPQuery.cpp @@ -181,6 +181,8 @@ void BPQueryTest::WriteFile(const std::string &fname, adios2::ADIOS &adios, io.DefineVariable("intV", shape, start, count); auto var_r64 = io.DefineVariable("doubleV", shape, start, count); + EXPECT_TRUE(var_i32); + EXPECT_TRUE(var_r64); } if (!engineName.empty()) diff --git a/testing/h5vol/TestH5VolWriteReadBPFile.cpp b/testing/h5vol/TestH5VolWriteReadBPFile.cpp index 2a350de3f2..f760bd68d3 100644 --- a/testing/h5vol/TestH5VolWriteReadBPFile.cpp +++ b/testing/h5vol/TestH5VolWriteReadBPFile.cpp @@ -193,6 +193,7 @@ void HDF5NativeWriter::CreateAndStoreScalar(std::string const &variableName, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); herr_t status = H5Dwrite(dsetID, h5Type, H5S_ALL, H5S_ALL, plistID, values); + EXPECT_TRUE(status > 0); } else { @@ -410,6 +411,7 @@ void HDF5NativeReader::ReadString(const std::string varName, size_t typesize = H5Tget_size(h5Type); // returns a fix number, 30 char *val = (char *)(calloc(typesize, sizeof(char))); hid_t ret2 = H5Dread(dataSetId, h5Type, H5S_ALL, H5S_ALL, H5P_DEFAULT, val); + EXPECT_TRUE(ret2 >= 0); // result.assign(val, typesize); result.assign(val, strlen(val)); free(val); @@ -464,11 +466,13 @@ void HDF5NativeReader::ReadVar(const std::string varName, void *dataArray, hid_t ret = H5Dread(dataSetId, h5type, memspace, dataspace, H5P_DEFAULT, dataArray); + EXPECT_TRUE(ret >= 0); } else { hid_t ret = H5Dread(dataSetId, h5type, H5S_ALL, H5S_ALL, H5P_DEFAULT, dataArray); + EXPECT_TRUE(ret >= 0); } H5Sclose(fileSpace);