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

hongjun at mcs.anl.gov hongjun at mcs.anl.gov
Tue Feb 7 14:53:48 CST 2012


Author: hongjun
Date: 2012-02-07 14:53:47 -0600 (Tue, 07 Feb 2012)
New Revision: 5381

Modified:
   MOAB/trunk/src/parallel/ParallelComm.cpp
   MOAB/trunk/src/parallel/moab/ParallelComm.hpp
Log:
o "send_entities", "recv_entities" and "post_irecv" functions are added
o They are used for send and recv meshes separately and can do mesh generation during communication
o passes make check


Modified: MOAB/trunk/src/parallel/ParallelComm.cpp
===================================================================
--- MOAB/trunk/src/parallel/ParallelComm.cpp	2012-02-07 18:26:59 UTC (rev 5380)
+++ MOAB/trunk/src/parallel/ParallelComm.cpp	2012-02-07 20:53:47 UTC (rev 5381)
@@ -701,6 +701,125 @@
 #endif
   }
 
+ErrorCode ParallelComm::send_entities(std::vector<unsigned int>& send_procs,
+                                      std::vector<Range*>& send_ents,
+                                      int& incoming1, int& incoming2,
+                                      const bool store_remote_handles)
+{
+#ifdef USE_MPE
+  if (myDebug->get_verbosity() == 2) {
+    MPE_Log_event(OWNED_START, procConfig.proc_rank(), "Starting send entities.");
+  }
+#endif
+  myDebug->tprintf(1, "Entering send_entities\n");
+  if (myDebug->get_verbosity() == 4) {
+    msgs.clear();
+    msgs.reserve(MAX_SHARING_PROCS);
+  }
+
+  unsigned int i;
+  int ind, success;
+  ErrorCode result = MB_SUCCESS;
+
+  // set buffProcs with communicating procs
+  unsigned int n_proc = send_procs.size();
+  for (i = 0; i < n_proc; i++) {
+    ind = get_buffers(send_procs[i]);
+    result = add_verts(*send_ents[i]);
+    RRA("Couldn't add verts.");
+
+    // filter out entities already shared with destination
+    Range tmp_range;
+    result = filter_pstatus(*send_ents[i], PSTATUS_SHARED, PSTATUS_AND,
+                            buffProcs[ind], &tmp_range);
+    RRA("Couldn't filter on owner.");
+    if (!tmp_range.empty()) {
+      *send_ents[i] = subtract(*send_ents[i], tmp_range);
+    }
+  }
+ 
+  //===========================================
+  // get entities to be sent to neighbors
+  // need to get procs each entity is sent to
+  //===========================================  
+  Range allsent, tmp_range;
+  int dum_ack_buff;


More information about the moab-dev mailing list