From f1d6c3ba52751d04fa149b56388b02dc0b78e262 Mon Sep 17 00:00:00 2001 From: heister Date: Wed, 29 Aug 2012 21:14:38 +0000 Subject: [PATCH] improve handling of HDF5 (patch from Eric Heien) git-svn-id: https://svn.dealii.org/trunk@26166 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 15 +++++++++++---- deal.II/configure | 11 +++++++++-- deal.II/source/base/data_out_base.cc | 12 ++++++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 9211f854bd..435f66c2f9 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -7125,7 +7125,12 @@ AC_ARG_WITH([hdf5], with_hdf5="no" elif test "$withval" = "yes"; then with_hdf5="yes" + warn_if_cannot_find_hdf5="yes" + elif test -z "$withval"; then + with_hdf5="yes" + H5CC="$withval" else + warn_if_cannot_find_hdf5="yes" with_hdf5="yes" H5CC="$withval" fi], @@ -7158,20 +7163,22 @@ if test "$with_hdf5" = "yes"; then AC_MSG_CHECKING([for HDF5 libraries]) if test ! -x "$H5CC"; then AC_MSG_RESULT([no]) - AC_MSG_WARN(m4_case(m4_normalize([$1]), - [serial], [ + if test "$warn_if_cannot_find_hdf5" = "yes"; then + AC_MSG_WARN(m4_case(m4_normalize([$1]), + [serial], [ Unable to locate serial HDF5 compilation helper script 'h5cc'. Please specify --with-hdf5= as the full path to h5cc. HDF5 support is being disabled (equivalent to --with-hdf5=no). -], [parallel],[ +], [parallel],[ Unable to locate parallel HDF5 compilation helper script 'h5pcc'. Please specify --with-hdf5= as the full path to h5pcc. HDF5 support is being disabled (equivalent to --with-hdf5=no). -], [ +], [ Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. Please specify --with-hdf5= as the full path to h5cc or h5pcc. HDF5 support is being disabled (equivalent to --with-hdf5=no). ])) + fi with_hdf5="no" else dnl h5cc provides both AM_ and non-AM_ options diff --git a/deal.II/configure b/deal.II/configure index a10253898c..389091d1a9 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 25932 . +# From configure.in Revision: 26149 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for deal.II 7.2.pre. # @@ -11816,7 +11816,12 @@ if test "${with_hdf5+set}" = set; then : with_hdf5="no" elif test "$withval" = "yes"; then with_hdf5="yes" + warn_if_cannot_find_hdf5="yes" + elif test -z "$withval"; then + with_hdf5="yes" + H5CC="$withval" else + warn_if_cannot_find_hdf5="yes" with_hdf5="yes" H5CC="$withval" fi @@ -11891,7 +11896,8 @@ $as_echo_n "checking for HDF5 libraries... " >&6; } if test ! -x "$H5CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + if test "$warn_if_cannot_find_hdf5" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. Please specify --with-hdf5= as the full path to h5cc or h5pcc. HDF5 support is being disabled (equivalent to --with-hdf5=no). @@ -11901,6 +11907,7 @@ Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. Please specify --with-hdf5= as the full path to h5cc or h5pcc. HDF5 support is being disabled (equivalent to --with-hdf5=no). " >&2;} + fi with_hdf5="no" else diff --git a/deal.II/source/base/data_out_base.cc b/deal.II/source/base/data_out_base.cc index aba9de9aeb..a2c8b1188b 100644 --- a/deal.II/source/base/data_out_base.cc +++ b/deal.II/source/base/data_out_base.cc @@ -5946,9 +5946,17 @@ void DataOutBase::write_hdf5_parallel (const std::vector > & AssertThrow(cell_dataspace >= 0, ExcIO()); // Create the dataset for the nodes and cells +#if H5Gcreate_vers == 1 + node_dataset = H5Dcreate(h5_file_id, "nodes", H5T_NATIVE_DOUBLE, node_dataspace, H5P_DEFAULT); +#else node_dataset = H5Dcreate(h5_file_id, "nodes", H5T_NATIVE_DOUBLE, node_dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); +#endif AssertThrow(node_dataset >= 0, ExcIO()); +#if H5Gcreate_vers == 1 + cell_dataset = H5Dcreate(h5_file_id, "cells", H5T_NATIVE_UINT, cell_dataspace, H5P_DEFAULT); +#else cell_dataset = H5Dcreate(h5_file_id, "cells", H5T_NATIVE_UINT, cell_dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); +#endif AssertThrow(cell_dataset >= 0, ExcIO()); // Close the node and cell dataspaces since we're done with them @@ -6056,7 +6064,11 @@ void DataOutBase::write_hdf5_parallel (const std::vector > & pt_data_dataspace = H5Screate_simple(2, node_ds_dim, NULL); AssertThrow(pt_data_dataspace >= 0, ExcIO()); +#if H5Gcreate_vers == 1 + pt_data_dataset = H5Dcreate(h5_file_id, vector_name.c_str(), H5T_NATIVE_DOUBLE, pt_data_dataspace, H5P_DEFAULT); +#else pt_data_dataset = H5Dcreate(h5_file_id, vector_name.c_str(), H5T_NATIVE_DOUBLE, pt_data_dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); +#endif AssertThrow(pt_data_dataset >= 0, ExcIO()); // Create the data subset we'll use to read from memory -- 2.39.5