FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Global::Gate< LocalVector_, Mirror_ > Class Template Reference

Global gate implementation. More...

#include <gate.hpp>

Public Types

typedef LAFEM::DenseVector< DataType, IndexType > BufferVectorType
 the internal buffer vector type More...
 
typedef LocalVector_::DataType DataType
 the data type More...
 
template<typename LocalVector2_ , typename Mirror2_ >
using GateType = Gate< LocalVector2_, Mirror2_ >
 Our 'base' class type. More...
 
template<typename DataType2_ , typename IndexType2_ >
using GateTypeByDI = Gate< typename LocalVector_::template ContainerType< DataType2_, IndexType2_ >, typename Mirror_::template MirrorType< DataType2_, IndexType2_ > >
 this typedef lets you create a gate container with new Data and Index types More...
 
typedef LocalVector_::IndexType IndexType
 the index type More...
 
typedef LocalVector_ LocalVectorType
 the local vector type More...
 
typedef Mirror_ MirrorType
 the mirror type More...
 
typedef SynchScalarTicket< DataType > ScalarTicketType
 
typedef SynchVectorTicket< LocalVector_, Mirror_ > VectorTicketType
 

Public Member Functions

 Gate ()
 standard constructor More...
 
 Gate (const Dist::Comm &comm)
 Constructor. More...
 
 Gate (Gate &&other)
 move constructor More...
 
virtual ~Gate ()
 virtual destructor More...
 
std::size_t bytes () const
 Returns the total amount of bytes allocated. More...
 
void compile (LocalVector_ &&vector)
 Compiles the gate to finish its setup. More...
 
template<typename LVT2_ >
void convert (const Gate< LVT2_, Mirror_ > &other, LocalVector_ &&vector, LAFEM::CloneMode mode=LAFEM::CloneMode::Shallow)
 Conversion function for different vector container type. More...
 
template<typename LVT2_ , typename MT2_ >
void convert (const Gate< LVT2_, MT2_ > &other)
 Conversion function for same vector container type but with different MDI-Type. More...
 
DataType dot (const LocalVector_ &x, const LocalVector_ &y) const
 Computes a synchronized dot-product of two type-1 vectors. More...
 
ScalarTicketType dot_async (const LocalVector_ &x, const LocalVector_ &y, bool sqrt=false) const
 Computes a synchronized dot-product of two type-1 vectors. More...
 
void from_1_to_0 (LocalVector_ &vector) const
 Converts a type-1 vector into a type-0 vector. More...
 
const Dist::Comm * get_comm () const
 Returns a const pointer to the underlying communicator. More...
 
const LocalVector_ & get_freqs () const
 Returns a const reference to the frequencies vector. More...
 
const std::vector< Mirror_ > & get_mirrors () const
 Returns a const reference to the neighbor mirrors vector. More...
 
Index get_num_global_dofs () const
 Returns the number of native global DOFs. More...
 
Index get_num_global_dofs_raw () const
 Returns the number of raw global DOFs. More...
 
Index get_num_local_dofs () const
 Returns the number of native local DOFs. More...
 
Index get_num_local_dofs_raw () const
 Returns the number of raw local DOFs. More...
 
const std::vector< int > get_ranks () const
 Returns a const reference to the neighbor ranks vector. More...
 
SyncLocation get_sync_location () const
 
DataType max (DataType x) const
 Computes the maximum of a scalar variable over all processes. More...
 
ScalarTicketType max_async (DataType x) const
 Computes the maximum of a scalar variable over all processes. More...
 
DataType min (DataType x) const
 Computes the minimum of a scalar variable over all processes. More...
 
ScalarTicketType min_async (DataType x) const
 Computes the minimum of a scalar variable over all processes. More...
 
DataType norm2 (DataType x) const
 Computes a reduced 2-norm over all processes. More...
 
ScalarTicketType norm2_async (DataType x) const
 Computes a reduced 2-norm over all processes. More...
 
Gate & operator= (Gate &&other)
 move-assign operator More...
 
void push (int rank, Mirror_ &&mirror)
 Adds a mirror for a neighbor process. More...
 
void set_comm (const Dist::Comm *comm_)
 Sets the communicator for this gate. More...
 
void set_sync_location (SyncLocation sync_location)
 Set the sync location to be used. More...
 
DataType sum (DataType x) const
 Computes a reduced sum over all processes. More...
 
ScalarTicketType sum_async (DataType x, bool sqrt=false) const
 Computes a reduced sum over all processes. More...
 
void sync_0 (LocalVector_ &vector) const
 Synchronizes a type-0 vector, resulting in a type-1 vector. More...
 
VectorTicketType sync_0_async (LocalVector_ &vector) const
 Synchronizes a type-0 vector, resulting in a type-1 vector. More...
 
void sync_1 (LocalVector_ &vector) const
 Synchronizes a type-1 vector, resulting in a type-1 vector. More...
 
VectorTicketType sync_1_async (LocalVector_ &vector) const
 Synchronizes a type-1 vector, resulting in a type-1 vector. More...
 

Public Attributes

const Dist::Comm * _comm
 our communicator More...
 
LocalVector_ _freqs
 frequency vector More...
 
std::vector< Mirror_ > _mirrors
 vector mirrors More...
 
std::vector< int > _ranks
 communication ranks More...
 
std::vector< BufferVectorType > _recv_buffers
 
Dist::RequestVector _recv_reqs
 
std::vector< Memory::TypedView< DataType > > _recv_views
 
std::vector< BufferVectorType > _send_buffers
 persistent buffer vectors More...
 
Dist::RequestVector _send_reqs
 persistent MPI Requests More...
 
std::vector< Memory::TypedView< DataType > > _send_views
 send and receive buffer views More...
 
SyncLocation _sync_location = SyncLocation::host
 

Protected Member Functions

PreferredBackend _get_sync_backend () const
 
void _sync_vec (LocalVector_ &vector) const
 Sychronizes a vector by adding all mirrors elements. More...
 

Detailed Description

template<typename LocalVector_, typename Mirror_>
class FEAT::Global::Gate< LocalVector_, Mirror_ >

Global gate implementation.

This class provides the functionality for the synchronization of data across interfaces between nearest neighbors (aka 'halos') in the overlapping domain decomposition approach and is used by most other Global classes. Note that a gate is tied to one finite element space (or a tuple thereof) and one vector type, i.e. if you need to synchronize different vector types belonging to possibly different finite element spaces, then you also need one gate object for each space-vector pair. In the case where you need two gate objects for the same finite element space object, but for different vector classes, you can make use of the convert functions to convert one gate into another one for the second vector type.

Template Parameters
LocalVector_The type of the local vector container; may be any valid combination of LAFEM (meta-)vector types
Mirror_The type of the vector mirror; must be compatible to the local vector type

To set up an object of this class, one has to perform three separate steps:

  1. Set the Dist::Comm object for the gate by using the set_comm() function.
  2. Add the mirror for each nearest neighbor by using the push() function.
  3. Compile the gate by calling the compile() function and supplying it with a temporary local vector.
Author
Peter Zajac

Definition at line 77 of file gate.hpp.

Member Typedef Documentation

◆ BufferVectorType

template<typename LocalVector_ , typename Mirror_ >
typedef LAFEM::DenseVector<DataType, IndexType> FEAT::Global::Gate< LocalVector_, Mirror_ >::BufferVectorType

the internal buffer vector type

Definition at line 89 of file gate.hpp.

◆ DataType

template<typename LocalVector_ , typename Mirror_ >
typedef LocalVector_::DataType FEAT::Global::Gate< LocalVector_, Mirror_ >::DataType

the data type

Definition at line 81 of file gate.hpp.

◆ GateType

template<typename LocalVector_ , typename Mirror_ >
template<typename LocalVector2_ , typename Mirror2_ >
using FEAT::Global::Gate< LocalVector_, Mirror_ >::GateType = Gate<LocalVector2_, Mirror2_>

Our 'base' class type.

Definition at line 114 of file gate.hpp.

◆ GateTypeByDI

template<typename LocalVector_ , typename Mirror_ >
template<typename DataType2_ , typename IndexType2_ >
using FEAT::Global::Gate< LocalVector_, Mirror_ >::GateTypeByDI = Gate<typename LocalVector_::template ContainerType<DataType2_, IndexType2_>, typename Mirror_::template MirrorType<DataType2_, IndexType2_> >

this typedef lets you create a gate container with new Data and Index types

Definition at line 118 of file gate.hpp.

◆ IndexType

template<typename LocalVector_ , typename Mirror_ >
typedef LocalVector_::IndexType FEAT::Global::Gate< LocalVector_, Mirror_ >::IndexType

the index type

Definition at line 83 of file gate.hpp.

◆ LocalVectorType

template<typename LocalVector_ , typename Mirror_ >
typedef LocalVector_ FEAT::Global::Gate< LocalVector_, Mirror_ >::LocalVectorType

the local vector type

Definition at line 85 of file gate.hpp.

◆ MirrorType

template<typename LocalVector_ , typename Mirror_ >
typedef Mirror_ FEAT::Global::Gate< LocalVector_, Mirror_ >::MirrorType

the mirror type

Definition at line 87 of file gate.hpp.

◆ ScalarTicketType

template<typename LocalVector_ , typename Mirror_ >
typedef SynchScalarTicket<DataType> FEAT::Global::Gate< LocalVector_, Mirror_ >::ScalarTicketType

Definition at line 91 of file gate.hpp.

◆ VectorTicketType

template<typename LocalVector_ , typename Mirror_ >
typedef SynchVectorTicket<LocalVector_, Mirror_> FEAT::Global::Gate< LocalVector_, Mirror_ >::VectorTicketType

Definition at line 92 of file gate.hpp.

Constructor & Destructor Documentation

◆ Gate() [1/3]

template<typename LocalVector_ , typename Mirror_ >
FEAT::Global::Gate< LocalVector_, Mirror_ >::Gate ( )
inlineexplicit

standard constructor

Definition at line 122 of file gate.hpp.

◆ Gate() [2/3]

template<typename LocalVector_ , typename Mirror_ >
FEAT::Global::Gate< LocalVector_, Mirror_ >::Gate ( const Dist::Comm &  comm)
inlineexplicit

Constructor.

Parameters
[in]commA resident reference to the communicator to be used by the gate.

Definition at line 133 of file gate.hpp.

◆ Gate() [3/3]

template<typename LocalVector_ , typename Mirror_ >
FEAT::Global::Gate< LocalVector_, Mirror_ >::Gate ( Gate< LocalVector_, Mirror_ > &&  other)
inline

move constructor

Definition at line 139 of file gate.hpp.

◆ ~Gate()

template<typename LocalVector_ , typename Mirror_ >
virtual FEAT::Global::Gate< LocalVector_, Mirror_ >::~Gate ( )
inlinevirtual

virtual destructor

Definition at line 176 of file gate.hpp.

Member Function Documentation

◆ _get_sync_backend()

template<typename LocalVector_ , typename Mirror_ >
PreferredBackend FEAT::Global::Gate< LocalVector_, Mirror_ >::_get_sync_backend ( ) const
inlineprotected

Definition at line 914 of file gate.hpp.

◆ _sync_vec()

◆ bytes()

◆ compile()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Gate< LocalVector_, Mirror_ >::compile ( LocalVector_ &&  vector)
inline

Compiles the gate to finish its setup.

Parameters
[in]vectorA temporary vector allocated to the correct size which is used for initialization of the internal frequencies vector. Its numerical contents are ignored.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 370 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_freqs, FEAT::Global::Gate< LocalVector_, Mirror_ >::_mirrors, FEAT::Global::Gate< LocalVector_, Mirror_ >::_send_buffers, FEAT::Dist::RequestVector::clear(), and FEAT::Dist::RequestVector::reserve().

Referenced by FEAT::Solver::AmaVankaGMRES< Global::Matrix< LocalMatrix_, MirrorRow_, MirrorCol_ >, Global::Filter< LocalFilter_, MirrorRow_ > >::AmaVankaGMRES(), FEAT::Control::StokesPowerSystemLevel< dim_, DataType_, IndexType_, ScalarMatrix_, TransferMatrix_ >::assemble_gates(), FEAT::Control::Meshopt::MeshoptSystemLevel< DT_, IT_, Functional_ >::assemble_gates(), and FEAT::Global::Gate< LocalVector_, Mirror_ >::convert().

◆ convert() [1/2]

template<typename LocalVector_ , typename Mirror_ >
template<typename LVT2_ >
void FEAT::Global::Gate< LocalVector_, Mirror_ >::convert ( const Gate< LVT2_, Mirror_ > &  other,
LocalVector_ &&  vector,
LAFEM::CloneMode  mode = LAFEM::CloneMode::Shallow 
)
inline

Conversion function for different vector container type.

This function (re)creates this gate from another gate with a different vector type, but the same mirrors. This can be used to create a gate using DenseVectorBlocked from a gate using DenseVector or vice versa.

Parameters
[in]otherA (transient) reference to the gate using the other vector type to create this gate from.
[in]vectorA temporary vector allocated to the correct size that is to be used for internal initialization.
[in]modeThe clone-mode to be used for cloning the mirrors. Defaults to shallow clone.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 289 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_mirrors, and FEAT::Global::Gate< LocalVector_, Mirror_ >::compile().

◆ convert() [2/2]

template<typename LocalVector_ , typename Mirror_ >
template<typename LVT2_ , typename MT2_ >
void FEAT::Global::Gate< LocalVector_, Mirror_ >::convert ( const Gate< LVT2_, MT2_ > &  other)
inline

Conversion function for same vector container type but with different MDI-Type.

Parameters
[in]otherA transient reference to the gate to convert from

Definition at line 238 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_mirrors, FEAT::Dist::RequestVector::clear(), and FEAT::Dist::RequestVector::reserve().

◆ dot()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Gate< LocalVector_, Mirror_ >::dot ( const LocalVector_ &  x,
const LocalVector_ &  y 
) const
inline

Computes a synchronized dot-product of two type-1 vectors.

Parameters
[in]x,yThe two type-1 vector whose dot-product is to be computed.
Returns
The dot-product of x and y.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 645 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_comm, FEAT::Global::Gate< LocalVector_, Mirror_ >::_freqs, FEAT::Global::Gate< LocalVector_, Mirror_ >::_ranks, FEAT::Dist::Comm::size(), and FEAT::Global::Gate< LocalVector_, Mirror_ >::sum().

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::dot().

◆ dot_async()

template<typename LocalVector_ , typename Mirror_ >
ScalarTicketType FEAT::Global::Gate< LocalVector_, Mirror_ >::dot_async ( const LocalVector_ &  x,
const LocalVector_ &  y,
bool  sqrt = false 
) const
inline

Computes a synchronized dot-product of two type-1 vectors.

Parameters
[in]x,yThe two type-1 vector whose dot-product is to be computed.
Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 675 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_freqs, and FEAT::Global::Gate< LocalVector_, Mirror_ >::sum_async().

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::dot_async(), and FEAT::Global::Vector< LocalVector_, Mirror_ >::norm2_async().

◆ from_1_to_0()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Gate< LocalVector_, Mirror_ >::from_1_to_0 ( LocalVector_ &  vector) const
inline

Converts a type-1 vector into a type-0 vector.

Parameters
[in,out]vectorOn entry, the type-1 vector to be converted. On exit, the converted type-0 vector.
Note
This function does not perform any synchronization.

Definition at line 530 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_freqs, and FEAT::Global::Gate< LocalVector_, Mirror_ >::_ranks.

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::from_1_to_0(), FEAT::Global::Gate< LocalVector_, Mirror_ >::sync_1(), and FEAT::Global::Gate< LocalVector_, Mirror_ >::sync_1_async().

◆ get_comm()

◆ get_freqs()

template<typename LocalVector_ , typename Mirror_ >
const LocalVector_ & FEAT::Global::Gate< LocalVector_, Mirror_ >::get_freqs ( ) const
inline

◆ get_mirrors()

template<typename LocalVector_ , typename Mirror_ >
const std::vector< Mirror_ > & FEAT::Global::Gate< LocalVector_, Mirror_ >::get_mirrors ( ) const
inline

Returns a const reference to the neighbor mirrors vector.

Returns
A const reference to the neighbor mirrors vector

Definition at line 216 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_mirrors.

Referenced by FEAT::Global::AlgDofParti< LocalVector_, Mirror_ >::assemble_by_gate().

◆ get_num_global_dofs()

template<typename LocalVector_ , typename Mirror_ >
Index FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_global_dofs ( ) const
inline

Returns the number of native global DOFs.

Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.
Returns
The number of native global DOFS

Definition at line 443 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_mirrors, FEAT::Dist::Comm::allreduce(), FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_local_dofs(), FEAT::Dist::op_sum, FEAT::Dist::Comm::rank(), FEAT::Dist::Comm::size(), and XASSERT.

Referenced by FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::num_cols(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::num_rows(), and FEAT::Global::Vector< LocalVector_, Mirror_ >::size().

◆ get_num_global_dofs_raw()

template<typename LocalVector_ , typename Mirror_ >
Index FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_global_dofs_raw ( ) const
inline

Returns the number of raw global DOFs.

Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.
Returns
The number of raw global DOFS

Definition at line 486 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_mirrors, FEAT::Dist::Comm::allreduce(), FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_local_dofs_raw(), FEAT::Dist::op_sum, FEAT::Dist::Comm::rank(), FEAT::Dist::Comm::size(), and XASSERT.

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::size_raw().

◆ get_num_local_dofs()

template<typename LocalVector_ , typename Mirror_ >
Index FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_local_dofs ( ) const
inline

Returns the number of native local DOFs.

Returns
The number of native local DOFS

Definition at line 420 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_freqs.

Referenced by FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_global_dofs().

◆ get_num_local_dofs_raw()

template<typename LocalVector_ , typename Mirror_ >
Index FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_local_dofs_raw ( ) const
inline

Returns the number of raw local DOFs.

Returns
The number of raw local DOFS

Definition at line 430 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_freqs.

Referenced by FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_global_dofs_raw().

◆ get_ranks()

template<typename LocalVector_ , typename Mirror_ >
const std::vector< int > FEAT::Global::Gate< LocalVector_, Mirror_ >::get_ranks ( ) const
inline

Returns a const reference to the neighbor ranks vector.

Returns
A const reference to the neighbor ranks vector

Definition at line 206 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_ranks.

Referenced by FEAT::Solver::AmaVankaGMRES< Global::Matrix< LocalMatrix_, MirrorRow_, MirrorCol_ >, Global::Filter< LocalFilter_, MirrorRow_ > >::AmaVankaGMRES().

◆ get_sync_location()

template<typename LocalVector_ , typename Mirror_ >
SyncLocation FEAT::Global::Gate< LocalVector_, Mirror_ >::get_sync_location ( ) const
inline

Definition at line 829 of file gate.hpp.

◆ max()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Gate< LocalVector_, Mirror_ >::max ( DataType  x) const
inline

Computes the maximum of a scalar variable over all processes.

Parameters
[in]xWhat we want to compute the maximum over all processes of.
Returns
The maximum of all x.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 758 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::max_async(), and FEAT::Global::SynchScalarTicket< DT_ >::wait().

Referenced by FEAT::Assembly::BurgersAssemblyJobBase< DataType_, Space_, ConvVector_ >::calc_sd_v_norm(), FEAT::Assembly::BurgersCarreauAssemblyJobBase< DataType_, Space_, ConvVector_ >::calc_sd_v_norm(), FEAT::Global::Vector< LocalVector_, Mirror_ >::max_abs_element(), FEAT::Global::Vector< LocalVector_, Mirror_ >::max_rel_diff(), FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::set_sd_v_norm(), and FEAT::Assembly::BurgersAssemblerCarreau< DataType_, IndexType_, dim_ >::set_sd_v_norm().

◆ max_async()

template<typename LocalVector_ , typename Mirror_ >
ScalarTicketType FEAT::Global::Gate< LocalVector_, Mirror_ >::max_async ( DataType  x) const
inline

Computes the maximum of a scalar variable over all processes.

Parameters
[in]xWhat we want to compute the maximum over all processes of.
Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 774 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_comm, and FEAT::Dist::op_max.

Referenced by FEAT::Global::Gate< LocalVector_, Mirror_ >::max(), FEAT::Global::Vector< LocalVector_, Mirror_ >::max_abs_element_async(), FEAT::Global::Vector< LocalVector_, Mirror_ >::max_element(), FEAT::Global::Vector< LocalVector_, Mirror_ >::max_element_async(), and FEAT::Global::Vector< LocalVector_, Mirror_ >::max_rel_diff_async().

◆ min()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Gate< LocalVector_, Mirror_ >::min ( DataType  x) const
inline

Computes the minimum of a scalar variable over all processes.

Parameters
[in]xWhat we want to compute the minimum over all processes of.
Returns
The minimum of all x.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 725 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::min_async(), and FEAT::Global::SynchScalarTicket< DT_ >::wait().

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::min_abs_element(), and FEAT::Global::Vector< LocalVector_, Mirror_ >::min_element().

◆ min_async()

template<typename LocalVector_ , typename Mirror_ >
ScalarTicketType FEAT::Global::Gate< LocalVector_, Mirror_ >::min_async ( DataType  x) const
inline

Computes the minimum of a scalar variable over all processes.

Parameters
[in]xWhat we want to compute the minimum over all processes of.
Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 741 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_comm, and FEAT::Dist::op_min.

Referenced by FEAT::Global::Gate< LocalVector_, Mirror_ >::min(), FEAT::Global::Vector< LocalVector_, Mirror_ >::min_abs_element_async(), and FEAT::Global::Vector< LocalVector_, Mirror_ >::min_element_async().

◆ norm2()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Gate< LocalVector_, Mirror_ >::norm2 ( DataType  x) const
inline

Computes a reduced 2-norm over all processes.

This function is equivalent to the call Math::sqrt(this->sum(x*x))

Parameters
[in]xThe value that is to be summarized over all processes.
Returns
The reduced 2-norm of all x.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 794 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::norm2_async(), and FEAT::Global::SynchScalarTicket< DT_ >::wait().

◆ norm2_async()

template<typename LocalVector_ , typename Mirror_ >
ScalarTicketType FEAT::Global::Gate< LocalVector_, Mirror_ >::norm2_async ( DataType  x) const
inline

Computes a reduced 2-norm over all processes.

This function is equivalent to the call Math::sqrt(this->sum(x*x))

Parameters
[in]xThe value that is to be summarized over all processes.
Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 813 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_comm, and FEAT::Dist::op_sum.

Referenced by FEAT::Global::Gate< LocalVector_, Mirror_ >::norm2().

◆ operator=()

◆ push()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Gate< LocalVector_, Mirror_ >::push ( int  rank,
Mirror_ &&  mirror 
)
inline

◆ set_comm()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Gate< LocalVector_, Mirror_ >::set_comm ( const Dist::Comm *  comm_)
inline

◆ set_sync_location()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Gate< LocalVector_, Mirror_ >::set_sync_location ( SyncLocation  sync_location)
inline

Set the sync location to be used.

Parameters
[in]sync_locationThe location to be used by default

Definition at line 824 of file gate.hpp.

Referenced by FEAT::Solver::AmaVankaGMRES< Global::Matrix< LocalMatrix_, MirrorRow_, MirrorCol_ >, Global::Filter< LocalFilter_, MirrorRow_ > >::AmaVankaGMRES().

◆ sum()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Gate< LocalVector_, Mirror_ >::sum ( DataType  x) const
inline

Computes a reduced sum over all processes.

Parameters
[in]xThe value that is to be summed over all processes.
Returns
The reduced sum of all x.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 692 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::sum_async(), and FEAT::Global::SynchScalarTicket< DT_ >::wait().

Referenced by FEAT::Global::Gate< LocalVector_, Mirror_ >::dot(), FEAT::Global::NonlinearFunctional< LocalNonlinearFunctional_, RowMirrorType_, ColMirrorType_ >::eval_fval_grad(), FEAT::Global::NonlinearFunctional< LocalNonlinearFunctional_, RowMirrorType_, ColMirrorType_ >::init(), and FEAT::Global::NonlinearFunctional< LocalNonlinearFunctional_, RowMirrorType_, ColMirrorType_ >::prepare().

◆ sum_async()

template<typename LocalVector_ , typename Mirror_ >
ScalarTicketType FEAT::Global::Gate< LocalVector_, Mirror_ >::sum_async ( DataType  x,
bool  sqrt = false 
) const
inline

Computes a reduced sum over all processes.

Parameters
[in]xThe value that is to be summed over all processes.
Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 708 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_comm, and FEAT::Dist::op_sum.

Referenced by FEAT::Global::Gate< LocalVector_, Mirror_ >::dot_async(), and FEAT::Global::Gate< LocalVector_, Mirror_ >::sum().

◆ sync_0()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Gate< LocalVector_, Mirror_ >::sync_0 ( LocalVector_ &  vector) const
inline

Synchronizes a type-0 vector, resulting in a type-1 vector.

This function performs a type-0 synchronization, i.e. sums up all local DOF contributions for each DOF, by exchanging the DOF values of each shared DOF among all nearest neighbors.

Parameters
[in,out]vectorOn entry, the type-0 vector to be synchronized.
On exit, the synchronized type-1 vector.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 552 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_sync_vec().

Referenced by FEAT::Global::NonlinearFunctional< LocalNonlinearFunctional_, RowMirrorType_, ColMirrorType_ >::init(), FEAT::Global::NonlinearFunctional< LocalNonlinearFunctional_, RowMirrorType_, ColMirrorType_ >::prepare(), FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_0(), and FEAT::Control::Meshopt::MeshoptSystemLevel< DT_, IT_, Functional_ >::sync_system_filter().

◆ sync_0_async()

template<typename LocalVector_ , typename Mirror_ >
VectorTicketType FEAT::Global::Gate< LocalVector_, Mirror_ >::sync_0_async ( LocalVector_ &  vector) const
inline

Synchronizes a type-0 vector, resulting in a type-1 vector.

This function performs a type-0 synchronization, i.e. sums up all local DOF contributions for each DOF, by exchanging the DOF values of each shared DOF among all nearest neighbors.

Parameters
[in,out]vectorOn entry, the type-0 vector to be synchronized.
On exit, the synchronized type-1 vector.
Returns
A ticket that has to be waited upon to complete the sync operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 573 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_comm, FEAT::Global::Gate< LocalVector_, Mirror_ >::_mirrors, and FEAT::Global::Gate< LocalVector_, Mirror_ >::_ranks.

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_0_async().

◆ sync_1()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Gate< LocalVector_, Mirror_ >::sync_1 ( LocalVector_ &  vector) const
inline

Synchronizes a type-1 vector, resulting in a type-1 vector.

This function performs a type-1 synchronization, i.e. averages all local DOF contributions for each DOF, by exchanging the DOF values of each shared DOF among all nearest neighbors.

Parameters
[in,out]vectorOn entry, the type-1 vector to be synchronized.
On exit, the synchronized type-1 vector.
[in]sync_backendThe backend on which the sychronization should take place
Note
This function effectively applies the from_1_to_0() and sync_0() functions onto the input vector.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 599 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_ranks, FEAT::Global::Gate< LocalVector_, Mirror_ >::_sync_vec(), and FEAT::Global::Gate< LocalVector_, Mirror_ >::from_1_to_0().

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_1().

◆ sync_1_async()

template<typename LocalVector_ , typename Mirror_ >
VectorTicketType FEAT::Global::Gate< LocalVector_, Mirror_ >::sync_1_async ( LocalVector_ &  vector) const
inline

Synchronizes a type-1 vector, resulting in a type-1 vector.

This function performs a type-1 synchronization, i.e. averages all local DOF contributions for each DOF, by exchanging the DOF values of each shared DOF among all nearest neighbors.

Parameters
[in,out]vectorOn entry, the type-1 vector to be synchronized.
On exit, the synchronized type-1 vector.
Returns
A ticket that has to be waited upon to complete the sync operation.
Note
This function effectively applies the from_1_to_0() and sync_0() functions onto the input vector.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 627 of file gate.hpp.

References FEAT::Global::Gate< LocalVector_, Mirror_ >::_comm, FEAT::Global::Gate< LocalVector_, Mirror_ >::_mirrors, FEAT::Global::Gate< LocalVector_, Mirror_ >::_ranks, and FEAT::Global::Gate< LocalVector_, Mirror_ >::from_1_to_0().

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_1_async().

Member Data Documentation

◆ _comm

◆ _freqs

◆ _mirrors

◆ _ranks

◆ _recv_buffers

template<typename LocalVector_ , typename Mirror_ >
std::vector<BufferVectorType> FEAT::Global::Gate< LocalVector_, Mirror_ >::_recv_buffers

Definition at line 102 of file gate.hpp.

◆ _recv_reqs

template<typename LocalVector_ , typename Mirror_ >
Dist::RequestVector FEAT::Global::Gate< LocalVector_, Mirror_ >::_recv_reqs

Definition at line 104 of file gate.hpp.

◆ _recv_views

template<typename LocalVector_ , typename Mirror_ >
std::vector<Memory::TypedView<DataType> > FEAT::Global::Gate< LocalVector_, Mirror_ >::_recv_views

Definition at line 106 of file gate.hpp.

◆ _send_buffers

template<typename LocalVector_ , typename Mirror_ >
std::vector<BufferVectorType> FEAT::Global::Gate< LocalVector_, Mirror_ >::_send_buffers
mutable

◆ _send_reqs

template<typename LocalVector_ , typename Mirror_ >
Dist::RequestVector FEAT::Global::Gate< LocalVector_, Mirror_ >::_send_reqs
mutable

◆ _send_views

template<typename LocalVector_ , typename Mirror_ >
std::vector<Memory::TypedView<DataType> > FEAT::Global::Gate< LocalVector_, Mirror_ >::_send_views
mutable

send and receive buffer views

Definition at line 106 of file gate.hpp.

Referenced by FEAT::Global::Gate< LocalVector_, Mirror_ >::_sync_vec(), and FEAT::Global::Gate< LocalVector_, Mirror_ >::operator=().

◆ _sync_location

template<typename LocalVector_ , typename Mirror_ >
SyncLocation FEAT::Global::Gate< LocalVector_, Mirror_ >::_sync_location = SyncLocation::host

Definition at line 110 of file gate.hpp.


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