[MOAB-dev] r4968 - MOAB/trunk/src/parallel

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Wed Jun 8 11:16:30 CDT 2011


Author: kraftche
Date: 2011-06-08 11:16:29 -0500 (Wed, 08 Jun 2011)
New Revision: 4968

Modified:
   MOAB/trunk/src/parallel/ParallelComm.cpp
Log:
change some asserts that check that MAX_SHARING_PROCS is not exceeded to tests are also done in a release build and that call MPI_Abort if it is exceeded

Modified: MOAB/trunk/src/parallel/ParallelComm.cpp
===================================================================
--- MOAB/trunk/src/parallel/ParallelComm.cpp	2011-06-08 15:05:18 UTC (rev 4967)
+++ MOAB/trunk/src/parallel/ParallelComm.cpp	2011-06-08 16:16:29 UTC (rev 4968)
@@ -2148,6 +2148,17 @@
     for (int i = 0; i < num_ps; i++) {
       idx = std::find(tag_ps, tag_ps+num_exist, ps[i]) - tag_ps;
       if (idx == (int) num_exist) {
+      
+        if (num_exist == MAX_SHARING_PROCS) {
+          std::cerr << "Exceeded MAX_SHARING_PROCS for "
+                    << CN::EntityTypeName( TYPE_FROM_HANDLE(new_h) )
+                    << ' ' << ID_FROM_HANDLE(new_h) 
+                    << " in process " << proc_config().proc_rank()
+                    << std::endl;
+          std::cerr.flush();
+          MPI_Abort( proc_config().proc_comm(), 66 );
+        }
+      
           // if there's only 1 sharing proc, and it's not me, then
           // we'll end up with 3; add me to the front
         if (!i && num_ps == 1 && num_exist == 1 &&
@@ -3756,7 +3767,16 @@
     }
     else {
       // pad tag data out to MAX_SHARING_PROCS with -1
-      assert( vit->first.size() <= MAX_SHARING_PROCS );
+      if (vit->first.size() > MAX_SHARING_PROCS) {
+        std::cerr << "Exceeded MAX_SHARING_PROCS for "
+                  << CN::EntityTypeName(TYPE_FROM_HANDLE(new_set))
+                  << ' ' << ID_FROM_HANDLE(new_set) 
+                  << " on process " << proc_config().proc_rank()
+                  << std::endl;
+        std::cerr.flush();
+        MPI_Abort(proc_config().proc_comm(), 66);
+      }
+      //assert( vit->first.size() <= MAX_SHARING_PROCS );
       std::copy( vit->first.begin(), vit->first.end(), proc_ids );
       std::fill( proc_ids + vit->first.size(), proc_ids + MAX_SHARING_PROCS, -1 );
       result = mbImpl->tag_set_data(sharedps_tag, &new_set, 1, proc_ids );
@@ -3992,7 +4012,13 @@
     }
     else {
         // pad lists 
-      assert( sharing_procs.size() <= MAX_SHARING_PROCS );
+      //assert( sharing_procs.size() <= MAX_SHARING_PROCS );
+      if (sharing_procs.size() > MAX_SHARING_PROCS) {
+        std::cerr << "MAX_SHARING_PROCS exceeded for vertex " << this_ent <<
+                     " on process " << proc_config().proc_rank() <<  std::endl;
+        std::cerr.flush();
+        MPI_Abort(proc_config().proc_comm(), 66);


More information about the moab-dev mailing list