preCICE v3.1.2
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
precice::acceleration::impl::ParallelMatrixOperations Class Reference

#include <ParallelMatrixOperations.hpp>

Collaboration diagram for precice::acceleration::impl::ParallelMatrixOperations:
[legend]

Public Member Functions

 ~ParallelMatrixOperations ()
 
void initialize (const bool needCyclicComm)
 Initializes the acceleration.
 
template<typename Derived1 , typename Derived2 >
void multiply (Eigen::PlainObjectBase< Derived1 > &leftMatrix, Eigen::PlainObjectBase< Derived2 > &rightMatrix, Eigen::PlainObjectBase< Derived2 > &result, const std::vector< int > &offsets, int p, int q, int r, bool dotProductComputation=true)
 
template<typename Derived1 , typename Derived2 , typename Derived3 >
void multiply (const Eigen::MatrixBase< Derived1 > &leftMatrix, const Eigen::MatrixBase< Derived2 > &rightMatrix, Eigen::PlainObjectBase< Derived3 > &result, int p, int q, int r)
 : Method computes the matrix-matrix/matrix-vector product of a (p x q) matrix that is distributed column-wise (e.g. pseudoInverse Z), with a matrix/vector of size (q x r) with r=1/cols, that is distributed row-wise (e.g. _matrixW, _matrixV, residual).
 

Private Member Functions

template<typename Derived1 , typename Derived2 >
void _multiplyNN (Eigen::PlainObjectBase< Derived1 > &leftMatrix, Eigen::PlainObjectBase< Derived2 > &rightMatrix, Eigen::PlainObjectBase< Derived2 > &result, const std::vector< int > &offsets, int p, int q, int r)
 
template<typename Derived1 , typename Derived2 >
void _multiplyNM_dotProduct (Eigen::PlainObjectBase< Derived1 > &leftMatrix, Eigen::PlainObjectBase< Derived2 > &rightMatrix, Eigen::PlainObjectBase< Derived2 > &result, const std::vector< int > &offsets, int p, int q, int r)
 
template<typename Derived1 , typename Derived2 >
void _multiplyNM_block (Eigen::PlainObjectBase< Derived1 > &leftMatrix, Eigen::PlainObjectBase< Derived2 > &rightMatrix, Eigen::PlainObjectBase< Derived2 > &result, const std::vector< int > &offsets, int p, int q, int r)
 Multiplies matrices based on a SAXPY-like block-wise computation with a rectangular result matrix of dimension n x m.
 
void establishCircularCommunication ()
 
void closeCircularCommunication ()
 

Private Attributes

logging::Logger _log {"acceleration::ParallelMatrixOperations"}
 
com::PtrCommunication _cyclicCommLeft = nullptr
 Communication between neighboring ranks, backwards.
 
com::PtrCommunication _cyclicCommRight = nullptr
 Communication between neighboring ranks, forward.
 
bool _needCyclicComm = true
 

Detailed Description

Definition at line 25 of file ParallelMatrixOperations.hpp.

Constructor & Destructor Documentation

◆ ~ParallelMatrixOperations()

precice::acceleration::impl::ParallelMatrixOperations::~ParallelMatrixOperations ( )

Definition at line 21 of file ParallelMatrixOperations.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ _multiplyNM_block()

template<typename Derived1 , typename Derived2 >
void precice::acceleration::impl::ParallelMatrixOperations::_multiplyNM_block ( Eigen::PlainObjectBase< Derived1 > & leftMatrix,
Eigen::PlainObjectBase< Derived2 > & rightMatrix,
Eigen::PlainObjectBase< Derived2 > & result,
const std::vector< int > & offsets,
int p,
int q,
int r )
inlineprivate

Multiplies matrices based on a SAXPY-like block-wise computation with a rectangular result matrix of dimension n x m.

Todo
: only primary rank should allocate memory.

Definition at line 259 of file ParallelMatrixOperations.hpp.

Here is the call graph for this function:

◆ _multiplyNM_dotProduct()

template<typename Derived1 , typename Derived2 >
void precice::acceleration::impl::ParallelMatrixOperations::_multiplyNM_dotProduct ( Eigen::PlainObjectBase< Derived1 > & leftMatrix,
Eigen::PlainObjectBase< Derived2 > & rightMatrix,
Eigen::PlainObjectBase< Derived2 > & result,
const std::vector< int > & offsets,
int p,
int q,
int r )
inlineprivate

Definition at line 222 of file ParallelMatrixOperations.hpp.

Here is the call graph for this function:

◆ _multiplyNN()

template<typename Derived1 , typename Derived2 >
void precice::acceleration::impl::ParallelMatrixOperations::_multiplyNN ( Eigen::PlainObjectBase< Derived1 > & leftMatrix,
Eigen::PlainObjectBase< Derived2 > & rightMatrix,
Eigen::PlainObjectBase< Derived2 > & result,
const std::vector< int > & offsets,
int p,
int q,
int r )
inlineprivate

cyclic send-receive operation

Definition at line 118 of file ParallelMatrixOperations.hpp.

Here is the call graph for this function:

◆ closeCircularCommunication()

void precice::acceleration::impl::ParallelMatrixOperations::closeCircularCommunication ( )
private

Closes the circular connection between ranks

@precondition establishCircularCommunication() was called @postcondition _cyclicCommLeft, _cyclicCommRight are disconnected and set to nullptr

Definition at line 47 of file ParallelMatrixOperations.cpp.

Here is the call graph for this function:

◆ establishCircularCommunication()

void precice::acceleration::impl::ParallelMatrixOperations::establishCircularCommunication ( )
private

Establishes the circular connection between ranks

This creates and connects the ranks.

@precondition _cyclicCommLeft and _cyclicCommRight must be nullptr @postcondition _cyclicCommLeft, _cyclicCommRight are connected

Definition at line 30 of file ParallelMatrixOperations.cpp.

Here is the call graph for this function:

◆ initialize()

void precice::acceleration::impl::ParallelMatrixOperations::initialize ( const bool needCyclicComm)

Initializes the acceleration.

Definition at line 9 of file ParallelMatrixOperations.cpp.

Here is the call graph for this function:

◆ multiply() [1/2]

template<typename Derived1 , typename Derived2 , typename Derived3 >
void precice::acceleration::impl::ParallelMatrixOperations::multiply ( const Eigen::MatrixBase< Derived1 > & leftMatrix,
const Eigen::MatrixBase< Derived2 > & rightMatrix,
Eigen::PlainObjectBase< Derived3 > & result,
int p,
int q,
int r )
inline

: Method computes the matrix-matrix/matrix-vector product of a (p x q) matrix that is distributed column-wise (e.g. pseudoInverse Z), with a matrix/vector of size (q x r) with r=1/cols, that is distributed row-wise (e.g. _matrixW, _matrixV, residual).

In each case mat-mat or mat-vec product, the result is of size (m x m) or (m x 1), where m is the number of cols, i.e., small such that the result is stored on each proc.

Parameters
[in]p- first dimension, i.e., overall (global) number of rows
[in]q- inner dimension
[in]r- second dimension, i.e., overall (global) number cols of result matrix

Definition at line 90 of file ParallelMatrixOperations.hpp.

Here is the call graph for this function:

◆ multiply() [2/2]

template<typename Derived1 , typename Derived2 >
void precice::acceleration::impl::ParallelMatrixOperations::multiply ( Eigen::PlainObjectBase< Derived1 > & leftMatrix,
Eigen::PlainObjectBase< Derived2 > & rightMatrix,
Eigen::PlainObjectBase< Derived2 > & result,
const std::vector< int > & offsets,
int p,
int q,
int r,
bool dotProductComputation = true )
inline

Definition at line 33 of file ParallelMatrixOperations.hpp.

Here is the call graph for this function:

Member Data Documentation

◆ _cyclicCommLeft

com::PtrCommunication precice::acceleration::impl::ParallelMatrixOperations::_cyclicCommLeft = nullptr
private

Communication between neighboring ranks, backwards.

Definition at line 311 of file ParallelMatrixOperations.hpp.

◆ _cyclicCommRight

com::PtrCommunication precice::acceleration::impl::ParallelMatrixOperations::_cyclicCommRight = nullptr
private

Communication between neighboring ranks, forward.

Definition at line 314 of file ParallelMatrixOperations.hpp.

◆ _log

logging::Logger precice::acceleration::impl::ParallelMatrixOperations::_log {"acceleration::ParallelMatrixOperations"}
private

Definition at line 114 of file ParallelMatrixOperations.hpp.

◆ _needCyclicComm

bool precice::acceleration::impl::ParallelMatrixOperations::_needCyclicComm = true
private

Definition at line 316 of file ParallelMatrixOperations.hpp.


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