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

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Mon Mar 7 19:11:59 CST 2011


Author: kraftche
Date: 2011-03-07 19:11:59 -0600 (Mon, 07 Mar 2011)
New Revision: 4545

Modified:
   MOAB/trunk/src/parallel/ParallelComm.cpp
Log:
Fix invalid sharing data for interface elements from ParallelComm::resolve_shared_ents

Code initially guesses at sharing for interface elements as the set of all
processes that share all of the vertices defining the element.  Code existed
to check this after initial handle exchange to verify that it was correct.
Upon identifying extra processes in the sharing list for an element the code 
updated the sharing information for the element.  However, additional state
is not updated correctly for such elements that are still shared by more than
one process.  Update ownership state and interface sets (including possibly
creating new interface sets and removing now empty ones) also.



Modified: MOAB/trunk/src/parallel/ParallelComm.cpp
===================================================================
--- MOAB/trunk/src/parallel/ParallelComm.cpp	2011-03-08 01:06:57 UTC (rev 4544)
+++ MOAB/trunk/src/parallel/ParallelComm.cpp	2011-03-08 01:11:59 UTC (rev 4545)
@@ -4587,41 +4587,182 @@
   return MB_SUCCESS;
 }
 
+struct ProcList {
+  int procs[MAX_SHARING_PROCS];
+};
+bool operator<( const ProcList& a, const ProcList& b ) {
+  for (int i = 0; i < MAX_SHARING_PROCS; ++i) {
+    if (a.procs[i] < b.procs[i]) 
+      return true;
+    else if (b.procs[i] < a.procs[i])
+      return false;
+    else if (a.procs[i] < 0)
+      return false; 
+  }
+  return false;
+}
+
 ErrorCode ParallelComm::check_clean_iface(Range &allsent) 
 {
     // allsent is all entities I think are on interface; go over them, looking
     // for zero-valued handles, and fix any I find
 
+    // Keep lists of entities for which teh sharing data changed, grouped
+    // by set of sharing procs.
+  typedef std::map< ProcList, Range > procmap_t;
+  procmap_t old_procs, new_procs;
+
   ErrorCode result = MB_SUCCESS;
   Range::iterator rit;
+  Range::reverse_iterator rvit;
   unsigned char pstatus;
-  int sharedp[MAX_SHARING_PROCS], nump;
+  int nump;
+  ProcList sharedp;
   EntityHandle sharedh[MAX_SHARING_PROCS];
-  for (rit = allsent.begin(); rit != allsent.end(); rit++) {
-    result = get_sharing_data(*rit, sharedp, sharedh, pstatus, nump);
+  for (rvit = allsent.rbegin(); rvit != allsent.rend(); rvit++) {
+    result = get_sharing_data(*rvit, sharedp.procs, sharedh, pstatus, nump);
     RRA("");
     assert("Should be shared with at least one other proc" && 
-           (nump > 1 || sharedp[0] != (int)procConfig.proc_rank()));
-    int numz = 0;
-    for (int i = 0; i < nump; i++) {
-      if (!sharedh[i]) numz++;


More information about the moab-dev mailing list