X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEM%2FMPIProcessorGroup.hxx;h=7c39ed26dfdad4edf539f69afcd7a36b065db8fa;hb=1f524fd9bdec402d829cbaf369fb194f90c8af20;hp=62c9f438a6dfa9f1885fdbba0b4f7f4951bbadb5;hpb=48782c06022ca2caa36f849cb5a29ea4fe2aaa83;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEM/MPIProcessorGroup.hxx b/src/ParaMEDMEM/MPIProcessorGroup.hxx index 62c9f438a..7c39ed26d 100644 --- a/src/ParaMEDMEM/MPIProcessorGroup.hxx +++ b/src/ParaMEDMEM/MPIProcessorGroup.hxx @@ -1,30 +1,32 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #ifndef __MPIPROCESSORGROUP_HXX__ #define __MPIPROCESSORGROUP_HXX__ +#include "ProcessorGroup.hxx" + #include #include namespace ParaMEDMEM { - class ProcessorGroup; class CommInterface; class MPIProcessorGroup : public ProcessorGroup @@ -33,11 +35,13 @@ namespace ParaMEDMEM MPIProcessorGroup(const CommInterface& interface); MPIProcessorGroup(const CommInterface& interface, std::set proc_ids, const MPI_Comm& world_comm=MPI_COMM_WORLD); MPIProcessorGroup (const ProcessorGroup& proc_group, std::set proc_ids); - MPIProcessorGroup(const CommInterface& interface,int pstart, int pend); + MPIProcessorGroup(const CommInterface& interface,int pstart, int pend, const MPI_Comm& world_comm=MPI_COMM_WORLD); + MPIProcessorGroup(const MPIProcessorGroup& other); virtual ~MPIProcessorGroup(); + virtual ProcessorGroup *deepCpy() const; virtual ProcessorGroup* fuse (const ProcessorGroup&) const; void intersect (ProcessorGroup&) { } - int myRank() const { int rank; MPI_Comm_rank(_comm,&rank); return rank; } + int myRank() 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; } @@ -45,7 +49,9 @@ namespace ParaMEDMEM ProcessorGroup* createProcGroup() const; MPI_Comm getWorldComm() { return _world_comm; } private: - const MPI_Comm _world_comm; + void updateMPISpecificAttributes(); + private: + const MPI_Comm _world_comm; // just an observer - current instance is not responsible for the management of this comm MPI_Group _group; MPI_Comm _comm; };