Opm::cuistl::GPUAwareMPISender< field_type, block_size, OwnerOverlapCopyCommunicationType > Class Template Reference

Derived class of GPUSender that handles MPI made with CUDA aware MPI The copOwnerToAll function uses MPI calls refering to data that resides on the GPU in order to send it directly to other GPUs, skipping the staging step on the CPU. More...

#include <CuOwnerOverlapCopy.hpp>

Inheritance diagram for Opm::cuistl::GPUAwareMPISender< field_type, block_size, OwnerOverlapCopyCommunicationType >:
Inheritance graph

Public Types

using X = CuVector< field_type >
 

Public Member Functions

 GPUAwareMPISender (const OwnerOverlapCopyCommunicationType &cpuOwnerOverlapCopy)
 
void copyOwnerToAll (const X &source, X &dest) const override
 copyOwnerToAll will copy source to the CPU, then call OwnerOverlapCopyCommunicationType::copyOwnerToAll on the copied data, and copy the result back to the GPU More...
 
void project (X &x) const
 project will project x to the owned subspace More...
 
void dot (const X &x, const X &y, field_type &output) const
 dot will carry out the dot product between x and y on the owned indices, then sum up the result across MPI processes. More...
 
field_type norm (const X &x) const
 norm computes the l^2-norm of x across processes. More...
 

Protected Attributes

std::once_flag m_initializedIndices
 
std::unique_ptr< CuVector< int > > m_indicesOwner
 
std::unique_ptr< CuVector< int > > m_indicesCopy
 
const OwnerOverlapCopyCommunicationType & m_cpuOwnerOverlapCopy
 

Detailed Description

template<class field_type, int block_size, class OwnerOverlapCopyCommunicationType>
class Opm::cuistl::GPUAwareMPISender< field_type, block_size, OwnerOverlapCopyCommunicationType >

Derived class of GPUSender that handles MPI made with CUDA aware MPI The copOwnerToAll function uses MPI calls refering to data that resides on the GPU in order to send it directly to other GPUs, skipping the staging step on the CPU.

Template Parameters
field_typeis float or double
block_sizeis the blocksize of the blockelements in the matrix
OwnerOverlapCopyCommunicationTypeis typically a Dune::LinearOperator::communication_type

Member Typedef Documentation

◆ X

template<class field_type , int block_size, class OwnerOverlapCopyCommunicationType >
using Opm::cuistl::GPUAwareMPISender< field_type, block_size, OwnerOverlapCopyCommunicationType >::X = CuVector<field_type>

Constructor & Destructor Documentation

◆ GPUAwareMPISender()

template<class field_type , int block_size, class OwnerOverlapCopyCommunicationType >
Opm::cuistl::GPUAwareMPISender< field_type, block_size, OwnerOverlapCopyCommunicationType >::GPUAwareMPISender ( const OwnerOverlapCopyCommunicationType &  cpuOwnerOverlapCopy)
inline

Member Function Documentation

◆ copyOwnerToAll()

template<class field_type , int block_size, class OwnerOverlapCopyCommunicationType >
void Opm::cuistl::GPUAwareMPISender< field_type, block_size, OwnerOverlapCopyCommunicationType >::copyOwnerToAll ( const X source,
X dest 
) const
inlineoverridevirtual

copyOwnerToAll will copy source to the CPU, then call OwnerOverlapCopyCommunicationType::copyOwnerToAll on the copied data, and copy the result back to the GPU

Parameters
[in]source
[out]dest

Implements Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >.

References Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::m_cpuOwnerOverlapCopy, Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::m_initializedIndices, and Opm::cuistl::detail::to_int().

◆ dot()

template<class field_type , class OwnerOverlapCopyCommunicationType >
void Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::dot ( const X x,
const X y,
field_type &  output 
) const
inlineinherited

◆ norm()

template<class field_type , class OwnerOverlapCopyCommunicationType >
field_type Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::norm ( const X x) const
inlineinherited

norm computes the l^2-norm of x across processes.

This will compute the dot product of x with itself on owned indices, then sum the result across process and return the square root of the sum.

References Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::dot().

◆ project()

template<class field_type , class OwnerOverlapCopyCommunicationType >
void Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::project ( X x) const
inlineinherited

Member Data Documentation

◆ m_cpuOwnerOverlapCopy

template<class field_type , class OwnerOverlapCopyCommunicationType >
const OwnerOverlapCopyCommunicationType& Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::m_cpuOwnerOverlapCopy
protectedinherited

◆ m_indicesCopy

template<class field_type , class OwnerOverlapCopyCommunicationType >
std::unique_ptr<CuVector<int> > Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::m_indicesCopy
mutableprotectedinherited

◆ m_indicesOwner

template<class field_type , class OwnerOverlapCopyCommunicationType >
std::unique_ptr<CuVector<int> > Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::m_indicesOwner
mutableprotectedinherited

◆ m_initializedIndices

template<class field_type , class OwnerOverlapCopyCommunicationType >
std::once_flag Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::m_initializedIndices
mutableprotectedinherited

The documentation for this class was generated from the following file: