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

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue Mar 29 13:49:01 CDT 2011


Author: kraftche
Date: 2011-03-29 13:49:00 -0500 (Tue, 29 Mar 2011)
New Revision: 4683

Modified:
   MOAB/trunk/src/io/ReadHDF5.cpp
   MOAB/trunk/src/io/ReadHDF5.hpp
Log:
work around unnecessary indepenent IO when reading sets from .h5m file in parallel due to data conversion

Modified: MOAB/trunk/src/io/ReadHDF5.cpp
===================================================================
--- MOAB/trunk/src/io/ReadHDF5.cpp	2011-03-29 18:48:09 UTC (rev 4682)
+++ MOAB/trunk/src/io/ReadHDF5.cpp	2011-03-29 18:49:00 UTC (rev 4683)
@@ -783,11 +783,12 @@
   
   dbgOut.tprint( 1, "GATHERING ADDITIONAL ENTITIES\n" );
   
+  enum RecusiveSetMode { RSM_NONE, RSM_SETS, RSM_CONTENTS };
   const char* const set_opts[] = { "NONE", "SETS", "CONTENTS" };
   int child_mode;
   rval = opts.match_option( "CHILDREN", set_opts, child_mode );
   if (MB_ENTITY_NOT_FOUND == rval)
-    child_mode = 2;
+    child_mode = RSM_CONTENTS;
   else if (MB_SUCCESS != rval) {
     readUtil->report_error( "Invalid value for 'CHILDREN' option" );
     return error(rval);
@@ -795,7 +796,7 @@
   int content_mode;
   rval = opts.match_option( "SETS", set_opts, content_mode );
   if (MB_ENTITY_NOT_FOUND == rval)
-    content_mode = 2;
+    content_mode = RSM_CONTENTS;
   else if (MB_SUCCESS != rval) {
     readUtil->report_error( "Invalid value for 'SETS' option" );
     return error(rval);
@@ -806,9 +807,9 @@
     // of the sets.)
   Range sets;
   intersect( fileInfo->sets, file_ids, sets );
-  if (content_mode == 2 || child_mode == 2) {
+  if (content_mode == RSM_CONTENTS || child_mode == RSM_CONTENTS) {
     dbgOut.tprint( 1, "  doing read_set_ids_recursive\n" );
-    rval = read_set_ids_recursive( sets, content_mode == 2, child_mode == 2 );
+    rval = read_set_ids_recursive( sets, content_mode == RSM_CONTENTS, child_mode == RSM_CONTENTS );
     if (MB_SUCCESS != rval)
       return error(rval);
   }
@@ -914,6 +915,7 @@
   dbgOut.tprint( 1, "READING ELEMENTS\n" );
  
     // decide if we need to read additional elements
+  enum SideMode { SM_EXPLICIT, SM_NODES, SM_SIDES };
   int side_mode;
   const char* const options[] = { "EXPLICIT", "NODES", "SIDES", 0 };
   rval = opts.match_option( "ELEMENTS", options, side_mode );
@@ -921,16 +923,16 @@
       // If only nodes were specified, then default to "NODES", otherwise
       // default to "SIDES".
     if (0 == max_dim)


More information about the moab-dev mailing list