Skip to content

Commit da87b50

Browse files
committed
libpressio version 0.56.1
Bug Fix + LibPressio now compiles again with non-parallel HDF5
1 parent a3a02d8 commit da87b50

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
2-
project(libpressio VERSION "0.56.0" LANGUAGES CXX C)
2+
project(libpressio VERSION "0.56.1" LANGUAGES CXX C)
33

44
#correct was to set a default build type
55
# https://blog.kitware.com/cmake-and-the-default-build-type/

COPYRIGHT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Copyright © 2021 , UChicago Argonne, LLC
22
All Rights Reserved
3-
[libpressio, Version 0.56.0]
3+
[libpressio, Version 0.56.1]
44
Robert Underwood
55
Argonne National Laboratory
66

src/plugins/io/hdf5.cc

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <H5public.h>
99
#include <std_compat/utility.h>
1010

11-
#if H5_HAVE_PARALLEL
11+
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
1212
#include <H5FDmpi.h>
1313
#endif
1414

@@ -159,7 +159,7 @@ struct hdf5_io: public libpressio_io_plugin {
159159
virtual struct pressio_data* read_impl(struct pressio_data* buffer) override {
160160
cleanup cleanup_facl;
161161
hid_t fapl_plist = H5P_DEFAULT;
162-
#if H5_HAVE_PARALLEL
162+
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
163163
if(use_parallel) {
164164
fapl_plist = H5Pcreate(H5P_FILE_ACCESS);
165165
MPI_Info info = MPI_INFO_NULL;
@@ -254,7 +254,7 @@ struct hdf5_io: public libpressio_io_plugin {
254254

255255
hid_t dxpl_plist = H5P_DEFAULT;
256256
cleanup dxpl_cleanup;
257-
#if H5_HAVE_PARALLEL
257+
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
258258
if(use_parallel) {
259259
hid_t dxpl_plist = H5Pcreate(H5P_DATASET_XFER);
260260
dxpl_cleanup = make_cleanup([&]{ H5Pclose(dxpl_plist);});
@@ -280,7 +280,7 @@ struct hdf5_io: public libpressio_io_plugin {
280280
int perms_ok = access(filename.c_str(), W_OK);
281281
cleanup cleanup_facl;
282282
hid_t fapl_plist = H5P_DEFAULT;
283-
#if H5_HAVE_PARALLEL
283+
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
284284
if(use_parallel) {
285285
fapl_plist = H5Pcreate(H5P_FILE_ACCESS);
286286
MPI_Info info = MPI_INFO_NULL;
@@ -378,7 +378,7 @@ struct hdf5_io: public libpressio_io_plugin {
378378

379379
hid_t dxpl_plist = H5P_DEFAULT;
380380
cleanup dxpl_cleanup;
381-
#if H5_HAVE_PARALLEL
381+
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
382382
if(use_parallel) {
383383
hid_t dxpl_plist = H5Pcreate(H5P_DATASET_XFER);
384384
dxpl_cleanup = make_cleanup([&]{ H5Pclose(dxpl_plist);});
@@ -400,7 +400,13 @@ struct hdf5_io: public libpressio_io_plugin {
400400
virtual struct pressio_options get_configuration_impl() const override{
401401
pressio_options options;
402402
set(options, "pressio:thread_safe", static_cast<int32_t>(pressio_thread_safety_single));
403-
set(options, "hdf5:parallel", static_cast<int32_t>(H5_HAVE_PARALLEL));
403+
set(options, "hdf5:parallel", static_cast<int32_t>(
404+
#ifdef H5_HAVE_PARALLEL
405+
H5_HAVE_PARALLEL
406+
#else
407+
0
408+
#endif
409+
));
404410
return options;
405411
}
406412

@@ -428,7 +434,7 @@ struct hdf5_io: public libpressio_io_plugin {
428434
auto file_extent_t = tmp.to_vector<uint64_t>();
429435
file_extent.assign(std::begin(file_extent_t), std::end(file_extent_t));
430436
}
431-
#if H5_HAVE_PARALLEL
437+
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
432438
get(options, "hdf5:use_parallel", &use_parallel);
433439
get(options, "hdf5:mpi_comm", (void**)(&comm));
434440
#endif
@@ -447,7 +453,7 @@ struct hdf5_io: public libpressio_io_plugin {
447453
set(opts, "hdf5:file_stride", to_uint64v(file_stride));
448454
set(opts, "hdf5:file_start", to_uint64v(file_stride));
449455
set(opts, "hdf5:file_extent", to_uint64v(file_extent));
450-
#if H5_HAVE_PARALLEL
456+
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
451457
set(opts, "hdf5:use_parallel", use_parallel);
452458
set(opts, "hdf5:mpi_comm", (void*)(comm));
453459
#endif
@@ -524,7 +530,7 @@ struct hdf5_io: public libpressio_io_plugin {
524530
std::string filename;
525531
std::string dataset_name;
526532
std::vector<hsize_t> file_block, file_start, file_count, file_stride, file_extent;
527-
#if H5_HAVE_PARALLEL
533+
#if defined(H5_HAVE_PARALLEL) && H5_HAVE_PARALLEL
528534
int use_parallel = false;
529535
MPI_Comm comm = MPI_COMM_WORLD;
530536
#endif

0 commit comments

Comments
 (0)