[MOAB-dev] r4902 - in MOAB/trunk/src/parallel: . moab

tautges at mcs.anl.gov tautges at mcs.anl.gov
Wed Jun 1 10:01:11 CDT 2011


Author: tautges
Date: 2011-06-01 10:01:11 -0500 (Wed, 01 Jun 2011)
New Revision: 4902

Modified:
   MOAB/trunk/src/parallel/ParallelComm.cpp
   MOAB/trunk/src/parallel/ParallelMergeMesh.cpp
   MOAB/trunk/src/parallel/moab/ParallelComm.hpp
   MOAB/trunk/src/parallel/moab/ParallelMergeMesh.hpp
Log:
Update the parallel merge mesh stuff to use new tag_shared_verts function.



Modified: MOAB/trunk/src/parallel/ParallelComm.cpp
===================================================================
--- MOAB/trunk/src/parallel/ParallelComm.cpp	2011-06-01 06:29:26 UTC (rev 4901)
+++ MOAB/trunk/src/parallel/ParallelComm.cpp	2011-06-01 15:01:11 UTC (rev 4902)
@@ -3926,7 +3926,111 @@
   return MB_SUCCESS;
 }
 
+// Overloaded form of tag_shared_verts
+// Tuple coming in is of form (arbitrary value, remoteProc, localHandle, remoteHandle)
+// Also will check for doubles in the list if the list is sorted
 ErrorCode ParallelComm::tag_shared_verts(tuple_list &shared_ents,
+                                         std::map<std::vector<int>, std::vector<EntityHandle> > &proc_nvecs,
+                                         Range& /*proc_verts*/) 
+{
+  Tag sharedp_tag, sharedps_tag, sharedh_tag, sharedhs_tag, pstatus_tag;
+  ErrorCode result = get_shared_proc_tags(sharedp_tag, sharedps_tag, 
+                                            sharedh_tag, sharedhs_tag, pstatus_tag);
+  RRA("Trouble getting shared proc tags in tag_shared_verts.");
+  
+  unsigned int j = 0;
+  std::vector<int> sharing_procs, sharing_procs2;
+  std::vector<EntityHandle> sharing_handles, sharing_handles2;
+  
+  //Were on tuple j/2
+  while (j < 2*shared_ents.n) {
+      // count & accumulate sharing procs
+    EntityHandle this_ent = shared_ents.vul[j], other_ent = 0;
+    int other_proc = -1;
+    while (j < 2*shared_ents.n && shared_ents.vul[j] == this_ent) {
+      j++;
+        // shouldn't have same proc
+      assert(shared_ents.vi[j] != (int)procConfig.proc_rank());
+      //Grab the remote data if its not a dublicate
+      if(shared_ents.vul[j] != other_ent || shared_ents.vi[j] != other_proc){
+	sharing_procs.push_back( shared_ents.vi[j] );
+	sharing_handles.push_back( shared_ents.vul[j] );
+      }
+      other_proc = shared_ents.vi[j];
+      other_ent = shared_ents.vul[j];
+      j++;
+    }
+
+    if (sharing_procs.size() > 1) {
+        // add current proc/handle to list
+      sharing_procs.push_back(procConfig.proc_rank());
+      sharing_handles.push_back(this_ent);
+    }
+      
+      // sort sharing_procs and sharing_handles such that
+      // sharing_procs is in ascending order.  Use temporary


More information about the moab-dev mailing list