17 explicit Comm(MPI_Comm comm) noexcept : comm_(comm) {}
18 Comm() noexcept :
Comm(MPI_COMM_NULL) {}
19 virtual ~Comm() { free(); }
23 Comm& operator=(MPI_Comm c) {
return *
this =
Comm(c); }
24 Comm(
Comm&& o)
noexcept { *
this = std::move(o); }
28 Comm& operator=(
const Comm&) =
delete;
30 MPI_Comm get()
const noexcept {
return mpi_active() ? comm_ : MPI_COMM_NULL; }
33 operator MPI_Comm()
const noexcept {
return get(); }
35 explicit operator bool()
const noexcept {
return get() != MPI_COMM_NULL; }
38 MPI_Comm release()
noexcept;
43 bool is_revoked()
const;
48 static int size(MPI_Comm comm);
49 static int rank(MPI_Comm comm);
50 static bool is_revoked(MPI_Comm comm);
51 static int revoke(MPI_Comm comm);
55 Comm dup_with_info(MPI_Info info)
const;
57 Comm create(MPI_Group group)
const;
58 Comm create_group(MPI_Group group,
int tag)
const;
60 Comm split(
int color,
int key)
const;
61 Comm split_type(
int split_type,
int key, MPI_Info info)
const;
63 Comm intercomm_create(
64 int local_leader, MPI_Comm peer_comm,
int remote_leader,
int tag
70 static Comm dup(MPI_Comm comm);
71 static Comm dup_with_info(MPI_Comm comm, MPI_Info info);
73 static Comm create(MPI_Comm comm, MPI_Group group);
74 static Comm create_group(MPI_Comm comm, MPI_Group group,
int tag);
76 static Comm split(MPI_Comm comm,
int color,
int key);
77 static Comm split_type(MPI_Comm comm,
int split_type,
int key, MPI_Info info);
79 static Comm intercomm_create(
80 MPI_Comm local_comm,
int local_leader, MPI_Comm peer_comm,
81 int remote_leader,
int tag
84 static Comm shrink(MPI_Comm comm);
87 MPI_Comm comm_ = MPI_COMM_NULL;