19#ifndef OPM_GPUISTL_GPUOWNEROVERLAPCOPY_HPP
20#define OPM_GPUISTL_GPUOWNEROVERLAPCOPY_HPP
22#include <dune/istl/owneroverlapcopy.hh>
24#include <opm/simulators/linalg/FlowLinearSolverParameters.hpp>
25#include <opm/simulators/linalg/gpuistl/GpuAwareMPISender.hpp>
26#include <opm/simulators/linalg/gpuistl/GpuObliviousMPISender.hpp>
27#include <opm/simulators/linalg/gpuistl/GpuVector.hpp>
53template <
class field_type,
class OwnerOverlapCopyCommunicationType>
64 void copyOwnerToAll(
const X& source,
X&
dest)
const
66 m_sender->copyOwnerToAll(source,
dest);
69 void dot(
const X& x,
const X&
y, field_type&
output)
const
74 field_type norm(
const X& x)
const
76 return m_sender->norm(x);
79 void project(
X& x)
const
90 return m_sender->communicator();
94 std::shared_ptr<GPUSender<field_type, OwnerOverlapCopyCommunicationType>> m_sender;
97template <
class field_type,
int block_size,
class OwnerOverlapCopyCommunicationType>
98std::shared_ptr<GpuOwnerOverlapCopy<field_type, OwnerOverlapCopyCommunicationType>>
102 const auto useGPUAwareMPI = Opm::Parameters::Get<Opm::Parameters::GpuAwareMpi>();
103 const auto verifyGPUAwareMPI = Opm::Parameters::Get<Opm::Parameters::VerifyGpuAwareMpi>();
104 std::shared_ptr<Opm::gpuistl::GPUSender<field_type, OwnerOverlapCopyCommunicationType>>
gpuComm;
113#if defined(MPIX_CUDA_AWARE_SUPPORT) && MPIX_CUDA_AWARE_SUPPORT
117#if defined(MPIX_CUDA_AWARE_SUPPORT)
125 fmt::format(
"The GPU-aware MPI support is not available. "
126 "CUDA aware support at compile time: {}, "
127 "CUDA aware support at runtime: {}. "
128 "Please check your MPI installation and the OPM configuration "
129 "or run with --gpu-aware-mpi=false. If you are sure that your MPI "
130 "implementation supports GPU aware MPI, you can disable this check "
131 "by setting --verify-gpu-aware-mpi=false.",
148 return std::make_shared<CudaCommunication>(
gpuComm);
Derived class of GPUSender that handles MPI made with CUDA aware MPI The copOwnerToAll function uses ...
Definition GpuAwareMPISender.hpp:46
Derived class of GPUSender that handles MPI calls that should NOT use GPU direct communicatoin The im...
Definition GpuObliviousMPISender.hpp:44
GPUSender is a wrapper class for classes which will implement copOwnerToAll This is implemented with ...
Definition GpuSender.hpp:44
CUDA compatiable variant of Dune::OwnerOverlapCopyCommunication.
Definition GpuOwnerOverlapCopy.hpp:55
const ::Dune::Communication< MPI_Comm > & communicator() const
communicator returns the MPI communicator used by this GpuOwnerOverlapCopy
Definition GpuOwnerOverlapCopy.hpp:88
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240