From: abn Date: Fri, 12 Apr 2024 09:17:00 +0000 (+0200) Subject: [ODEC] Bug fix for empty matrix parts - thanks Antoine G.! X-Git-Tag: V9_13_0a1~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9ed099bcfad67b9678acbbc231a7b2e0917bfab4;p=tools%2Fmedcoupling.git [ODEC] Bug fix for empty matrix parts - thanks Antoine G.! --- diff --git a/src/ParaMEDMEM/OverlapMapping.cxx b/src/ParaMEDMEM/OverlapMapping.cxx index b19d1706e..051ad3043 100644 --- a/src/ParaMEDMEM/OverlapMapping.cxx +++ b/src/ParaMEDMEM/OverlapMapping.cxx @@ -311,7 +311,7 @@ void OverlapMapping::serializeMatrixStep0ST(const mcIdType *nbOfElemsSrc, mcIdTy int myProcId=_group.myRank(); for(std::size_t i=0;i<_matrixes_st.size();i++) { - if(_source_proc_id_st[i]==myProcId)// && _target_proc_id_st[i]!=myProcId + if(_source_proc_id_st[i]==myProcId && _matrixes_st[i].size())// && _target_proc_id_st[i]!=myProcId { count[_target_proc_id_st[i]]=(int)_matrixes_st[i].size()+1; szz+=_matrixes_st[i].size()+1; @@ -323,7 +323,7 @@ void OverlapMapping::serializeMatrixStep0ST(const mcIdType *nbOfElemsSrc, mcIdTy offsets[i]=offsets[i-1]+count[i-1]; for(std::size_t i=0;i<_matrixes_st.size();i++) { - if(_source_proc_id_st[i]==myProcId) + if(_source_proc_id_st[i]==myProcId && _matrixes_st[i].size()) { mcIdType start=offsets[_target_proc_id_st[i]]; mcIdType *work=bigArr+start; @@ -374,7 +374,7 @@ mcIdType OverlapMapping::serializeMatrixStep1ST(const mcIdType *nbOfElemsSrc, co std::size_t fullLgth=0; for(std::size_t i=0;i<_matrixes_st.size();i++) { - if(_source_proc_id_st[i]==myProcId) + if(_source_proc_id_st[i]==myProcId && _matrixes_st[i].size()) { const std::vector< SparseDoubleVec >& mat=_matrixes_st[i]; mcIdType lgthToSend=0; @@ -393,7 +393,7 @@ mcIdType OverlapMapping::serializeMatrixStep1ST(const mcIdType *nbOfElemsSrc, co fullLgth=0; for(std::size_t i=0;i<_matrixes_st.size();i++) { - if(_source_proc_id_st[i]==myProcId) + if(_source_proc_id_st[i]==myProcId && _matrixes_st[i].size()) { const std::vector< SparseDoubleVec >& mat=_matrixes_st[i]; for(std::vector< SparseDoubleVec >::const_iterator it1=mat.begin();it1!=mat.end();it1++)