From 11fb093f3bbc6261f7a1ec02dc1a83255c13d185 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 1192ad9ea..4d85fddd2 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