[MOAB-dev] r2962 - MOAB/branches/parallel_ghosting/parallel

tautges at mcs.anl.gov tautges at mcs.anl.gov
Tue Jun 23 10:33:13 CDT 2009


Author: tautges
Date: 2009-06-23 10:33:13 -0500 (Tue, 23 Jun 2009)
New Revision: 2962

Modified:
   MOAB/branches/parallel_ghosting/parallel/MBParallelComm.cpp
   MOAB/branches/parallel_ghosting/parallel/MBParallelComm.hpp
   MOAB/branches/parallel_ghosting/parallel/mbparallelcomm_test.cpp
   MOAB/branches/parallel_ghosting/parallel/parallel_hdf5_test.cc
   MOAB/branches/parallel_ghosting/parallel/parallel_unit_tests.cpp
Log:
parallel_hdf5_test: don't call filter_pstatus on empty list
parallel_unit_tests: allow for non-shared entities
mbparallelcomm_test: updated syntax for unpack_buffer
MBParallelComm: make range passed in to exchange_tags non-const,
  since if empty range is input it is filled with shared ents

pcomm_unit and most of parallel_unit_tests pass; failures remaining 
may be problems with tests rather than parallel code.



Modified: MOAB/branches/parallel_ghosting/parallel/MBParallelComm.cpp
===================================================================
--- MOAB/branches/parallel_ghosting/parallel/MBParallelComm.cpp	2009-06-23 14:25:58 UTC (rev 2961)
+++ MOAB/branches/parallel_ghosting/parallel/MBParallelComm.cpp	2009-06-23 15:33:13 UTC (rev 2962)
@@ -3990,7 +3990,7 @@
 
 MBErrorCode MBParallelComm::exchange_tags(std::vector<MBTag> &src_tags,
                                           std::vector<MBTag> &dst_tags,
-                                          const MBRange &entities)
+                                          MBRange &entities)
 {
   MBErrorCode result;
   int success;
@@ -4019,6 +4019,9 @@
     // pack and send tags from this proc to others
     // make sendReqs vector to simplify initialization
   std::fill(sendReqs, sendReqs+MAX_SHARING_PROCS, MPI_REQUEST_NULL);
+
+    // take all shared entities if incoming list is empty
+  if (entities.empty()) entities = sharedEnts;
   
   for (ind = 0, sit = buffProcs.begin(); sit != buffProcs.end(); sit++, ind++) {
     
@@ -4029,8 +4032,10 @@
     RRA("Failed pstatus AND check.");
     
       // remote nonowned entities
-    result = filter_pstatus(tag_ents, PSTATUS_NOT_OWNED, PSTATUS_NOT);
-    RRA("Failed pstatus NOT check.");
+    if (!tag_ents.empty()) {
+      result = filter_pstatus(tag_ents, PSTATUS_NOT_OWNED, PSTATUS_NOT);
+      RRA("Failed pstatus NOT check.");
+    }
     
       // pack-send; this also posts receives if store_remote_handles is true
     std::vector<MBRange> tag_ranges;

Modified: MOAB/branches/parallel_ghosting/parallel/MBParallelComm.hpp
===================================================================
--- MOAB/branches/parallel_ghosting/parallel/MBParallelComm.hpp	2009-06-23 14:25:58 UTC (rev 2961)
+++ MOAB/branches/parallel_ghosting/parallel/MBParallelComm.hpp	2009-06-23 15:33:13 UTC (rev 2962)
@@ -186,21 +186,21 @@
      */
   MBErrorCode exchange_tags(std::vector<MBTag> &src_tags,
                             std::vector<MBTag> &dst_tags,
-                            const MBRange &entities);
+                            MBRange &entities);
   
     /** \brief Exchange tags for all shared and ghosted entities
      * This function should be called collectively over the communicator for this MBParallelComm
      * \param tag_name Name of tag to be exchanged
      */
   MBErrorCode exchange_tags(const char *tag_name,
-                            const MBRange &entities);
+                            MBRange &entities);
   
     /** \brief Exchange tags for all shared and ghosted entities
      * This function should be called collectively over the communicator for this MBParallelComm
      * \param tagh Handle of tag to be exchanged
      */
   MBErrorCode exchange_tags(MBTag tagh,
-                            const MBRange &entities);
+                            MBRange &entities);
   
     /** \brief Broadcast all entities resident on from_proc to other processors
      * This function assumes remote handles are *not* being stored, since (usually)
@@ -976,7 +976,7 @@
 }
 
 inline MBErrorCode MBParallelComm::exchange_tags(const char *tag_name,
-                                                 const MBRange &entities)
+                                                 MBRange &entities)
 {
     // get the tag handle
   std::vector<MBTag> tags(1);
@@ -988,7 +988,7 @@
 }
   
 inline MBErrorCode MBParallelComm::exchange_tags(MBTag tagh,
-                                                 const MBRange &entities)
+                                                 MBRange &entities)
 {
     // get the tag handle
   std::vector<MBTag> tags;

Modified: MOAB/branches/parallel_ghosting/parallel/mbparallelcomm_test.cpp
===================================================================
--- MOAB/branches/parallel_ghosting/parallel/mbparallelcomm_test.cpp	2009-06-23 14:25:58 UTC (rev 2961)
+++ MOAB/branches/parallel_ghosting/parallel/mbparallelcomm_test.cpp	2009-06-23 15:33:13 UTC (rev 2962)
@@ -396,12 +396,12 @@
                                    buff, buff_size);
   RRA("Packing buffer count (non-stored handles) failed.");
 
-  std::vector<std::vector<MBEntityHandle> > L1h;
+  std::vector<std::vector<MBEntityHandle> > L1hloc, L1hrem;
   std::vector<std::vector<int> > L1p;
   std::vector<MBEntityHandle> L2hloc, L2hrem;
   std::vector<unsigned int> L2p;
   
-  result = pcomm->unpack_buffer(&buff[0], false, -1, -1, L1h, L1p, L2hloc, 
+  result = pcomm->unpack_buffer(&buff[0], false, -1, -1, L1hloc, L1hrem, L1p, L2hloc, 
                          L2hrem, L2p, new_ents);
   RRA("Unpacking buffer (non-stored handles) failed.");
 

Modified: MOAB/branches/parallel_ghosting/parallel/parallel_hdf5_test.cc
===================================================================
--- MOAB/branches/parallel_ghosting/parallel/parallel_hdf5_test.cc	2009-06-23 14:25:58 UTC (rev 2961)
+++ MOAB/branches/parallel_ghosting/parallel/parallel_hdf5_test.cc	2009-06-23 15:33:13 UTC (rev 2962)
@@ -261,9 +261,11 @@
     MBRange range;
     rval = moab.get_entities_by_type( 0, t, range );
     CHECK_ERR(rval);
-    rval = pcomm->filter_pstatus(range, PSTATUS_SHARED, PSTATUS_AND);
+    if (!range.empty())
+      rval = pcomm->filter_pstatus(range, PSTATUS_SHARED, PSTATUS_AND);
     CHECK_ERR(rval);
-    rval = pcomm->filter_pstatus(range, PSTATUS_NOT_OWNED, PSTATUS_NOT);
+    if (!range.empty())
+      rval = pcomm->filter_pstatus(range, PSTATUS_NOT_OWNED, PSTATUS_NOT);
     CHECK_ERR(rval);
     counts[t] = range.size();
   }

Modified: MOAB/branches/parallel_ghosting/parallel/parallel_unit_tests.cpp
===================================================================
--- MOAB/branches/parallel_ghosting/parallel/parallel_unit_tests.cpp	2009-06-23 14:25:58 UTC (rev 2961)
+++ MOAB/branches/parallel_ghosting/parallel/parallel_unit_tests.cpp	2009-06-23 15:33:13 UTC (rev 2962)
@@ -1193,9 +1193,10 @@
         // find handle from senting proc
       pi2 = pi1 + MAX_SHARING_PROCS;
       pi3 = std::find( pi1, pi2, (int)i );
-      assert( pi3 != pi2 );
-      int idx = pi3 - vert_procs.begin();
-      data_by_id[id].handles.push_back( vert_handles[idx] );
+      if( pi3 != pi2 ) {
+        int idx = pi3 - vert_procs.begin();
+        data_by_id[id].handles.push_back( vert_handles[idx] );
+      }
       pi1 = pi2;
     }
   }
@@ -1229,7 +1230,8 @@
       int idx = std::lower_bound( it->second.procs.begin(), 
                                   it->second.procs.end(),
                                   procs[i] ) - it->second.procs.begin();
-      it->second.handles[idx] = handles[i];
+      if (!handles.empty())
+        it->second.handles[idx] = handles[i];
     }
   }
   



More information about the moab-dev mailing list