sisi4s
Loading...
Searching...
No Matches
sisi4s::ScaLapackMatrix< F > Class Template Reference

#include <ScaLapackMatrix.hpp>

Inheritance diagram for sisi4s::ScaLapackMatrix< F >:
Collaboration diagram for sisi4s::ScaLapackMatrix< F >:

Public Member Functions

 ScaLapackMatrix (ScaLapackMatrix< F > &A)
 Copies the content ScaLapack matrix inheriting its distribution and its BlacsWorld.
 
 ScaLapackMatrix (CTF::Matrix< F > &A, BlacsWorld *blacsWorld, int blockSize=64)
 Construct a ScaLapack matrix from the content of a CTF::Matrix in the given BlacsWorld.
 
 ScaLapackMatrix (Tensor< F > &A, int lens[2], BlacsWorld *blacsWorld, int blockSize=64)
 Contructs a ScaLapack matrix from the matricized content of a Tensor in the given BlacsWorld by copying each entry of the tensor into the matrix with the same respective global index, i.e.: matrix[I + lens[0]*J] = A[i + A.lens[0]*j + A.lens[0]*A.lens[1]*k + ...] The caller is responsible for compatible shapes.
 
 ~ScaLapackMatrix ()
 Frees all resources associated with the ScaLapack matrix on all processes.
 
const int * getDescriptor () const
 Returns a pointer to a ScaLapack matrix descriptor, i.e. the first 9 integers of the class ScaLapackDescriptor, which are in the format ScaLapack routines expect it.
 
const F * getLocalValues () const
 Returns the pointer to the block data owned by this process.
 
F * getLocalValues ()
 Returns the pointer to the mutable block data owned by this process.
 
void write (CTF::Matrix< F > &A)
 Writes the content of the ScaLapackMatrix to the given CTF::Matrix. The CTF::Matrix must be allocated in the correct shape.
 
void write (Tensor< F > &A)
 Writes the matricized content of the ScaLapackMatrix to the given Tensor, i.e.: A[i + A.lens[0]*j + A.lens[0]*A.lens[1]*k + ...] = matrix[I + lens[0]*J] The caller is responsible for compatible shapes.
 
- Public Member Functions inherited from sisi4s::ScaLapackDescriptor
 ScaLapackDescriptor (BlacsWorld *blacsWorld, int lens_[2], int blockSize)
 

Protected Member Functions

int getGlobalIndex (int localIndex, int dimension)
 Retrieves the global row or column index within the full matrix from the given row or column index within the local block.
 

Protected Attributes

BlacsWorldblacsWorld
 The BlacsWorld specifying the processor grid this matrix is distributed over.
 
int64_t * localIndices
 The global indices within the local matrix elements owned by this process. The global index of an element in row i and in column j of the full matrix is (i + lens[0]*j).
 
F * localValues
 The block data owned by this process.
 

Additional Inherited Members

- Public Attributes inherited from sisi4s::ScaLapackDescriptor
int dataType
 
int blacsContext
 
int lens [2]
 
int blockSize [2]
 
int offset [2]
 
int localLens [2]
 

Constructor & Destructor Documentation

◆ ScaLapackMatrix() [1/3]

template<typename F >
ScaLapackMatrix::ScaLapackMatrix ( ScaLapackMatrix< F > &  A)

Copies the content ScaLapack matrix inheriting its distribution and its BlacsWorld.

◆ ScaLapackMatrix() [2/3]

template<typename F >
ScaLapackMatrix::ScaLapackMatrix ( CTF::Matrix< F > &  A,
BlacsWorld blacsWorld,
int  blockSize = 64 
)

Construct a ScaLapack matrix from the content of a CTF::Matrix in the given BlacsWorld.

◆ ScaLapackMatrix() [3/3]

template<typename F >
ScaLapackMatrix::ScaLapackMatrix ( sisi4s::Tensor< F > &  A,
int  lens[2],
BlacsWorld blacsWorld,
int  blockSize = 64 
)

Contructs a ScaLapack matrix from the matricized content of a Tensor in the given BlacsWorld by copying each entry of the tensor into the matrix with the same respective global index, i.e.: matrix[I + lens[0]*J] = A[i + A.lens[0]*j + A.lens[0]*A.lens[1]*k + ...] The caller is responsible for compatible shapes.

Here is the call graph for this function:

◆ ~ScaLapackMatrix()

template<typename F >
template ScaLapackMatrix::~ScaLapackMatrix ( )

Frees all resources associated with the ScaLapack matrix on all processes.

Member Function Documentation

◆ getDescriptor()

template<typename F = double>
const int * sisi4s::ScaLapackMatrix< F >::getDescriptor ( ) const
inline

Returns a pointer to a ScaLapack matrix descriptor, i.e. the first 9 integers of the class ScaLapackDescriptor, which are in the format ScaLapack routines expect it.

◆ getGlobalIndex()

template<typename F >
int ScaLapackMatrix::getGlobalIndex ( int  localIndex,
int  dimension 
)
protected

Retrieves the global row or column index within the full matrix from the given row or column index within the local block.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLocalValues() [1/2]

template<typename F = double>
F * sisi4s::ScaLapackMatrix< F >::getLocalValues ( )
inline

Returns the pointer to the mutable block data owned by this process.

◆ getLocalValues() [2/2]

template<typename F = double>
const F * sisi4s::ScaLapackMatrix< F >::getLocalValues ( ) const
inline

Returns the pointer to the block data owned by this process.

◆ write() [1/2]

template<typename F >
void ScaLapackMatrix::write ( CTF::Matrix< F > &  A)

Writes the content of the ScaLapackMatrix to the given CTF::Matrix. The CTF::Matrix must be allocated in the correct shape.

Here is the caller graph for this function:

◆ write() [2/2]

template<typename F >
void ScaLapackMatrix::write ( Tensor< F > &  A)

Writes the matricized content of the ScaLapackMatrix to the given Tensor, i.e.: A[i + A.lens[0]*j + A.lens[0]*A.lens[1]*k + ...] = matrix[I + lens[0]*J] The caller is responsible for compatible shapes.

Member Data Documentation

◆ blacsWorld

template<typename F = double>
BlacsWorld* sisi4s::ScaLapackMatrix< F >::blacsWorld
protected

The BlacsWorld specifying the processor grid this matrix is distributed over.

◆ localIndices

template<typename F = double>
int64_t* sisi4s::ScaLapackMatrix< F >::localIndices
protected

The global indices within the local matrix elements owned by this process. The global index of an element in row i and in column j of the full matrix is (i + lens[0]*j).

◆ localValues

template<typename F = double>
F* sisi4s::ScaLapackMatrix< F >::localValues
protected

The block data owned by this process.


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