diff --git a/include/ginkgo/core/base/mpi.hpp b/include/ginkgo/core/base/mpi.hpp index 0909dce5cea..8b4a9a6e10b 100644 --- a/include/ginkgo/core/base/mpi.hpp +++ b/include/ginkgo/core/base/mpi.hpp @@ -455,6 +455,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. *