1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef __PROCESSORGROUP_HXX__
21 #define __PROCESSORGROUP_HXX__
23 #include "CommInterface.hxx"
33 ProcessorGroup(const CommInterface& interface):_comm_interface(interface) { }
34 ProcessorGroup(const CommInterface& interface, std::set<int> proc_ids):
35 _comm_interface(interface),_proc_ids(proc_ids) { }
36 ProcessorGroup (const ProcessorGroup& proc_group, std::set<int> proc_ids):
37 _comm_interface(proc_group.getCommInterface()),_proc_ids(proc_ids) { }
38 ProcessorGroup (const ProcessorGroup& other):
39 _comm_interface(other.getCommInterface()),_proc_ids(other._proc_ids) { }
40 ProcessorGroup (const CommInterface& interface, int start, int end);
41 virtual ~ProcessorGroup() { }
42 virtual ProcessorGroup *deepCpy() const = 0;
43 virtual ProcessorGroup* fuse (const ProcessorGroup&) const = 0;
44 virtual void intersect (ProcessorGroup&) = 0;
45 bool contains(int rank) const { return _proc_ids.find(rank)!=_proc_ids.end(); }
46 virtual bool containsMyRank() const = 0;
47 int size() const { return _proc_ids.size(); }
48 const CommInterface& getCommInterface()const { return _comm_interface; }
49 virtual int myRank() const = 0;
50 virtual int translateRank(const ProcessorGroup*, int) const = 0;
51 virtual ProcessorGroup* createComplementProcGroup() const = 0;
52 virtual ProcessorGroup* createProcGroup() const = 0;
53 virtual const std::set<int>& getProcIDs()const { return _proc_ids; }
55 const CommInterface _comm_interface;
56 std::set<int> _proc_ids;