From 8d238bfca8e4ae1aadf038abd464ad3a18edb5e6 Mon Sep 17 00:00:00 2001 From: abn Date: Wed, 13 Dec 2023 22:08:10 +0100 Subject: [PATCH] [OverlapDEC] Fixing ODEC work algo sharing 1 --- src/ParaMEDMEM/OverlapElementLocator.cxx | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) 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