From a82cccd8ae2c60acbacc03849e6f22a76c8af9c2 Mon Sep 17 00:00:00 2001 From: NAThompson Date: Thu, 20 Feb 2020 12:57:47 -0500 Subject: [PATCH 1/4] Fix memory leak from CompressZFP. --- source/adios2/operator/compress/CompressZFP.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/adios2/operator/compress/CompressZFP.cpp b/source/adios2/operator/compress/CompressZFP.cpp index 87f821fd3c..9cc51ed370 100644 --- a/source/adios2/operator/compress/CompressZFP.cpp +++ b/source/adios2/operator/compress/CompressZFP.cpp @@ -63,6 +63,7 @@ size_t CompressZFP::Compress(const void *dataIn, const Dims &dimensions, zfp_field_free(field); zfp_stream_close(stream); + free(bitstream); return sizeOut; } From fa189eddc128f49abb595d03fade2b299a4b014a Mon Sep 17 00:00:00 2001 From: NAThompson Date: Fri, 21 Feb 2020 05:04:51 -0500 Subject: [PATCH 2/4] Free the bitstream pointer with the correct ZFP call. --- source/adios2/operator/compress/CompressZFP.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/adios2/operator/compress/CompressZFP.cpp b/source/adios2/operator/compress/CompressZFP.cpp index 9cc51ed370..d720f4d0db 100644 --- a/source/adios2/operator/compress/CompressZFP.cpp +++ b/source/adios2/operator/compress/CompressZFP.cpp @@ -63,7 +63,7 @@ size_t CompressZFP::Compress(const void *dataIn, const Dims &dimensions, zfp_field_free(field); zfp_stream_close(stream); - free(bitstream); + stream_close(bitstream); return sizeOut; } From d698fc6c209cbcfe038c78740087ee8491c40dff Mon Sep 17 00:00:00 2001 From: NAThompson Date: Fri, 21 Feb 2020 08:52:44 -0500 Subject: [PATCH 3/4] Fix ZFP bistream leak through SST. --- source/adios2/toolkit/sst/cp/ffs_zfp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/adios2/toolkit/sst/cp/ffs_zfp.c b/source/adios2/toolkit/sst/cp/ffs_zfp.c index 76a133b13f..7f4737a2d0 100644 --- a/source/adios2/toolkit/sst/cp/ffs_zfp.c +++ b/source/adios2/toolkit/sst/cp/ffs_zfp.c @@ -153,6 +153,7 @@ extern char *FFS_ZFPCompress(SstStream Stream, const size_t DimCount, size_t sizeOut = zfp_compress(stream, field); zfp_field_free(field); zfp_stream_close(stream); + stream_close(bitstream); *ByteCountP = sizeOut; return bufferOut; } From 41ec6fa0f1c97d7492e34e7f5daff8ad5b914c77 Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Fri, 21 Feb 2020 09:35:38 -0500 Subject: [PATCH 4/4] CI: Add ZFP to the AddressSanitizer build --- scripts/ci/cmake/ci-fedora-asan.cmake | 12 +++++------- scripts/ci/images/fedora-asan/Dockerfile | 13 +++++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/scripts/ci/cmake/ci-fedora-asan.cmake b/scripts/ci/cmake/ci-fedora-asan.cmake index bc80a0454c..acb8f27c66 100644 --- a/scripts/ci/cmake/ci-fedora-asan.cmake +++ b/scripts/ci/cmake/ci-fedora-asan.cmake @@ -1,20 +1,18 @@ # Client maintainer: chuck.atkins@kitware.com -set(ENV{CC} gcc) -set(ENV{CXX} g++) -set(ENV{FC} gfortran) -set(ASAN_FLAGS "-fsanitize=address -pthread") +set(ENV{CC} clang) +set(ENV{CXX} clang++) +set(ASAN_FLAGS "-fsanitize=address -fno-omit-frame-pointer -pthread") set(ENV{CFLAGS} "${ASAN_FLAGS}") set(ENV{CXXFLAGS} "${ASAN_FLAGS}") set(ENV{FFLAGS} "${ASAN_FLAGS}") set(dashboard_cache " +ADIOS2_USE_Fortran:STRING=OFF ADIOS2_USE_HDF5:STRING=ON ADIOS2_USE_MPI:STRING=OFF ADIOS2_USE_Python:STRING=OFF - -HDF5_C_COMPILER_EXECUTABLE:FILEPATH=/usr/bin/h5cc -HDF5_DIFF_EXECUTABLE:FILEPATH=/usr/bin/h5diff +ADIOS2_USE_ZFP:STRING=ON ") set(dashboard_track "Analysis") diff --git a/scripts/ci/images/fedora-asan/Dockerfile b/scripts/ci/images/fedora-asan/Dockerfile index 3d2e1a5c1b..e77f058d22 100644 --- a/scripts/ci/images/fedora-asan/Dockerfile +++ b/scripts/ci/images/fedora-asan/Dockerfile @@ -3,6 +3,19 @@ FROM ornladios/adios2:fedora-sanitizers-base # Install core dev packages RUN dnf -y install libasan python3-devel python3-numpy hdf5-devel +# Install ZFP +WORKDIR /opt/zfp +RUN curl -L https://github.com/LLNL/zfp/releases/download/0.5.5/zfp-0.5.5.tar.gz | tar -xvz && \ + mkdir build && \ + cd build && \ + cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/zfp/0.5.5 ../zfp-0.5.5 && \ + make -j$(grep -c '^processor' /proc/cpuinfo) install && \ + cd .. && \ + rm -rf zfp-0.5.5 build +ENV PATH=/opt/zfp/0.5.5/bin:${PATH} \ + LD_LIBRARY_PATH=/opt/zfp/0.5.5/lib64:${LD_LIBRARY_PATH} \ + CMAKE_PREFIX_PATH=/opt/zfp/0.5.5:${CMAKE_PREFIX_PATH} + # Misc cleanup RUN dnf clean all && \ rm -rfv /tmp/* /var/cache/dnf