Skip to content

Commit

Permalink
create owning communicator
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelKoch committed Aug 9, 2024
1 parent 991bbac commit 44284fc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/ginkgo/core/base/mpi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,14 @@ class communicator {
this->comm_.reset(new MPI_Comm(comm_out), comm_deleter{});
}

static communicator create_owning(const MPI_Comm& comm,
bool force_host_buffer = false)
{
communicator comm_out(MPI_COMM_NULL, force_host_buffer);
comm_out.comm_.reset(new MPI_Comm(comm), comm_deleter{});
return comm_out;
}

/**
* Return the underlying MPI_Comm object.
*
Expand Down

0 comments on commit 44284fc

Please sign in to comment.