[MOAB-dev] r2013 - in MOAB/trunk: parallel tools/iMesh tools/mbcoupler tools/mbzoltan

tautges at mcs.anl.gov tautges at mcs.anl.gov
Tue Jul 15 12:27:56 CDT 2008


Author: tautges
Date: 2008-07-15 12:27:56 -0500 (Tue, 15 Jul 2008)
New Revision: 2013

Modified:
   MOAB/trunk/parallel/Makefile.am
   MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp
   MOAB/trunk/tools/mbcoupler/MBCoupler.cpp
   MOAB/trunk/tools/mbcoupler/MBCoupler.hpp
   MOAB/trunk/tools/mbcoupler/addfield.cpp
   MOAB/trunk/tools/mbzoltan/MBZoltan.cpp
Log:
MBZoltan: turning off debug output.

mbcoupler: adding ability to increase # elements per leaf node in tree
in cases where tree construction fails; will do this 3 times before
failing.

iMesh: changing some error returns from MOAB- to iBase-type.

parallel: putting some of the .h files in the install list, since
they're referenced by other installed headers.



Modified: MOAB/trunk/parallel/Makefile.am
===================================================================
--- MOAB/trunk/parallel/Makefile.am	2008-07-15 14:21:13 UTC (rev 2012)
+++ MOAB/trunk/parallel/Makefile.am	2008-07-15 17:27:56 UTC (rev 2013)
@@ -26,16 +26,17 @@
      MBProcConfig.cpp \
      MBParallelData.cpp \
      ReadParallel.cpp \
-     crystal.c crystal.h errmem.h errmem.c \
+     crystal.c errmem.c \
      transfer.c gs.c gs.h tuple_list.c \
-     tuple_list.h types.h \
+     tuple_list.h \
      sort.c sort.h
 
   MOAB_PARALLEL_HDRS += \
      MBParallelComm.hpp \
      MBProcConfig.hpp \
      MBParallelData.hpp \
-     ReadParallel.hpp 
+     ReadParallel.hpp \
+     crystal.h errmem.h types.h
 
 if PARALLEL_HDF5
 #  libMOABpar_la_LIBADD = $(top_builddir)/mhdf/libmhdf.la

Modified: MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp
===================================================================
--- MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp	2008-07-15 14:21:13 UTC (rev 2012)
+++ MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp	2008-07-15 17:27:56 UTC (rev 2013)
@@ -1123,10 +1123,10 @@
                            int *num_sets, int *err) 
   {
     if (num_hops > 1) {
-      iMesh_processError(iBase_ERROR_MAP[iBase_NOT_SUPPORTED], 
+      iMesh_processError(iBase_NOT_SUPPORTED, 
                          "iMesh_getNumEntSets: not currently implemented for num_hops > 1.");
       *num_sets = 0;
-      RETURN(iBase_ERROR_MAP[iBase_NOT_SUPPORTED]);
+      RETURN(iBase_NOT_SUPPORTED);
     }
     
     MBErrorCode result = MBI->get_number_entities_by_type
@@ -1545,19 +1545,19 @@
       lower_ents = CONST_HANDLE_ARRAY_PTR(lower_order_entity_handles);
         // check that we have the right number of lower order entity handles
       if (lower_order_entity_handles_size % MBCN::VerticesPerEntity(this_type) != 0) {
-        iMesh_processError(iBase_ERROR_MAP[iBase_INVALID_ENTITY_COUNT], "iMesh_createEntArr: wrong # vertices for this entity type.");
-        RETURN(iBase_ERROR_MAP[iBase_INVALID_ENTITY_COUNT]);
+        iMesh_processError(iBase_INVALID_ENTITY_COUNT, "iMesh_createEntArr: wrong # vertices for this entity type.");
+        RETURN(iBase_INVALID_ENTITY_COUNT);
       }
     }
     else {
-      iMesh_processError(iBase_ERROR_MAP[iBase_INVALID_ARGUMENT], "iMesh_createEntArr: can't create vertices with this function, use createVtxArr instead.");
-      RETURN(iBase_ERROR_MAP[iBase_INVALID_ARGUMENT]);
+      iMesh_processError(iBase_INVALID_ARGUMENT, "iMesh_createEntArr: can't create vertices with this function, use createVtxArr instead.");
+      RETURN(iBase_INVALID_ARGUMENT);
     }
   
     if (num_ents == 0) {
       iMesh_processError(iBase_INVALID_ENTITY_COUNT, 
                          "iMesh_createEntArr: called to create 0 entities.");
-      RETURN(iBase_ERROR_MAP[iBase_INVALID_ENTITY_COUNT]);
+      RETURN(iBase_INVALID_ENTITY_COUNT);
     }
 
       // if there aren't any elements in the array, allocate it
@@ -2617,9 +2617,9 @@
              && entity_type <= iBase_ALL_TYPES)
       use_type = true;
     else {
-      iMesh_processError(iBase_ERROR_MAP[iBase_BAD_TYPE_AND_TOPO], 
+      iMesh_processError(iBase_BAD_TYPE_AND_TOPO, 
                          "iMesh_getEntities:ERROR not valid entity type or topology");
-      RETURN(iBase_ERROR_MAP[iBase_BAD_TYPE_AND_TOPO]);
+      RETURN(iBase_BAD_TYPE_AND_TOPO);
     }
 
     MBEntityHandle handle = ENTITY_HANDLE(entity_set_handle);
@@ -2804,9 +2804,9 @@
              && entity_type <= iBase_ALL_TYPES)
       use_type = true;
     else {
-      iMesh_processError(iBase_ERROR_MAP[iBase_BAD_TYPE_AND_TOPO], 
+      iMesh_processError(iBase_BAD_TYPE_AND_TOPO, 
                          "iMesh_getEntities:ERROR not valid entity type or topology");
-      RETURN(iBase_ERROR_MAP[iBase_BAD_TYPE_AND_TOPO]);
+      RETURN(iBase_BAD_TYPE_AND_TOPO);
     }
 
     MBEntityHandle handle = ENTITY_HANDLE(entity_set_handle);

Modified: MOAB/trunk/tools/mbcoupler/MBCoupler.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/MBCoupler.cpp	2008-07-15 14:21:13 UTC (rev 2012)
+++ MOAB/trunk/tools/mbcoupler/MBCoupler.cpp	2008-07-15 17:27:56 UTC (rev 2013)
@@ -23,7 +23,7 @@
                      MBRange &local_elems,
                      int coupler_id,
                      bool init_tree)
-    : mbImpl(impl), myPc(pc), myId(coupler_id)
+    : mbImpl(impl), myPc(pc), myId(coupler_id), numIts(3)
 {
   assert(NULL != impl && NULL != myPc);
 
@@ -63,11 +63,22 @@
   }
 
     // build the tree for local processor
-  myTree = new MBAdaptiveKDTree(mbImpl);
-  result = myTree->build_tree(local_ents, localRoot, &settings);
-  if (MB_SUCCESS != result) {
-    std::cout << "Problems building tree" << std::endl;
-    return result;
+  for (int i = 0; i < numIts; i++) {
+    myTree = new MBAdaptiveKDTree(mbImpl);
+    result = myTree->build_tree(local_ents, localRoot, &settings);
+    if (MB_SUCCESS != result) {
+      std::cout << "Problems building tree";
+      if (numIts != i) {
+        delete myTree;
+        settings.maxEntPerLeaf *= 2;
+        std::cout << "; increasing elements/leaf to " 
+                  << settings.maxEntPerLeaf << std::endl;;
+      }
+      else {
+        std::cout << "; exiting" << std::endl;
+        return result;
+      }
+    }
   }
 
     // get the bounding box for local tree

Modified: MOAB/trunk/tools/mbcoupler/MBCoupler.hpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/MBCoupler.hpp	2008-07-15 14:21:13 UTC (rev 2012)
+++ MOAB/trunk/tools/mbcoupler/MBCoupler.hpp	2008-07-15 17:27:56 UTC (rev 2013)
@@ -208,6 +208,10 @@
      */
   std::vector<unsigned int> localMappedPts;
 
+    /* \brief Number of iterations of tree building before failing
+     *
+     */
+  int numIts;
 };
 
 #endif

Modified: MOAB/trunk/tools/mbcoupler/addfield.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/addfield.cpp	2008-07-15 14:21:13 UTC (rev 2012)
+++ MOAB/trunk/tools/mbcoupler/addfield.cpp	2008-07-15 17:27:56 UTC (rev 2013)
@@ -1,6 +1,7 @@
 #include <iostream>
 #include "MBCore.hpp"
 #include <math.h>
+#include <cstdlib>
 using namespace std;
 
 

Modified: MOAB/trunk/tools/mbzoltan/MBZoltan.cpp
===================================================================
--- MOAB/trunk/tools/mbzoltan/MBZoltan.cpp	2008-07-15 14:21:13 UTC (rev 2012)
+++ MOAB/trunk/tools/mbzoltan/MBZoltan.cpp	2008-07-15 17:27:56 UTC (rev 2013)
@@ -44,7 +44,7 @@
 static int *NborGlobalId=NULL;
 static int *NborProcs=NULL;
 
-const bool debug = true;
+const bool debug = false;
 
 MBZoltan::~MBZoltan() 
 {




More information about the moab-dev mailing list