Skip to content

Commit

Permalink
Merge pull request #2517 from eisenhauer/MGardFix
Browse files Browse the repository at this point in the history
update mgard due to its API change
  • Loading branch information
eisenhauer authored Nov 17, 2020
2 parents addcb47 + 85ba8c7 commit a205a33
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cmake/FindMGARD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ if(NOT MGARD_FOUND)
)
endif()

find_path(MGARD_INCLUDE_DIR mgard.h ${MGARD_INCLUDE_OPTS})
find_path(MGARD_INCLUDE_DIR mgard_api.h ${MGARD_INCLUDE_OPTS})
find_library(MGARD_LIBRARY NAMES mgard ${MGARD_LIBRARY_OPTS})
find_library(ZLIB_LIBRARY NAMES zlib z ${ZLIB_LIBRARY_OPTS})
find_library(BLOSC_LIBRARY NAMES blosc ${BLOSC_LIBRARY_OPTS})
find_library(ZSTD_LIBRARY NAMES zstd ${ZSTD_LIBRARY_OPTS})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MGARD
FOUND_VAR MGARD_FOUND
REQUIRED_VARS MGARD_LIBRARY ZLIB_LIBRARY BLOSC_LIBRARY MGARD_INCLUDE_DIR
REQUIRED_VARS MGARD_LIBRARY ZLIB_LIBRARY ZSTD_LIBRARY MGARD_INCLUDE_DIR
)
if(MGARD_FOUND)
set(MGARD_INCLUDE_DIRS ${MGARD_INCLUDE_DIR})
set(MGARD_LIBRARIES ${MGARD_LIBRARY} ${ZLIB_LIBRARY} ${BLOSC_LIBRARY})
set(MGARD_LIBRARIES ${MGARD_LIBRARY} ${ZLIB_LIBRARY} ${ZSTD_LIBRARY})
if(MGARD_FOUND AND NOT TARGET MGARD::MGARD)
add_library(MGARD::MGARD UNKNOWN IMPORTED)
set_target_properties(MGARD::MGARD PROPERTIES
Expand Down
5 changes: 2 additions & 3 deletions source/adios2/operator/compress/CompressMGARD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ size_t CompressMGARD::Compress(const void *dataIn, const Dims &dimensions,

int sizeOut = 0;
unsigned char *dataOutPtr = mgard_compress(
mgardType, const_cast<double *>(static_cast<const double *>(dataIn)),
sizeOut, r[0], r[1], r[2], tolerance, s);
const_cast<double *>(static_cast<const double *>(dataIn)), sizeOut,
r[0], r[1], r[2], tolerance, s);

const size_t sizeOutT = static_cast<size_t>(sizeOut);
std::memcpy(bufferOut, dataOutPtr, sizeOutT);
Expand Down Expand Up @@ -135,7 +135,6 @@ size_t CompressMGARD::Decompress(const void *bufferIn, const size_t sizeIn,
}

void *dataPtr = mgard_decompress(
mgardType, quantizer,
reinterpret_cast<unsigned char *>(const_cast<void *>(bufferIn)),
static_cast<int>(sizeIn), r[0], r[1], r[2], 0.0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <cstdint>
#include <cstring>

#include <algorithm>
#include <iostream> //std::cout
#include <numeric> //std::iota
#include <stdexcept>
Expand Down

0 comments on commit a205a33

Please sign in to comment.