[MOAB-dev] r4635 - in MOAB/trunk: src/io src/io/mhdf/src src/parallel test/parallel
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Wed Mar 23 18:28:01 CDT 2011
Author: kraftche
Date: 2011-03-23 18:28:01 -0500 (Wed, 23 Mar 2011)
New Revision: 4635
Modified:
MOAB/trunk/src/io/ReadHDF5Dataset.cpp
MOAB/trunk/src/io/mhdf/src/util.c
MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
MOAB/trunk/test/parallel/mhdf_parallel.c
Log:
fix parallel I/O with HDF5 1.6.x
Modified: MOAB/trunk/src/io/ReadHDF5Dataset.cpp
===================================================================
--- MOAB/trunk/src/io/ReadHDF5Dataset.cpp 2011-03-23 19:47:28 UTC (rev 4634)
+++ MOAB/trunk/src/io/ReadHDF5Dataset.cpp 2011-03-23 23:28:01 UTC (rev 4635)
@@ -289,12 +289,15 @@
throw Exception(__LINE__);
#if HDF5_16API
- hid_t mem_id = H5Screate(H5S_SIMPLE);
+ hsize_t one = 1;
+ hid_t mem_id = H5Screate_simple( 1, &one, NULL );
if (mem_id < 0)
throw Exception(__LINE__);
err = H5Sselect_none( mem_id );
- if (err < 0)
+ if (err < 0) {
+ H5Sclose(mem_id);
throw Exception(__LINE__);
+ }
#else
hid_t mem_id = H5Screate(H5S_NULL);
if (mem_id < 0)
@@ -302,10 +305,9 @@
#endif
err = H5Dread( dataSet, fileType, mem_id, dataSpace, ioProp, 0 );
+ H5Sclose( mem_id );
if (err < 0)
throw Exception(__LINE__);
-
- H5Sclose( mem_id );
}
} // namespace moab
Modified: MOAB/trunk/src/io/mhdf/src/util.c
===================================================================
--- MOAB/trunk/src/io/mhdf/src/util.c 2011-03-23 19:47:28 UTC (rev 4634)
+++ MOAB/trunk/src/io/mhdf/src/util.c 2011-03-23 23:28:01 UTC (rev 4635)
@@ -307,6 +307,9 @@
hsize_t offsets[2], counts[2] = {1,1};
herr_t rval;
int dims;
+#if (1000 * H5_VERS_MAJOR + H5_VERS_MINOR) < 1008
+ const hsize_t one = 1;
+#endif
if (offset < 0 || count < 0)
{
@@ -370,7 +373,7 @@
#if H5_VERS_MAJOR > 1 || H5_VERS_MINOR >= 8
More information about the moab-dev
mailing list