24 explicit Group(MPI_Group group) noexcept : group_(group) {}
36 virtual ~Group() { free(); }
40 Group& operator=(MPI_Group group) {
return *
this =
Group(group); }
41 Group(
Group&& o)
noexcept { *
this = std::move(o); }
48 MPI_Group get()
const noexcept {
49 return mpi_active() ? group_ : MPI_GROUP_NULL;
53 operator MPI_Group()
const noexcept {
return get(); }
55 explicit operator bool()
const noexcept {
56 return get() != MPI_GROUP_NULL && get() != MPI_GROUP_EMPTY;
60 MPI_Group release()
noexcept;
67 std::vector<int> translate_ranks(
68 const std::vector<int>& ranks1,
const Group& group2
74 std::vector<int> translate_ranks(
const Group& group2)
const;
77 int translate_rank(
int rank1,
const Group& group2)
const;
80 bool is_builtin()
const noexcept;
88 bool operator==(
const Group& other)
const;
89 bool operator!=(
const Group& other)
const {
return !(*
this == other); }
93 bool similar(
const Group& other)
const;
116 Group incl(
const std::vector<int>& ranks)
const;
119 Group excl(
const std::vector<int>& ranks)
const;
123 Group range_incl(
const std::vector<std::array<int, 3>>& ranges)
const;
126 Group range_excl(
const std::vector<std::array<int, 3>>& ranges)
const;
131 static Group dup(MPI_Group source);
134 static Group incl(MPI_Group source,
const std::vector<int>& ranks);
137 static Group excl(MPI_Group source,
const std::vector<int>& ranks);
141 static Group range_incl(
142 MPI_Group source,
const std::vector<std::array<int, 3>>& ranges
146 static Group range_excl(
147 MPI_Group source,
const std::vector<std::array<int, 3>>& ranges
160 MPI_Group group_ = MPI_GROUP_NULL;
163 static bool is_builtin_group(MPI_Group group)
noexcept;
166 static int compare(
const Group& group1,
const Group& group2);