From: Anthony Geay Date: Fri, 18 Aug 2023 09:41:34 +0000 (+0200) Subject: [EDF26706] : WIP X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=14a69ac68fd8ac00e73b7ff6b8b8caed076f437c;p=tools%2Fmedcoupling.git [EDF26706] : WIP --- diff --git a/src/ParaMEDMEM/DisjointDEC.cxx b/src/ParaMEDMEM/DisjointDEC.cxx index fee772614..6b07d7025 100644 --- a/src/ParaMEDMEM/DisjointDEC.cxx +++ b/src/ParaMEDMEM/DisjointDEC.cxx @@ -249,7 +249,7 @@ namespace MEDCoupling { if(!isInUnion()) return ; - ProcessorGroup* local_group; + ProcessorGroup *local_group = nullptr; if (_source_group->containsMyRank()) local_group=_source_group; else if (_target_group->containsMyRank()) diff --git a/src/ParaMEDMEM/InterpKernelDEC.cxx b/src/ParaMEDMEM/InterpKernelDEC.cxx index d786641ee..a95d9fd53 100644 --- a/src/ParaMEDMEM/InterpKernelDEC.cxx +++ b/src/ParaMEDMEM/InterpKernelDEC.cxx @@ -31,7 +31,7 @@ namespace MEDCoupling { - InterpKernelDEC::InterpKernelDEC():_interpolation_matrix(nullptr) + InterpKernelDEC::InterpKernelDEC() { } diff --git a/src/ParaMEDMEM/MPIProcessorGroup.cxx b/src/ParaMEDMEM/MPIProcessorGroup.cxx index 4c33fb097..bf6621da3 100644 --- a/src/ParaMEDMEM/MPIProcessorGroup.cxx +++ b/src/ParaMEDMEM/MPIProcessorGroup.cxx @@ -248,11 +248,32 @@ namespace MEDCoupling int MPIProcessorGroup::myRank() const { - int rank; - MPI_Comm_rank(_comm,&rank); + int rank(-1); + _comm_interface.commRank(_comm,&rank); + return rank; + } + + int MPIProcessorGroup::myRankInTheWorld() const + { + int rank(-1); + _comm_interface.commRank(_world_comm,&rank); return rank; } + int MPIProcessorGroup::sizeInGroup() const + { + int size(-1); + _comm_interface.commSize(_comm,&size); + return size; + } + + int MPIProcessorGroup::sizeInWorld() const + { + int size(-1); + _comm_interface.commSize(_world_comm,&size); + return size; + } + ProcessorGroup* MPIProcessorGroup::createProcGroup() const { set procs; diff --git a/src/ParaMEDMEM/MPIProcessorGroup.hxx b/src/ParaMEDMEM/MPIProcessorGroup.hxx index 09e0de56f..3019a40a0 100644 --- a/src/ParaMEDMEM/MPIProcessorGroup.hxx +++ b/src/ParaMEDMEM/MPIProcessorGroup.hxx @@ -44,6 +44,9 @@ namespace MEDCoupling virtual ProcessorGroup* fuse (const ProcessorGroup&) const; void intersect (ProcessorGroup&) { } int myRank() const; + int myRankInTheWorld() const; + int sizeInGroup() const; + int sizeInWorld() const; bool containsMyRank() const { int rank; MPI_Group_rank(_group, &rank); return (rank!=MPI_UNDEFINED); } int translateRank(const ProcessorGroup* group, int rank) const; const MPI_Comm* getComm() const { return &_comm; }