[MOAB-dev] r1791 - MOAB/trunk/tools/mbzoltan

tautges at mcs.anl.gov tautges at mcs.anl.gov
Fri May 2 09:26:27 CDT 2008


Author: tautges
Date: 2008-05-02 09:26:27 -0500 (Fri, 02 May 2008)
New Revision: 1791

Modified:
   MOAB/trunk/tools/mbzoltan/MBZoltan.cpp
   MOAB/trunk/tools/mbzoltan/main.cpp
Log:
Fixing memory error in my latest changes to MBZoltan, and adding MPI_Finalize.


Modified: MOAB/trunk/tools/mbzoltan/MBZoltan.cpp
===================================================================
--- MOAB/trunk/tools/mbzoltan/MBZoltan.cpp	2008-05-02 13:25:23 UTC (rev 1790)
+++ MOAB/trunk/tools/mbzoltan/MBZoltan.cpp	2008-05-02 14:26:27 UTC (rev 1791)
@@ -23,6 +23,7 @@
 #include <zoltan_cpp.h>
 
 #include <iostream>
+#include <assert.h>
 
 #include "MBZoltan.hpp"
 #include "MBInterface.hpp"
@@ -342,7 +343,7 @@
   MBRange adjs;
     // can use a fixed-size array 'cuz the number of lower-dimensional neighbors is limited
     // by MBCN
-  int neighbors[MB_MAX_SUB_ENTITIES];
+  int neighbors[5*MB_MAX_SUB_ENTITIES];
   double avg_position[3];
   int moab_id;
   
@@ -362,6 +363,7 @@
     
       // get the graph vertex ids of those
     if (!adjs.empty()) {
+      assert(adjs.size() < 5*MB_MAX_SUB_ENTITIES);
       result = mbImpl->tag_get_data(gid, adjs, neighbors); RR;
     }
 

Modified: MOAB/trunk/tools/mbzoltan/main.cpp
===================================================================
--- MOAB/trunk/tools/mbzoltan/main.cpp	2008-05-02 13:25:23 UTC (rev 1790)
+++ MOAB/trunk/tools/mbzoltan/main.cpp	2008-05-02 14:26:27 UTC (rev 1791)
@@ -78,5 +78,7 @@
   delete mbz;
   delete mbImpl;
 
+  err = MPI_Finalize();
+
   return 0;
 }




More information about the moab-dev mailing list