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

tautges at mcs.anl.gov tautges at mcs.anl.gov
Fri Aug 26 14:48:23 CDT 2011


Author: tautges
Date: 2011-08-26 14:48:23 -0500 (Fri, 26 Aug 2011)
New Revision: 5128

Modified:
   MOAB/trunk/src/parallel/ParallelComm.cpp
Log:
A bit of optimization to tagging shared vertices.



Modified: MOAB/trunk/src/parallel/ParallelComm.cpp
===================================================================
--- MOAB/trunk/src/parallel/ParallelComm.cpp	2011-08-26 19:27:15 UTC (rev 5127)
+++ MOAB/trunk/src/parallel/ParallelComm.cpp	2011-08-26 19:48:23 UTC (rev 5128)
@@ -4220,8 +4220,9 @@
   RRA("Trouble getting shared proc tags in tag_shared_verts.");
   
   unsigned int j = 0, i = 0;
-  std::vector<int> sharing_procs, sharing_procs2;
-  std::vector<EntityHandle> sharing_handles, sharing_handles2;
+  std::vector<int> sharing_procs, sharing_procs2, tag_procs;
+  std::vector<EntityHandle> sharing_handles, sharing_handles2, tag_lhandles, tag_rhandles;
+  std::vector<unsigned char> pstatus;
   
   //Were on tuple j/2
   if (i_extra) i += i_extra;
@@ -4248,22 +4249,22 @@
         // 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
-      // lists and binary search to re-order sharing_handles.
-    sharing_procs2 = sharing_procs;
-    std::sort( sharing_procs2.begin(), sharing_procs2.end() );
-    sharing_handles2.resize( sharing_handles.size() );
-    for (size_t k = 0; k < sharing_handles.size(); ++k) {
-      size_t idx = std::lower_bound( sharing_procs2.begin(), 
-                                     sharing_procs2.end(), 
-                                     sharing_procs[k] ) - sharing_procs2.begin();
-      sharing_handles2[idx] = sharing_handles[k];
+        // sort sharing_procs and sharing_handles such that
+        // sharing_procs is in ascending order.  Use temporary
+        // lists and binary search to re-order sharing_handles.
+      sharing_procs2 = sharing_procs;
+      std::sort( sharing_procs2.begin(), sharing_procs2.end() );
+      sharing_handles2.resize( sharing_handles.size() );
+      for (size_t k = 0; k < sharing_handles.size(); ++k) {
+        size_t idx = std::lower_bound( sharing_procs2.begin(), 
+                                       sharing_procs2.end(), 
+                                       sharing_procs[k] ) - sharing_procs2.begin();
+        sharing_handles2[idx] = sharing_handles[k];
+      }
+      sharing_procs.swap( sharing_procs2 );
+      sharing_handles.swap( sharing_handles2 );
     }
-    sharing_procs.swap( sharing_procs2 );
-    sharing_handles.swap( sharing_handles2 );
     


More information about the moab-dev mailing list