Skip to content

Commit

Permalink
libpressio version 0.56.1
Browse files Browse the repository at this point in the history
Bug Fix

+ LibPressio now compiles again with non-parallel HDF5
  • Loading branch information
robertu94 committed Jan 20, 2021
1 parent a3a02d8 commit da87b50
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(libpressio VERSION "0.56.0" LANGUAGES CXX C)
project(libpressio VERSION "0.56.1" LANGUAGES CXX C)

#correct was to set a default build type
# https://blog.kitware.com/cmake-and-the-default-build-type/
Expand Down
2 changes: 1 addition & 1 deletion COPYRIGHT.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Copyright © 2021 , UChicago Argonne, LLC
All Rights Reserved
[libpressio, Version 0.56.0]
[libpressio, Version 0.56.1]
Robert Underwood
Argonne National Laboratory

Expand Down
24 changes: 15 additions & 9 deletions src/plugins/io/hdf5.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <H5public.h>
#include <std_compat/utility.h>

#if H5_HAVE_PARALLEL
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
#include <H5FDmpi.h>
#endif

Expand Down Expand Up @@ -159,7 +159,7 @@ struct hdf5_io: public libpressio_io_plugin {
virtual struct pressio_data* read_impl(struct pressio_data* buffer) override {
cleanup cleanup_facl;
hid_t fapl_plist = H5P_DEFAULT;
#if H5_HAVE_PARALLEL
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
if(use_parallel) {
fapl_plist = H5Pcreate(H5P_FILE_ACCESS);
MPI_Info info = MPI_INFO_NULL;
Expand Down Expand Up @@ -254,7 +254,7 @@ struct hdf5_io: public libpressio_io_plugin {

hid_t dxpl_plist = H5P_DEFAULT;
cleanup dxpl_cleanup;
#if H5_HAVE_PARALLEL
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
if(use_parallel) {
hid_t dxpl_plist = H5Pcreate(H5P_DATASET_XFER);
dxpl_cleanup = make_cleanup([&]{ H5Pclose(dxpl_plist);});
Expand All @@ -280,7 +280,7 @@ struct hdf5_io: public libpressio_io_plugin {
int perms_ok = access(filename.c_str(), W_OK);
cleanup cleanup_facl;
hid_t fapl_plist = H5P_DEFAULT;
#if H5_HAVE_PARALLEL
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
if(use_parallel) {
fapl_plist = H5Pcreate(H5P_FILE_ACCESS);
MPI_Info info = MPI_INFO_NULL;
Expand Down Expand Up @@ -378,7 +378,7 @@ struct hdf5_io: public libpressio_io_plugin {

hid_t dxpl_plist = H5P_DEFAULT;
cleanup dxpl_cleanup;
#if H5_HAVE_PARALLEL
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
if(use_parallel) {
hid_t dxpl_plist = H5Pcreate(H5P_DATASET_XFER);
dxpl_cleanup = make_cleanup([&]{ H5Pclose(dxpl_plist);});
Expand All @@ -400,7 +400,13 @@ struct hdf5_io: public libpressio_io_plugin {
virtual struct pressio_options get_configuration_impl() const override{
pressio_options options;
set(options, "pressio:thread_safe", static_cast<int32_t>(pressio_thread_safety_single));
set(options, "hdf5:parallel", static_cast<int32_t>(H5_HAVE_PARALLEL));
set(options, "hdf5:parallel", static_cast<int32_t>(
#ifdef H5_HAVE_PARALLEL
H5_HAVE_PARALLEL
#else
0
#endif
));
return options;
}

Expand Down Expand Up @@ -428,7 +434,7 @@ struct hdf5_io: public libpressio_io_plugin {
auto file_extent_t = tmp.to_vector<uint64_t>();
file_extent.assign(std::begin(file_extent_t), std::end(file_extent_t));
}
#if H5_HAVE_PARALLEL
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
get(options, "hdf5:use_parallel", &use_parallel);
get(options, "hdf5:mpi_comm", (void**)(&comm));
#endif
Expand All @@ -447,7 +453,7 @@ struct hdf5_io: public libpressio_io_plugin {
set(opts, "hdf5:file_stride", to_uint64v(file_stride));
set(opts, "hdf5:file_start", to_uint64v(file_stride));
set(opts, "hdf5:file_extent", to_uint64v(file_extent));
#if H5_HAVE_PARALLEL
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
set(opts, "hdf5:use_parallel", use_parallel);
set(opts, "hdf5:mpi_comm", (void*)(comm));
#endif
Expand Down Expand Up @@ -524,7 +530,7 @@ struct hdf5_io: public libpressio_io_plugin {
std::string filename;
std::string dataset_name;
std::vector<hsize_t> file_block, file_start, file_count, file_stride, file_extent;
#if H5_HAVE_PARALLEL
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
int use_parallel = false;
MPI_Comm comm = MPI_COMM_WORLD;
#endif
Expand Down

0 comments on commit da87b50

Please sign in to comment.