[MOAB-dev] r2138 - MOAB/trunk/parallel

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Fri Oct 10 17:09:38 CDT 2008


Author: kraftche
Date: 2008-10-10 17:09:37 -0500 (Fri, 10 Oct 2008)
New Revision: 2138

Modified:
   MOAB/trunk/parallel/MBParallelComm.cpp
   MOAB/trunk/parallel/parallel_unit_tests.cpp
Log:
Bug fixes:
  o Put owned entities that are ghosted elsewhere, not ghosted entities that
    are owned elsewher in MBParallelComm::ghostedEntities, as per the
    documentation and usage in MBParallelComm::exchange_tags
  o Don't try to send tag values for entities for which no tag value is
    available.  NOTE:  This still sends default values when the application
    has not set an explicit tag value because not doing so broke other stuff.



Modified: MOAB/trunk/parallel/MBParallelComm.cpp
===================================================================
--- MOAB/trunk/parallel/MBParallelComm.cpp	2008-10-09 20:02:00 UTC (rev 2137)
+++ MOAB/trunk/parallel/MBParallelComm.cpp	2008-10-10 22:09:37 UTC (rev 2138)
@@ -3234,7 +3234,10 @@
                                 sent_ents[ind]);
     RRA("Failed to pack-send in ghost exchange.");
 
-    if (0 != num_layers) new_ghosted.merge(sent_ents[ind]);
+    if (0 != num_layers) {
+      new_ghosted.merge(sent_ents[ind]);
+      ghostedEnts[*sit].merge(sent_ents[ind]);
+    }
   }
   
     // receive/unpack entities
@@ -3281,7 +3284,7 @@
         RRA("Failed to recv-unpack message.");
         if (0 != num_layers) {
           new_ghosts.merge(recd_ents[ind]);
-          ghostedEnts[buffProcs[ind]].merge(recd_ents[ind]);
+          //ghostedEnts[buffProcs[ind]].merge(recd_ents[ind]);
         }
         break;
       case MB_MESG_REMOTE_HANDLES_VECTOR:
@@ -3391,7 +3394,8 @@
       if (MB_SUCCESS != result || owner != (int)proc_config().proc_rank()) 
         continue;
       
-      result = get_ghost_layers(*rit, -1, 0, 0, tag_ents);
+      //result = get_ghost_layers(*rit, -1, 0, 0, tag_ents);
+      result = mbImpl->get_entities_by_handle(*rit, tag_ents);
       RRA("Failed to get tag ents for exchange.");
     }
 
@@ -3402,9 +3406,19 @@
       // pack-send; this also posts receives if store_remote_handles is true
     int buff_size = 0;
     std::vector<MBRange> tag_ranges;
-    for (std::vector<MBTag>::iterator vit = tags.begin(); vit != tags.end(); vit++)
-      tag_ranges.push_back(tag_ents);
-
+    for (std::vector<MBTag>::iterator vit = tags.begin(); vit != tags.end(); vit++) {
+      const void* ptr;
+      int size;
+      if (tagServer->get_default_data_ref( *vit, ptr, size ) != MB_SUCCESS) {
+        MBRange tagged_ents;
+        tagServer->get_entities( *vit, tagged_ents );
+        tag_ranges.push_back(tag_ents.intersect(tagged_ents));
+      } 
+      else {
+        tag_ranges.push_back(tag_ents);
+      }
+    }
+    
       // count first
     unsigned char *buff_ptr = &ownerSBuffs[ind][0];
     MBRange::iterator rit = tag_ents.begin();

Modified: MOAB/trunk/parallel/parallel_unit_tests.cpp
===================================================================
--- MOAB/trunk/parallel/parallel_unit_tests.cpp	2008-10-09 20:02:00 UTC (rev 2137)
+++ MOAB/trunk/parallel/parallel_unit_tests.cpp	2008-10-10 22:09:37 UTC (rev 2138)
@@ -87,9 +87,9 @@
   MPI_Comm_rank( MPI_COMM_WORLD, &rank );
   if (rank == 0) {
     if (is_err) 
-      std::cout << func_name << " FAILED!!" << std::endl;
+      std::cout << func_name << " : FAILED!!" << std::endl;
     else
-      std::cout << func_name << " success" << std::endl;
+      std::cout << func_name << " : success" << std::endl;
   }
   
   return is_err;
@@ -745,7 +745,8 @@
   rval = moab.tag_set_data( sparse_test_tag, local, &procs1[0] ); CHKERR(rval);
   
     // exchange tag data
-  rval = pcomm->exchange_tags( sparse_test_tag ); CHKERR(rval);
+  rval = pcomm->exchange_tags( sparse_test_tag ); 
+  PCHECK( MB_SUCCESS == rval );
   
     // make sure local values are unchanged
   std::vector<int> procs2(local.size());




More information about the moab-dev mailing list