Ginkgo Generated from branch based on master. Ginkgo version 1.7.0
A numerical linear algebra library targeting many-core architectures
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Functions
gko::experimental::distributed Namespace Reference

The distributed namespace. More...

Namespaces

namespace  preconditioner
 The Preconditioner namespace.
 

Classes

class  DistributedBase
 A base class for distributed objects. More...
 
class  Matrix
 The Matrix class defines a (MPI-)distributed matrix. More...
 
class  Partition
 Represents a partition of a range of indices [0, size) into a disjoint set of parts. More...
 
class  Vector
 Vector is a format which explicitly stores (multiple) distributed column vectors in a dense storage format. More...
 

Typedefs

using comm_index_type = int
 Index type for enumerating processes in a distributed application.
 

Functions

template<typename ValueType >
detail::temporary_conversion< experimental::distributed::Vector< ValueType > > make_temporary_conversion (LinOp *matrix)
 Convert the given LinOp from experimental::distributed::Vector<...> to experimental::distributed::Vector<ValueType>.
 
template<typename ValueType >
detail::temporary_conversion< const experimental::distributed::Vector< ValueType > > make_temporary_conversion (const LinOp *matrix)
 Convert the given LinOp from experimental::distributed::Vector<...> to experimental::distributed::Vector<ValueType>.
 
template<typename ValueType , typename Function , typename... Args>
void precision_dispatch (Function fn, Args *... linops)
 Calls the given function with each given argument LinOp temporarily converted into experimental::distributed::Vector<ValueType> as parameters.
 
template<typename ValueType , typename Function >
void precision_dispatch_real_complex (Function fn, const LinOp *in, LinOp *out)
 Calls the given function with the given LinOps temporarily converted to experimental::distributed::Vector<ValueType>* as parameters.
 
template<typename ValueType , typename Function >
void precision_dispatch_real_complex (Function fn, const LinOp *alpha, const LinOp *in, LinOp *out)
 Calls the given function with the given LinOps temporarily converted to experimental::distributed::Vector<ValueType>* as parameters.
 
template<typename ValueType , typename Function >
void precision_dispatch_real_complex (Function fn, const LinOp *alpha, const LinOp *in, const LinOp *beta, LinOp *out)
 Calls the given function with the given LinOps temporarily converted to experimental::distributed::Vector<ValueType>* as parameters.
 
template<typename LocalIndexType , typename GlobalIndexType >
std::unique_ptr< Partition< LocalIndexType, GlobalIndexType > > build_partition_from_local_range (std::shared_ptr< const Executor > exec, mpi::communicator comm, span local_range)
 Builds a partition from a local range.
 
template<typename LocalIndexType , typename GlobalIndexType >
std::unique_ptr< Partition< LocalIndexType, GlobalIndexType > > build_partition_from_local_size (std::shared_ptr< const Executor > exec, mpi::communicator comm, size_type local_size)
 Builds a partition from a local size.
 

Detailed Description

The distributed namespace.

Typedef Documentation

◆ comm_index_type

Index type for enumerating processes in a distributed application.

Conforms to the MPI C interface of e.g. MPI rank or size

Function Documentation

◆ build_partition_from_local_range()

std::unique_ptr< Partition< LocalIndexType, GlobalIndexType > > gko::experimental::distributed::build_partition_from_local_range ( std::shared_ptr< const Executor > exec,
mpi::communicator comm,
span local_range )

Builds a partition from a local range.

Parameters
execthe Executor on which the partition should be built.
commthe communicator used to determine the global partition.
local_rangethe start and end indices of the local range.
Warning
This throws, if the resulting partition would contain gaps. That means that for a partition of size n every local range r_i = [s_i, e_i) either s_i != 0 and another local range r_j = [s_j, e_j = s_i) exists, or e_i != n and another local range r_j = [s_j = e_i, e_j) exists.
Returns
a Partition where each range has the individual local_start and local_ends.

◆ build_partition_from_local_size()

std::unique_ptr< Partition< LocalIndexType, GlobalIndexType > > gko::experimental::distributed::build_partition_from_local_size ( std::shared_ptr< const Executor > exec,
mpi::communicator comm,
size_type local_size )

Builds a partition from a local size.

Parameters
execthe Executor on which the partition should be built.
commthe communicator used to determine the global partition.
local_rangethe number of the locally owned indices
Returns
a Partition where each range has the specified local size. More specifically, if this is called on process i with local_size s_i, then the range i has size s_i, and range r_i = [start, start + s_i), where start = sum_j^(i-1) s_j.

◆ make_temporary_conversion() [1/2]

template<typename ValueType >
detail::temporary_conversion< const experimental::distributed::Vector< ValueType > > gko::experimental::distributed::make_temporary_conversion ( const LinOp * matrix)

Convert the given LinOp from experimental::distributed::Vector<...> to experimental::distributed::Vector<ValueType>.

The conversion tries to convert the input LinOp to all Dense types with value type recursively reachable by next_precision<...> starting from the ValueType template parameter. This means that all real-to-real and complex-to-complex conversions for default precisions are being considered. If the input matrix is non-const, the contents of the modified converted object will be converted back to the input matrix when the returned object is destroyed. This may lead to a loss of precision!

Parameters
matrixthe input matrix which is supposed to be converted. It is wrapped unchanged if it is already of type experimental::distributed::Vector<ValueType>, otherwise it will be converted to this type if possible.
Returns
a detail::temporary_conversion pointing to the (potentially converted) object.
Exceptions
NotSupportedif the input matrix cannot be converted to experimental::distributed::Vector<ValueType>
Template Parameters
ValueTypethe value type into whose associated experimental::distributed::Vector type to convert the input LinOp.

References gko::one().

◆ make_temporary_conversion() [2/2]

template<typename ValueType >
detail::temporary_conversion< experimental::distributed::Vector< ValueType > > gko::experimental::distributed::make_temporary_conversion ( LinOp * matrix)

Convert the given LinOp from experimental::distributed::Vector<...> to experimental::distributed::Vector<ValueType>.

The conversion tries to convert the input LinOp to all Dense types with value type recursively reachable by next_precision<...> starting from the ValueType template parameter. This means that all real-to-real and complex-to-complex conversions for default precisions are being considered. If the input matrix is non-const, the contents of the modified converted object will be converted back to the input matrix when the returned object is destroyed. This may lead to a loss of precision!

Parameters
matrixthe input matrix which is supposed to be converted. It is wrapped unchanged if it is already of type experimental::distributed::Vector<ValueType>, otherwise it will be converted to this type if possible.
Returns
a detail::temporary_conversion pointing to the (potentially converted) object.
Exceptions
NotSupportedif the input matrix cannot be converted to experimental::distributed::Vector<ValueType>
Template Parameters
ValueTypethe value type into whose associated experimental::distributed::Vector type to convert the input LinOp.

References gko::one().

◆ precision_dispatch()

template<typename ValueType , typename Function , typename... Args>
void gko::experimental::distributed::precision_dispatch ( Function fn,
Args *... linops )

Calls the given function with each given argument LinOp temporarily converted into experimental::distributed::Vector<ValueType> as parameters.

Parameters
fnthe given function. It will be passed one (potentially const) experimental::distributed::Vector<ValueType>* parameter per parameter in the parameter pack linops.
linopsthe given arguments to be converted and passed on to fn.
Template Parameters
ValueTypethe value type to use for the parameters of fn.
Functionthe function pointer, lambda or other functor type to call with the converted arguments.
Argsthe argument type list.

References gko::one().

◆ precision_dispatch_real_complex() [1/3]

template<typename ValueType , typename Function >
void gko::experimental::distributed::precision_dispatch_real_complex ( Function fn,
const LinOp * alpha,
const LinOp * in,
const LinOp * beta,
LinOp * out )

Calls the given function with the given LinOps temporarily converted to experimental::distributed::Vector<ValueType>* as parameters.

If ValueType is real and both input vectors are complex, uses experimental::distributed::Vector::get_real_view() to convert them into real matrices after precision conversion.

See also
precision_dispatch()

References gko::one().

◆ precision_dispatch_real_complex() [2/3]

template<typename ValueType , typename Function >
void gko::experimental::distributed::precision_dispatch_real_complex ( Function fn,
const LinOp * alpha,
const LinOp * in,
LinOp * out )

Calls the given function with the given LinOps temporarily converted to experimental::distributed::Vector<ValueType>* as parameters.

If ValueType is real and both input vectors are complex, uses experimental::distributed::Vector::get_real_view() to convert them into real matrices after precision conversion.

See also
precision_dispatch()

References gko::one().

◆ precision_dispatch_real_complex() [3/3]

template<typename ValueType , typename Function >
void gko::experimental::distributed::precision_dispatch_real_complex ( Function fn,
const LinOp * in,
LinOp * out )

Calls the given function with the given LinOps temporarily converted to experimental::distributed::Vector<ValueType>* as parameters.

If ValueType is real and both input vectors are complex, uses experimental::distributed::Vector::get_real_view() to convert them into real matrices after precision conversion.

See also
precision_dispatch()

References gko::one().