[MOAB-dev] r3916 - in MOAB/trunk/src: io parallel

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue May 18 17:14:32 CDT 2010


Author: kraftche
Date: 2010-05-18 17:14:32 -0500 (Tue, 18 May 2010)
New Revision: 3916

Modified:
   MOAB/trunk/src/io/WriteHDF5.cpp
   MOAB/trunk/src/io/WriteHDF5.hpp
   MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
Log:
Do not cache ranges of tagged entities

Caching ranges of tagged entities could require large
amounts of memory, particularly for a parallel write 
where the handles of the entities to be written could
be very fragmented.


Modified: MOAB/trunk/src/io/WriteHDF5.cpp
===================================================================
--- MOAB/trunk/src/io/WriteHDF5.cpp	2010-05-18 22:01:38 UTC (rev 3915)
+++ MOAB/trunk/src/io/WriteHDF5.cpp	2010-05-18 22:14:32 UTC (rev 3916)
@@ -1755,6 +1755,7 @@
 */
 
 ErrorCode WriteHDF5::write_sparse_ids( const SparseTag& tag_data,
+                                       const Range& range,
                                        hid_t id_table,
                                        size_t table_size,
                                        const char* name )
@@ -1771,15 +1772,14 @@
   id_t* id_buffer = (id_t*)dataBuffer;
   
     // Write IDs of tagged entities.
-  Range range;
-  long remaining = tag_data.range.size();
+  long remaining = range.size();
   long offset = tag_data.offset;
   long num_writes = (remaining + chunk_size - 1)/chunk_size;
   if (tag_data.max_num_ents) {
     assert(tag_data.max_num_ents >= (unsigned long)remaining);
     num_writes = (tag_data.max_num_ents + chunk_size - 1)/chunk_size;
   }
-  Range::const_iterator iter = tag_data.range.begin();
+  Range::const_iterator iter = range.begin();
   while (remaining)
   {
     VALGRIND_MAKE_MEM_UNDEFINED( dataBuffer, bufferSize );
@@ -1789,10 +1789,10 @@
     remaining -= count;
     Range::const_iterator stop = iter;
     stop += count;
-    range.clear();
-    range.merge( iter, stop );
+    Range tmp;;
+    tmp.merge( iter, stop );
     iter = stop;
-    assert(range.size() == (unsigned)count);
+    assert(tmp.size() == (unsigned)count);
     
     rval = range_to_id_list( range, id_buffer );
     CHK_MB_ERR_0( rval );
@@ -1863,6 +1863,10 @@
     }
   }
   
+    // get entities for which to write tag values
+  Range range;
+  rval = get_sparse_tagged_entities( tag_data, range );


More information about the moab-dev mailing list