[MOAB-dev] r4390 - MOAB/trunk/src/io

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Mon Dec 20 15:30:59 CST 2010


Author: kraftche
Date: 2010-12-20 15:30:58 -0600 (Mon, 20 Dec 2010)
New Revision: 4390

Modified:
   MOAB/trunk/src/io/ReadHDF5.cpp
Log:
fix bug where HDF5 reader specifies incorrect size for value of fixed-length tag on mesh (doesn't affect any existing code because MOAB ignores size argument for fixed-length tags)

Modified: MOAB/trunk/src/io/ReadHDF5.cpp
===================================================================
--- MOAB/trunk/src/io/ReadHDF5.cpp	2010-12-20 19:35:44 UTC (rev 4389)
+++ MOAB/trunk/src/io/ReadHDF5.cpp	2010-12-20 21:30:58 UTC (rev 4390)
@@ -2942,8 +2942,13 @@
   }
     
   if (info.global_value) {
-    int type_size = hdf_type ? H5Tget_size(hdf_type) : 1;
-    int tag_size = info.global_value_size * type_size;
+    int tag_size;
+    if (!hdf_type) // opaque
+      tag_size = info.global_value_size; 
+    else if (info.size > 0)  // fixed-length tag
+      tag_size = H5Tget_size(hdf_type);
+    else // variable-length
+      tag_size = info.global_value_size * H5Tget_size(hdf_type); 
     rval = iFace->tag_set_data( handle, 0, 0, &info.global_value, &tag_size );
     if (MB_SUCCESS != rval) {
       if (hdf_type) H5Tclose( hdf_type );

































More information about the moab-dev mailing list