From 1a1eef6e8c0bb76b56b160b6636820155cf9afe1 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 1 Jul 2019 10:53:40 +0200 Subject: [PATCH] Version: 2.4.0 --- ...th-msvc.patch => 0001-pyd-path-msvc.patch} | 0 recipes/adios2/0002-name-clash-msvc.patch | 91 ------ recipes/adios2/0003-hdf5p-msvc.patch | 300 ------------------ recipes/adios2/bld.bat | 3 + recipes/adios2/meta.yaml | 15 +- 5 files changed, 8 insertions(+), 401 deletions(-) rename recipes/adios2/{0004-pyd-path-msvc.patch => 0001-pyd-path-msvc.patch} (100%) delete mode 100644 recipes/adios2/0002-name-clash-msvc.patch delete mode 100644 recipes/adios2/0003-hdf5p-msvc.patch diff --git a/recipes/adios2/0004-pyd-path-msvc.patch b/recipes/adios2/0001-pyd-path-msvc.patch similarity index 100% rename from recipes/adios2/0004-pyd-path-msvc.patch rename to recipes/adios2/0001-pyd-path-msvc.patch diff --git a/recipes/adios2/0002-name-clash-msvc.patch b/recipes/adios2/0002-name-clash-msvc.patch deleted file mode 100644 index bb6e617a5123f..0000000000000 --- a/recipes/adios2/0002-name-clash-msvc.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 5f9bdb4e42a108ec19c2bf4034a3a2ddb0c5d951 Mon Sep 17 00:00:00 2001 -From: Kai Germaschewski -Date: Sat, 29 Jun 2019 05:35:24 -0400 -Subject: [PATCH] fix MSVC/conda build - -This simply renames `helper::CopyMemory` to `helper::CopyMemoryBlock` to -avoid a name clash with the `CopyMemory` defined in the MSVC build in #1485. ---- - source/adios2/helper/adiosMemory.h | 16 ++++++++-------- - source/adios2/helper/adiosMemory.inl | 12 ++++++------ - .../adios2/toolkit/format/bp3/BP3Serializer.tcc | 2 +- - .../adios2/toolkit/format/bp4/BP4Serializer.tcc | 2 +- - 4 files changed, 16 insertions(+), 16 deletions(-) - -diff --git a/source/adios2/helper/adiosMemory.h b/source/adios2/helper/adiosMemory.h -index 91d5f1353..44a773c1b 100644 ---- a/source/adios2/helper/adiosMemory.h -+++ b/source/adios2/helper/adiosMemory.h -@@ -111,14 +111,14 @@ T ReadValue(const std::vector &buffer, size_t &position, - * @param srcMemCount - */ - template --void CopyMemory(T *dest, const Dims &destStart, const Dims &destCount, -- const bool destRowMajor, const U *src, const Dims &srcStart, -- const Dims &srcCount, const bool srcRowMajor, -- const bool endianReverse = false, -- const Dims &destMemStart = Dims(), -- const Dims &destMemCount = Dims(), -- const Dims &srcMemStart = Dims(), -- const Dims &srcMemCount = Dims()) noexcept; -+void CopyMemoryBlock(T *dest, const Dims &destStart, const Dims &destCount, -+ const bool destRowMajor, const U *src, -+ const Dims &srcStart, const Dims &srcCount, -+ const bool srcRowMajor, const bool endianReverse = false, -+ const Dims &destMemStart = Dims(), -+ const Dims &destMemCount = Dims(), -+ const Dims &srcMemStart = Dims(), -+ const Dims &srcMemCount = Dims()) noexcept; - - void CopyPayload(char *dest, const Dims &destStart, const Dims &destCount, - const bool destRowMajor, const char *src, const Dims &srcStart, -diff --git a/source/adios2/helper/adiosMemory.inl b/source/adios2/helper/adiosMemory.inl -index e130030e9..7ff9d88de 100644 ---- a/source/adios2/helper/adiosMemory.inl -+++ b/source/adios2/helper/adiosMemory.inl -@@ -252,12 +252,12 @@ void ClipVector(std::vector &vec, const size_t start, - } - - template --void CopyMemory(T *dest, const Dims &destStart, const Dims &destCount, -- const bool destRowMajor, const U *src, const Dims &srcStart, -- const Dims &srcCount, const bool srcRowMajor, -- const bool endianReverse, const Dims &destMemStart, -- const Dims &destMemCount, const Dims &srcMemStart, -- const Dims &srcMemCount) noexcept -+void CopyMemoryBlock(T *dest, const Dims &destStart, const Dims &destCount, -+ const bool destRowMajor, const U *src, -+ const Dims &srcStart, const Dims &srcCount, -+ const bool srcRowMajor, const bool endianReverse, -+ const Dims &destMemStart, const Dims &destMemCount, -+ const Dims &srcMemStart, const Dims &srcMemCount) noexcept - { - // transform everything to payload dims - const Dims destStartPayload = PayloadDims(destStart, destRowMajor); -diff --git a/source/adios2/toolkit/format/bp3/BP3Serializer.tcc b/source/adios2/toolkit/format/bp3/BP3Serializer.tcc -index a66b9dc62..7d54681e6 100644 ---- a/source/adios2/toolkit/format/bp3/BP3Serializer.tcc -+++ b/source/adios2/toolkit/format/bp3/BP3Serializer.tcc -@@ -862,7 +862,7 @@ void BP3Serializer::PutPayloadInBuffer( - ProfilerStart("memcpy"); - if (!blockInfo.MemoryStart.empty()) - { -- helper::CopyMemory( -+ helper::CopyMemoryBlock( - reinterpret_cast(m_Data.m_Buffer.data() + m_Data.m_Position), - blockInfo.Start, blockInfo.Count, sourceRowMajor, blockInfo.Data, - blockInfo.Start, blockInfo.Count, sourceRowMajor, false, Dims(), -diff --git a/source/adios2/toolkit/format/bp4/BP4Serializer.tcc b/source/adios2/toolkit/format/bp4/BP4Serializer.tcc -index 86b688e0b..3eb210508 100644 ---- a/source/adios2/toolkit/format/bp4/BP4Serializer.tcc -+++ b/source/adios2/toolkit/format/bp4/BP4Serializer.tcc -@@ -903,7 +903,7 @@ void BP4Serializer::PutPayloadInBuffer( - if (!blockInfo.MemoryStart.empty()) - { - // TODO make it a BP4Serializer function -- helper::CopyMemory( -+ helper::CopyMemoryBlock( - reinterpret_cast(m_Data.m_Buffer.data() + m_Data.m_Position), - blockInfo.Start, blockInfo.Count, sourceRowMajor, blockInfo.Data, - blockInfo.Start, blockInfo.Count, sourceRowMajor, false, Dims(), - diff --git a/recipes/adios2/0003-hdf5p-msvc.patch b/recipes/adios2/0003-hdf5p-msvc.patch deleted file mode 100644 index f8731aae767c4..0000000000000 --- a/recipes/adios2/0003-hdf5p-msvc.patch +++ /dev/null @@ -1,300 +0,0 @@ -From e945ae8c2900b7d6450882791042a49be09141af Mon Sep 17 00:00:00 2001 -From: Kai Germaschewski -Date: Sat, 29 Jun 2019 07:40:26 -0400 -Subject: [PATCH 1/3] fix HDF5Reader build with MSVC - -Sadly, variable-sized stack arrays are only a feature of C99, but not C++11, -so this patch uses std::vector instead. ---- - source/adios2/engine/hdf5/HDF5ReaderP.cpp | 10 ++++++---- - source/adios2/toolkit/interop/hdf5/HDF5Common.cpp | 5 +++-- - 2 files changed, 9 insertions(+), 6 deletions(-) - -diff --git a/source/adios2/engine/hdf5/HDF5ReaderP.cpp b/source/adios2/engine/hdf5/HDF5ReaderP.cpp -index f018718af..542855246 100644 ---- a/source/adios2/engine/hdf5/HDF5ReaderP.cpp -+++ b/source/adios2/engine/hdf5/HDF5ReaderP.cpp -@@ -14,6 +14,8 @@ - #include "adios2/common/ADIOSMPI.h" - #include "adios2/helper/adiosFunctions.h" //CSVToVector - -+#include -+ - namespace adios2 - { - namespace core -@@ -146,7 +148,7 @@ size_t HDF5ReaderP::ReadDataset(hid_t dataSetId, hid_t h5Type, - } - else - { -- hsize_t start[ndims], count[ndims], stride[ndims]; -+ std::vector start(ndims), count(ndims), stride(ndims); - bool isOrderC = helper::IsRowMajor(m_IO.m_HostLanguage); - - for (int i = 0; i < ndims; i++) -@@ -164,12 +166,12 @@ size_t HDF5ReaderP::ReadDataset(hid_t dataSetId, hid_t h5Type, - slabsize *= count[i]; - stride[i] = 1; - } -- hid_t ret = H5Sselect_hyperslab(fileSpace, H5S_SELECT_SET, start, -- stride, count, NULL); -+ hid_t ret = H5Sselect_hyperslab(fileSpace, H5S_SELECT_SET, start.data(), -+ stride.data(), count.data(), NULL); - if (ret < 0) - return 0; - -- hid_t memDataSpace = H5Screate_simple(ndims, count, NULL); -+ hid_t memDataSpace = H5Screate_simple(ndims, count.data(), NULL); - interop::HDF5TypeGuard g_mds(memDataSpace, interop::E_H5_SPACE); - - int elementsRead = 1; -diff --git a/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp b/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp -index 1173e9137..e723442ea 100644 ---- a/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp -+++ b/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include "adios2/common/ADIOSMPI.h" - #include "adios2/helper/adiosFunctions.h" // IsRowMajor -@@ -419,8 +420,8 @@ void HDF5Common::AddVar(core::IO &io, std::string const &name, hid_t datasetId, - { - hid_t dspace = H5Dget_space(datasetId); - const int ndims = H5Sget_simple_extent_ndims(dspace); -- hsize_t dims[ndims]; -- H5Sget_simple_extent_dims(dspace, dims, NULL); -+ std::vector dims(ndims); -+ H5Sget_simple_extent_dims(dspace, dims.data(), NULL); - H5Sclose(dspace); - - Dims shape; - -From cfc18a2766d6c3fd830b0215cbc8a30b51b49f1e Mon Sep 17 00:00:00 2001 -From: Kai Germaschewski -Date: Sat, 29 Jun 2019 21:34:50 -0400 -Subject: [PATCH 2/3] msvc: fix some more msvc complaints - -including use of `uint` and more stack-allocated arrays ---- - .../adios2/toolkit/interop/hdf5/HDF5Common.cpp | 16 +++++++--------- - 1 file changed, 7 insertions(+), 9 deletions(-) - -diff --git a/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp b/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp -index e723442ea..002633fb5 100644 ---- a/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp -+++ b/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp -@@ -190,7 +190,7 @@ void HDF5Common::WriteAdiosSteps() - hid_t attr = - H5Acreate(m_FileId, ATTRNAME_NUM_STEPS.c_str(), - /*"NumSteps",*/ H5T_NATIVE_UINT, s, H5P_DEFAULT, H5P_DEFAULT); -- uint totalAdiosSteps = m_CurrentAdiosStep + 1; -+ unsigned int totalAdiosSteps = m_CurrentAdiosStep + 1; - - if (m_GroupId < 0) - { -@@ -296,18 +296,16 @@ void HDF5Common::FindVarsFromH5(core::IO &io, hid_t top_id, const char *gname, - hid_t datasetId = H5Dopen(gid, name, H5P_DEFAULT); - HDF5TypeGuard d(datasetId, E_H5_DATASET); - -- char longName[std::strlen(heritage) + -- std::strlen(gname) + std::strlen(name) + -- 10]; -+ std::string longName; - - if (strcmp(gname, "/") == 0) - { -- sprintf(longName, "/%s", name); -+ longName = std::string("/") + name; - } - else - { -- sprintf(longName, "%s/%s/%s", heritage, gname, -- name); -+ longName = std::string(heritage) + "/" + gname + -+ "/" + name; - } - // CreateVar(io, datasetId, name); - ReadNativeAttrToIO(io, datasetId, longName); -@@ -1246,7 +1244,7 @@ void HDF5Common::ReadAttrToIO(core::IO &io) - { - numAttrs = oinfo.num_attrs; - int k = 0; -- int MAX_ATTR_NAME_SIZE = 100; -+ const int MAX_ATTR_NAME_SIZE = 100; - for (k = 0; k < numAttrs; k++) - { - char attrName[MAX_ATTR_NAME_SIZE]; -@@ -1304,7 +1302,7 @@ void HDF5Common::ReadNativeAttrToIO(core::IO &io, hid_t datasetId, - // consuimg - } - int k = 0; -- int MAX_ATTR_NAME_SIZE = 100; -+ const int MAX_ATTR_NAME_SIZE = 100; - for (k = 0; k < numAttrs; k++) - { - char attrName[MAX_ATTR_NAME_SIZE]; - -From 6fe4dbf5be981e1b099a0bdc5905e16672337693 Mon Sep 17 00:00:00 2001 -From: Kai Germaschewski -Date: Sun, 30 Jun 2019 06:56:46 -0400 -Subject: [PATCH 3/3] msvc: fix remaining VLA arrays - -I should have gotten them all now via `-Werror=vla` (with clang) ---- - .../toolkit/interop/hdf5/HDF5Common.cpp | 6 +-- - .../toolkit/interop/hdf5/HDF5Common.tcc | 4 +- - source/utils/adios_iotest/hdf5Stream.cpp | 37 ++++++++++--------- - 3 files changed, 25 insertions(+), 22 deletions(-) - -diff --git a/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp b/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp -index 002633fb5..e46bde7eb 100644 ---- a/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp -+++ b/source/adios2/toolkit/interop/hdf5/HDF5Common.cpp -@@ -933,9 +933,9 @@ void HDF5Common::AddNonStringAttribute(core::IO &io, - } - else - { -- T val[arraySize]; -- H5Aread(attrId, h5Type, val); -- io.DefineAttribute(attrName, val, arraySize); -+ std::vector val(arraySize); -+ H5Aread(attrId, h5Type, val.data()); -+ io.DefineAttribute(attrName, val.data(), arraySize); - } - } - -diff --git a/source/adios2/toolkit/interop/hdf5/HDF5Common.tcc b/source/adios2/toolkit/interop/hdf5/HDF5Common.tcc -index 4aa723980..b6634e166 100644 ---- a/source/adios2/toolkit/interop/hdf5/HDF5Common.tcc -+++ b/source/adios2/toolkit/interop/hdf5/HDF5Common.tcc -@@ -208,7 +208,7 @@ void HDF5Common::AddBlockInfo(const core::Variable &variable, hid_t parentId) - H5Dcreate(parentId, blockInfo_name.c_str(), H5T_NATIVE_HSIZE, - metaSpace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - -- size_t blocks[dimSize * 2]; -+ std::vector blocks(dimSize * 2); - for (int i = 0; i < dimSize; i++) - { - blocks[i + dimSize] = variable.m_Count[i]; -@@ -223,7 +223,7 @@ void HDF5Common::AddBlockInfo(const core::Variable &variable, hid_t parentId) - metaCount, NULL); - - H5Dwrite(metaId, H5T_NATIVE_HSIZE, metaLocal_id, metaSpace_id, -- m_PropertyTxfID, blocks); -+ m_PropertyTxfID, blocks.data()); - - H5Sclose(metaLocal_id); - H5Sclose(metaSpace_id); -diff --git a/source/utils/adios_iotest/hdf5Stream.cpp b/source/utils/adios_iotest/hdf5Stream.cpp -index 8b12dcdd1..e684e15d6 100644 ---- a/source/utils/adios_iotest/hdf5Stream.cpp -+++ b/source/utils/adios_iotest/hdf5Stream.cpp -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - - hdf5Stream::hdf5Stream(const std::string &streamName, const adios2::Mode mode, - MPI_Comm comm) -@@ -80,9 +81,9 @@ hid_t hdf5Stream::hdf5Type(std::string &type) - void hdf5Stream::defineHDF5Array(const std::shared_ptr ov) - { - const int ndim = ov->ndim + 1; -- hsize_t maxdims[ndim]; -- hsize_t dims[ndim]; -- hsize_t count[ndim]; -+ std::vector maxdims(ndim); -+ std::vector dims(ndim); -+ std::vector count(ndim); - - maxdims[0] = H5S_UNLIMITED; - dims[0] = 1; -@@ -94,14 +95,14 @@ void hdf5Stream::defineHDF5Array(const std::shared_ptr ov) - count[d] = ov->count[d - 1]; - } - -- hid_t dataspace = H5Screate_simple(ndim, dims, maxdims); -+ hid_t dataspace = H5Screate_simple(ndim, dims.data(), maxdims.data()); - - hid_t cparms; - /* - * Set chunking, the only way to have extendible arrays - */ - cparms = H5Pcreate(H5P_DATASET_CREATE); -- H5Pset_chunk(cparms, ndim, count); -+ H5Pset_chunk(cparms, ndim, count.data()); - - hid_t dataset; - dataset = H5Dcreate2(h5file, ov->name.c_str(), hdf5Type(ov->type), -@@ -117,9 +118,9 @@ void hdf5Stream::putHDF5Array(const std::shared_ptr ov, - const auto it = varmap.find(ov->name); - hdf5VarInfo &vi = it->second; - int ndim = ov->ndim + 1; -- hsize_t start[ndim]; -- hsize_t count[ndim]; -- hsize_t dims[ndim]; -+ std::vector start(ndim); -+ std::vector count(ndim); -+ std::vector dims(ndim); - start[0] = step - 1; - count[0] = 1; - dims[0] = step; -@@ -130,12 +131,13 @@ void hdf5Stream::putHDF5Array(const std::shared_ptr ov, - dims[d] = ov->shape[d - 1]; - } - -- H5Dset_extent(vi.dataset, dims); -+ H5Dset_extent(vi.dataset, dims.data()); - hid_t filespace = H5Dget_space(vi.dataset); -- H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, count, NULL); -+ H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start.data(), NULL, -+ count.data(), NULL); - hid_t dxpl_id = H5Pcreate(H5P_DATASET_XFER); - H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE); -- hid_t memspace = H5Screate_simple(ndim, count, NULL); -+ hid_t memspace = H5Screate_simple(ndim, count.data(), NULL); - H5Dwrite(vi.dataset, hdf5Type(ov->type), memspace, filespace, dxpl_id, - ov->data.data()); - H5Pclose(dxpl_id); -@@ -256,8 +258,8 @@ void hdf5Stream::getHDF5Array(std::shared_ptr ov, size_t step) - } - int ndim = ov->ndim + 1; - -- hsize_t start[ndim]; -- hsize_t count[ndim]; -+ std::vector start(ndim); -+ std::vector count(ndim); - start[0] = step - 1; - count[0] = 1; - for (int d = 1; d < ndim; ++d) -@@ -272,10 +274,11 @@ void hdf5Stream::getHDF5Array(std::shared_ptr ov, size_t step) - ov->data.resize(ov->datasize); - } - -- hid_t memspace = H5Screate_simple(ndim, count, NULL); -+ hid_t memspace = H5Screate_simple(ndim, count.data(), NULL); - hid_t dxpl_id = H5Pcreate(H5P_DATASET_XFER); - H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE); -- H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, count, NULL); -+ H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start.data(), NULL, -+ count.data(), NULL); - void *buf = reinterpret_cast(ov->data.data()); - H5Dread(dataset, hdf5Type(ov->type), memspace, filespace, dxpl_id, buf); - -@@ -317,9 +320,9 @@ adios2::StepStatus hdf5Stream::Read(CommandRead *cmdR, Config &cfg, - std::shared_ptr var = cmdR->variables.front(); - hid_t dataset = H5Dopen2(h5file, var->name.c_str(), H5P_DEFAULT); - hid_t filespace = H5Dget_space(dataset); -- hsize_t dims[var->ndim + 1]; -+ std::vector dims(var->ndim + 1); - int ndim = H5Sget_simple_extent_ndims(filespace); -- H5Sget_simple_extent_dims(filespace, dims, NULL); -+ H5Sget_simple_extent_dims(filespace, dims.data(), NULL); - /* ndim == var->ndim+1 */ - nSteps = dims[0]; - if (!settings.myRank && settings.verbose) - diff --git a/recipes/adios2/bld.bat b/recipes/adios2/bld.bat index ca95c0ec723b8..27502ca6e0b09 100644 --- a/recipes/adios2/bld.bat +++ b/recipes/adios2/bld.bat @@ -22,7 +22,10 @@ cmake ^ -DADIOS2_USE_Python=ON ^ -DADIOS2_USE_Profiling=OFF ^ -DADIOS2_USE_Fortran=OFF ^ + -DCMAKE_INSTALL_LIBDIR=lib ^ + -DCMAKE_INSTALL_PYTHONDIR=%SP_DIR% ^ -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ + -DCMAKE_PYTHON_OUTPUT_DIRECTORY=%CURRENTDIR%\lib\site-packages ^ %SRC_DIR% if errorlevel 1 exit 1 diff --git a/recipes/adios2/meta.yaml b/recipes/adios2/meta.yaml index 8d024fdf95ee0..86095feb2a73a 100644 --- a/recipes/adios2/meta.yaml +++ b/recipes/adios2/meta.yaml @@ -1,8 +1,7 @@ {% set name = "adios2" %} -{% set version = "2.4.0rc1" %} -{% set version_fn = version.replace("rc", "-rc") %} +{% set version = "2.4.0" %} {% set build = 0 %} -{% set sha256 = "d9b85ce917deccf5c0d055fe3e7a18a5db34032bc31c92a95c82298cba6b07fe" %} +{% set sha256 = "50ecea04b1e41c88835b4b3fd4e7bf0a0a2a3129855c9cc4ba6cf6a1575106e2" %} # ensure mpi is defined (needed for conda-smithy recipe-lint) {% set mpi = mpi or 'nompi' %} @@ -17,16 +16,12 @@ package: version: {{ version }} source: - fn: v{{ version_fn }}.tar.gz - url: https://github.com/ornladios/ADIOS2/archive/v{{ version_fn }}.tar.gz + fn: v{{ version }}.tar.gz + url: https://github.com/ornladios/ADIOS2/archive/v{{ version }}.tar.gz sha256: {{ sha256 }} patches: - # FIXME: https://github.com/ornladios/ADIOS2/pull/1575 - - 0002-name-clash-msvc.patch - # FIXME: https://github.com/ornladios/ADIOS2/pull/1577 - - 0003-hdf5p-msvc.patch # FIXME: https://github.com/ornladios/ADIOS2/pull/1593 - - 0004-pyd-path-msvc.patch + - 0001-pyd-path-msvc.patch build: number: {{ build }}