[MOAB-dev] r5928 - in MOAB/trunk: src src/moab test

tautges at mcs.anl.gov tautges at mcs.anl.gov
Tue Dec 18 15:09:41 CST 2012


Author: tautges
Date: 2012-12-18 15:09:41 -0600 (Tue, 18 Dec 2012)
New Revision: 5928

Modified:
   MOAB/trunk/src/BitTag.cpp
   MOAB/trunk/src/BitTag.hpp
   MOAB/trunk/src/Core.cpp
   MOAB/trunk/src/DenseTag.cpp
   MOAB/trunk/src/DenseTag.hpp
   MOAB/trunk/src/MeshTag.cpp
   MOAB/trunk/src/MeshTag.hpp
   MOAB/trunk/src/SparseTag.cpp
   MOAB/trunk/src/SparseTag.hpp
   MOAB/trunk/src/TagInfo.hpp
   MOAB/trunk/src/VarLenDenseTag.cpp
   MOAB/trunk/src/VarLenDenseTag.hpp
   MOAB/trunk/src/VarLenSparseTag.cpp
   MOAB/trunk/src/VarLenSparseTag.hpp
   MOAB/trunk/src/moab/Core.hpp
   MOAB/trunk/src/moab/Interface.hpp
   MOAB/trunk/test/TagTest.cpp
Log:
Change to tag_iterate, to allow application to request that tag storage space not be allocated.

This commit also modifies interpretation of arguments to the Core::list_entities function, see
below for details.

Fixes tickets 271 and 268.

Passes all tests, serial and parallel.

TagTest.cpp: add a test for ticket #271, where apps could change the default value of a tag
  (that bug is also fixed in this commit)
Most tag classes, plus Core and Interface: add an allocate parameter to tag_iterate, allowing applications to request that tag
  memory not be allocated as a result of calling this function.
SparseTag: fix the bug exposing tag default value, along with allocation change above
Core: modified meaning of arguments to Core::list_entities(EntityHandle*entities, int num_entities); if entities == NULL, then
  num_entities < 0 : list the whole database
               == 0: list the number of entities of each type
               > 0 : list all entities of type == (EntityType)num_entities
  This makes debugging significantly easier, since you don't need to assemble an entity range
  or vector to print e.g. all entity sets



Modified: MOAB/trunk/src/BitTag.cpp
===================================================================
--- MOAB/trunk/src/BitTag.cpp	2012-12-18 19:23:22 UTC (rev 5927)
+++ MOAB/trunk/src/BitTag.cpp	2012-12-18 21:09:41 UTC (rev 5928)
@@ -332,7 +332,8 @@
                                Error* error,
                                Range::iterator&,
                                const Range::iterator&,
-                               void*& )
+                               void*&,
+                               bool )
   { return report_unsupported(error); }
 
 template <class Container> inline 

Modified: MOAB/trunk/src/BitTag.hpp
===================================================================
--- MOAB/trunk/src/BitTag.hpp	2012-12-18 19:23:22 UTC (rev 5927)
+++ MOAB/trunk/src/BitTag.hpp	2012-12-18 21:09:41 UTC (rev 5928)
@@ -292,7 +292,8 @@
                          Error* error_handler, 
                          Range::iterator& iter,
                          const Range::iterator& end,
-                         void*& data_ptr );
+                         void*& data_ptr,
+                         bool allocate = true);
 
   /**\brief Get all tagged entities
    *

Modified: MOAB/trunk/src/Core.cpp
===================================================================
--- MOAB/trunk/src/Core.cpp	2012-12-18 19:23:22 UTC (rev 5927)
+++ MOAB/trunk/src/Core.cpp	2012-12-18 21:09:41 UTC (rev 5928)
@@ -2483,11 +2483,13 @@
                              Range::const_iterator iter,
                              Range::const_iterator end,
                              int& count,
-                             void*& data_ptr )
+                             void*& data_ptr,
+                             bool allocate)
 {
   Range::const_iterator init = iter;
   assert(valid_tag_handle( tag_handle ));
-  ErrorCode result = tag_handle->tag_iterate( sequenceManager, mError, iter, end, data_ptr );
+  ErrorCode result = tag_handle->tag_iterate( sequenceManager, mError, iter, end, data_ptr, 
+                                              allocate);
   if (MB_SUCCESS == result)
     count = iter - init;
   return result;
@@ -2887,7 +2889,7 @@


More information about the moab-dev mailing list