[MOAB-dev] r5322 - in MOAB/trunk: itaps/imesh src/parallel src/parallel/moab
hongjun at mcs.anl.gov
hongjun at mcs.anl.gov
Mon Jan 16 14:04:37 CST 2012
Author: hongjun
Date: 2012-01-16 14:04:33 -0600 (Mon, 16 Jan 2012)
New Revision: 5322
Modified:
MOAB/trunk/itaps/imesh/iMeshP_MOAB.cpp
MOAB/trunk/src/parallel/ParallelComm.cpp
MOAB/trunk/src/parallel/moab/ParallelComm.hpp
Log:
o "post_irec" function is added
o it posts asynchronous receive before meshing
o used only for exchanging surface meshes in "exchange_owned_meshs"
o request lists are offered to "exchange_owned_meshs" from outside
o passes make check
Modified: MOAB/trunk/itaps/imesh/iMeshP_MOAB.cpp
===================================================================
--- MOAB/trunk/itaps/imesh/iMeshP_MOAB.cpp 2012-01-15 20:39:53 UTC (rev 5321)
+++ MOAB/trunk/itaps/imesh/iMeshP_MOAB.cpp 2012-01-16 20:04:33 UTC (rev 5322)
@@ -1550,8 +1550,10 @@
exchange_ents[ind]->insert(itaps_cast<EntityHandle>(entity_handles[i]));
}
+ std::vector<MPI_Request> recv_ent_reqs, recv_remoteh_reqs;
rval = pcomm->exchange_owned_meshs(exchange_procs, exchange_ents,
- true);
+ recv_ent_reqs, recv_remoteh_reqs,
+ true);
CHKERR(rval,"ParallelComm::exchange_owned_meshs failed");
// delete exchange list
Modified: MOAB/trunk/src/parallel/ParallelComm.cpp
===================================================================
--- MOAB/trunk/src/parallel/ParallelComm.cpp 2012-01-15 20:39:53 UTC (rev 5321)
+++ MOAB/trunk/src/parallel/ParallelComm.cpp 2012-01-16 20:04:33 UTC (rev 5322)
@@ -5701,11 +5701,49 @@
return MB_SUCCESS;
}
+ErrorCode ParallelComm::post_irecv(std::vector<unsigned int>& exchange_procs)
+{
+ // set buffers
+ int n_proc = exchange_procs.size();
+ for (int i = 0; i < n_proc; i++) get_buffers(exchange_procs[i]);
+ reset_all_buffers();
+
+ // post ghost irecv's for entities from all communicating procs
+ // index reqs the same as buffer/sharing procs indices
+ int success;
+ ErrorCode result;
+ recvReqs.resize(2*buffProcs.size(), MPI_REQUEST_NULL);
+ recvRemotehReqs.resize(2*buffProcs.size(), MPI_REQUEST_NULL);
+ sendReqs.resize(2*buffProcs.size(), MPI_REQUEST_NULL);
+
+ int incoming = 0;
+ for (int i = 0; i < n_proc; i++) {
+ int ind = get_buffers(exchange_procs[i]);
+ incoming++;
+ PRINT_DEBUG_IRECV(procConfig.proc_rank(), buffProcs[ind],
+ remoteOwnedBuffs[ind]->mem_ptr, INITIAL_BUFF_SIZE,
+ MB_MESG_ENTS_SIZE, incoming);
+ success = MPI_Irecv(remoteOwnedBuffs[ind]->mem_ptr, INITIAL_BUFF_SIZE,
+ MPI_UNSIGNED_CHAR, buffProcs[ind],
+ MB_MESG_ENTS_SIZE, procConfig.proc_comm(),
+ &recvReqs[2*ind]);
More information about the moab-dev
mailing list