From: abn Date: Wed, 13 Dec 2023 21:08:10 +0000 (+0100) Subject: [OverlapDEC] Fixing ODEC work algo sharing 1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8d238bfca8e4ae1aadf038abd464ad3a18edb5e6;p=tools%2Fmedcoupling.git [OverlapDEC] Fixing ODEC work algo sharing 1 --- diff --git a/src/ParaMEDMEM/OverlapElementLocator.cxx b/src/ParaMEDMEM/OverlapElementLocator.cxx index 481ae7be0..4a96f9ef7 100644 --- a/src/ParaMEDMEM/OverlapElementLocator.cxx +++ b/src/ParaMEDMEM/OverlapElementLocator.cxx @@ -344,6 +344,8 @@ namespace MEDCoupling _procs_to_send_mesh.push_back(Proc_SrcOrTgt(i,false)); } } + // Sort to avoid deadlocks!! + std::sort(_procs_to_send_mesh.begin(), _procs_to_send_mesh.end()); #ifdef DEC_DEBUG std::stringstream scout; scout << "(" << _group.myRank() << ") PROC TO SEND list is: "; @@ -362,37 +364,35 @@ namespace MEDCoupling { int myProcId=_group.myRank(); //starting to receive every procs whose id is lower than myProcId. - std::vector toDoListForFetchRemaining; + std::vector firstRcv, secondRcv; for (const ProcCouple& pc: _to_do_list) { if(pc.first == pc.second) continue; // no xchg needed if(pc.first==myProcId) { - if(pc.second