[MOAB-dev] commit/MOAB: tautges: Improving comments and a bit of code.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Jul 29 10:12:06 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/ef18d29a14eb/
Changeset:   ef18d29a14eb
Branch:      master
User:        tautges
Date:        2013-07-29 17:11:58
Summary:     Improving comments and a bit of code.

Affected #:  2 files

diff --git a/src/parallel/ParallelComm.cpp b/src/parallel/ParallelComm.cpp
index 348bad0..90bab23 100644
--- a/src/parallel/ParallelComm.cpp
+++ b/src/parallel/ParallelComm.cpp
@@ -6894,12 +6894,10 @@ ErrorCode ParallelComm::post_irecv(std::vector<unsigned int>& shared_procs,
   
     // take all shared entities if incoming list is empty
     Range entities;
-    if (entities_in.empty()) {
+    if (entities_in.empty()) 
       std::copy(sharedEnts.begin(), sharedEnts.end(), range_inserter(entities));
-    }
-    else 
-      entities = entities_in;
-  
+    else entities = entities_in;
+
     int dum_ack_buff;
 
     for (ind = 0, sit = buffProcs.begin(); sit != buffProcs.end(); sit++, ind++) {
@@ -6910,7 +6908,7 @@ ErrorCode ParallelComm::post_irecv(std::vector<unsigned int>& shared_procs,
       result = filter_pstatus(tag_ents, PSTATUS_SHARED, PSTATUS_AND, *sit);
       RRA("Failed pstatus AND check.");
     
-      // remote nonowned entities
+      // remove nonowned entities
       if (!tag_ents.empty()) {
         result = filter_pstatus(tag_ents, PSTATUS_NOT_OWNED, PSTATUS_NOT);
         RRA("Failed pstatus NOT check.");
@@ -6998,7 +6996,10 @@ ErrorCode ParallelComm::post_irecv(std::vector<unsigned int>& shared_procs,
     assert(src_tags.size() == dst_tags.size());
     if (src_tags != dst_tags) {
       std::vector<unsigned char> data;
-      Range owned_ents(entities_in);
+      Range owned_ents;
+      if (entities_in.empty()) 
+        std::copy(sharedEnts.begin(), sharedEnts.end(), range_inserter(entities));
+      else owned_ents = entities_in;
       result = filter_pstatus(owned_ents, PSTATUS_NOT_OWNED, PSTATUS_NOT);
       RRA("Failure to get subset of owned entities");
   

diff --git a/src/parallel/moab/ParallelComm.hpp b/src/parallel/moab/ParallelComm.hpp
index c558334..55bdd93 100644
--- a/src/parallel/moab/ParallelComm.hpp
+++ b/src/parallel/moab/ParallelComm.hpp
@@ -291,26 +291,38 @@ namespace moab {
     /** \brief Exchange tags for all shared and ghosted entities
      * This function should be called collectively over the communicator for this ParallelComm.
      * If this version is called, all ghosted/shared entities should have a value for this
-     * tag (or the tag should have a default value).
-     * \param tags Vector of tag handles to be exchanged
+     * tag (or the tag should have a default value).  If the entities vector is empty, all shared entities
+     * participate in the exchange.  If a proc has no owned entities this function must still be called
+     * since it is collective.
+     * \param src_tags Vector of tag handles to be exchanged
+     * \param dst_tags Tag handles to store the tags on the non-owning procs
+     * \param entities Entities for which tags are exchanged
      */
     ErrorCode exchange_tags( const std::vector<Tag> &src_tags,
-			     const  std::vector<Tag> &dst_tags,
-			     const Range &entities);
+                             const  std::vector<Tag> &dst_tags,
+                             const Range &entities);
   
     /** \brief Exchange tags for all shared and ghosted entities
-     * This function should be called collectively over the communicator for this ParallelComm
+     * This function should be called collectively over the communicator for this ParallelComm.
+     * If the entities vector is empty, all shared entities
+     * participate in the exchange.  If a proc has no owned entities this function must still be called
+     * since it is collective.
      * \param tag_name Name of tag to be exchanged
+     * \param entities Entities for which tags are exchanged
      */
     ErrorCode exchange_tags( const char *tag_name,
-			     const Range &entities);
+                             const Range &entities);
   
     /** \brief Exchange tags for all shared and ghosted entities
-     * This function should be called collectively over the communicator for this ParallelComm
+     * This function should be called collectively over the communicator for this ParallelComm.  
+     * If the entities vector is empty, all shared entities
+     * participate in the exchange.  If a proc has no owned entities this function must still be called
+     * since it is collective.
      * \param tagh Handle of tag to be exchanged
+     * \param entities Entities for which tags are exchanged
      */
     ErrorCode exchange_tags( Tag tagh,
-			     const Range &entities);
+                             const Range &entities);
   
     /** \brief Perform data reduction operation for all shared and ghosted entities
      * This function should be called collectively over the communicator for this ParallelComm.

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list