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

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Thu Apr 21 08:41:05 CDT 2011


Author: kraftche
Date: 2011-04-21 08:41:05 -0500 (Thu, 21 Apr 2011)
New Revision: 4762

Modified:
   MOAB/trunk/src/io/ReadHDF5.cpp
Log:
fix bug where .h5m reader failed to read values for the same variable-length tag from multiple files

Modified: MOAB/trunk/src/io/ReadHDF5.cpp
===================================================================
--- MOAB/trunk/src/io/ReadHDF5.cpp	2011-04-21 13:35:11 UTC (rev 4761)
+++ MOAB/trunk/src/io/ReadHDF5.cpp	2011-04-21 13:41:05 UTC (rev 4762)
@@ -3105,9 +3105,28 @@
       return error(rval);
     }
     
-    if ((curr_store != MB_TAG_BIT && curr_size != info.bytes) || curr_type != mb_type ||
-        ((curr_store == MB_TAG_BIT || storage == MB_TAG_BIT) && 
-          curr_store != storage))
+    bool match = true;
+    if (curr_type == MB_TYPE_BIT) {
+      if (mb_type != MB_TYPE_BIT)
+        match = false;
+      if (curr_size != info.size)
+        match = false;
+    }
+    else {
+      if (curr_type != MB_TYPE_OPAQUE &&
+          mb_type != MB_TYPE_OPAQUE &&
+          curr_type != mb_type)
+        match = false;
+      
+      if (curr_size == MB_VARIABLE_LENGTH) {
+        if (info.size != -1)
+          match = false;
+      }
+      else if (curr_size != info.bytes)
+        match = false;
+    }  
+    
+    if (!match)
     {
       readUtil->report_error( "Tag type in file does not match type in "
                               "database for \"%s\"\n", info.name );

















More information about the moab-dev mailing list