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, IndexTypeBufferVectorType
 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< DataTypeScalarTicketType
 
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::Commget_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...
 
template<LAFEM::Perspective perspective_ = LAFEM::Perspective::native>
Index get_num_global_dofs () const
 Returns the number of global DOFs. More...
 
template<LAFEM::Perspective perspective_ = LAFEM::Perspective::native>
Index get_num_local_dofs () const
 Returns the number of local DOFs. More...
 
const std::vector< int > get_ranks () const
 Returns a const reference to the neighbor ranks vector. More...
 
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...
 
Gateoperator= (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...
 
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...
 

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 50 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 62 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 54 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 79 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 83 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 56 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 58 of file gate.hpp.

◆ MirrorType

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

the mirror type

Definition at line 60 of file gate.hpp.

◆ ScalarTicketType

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

Definition at line 64 of file gate.hpp.

◆ VectorTicketType

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

Definition at line 65 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 87 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 98 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 104 of file gate.hpp.

◆ ~Gate()

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

virtual destructor

Definition at line 129 of file gate.hpp.

Member Function Documentation

◆ 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 296 of file gate.hpp.

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

Referenced by 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 228 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 191 of file gate.hpp.

◆ 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 506 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 536 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 387 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

Returns a const reference to the frequencies vector.

Returns
A const reference to the frequencies vector

Definition at line 179 of file gate.hpp.

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

◆ 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 169 of file gate.hpp.

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

◆ get_num_global_dofs()

template<typename LocalVector_ , typename Mirror_ >
template<LAFEM::Perspective perspective_ = LAFEM::Perspective::native>
Index FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_global_dofs ( ) const
inline

Returns the number of global DOFs.

Template Parameters
perspective_Specifies whether to compute the native or POD DOF count
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 global DOFS; either in native or POD size

Definition at line 343 of file gate.hpp.

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

◆ get_num_local_dofs()

template<typename LocalVector_ , typename Mirror_ >
template<LAFEM::Perspective perspective_ = LAFEM::Perspective::native>
Index FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_local_dofs ( ) const
inline

Returns the number of local DOFs.

Template Parameters
perspective_Specifies whether to compute the native or POD DOF count
Returns
The number of local DOFS; either in native or POD size

Definition at line 326 of file gate.hpp.

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

◆ 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 159 of file gate.hpp.

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

◆ 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 619 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 635 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 586 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 602 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 655 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 674 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=()

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

◆ 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

Sets the communicator for this gate.

Parameters
[in]comm_A resident pointer to the communicator object to use.

Definition at line 149 of file gate.hpp.

Referenced by FEAT::Control::StokesPowerSystemLevel< dim_, DataType_, IndexType_, ScalarMatrix_, TransferMatrix_ >::assemble_gates(), and FEAT::Control::Meshopt::MeshoptSystemLevel< DT_, IT_, Functional_ >::assemble_gates().

◆ 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 553 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 569 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 408 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::SynchVectorTicket< VT_, VMT_ >::wait().

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 432 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.
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 457 of file gate.hpp.

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

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 485 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


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