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

tautges at mcs.anl.gov tautges at mcs.anl.gov
Fri Apr 9 21:44:20 CDT 2010


Author: tautges
Date: 2010-04-09 21:44:20 -0500 (Fri, 09 Apr 2010)
New Revision: 3764

Modified:
   MOAB/trunk/tools/mbzoltan/MBZoltan.cpp
Log:
Adding warning for when empty partition sets are generated.

Un-extruded tjunction mesh now reads properly on 64 procs on laptop.



Modified: MOAB/trunk/tools/mbzoltan/MBZoltan.cpp
===================================================================
--- MOAB/trunk/tools/mbzoltan/MBZoltan.cpp	2010-04-10 01:57:56 UTC (rev 3763)
+++ MOAB/trunk/tools/mbzoltan/MBZoltan.cpp	2010-04-10 02:44:20 UTC (rev 3764)
@@ -481,6 +481,20 @@
     for (rit = elems.begin(), i = 0; rit != elems.end(); rit++, i++) {
       result = mbImpl->add_entities(part_sets[assignment[i]], &(*rit), 1); RR;
     }
+
+      // check for empty sets, warn if there are any
+    std::vector<unsigned int> empty_sets;
+    for (i = 0; i < nparts; i++) {
+      int num_ents = 0;
+      result = mbImpl->get_number_entities_by_handle(part_sets[i], num_ents);
+      if (MB_SUCCESS != result || !num_ents) empty_sets.push_back(i);
+    }
+    if (!empty_sets.empty()) {
+      std::cout << "WARNING: " << empty_sets.size() << " empty sets in partition: ";
+      for (std::vector<unsigned int>::iterator vit = empty_sets.begin(); vit != empty_sets.end(); vit++)
+        std::cout << *vit << " ";
+      std::cout << std::endl;
+    }
   }
   
   if (write_as_tags) {
@@ -576,7 +590,7 @@
 int MBZoltan::mbInitializePoints(int npts, double *pts, int *ids, 
                                  int *adjs, int *length)
 {
-  int i;
+  unsigned int i;
   int j;
   int *numPts, *nborProcs;
   int sum, ptsPerProc, ptsAssigned, mySize;
@@ -595,7 +609,7 @@
     ptsPerProc = npts / mbpc->proc_config().proc_size();
     ptsAssigned = 0;
 
-    for (i=0; (int) i < mbpc->proc_config().proc_size()-1; i++)
+    for (i=0; i < mbpc->proc_config().proc_size()-1; i++)
     {
       numPts[i] = ptsPerProc;
       ptsAssigned += ptsPerProc;
@@ -627,7 +641,7 @@
 
     sendProcs = nborProcs + (sendNborId - adjs);
 
-    for (i=1; (int)i<mbpc->proc_config().proc_size(); i++)
+    for (i=1; i<mbpc->proc_config().proc_size(); i++)
     {
       MPI_Send(&numPts[i], 1, MPI_INT, i, 0x00,MPI_COMM_WORLD);


More information about the moab-dev mailing list