[MOAB-dev] r4532 - in MOAB/trunk/src: . io moab parallel

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Mon Feb 28 13:36:32 CST 2011


Author: kraftche
Date: 2011-02-28 13:36:32 -0600 (Mon, 28 Feb 2011)
New Revision: 4532

Modified:
   MOAB/trunk/src/WriteUtil.cpp
   MOAB/trunk/src/WriteUtil.hpp
   MOAB/trunk/src/io/WriteHDF5.cpp
   MOAB/trunk/src/io/WriteHDF5.hpp
   MOAB/trunk/src/moab/WriteUtilIface.hpp
   MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
Log:
use collective IO for parallel write of non-shared entity sets to .h5m file

Modified: MOAB/trunk/src/WriteUtil.cpp
===================================================================
--- MOAB/trunk/src/WriteUtil.cpp	2011-02-25 17:37:32 UTC (rev 4531)
+++ MOAB/trunk/src/WriteUtil.cpp	2011-02-28 19:36:32 UTC (rev 4532)
@@ -26,6 +26,7 @@
 #include "AEntityFactory.hpp"
 #include "MBTagConventions.hpp"
 #include "RangeSeqIntersectIter.hpp"
+#include "MeshSetSequence.hpp"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -851,4 +852,68 @@
   return MB_SUCCESS;  
 }
 
+ErrorCode WriteUtil::get_entity_list_pointers( Range::const_iterator begin,
+                                               Range::const_iterator end,
+                                               EntityHandle const* * pointers,
+                                               EntityListType relation,
+                                               int* lengths,
+                                               unsigned char* flags )
+{
+  RangeSeqIntersectIter iter(mMB->sequence_manager());
+  ErrorCode rval = iter.init( begin, end );
+  while (MB_SUCCESS == rval) {
+  
+    EntityType type = TYPE_FROM_HANDLE( iter.get_start_handle() );
+    
+    if (MBENTITYSET == type) {
+      const MeshSetSequence* seq = reinterpret_cast<MeshSetSequence*>(iter.get_sequence());
+      const MeshSet* set;
+      int len; size_t clen;
+      for (EntityHandle h = iter.get_start_handle(); h <= iter.get_end_handle(); ++h) {
+        set = seq->get_set(h);
+        switch (relation) {
+          case CONTENTS: *pointers = set->get_contents( clen ); len = clen; break;
+          case CHILDREN: *pointers = set->get_children( len ); break;
+          case PARENTS:  *pointers = set->get_parents( len ); break;
+        }
+        if (lengths) {
+          *lengths = len;
+          ++lengths;
+        }
+        if (flags) {
+          *flags = set->flags();
+          ++flags;
+        }
+        ++pointers;
+      }
+    }


More information about the moab-dev mailing list