StarNEig Library  version v0.1-beta.2
A task-based library for solving nonsymmetric eigenvalue problems
ScaLAPACK compatibility / BLACS matrices

Data types and functions for BLACS formatted distributed matrices. More...

Data Structures

struct  starneig_blacs_descr
 BLACS descriptor. More...
 

BLACS contexts

typedef int starneig_blacs_context_t
 BLACS context.
 
starneig_blacs_context_t starneig_distr_to_blacs_context (starneig_distr_t distr)
 Convers a data distribution to a BLACS context. More...
 
starneig_distr_t starneig_blacs_context_to_distr (starneig_blacs_context_t context)
 Convers a BLACS context to a data distribution. More...
 
int starneig_distr_is_blacs_compatible (starneig_distr_t distr)
 Checks whether a data distribution is BLACS compatible. More...
 
int starneig_distr_is_compatible_with (starneig_distr_t distr, starneig_blacs_context_t context)
 Checks whether a data distribution is compatible with a given BLACS context. More...
 

BLACS descriptors

typedef struct starneig_blacs_descr starneig_blacs_descr_t
 BLACS descriptor.
 
void starneig_create_blacs_matrix (int rows, int cols, int row_blksz, int col_blksz, starneig_datatype_t type, starneig_blacs_context_t context, starneig_blacs_descr_t *descr, void **local)
 Creates a BLACS matrix with uninitialized matrix elements. More...
 
void starneig_distr_matrix_to_blacs_descr (starneig_distr_matrix_t matrix, starneig_blacs_context_t context, starneig_blacs_descr_t *descr, void **local)
 Convers a distributed matrix to a BLACS descriptor and a matching local array. More...
 
starneig_distr_matrix_t starneig_blacs_descr_to_distr_matrix (starneig_datatype_t type, starneig_distr_t distr, starneig_blacs_descr_t *descr, void *local)
 Convers a BLACS descriptor and a matching local array to a distributed matrix. More...
 
int starneig_distr_matrix_is_blacs_compatible (starneig_distr_matrix_t matrix)
 Checks whether a distributed matrix is BLACS compatible. More...
 
int starneig_distr_matrix_is_compatible_with (starneig_distr_matrix_t matrix, starneig_blacs_context_t context)
 Checks whether a distributed matrix is compatible with a given BLACS context. More...
 

Detailed Description

Data types and functions for BLACS formatted distributed matrices.


Data Structure Documentation

◆ starneig_blacs_descr

struct starneig_blacs_descr

BLACS descriptor.

Data Fields
int type The descriptor type.
starneig_blacs_context_t context The related BLACS context.
int m The number of (global) rows in the matrix.
int n The number of (global) columns in the matrix.
int sm The number of rows in a distribution block.
int sn The number of columns in a distribution block.
int rsrc The process grid row over which the first row is distributed.
int csrc The process grid column over which the first column is distributed.
int lld The leading dimension of the local array.

Function Documentation

◆ starneig_distr_to_blacs_context()

starneig_blacs_context_t starneig_distr_to_blacs_context ( starneig_distr_t  distr)

Convers a data distribution to a BLACS context.

Attention
The data distribution must describe a two-dimensional block cyclic distribution.
Parameters
[in]distrThe data distribution.
Returns
The BLACS context.

◆ starneig_blacs_context_to_distr()

starneig_distr_t starneig_blacs_context_to_distr ( starneig_blacs_context_t  context)

Convers a BLACS context to a data distribution.

Parameters
[in]contextThe BLACS context.
Returns
The data distribution.

◆ starneig_distr_is_blacs_compatible()

int starneig_distr_is_blacs_compatible ( starneig_distr_t  distr)

Checks whether a data distribution is BLACS compatible.

Parameters
[in]distrThe data distribution.
Returns
Non-zero if the data distribution matrix is BLACS compatible.

◆ starneig_distr_is_compatible_with()

int starneig_distr_is_compatible_with ( starneig_distr_t  distr,
starneig_blacs_context_t  context 
)

Checks whether a data distribution is compatible with a given BLACS context.

Parameters
[in]distrThe data distribution.
[in]contextThe BLACS context.
Returns
Non-zero if the data distribution compatible with the BLACS context.

◆ starneig_create_blacs_matrix()

void starneig_create_blacs_matrix ( int  rows,
int  cols,
int  row_blksz,
int  col_blksz,
starneig_datatype_t  type,
starneig_blacs_context_t  context,
starneig_blacs_descr_t descr,
void **  local 
)

Creates a BLACS matrix with uninitialized matrix elements.

Parameters
[in]rowsThe number of (global) rows in the matrix.
[in]colsThe number of (global) columns in the matrix.
[in]row_blkszThe number of rows in a distribution block. Can be set to -1 in which case the library decides the value.
[in]col_blkszThe number of columns in a distribution block. Can be set to -1 in which case the library decides the value.
[in]typeThe matrix element data type.
[in]contextThe BLACS context.
[out]descrThe BLACS descriptor.
[out]localA pointer to the local array.

◆ starneig_distr_matrix_to_blacs_descr()

void starneig_distr_matrix_to_blacs_descr ( starneig_distr_matrix_t  matrix,
starneig_blacs_context_t  context,
starneig_blacs_descr_t descr,
void **  local 
)

Convers a distributed matrix to a BLACS descriptor and a matching local array.

This function creates a wrapper object. The contents of the distributed matrix may be modified by the functions that use the wrapper object.

...
starneig_distr_t distr = starneig_distr_matrix_get_distr(A);
double *local_a;
dA, context, &descr_a, (void **)&local_a);
Parameters
[in]matrixThe distributed matrix.
[in]contextThe BLACS context. The context must have been converted from the same data distribution the distributed matrix is using or vice versa.
[out]descrThe BLACS descriptor.
[out]localA pointer to the local array.

◆ starneig_blacs_descr_to_distr_matrix()

starneig_distr_matrix_t starneig_blacs_descr_to_distr_matrix ( starneig_datatype_t  type,
starneig_distr_t  distr,
starneig_blacs_descr_t descr,
void *  local 
)

Convers a BLACS descriptor and a matching local array to a distributed matrix.

This function creates a wrapper object. The contents of the local array may be modified by the functions that use the wrapper object. The starneig_distr_matrix_destroy() function does not de-initilize the BLACS descriptor nor free the local array.

double *local_a;
...
starneig_distr_t distr = starneig_blacs_context_to_distr(context);
STARNEIG_REAL_DOUBLE, distr, descr_a, (void *)local_a);
Parameters
[in]typeThe matrix element data type.
[in]distrThe data distribution. The data distribution must have been converted from the same BLACS context the BLACS descriptor is using or vice versa.
[in]descrThe BLACS descriptor.
[in]localA pointer to the local array.
Returns
The distributed matrix.

◆ starneig_distr_matrix_is_blacs_compatible()

int starneig_distr_matrix_is_blacs_compatible ( starneig_distr_matrix_t  matrix)

Checks whether a distributed matrix is BLACS compatible.

Parameters
[in]matrixThe distributed matrix.
Returns
Non-zero if the distributed matrix is BLACS compatible.

◆ starneig_distr_matrix_is_compatible_with()

int starneig_distr_matrix_is_compatible_with ( starneig_distr_matrix_t  matrix,
starneig_blacs_context_t  context 
)

Checks whether a distributed matrix is compatible with a given BLACS context.

Parameters
[in]matrixThe distributed matrix.
[in]contextThe BLACS context.
Returns
Non-zero if the distributed matrix compatible with the BLACS context.