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

hongjun at mcs.anl.gov hongjun at mcs.anl.gov
Thu Apr 21 13:26:52 CDT 2011


Author: hongjun
Date: 2011-04-21 13:26:52 -0500 (Thu, 21 Apr 2011)
New Revision: 4764

Modified:
   MOAB/trunk/src/parallel/ParallelComm.cpp
Log:
o Parent/child set packing in "pack_sets" only works when "store_remote_handle" is false
o Passes make check


Modified: MOAB/trunk/src/parallel/ParallelComm.cpp
===================================================================
--- MOAB/trunk/src/parallel/ParallelComm.cpp	2011-04-21 14:34:12 UTC (rev 4763)
+++ MOAB/trunk/src/parallel/ParallelComm.cpp	2011-04-21 18:26:52 UTC (rev 4764)
@@ -2544,53 +2544,65 @@
     PACK_INT(buff->buff_ptr, members.size());
     PACK_EH(buff->buff_ptr, &members[0], members.size());
   }
+
+  // pack parent/child sets
+  if (!store_remote_handles) { // only works not store remote handles
     // pack numbers of parents/children
-  unsigned int tot_pch = 0;
-  int num_pch;
-  buff->check_space(2*all_sets.size()*sizeof(int));
-  for (rit = all_sets.begin(), i = 0; rit != all_sets.end(); rit++, i++) {
+    unsigned int tot_pch = 0;
+    int num_pch;
+    buff->check_space(2*all_sets.size()*sizeof(int));
+    for (rit = all_sets.begin(), i = 0; rit != all_sets.end(); rit++, i++) {
       // pack parents
-    result = mbImpl->num_parent_meshsets(*rit, &num_pch);
-    RRA("Failed to get num parents.");
-    PACK_INT(buff->buff_ptr, num_pch);
-    tot_pch += num_pch;
-    result = mbImpl->num_child_meshsets(*rit, &num_pch);
-    RRA("Failed to get num children.");
-    PACK_INT(buff->buff_ptr, num_pch);
-    tot_pch += num_pch;
-  }
+      result = mbImpl->num_parent_meshsets(*rit, &num_pch);
+      RRA("Failed to get num parents.");
+      PACK_INT(buff->buff_ptr, num_pch);
+      tot_pch += num_pch;
+      result = mbImpl->num_child_meshsets(*rit, &num_pch);
+      RRA("Failed to get num children.");
+      PACK_INT(buff->buff_ptr, num_pch);
+      tot_pch += num_pch;
+    }
 
     // now pack actual parents/children
-  members.clear();
-  members.reserve(tot_pch);
-  std::vector<EntityHandle> tmp_pch;
-  for (rit = all_sets.begin(), i = 0; rit != all_sets.end(); rit++, i++) {
-    result = mbImpl->get_parent_meshsets(*rit, tmp_pch);
-    RRA("Failed to get parents.");
-    std::copy(tmp_pch.begin(), tmp_pch.end(), std::back_inserter(members));
-    tmp_pch.clear();
-    result = mbImpl->get_child_meshsets(*rit, tmp_pch);
-    RRA("Failed to get children.");


More information about the moab-dev mailing list