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

tautges at mcs.anl.gov tautges at mcs.anl.gov
Tue Aug 28 12:50:43 CDT 2012


Author: tautges
Date: 2012-08-28 12:50:43 -0500 (Tue, 28 Aug 2012)
New Revision: 5709

Modified:
   MOAB/trunk/src/io/ReadDamsel.cpp
   MOAB/trunk/src/io/ReadHDF5.cpp
   MOAB/trunk/src/io/ReadNC.cpp
   MOAB/trunk/src/io/WriteDamsel.cpp
Log:
Fixing a few bugs preventing tests from running.
Damsel: test for -1 returned for tag/entity count (bug reported to damsel library
team on trying to read non-hdf5 file)
HDF5: for certain cases, make sure to reset the error handling function in HDF5
NC: inserted missing call to file close (openmpi barfs when trying to MPI_Finalize with open files)



Modified: MOAB/trunk/src/io/ReadDamsel.cpp
===================================================================
--- MOAB/trunk/src/io/ReadDamsel.cpp	2012-08-27 22:13:48 UTC (rev 5708)
+++ MOAB/trunk/src/io/ReadDamsel.cpp	2012-08-28 17:50:43 UTC (rev 5709)
@@ -33,16 +33,19 @@
 
 ReadDamsel::~ReadDamsel()
 {
-  if (!readMeshIface) // init() failed.
-    return;
-
-  mbImpl->release_interface(readMeshIface);
+  if (readMeshIface) mbImpl->release_interface(readMeshIface);
+  if (mError) mbImpl->release_interface(mError);
   DMSLlib_finalize(dU.dmslLib);
 }
 
 ErrorCode ReadDamsel::init()
 {
   mbImpl->query_interface(readMeshIface);
+  assert(readMeshIface);
+
+  mbImpl->query_interface(mError);
+  assert(mError);
+  
   return MB_SUCCESS;
 }
 
@@ -109,6 +112,8 @@
   num_ent_infos = DMSLmodel_get_entity_count(dU.dmslModel);
   int num_coll_infos = DMSLmodel_get_collection_count(dU.dmslModel);
   CHK_DMSL_ERR(err, "DMSLmodel_get_collection_count failed.");
+  if (-1 == num_containers || -1 == num_tag_infos || -1 == num_ent_infos) 
+    CHK_MB_ERR(MB_FAILURE, "Bad count for containers/tags/ents.");
 
   std::vector<damsel_entity_buf_type> ent_infos(num_ent_infos);
   std::vector<damsel_collection_buf_type> coll_infos(num_coll_infos);

Modified: MOAB/trunk/src/io/ReadHDF5.cpp
===================================================================
--- MOAB/trunk/src/io/ReadHDF5.cpp	2012-08-27 22:13:48 UTC (rev 5708)
+++ MOAB/trunk/src/io/ReadHDF5.cpp	2012-08-28 17:50:43 UTC (rev 5709)
@@ -367,6 +367,7 @@
 #ifndef HDF5_PARALLEL
     readUtil->report_error("MOAB not configured with parallel HDF5 support");
     free(dataBuffer);
+    dataBuffer = NULL;
     return MB_NOT_IMPLEMENTED;
 #else
 
@@ -427,7 +428,7 @@


More information about the moab-dev mailing list