SpM Handbook 1.2.4
Loading...
Searching...
No Matches
z_spm_matrixvector.c File Reference
#include "common.h"
#include <lapacke.h>
#include <cblas.h>

Go to the source code of this file.

Functions

int spm_zspmm (spm_side_t side, spm_trans_t transA, spm_trans_t transB, spm_int_t K, spm_complex64_t alpha, const spmatrix_t *A, const spm_complex64_t *B, spm_int_t ldb, spm_complex64_t beta, spm_complex64_t *C, spm_int_t ldc)
 Compute a matrix-matrix product.
 
int spm_zspmv (spm_trans_t trans, spm_complex64_t alpha, const spmatrix_t *A, const spm_complex64_t *x, spm_int_t incx, spm_complex64_t beta, spm_complex64_t *y, spm_int_t incy)
 compute the matrix-vector product:
 
#define LAPACKE_zlascl_work(_dir_, _uplo_, _kl_, _ku_, _cfrom_, _cto_, _m_, _n_, _A_, _lda_)    __spm_zlascl( (_cto_), (_m_), (_n_), (_A_), (_lda_) )
 Alias if Lapacke zlscl is not available.
 
typedef struct __spm_zmatvec_s __spm_zmatvec_t
 Typedef associated to structure.
 
typedef spm_complex64_t(* __conj_fct_t) (spm_complex64_t)
 Typedef to define the op function applied to the element (id or conj)
 
typedef int(* __loop_fct_t) (const __spm_zmatvec_t *)
 Typedef to the main loop function performing the matvec operation.
 
static spm_complex64_t __fct_id (spm_complex64_t val)
 Identity function.
 
static void z_spmm_build_Ctmp (int nrhs, const spmatrix_t *spm, const spm_complex64_t *Cloc, spm_int_t ldcl, spm_complex64_t **Cglb, spm_int_t *ldcg)
 Build a global C RHS, set to 0 for remote datas.
 
static void z_spmm_build_Btmp (int nrhs, const spmatrix_t *spm, const spm_complex64_t *Bloc, spm_int_t ldbl, spm_complex64_t **Bglb, spm_int_t *ldbg)
 Build a global B vector by gathering datas from all nodes.
 

Detailed Description

SParse Matrix package matrix-vector multiplication routines.

Version
1.2.4
Author
Matthieu Kuhn
Mathieu Faverge
Tony Delarue
Alycia Lisito
Date
2024-05-29
Generated arithmetic file from /builds/2mk6rsew/0/fpruvost/spm/src/z_spm_matrixvector.c, normal z -> z, Fri Nov 29 11:34:31 2024

Definition in file z_spm_matrixvector.c.

Macro Definition Documentation

◆ LAPACKE_zlascl_work

#define LAPACKE_zlascl_work (   _dir_,
  _uplo_,
  _kl_,
  _ku_,
  _cfrom_,
  _cto_,
  _m_,
  _n_,
  _A_,
  _lda_ 
)     __spm_zlascl( (_cto_), (_m_), (_n_), (_A_), (_lda_) )

Alias if Lapacke zlscl is not available.

Parameters
[in]_dir_Unused parameter
[in]_uplo_Unused parameter
[in]_kl_Unused parameter
[in]_ku_Unused parameter
[in]_cfrom_Unused parameter
[in]_cto_The scaling factor of the matrix A
[in]_m_The number of rows of the matrix A
[in]_n_The number of columns of the matrix A
[in,out]_A_On entry the lda-by-n matrix to scale. On exit, the matrix is multiplied by cto.
[in]_lda_The leading dimension of the matrix A. lda >= max(1, m)

Definition at line 737 of file z_spm_matrixvector.c.

Typedef Documentation

◆ __spm_zmatvec_t

typedef struct __spm_zmatvec_s __spm_zmatvec_t

Typedef associated to structure.

Definition at line 35 of file z_spm_matrixvector.c.

◆ __conj_fct_t

typedef spm_complex64_t(* __conj_fct_t) (spm_complex64_t)

Typedef to define the op function applied to the element (id or conj)

Definition at line 40 of file z_spm_matrixvector.c.

◆ __loop_fct_t

typedef int(* __loop_fct_t) (const __spm_zmatvec_t *)

Typedef to the main loop function performing the matvec operation.

Definition at line 45 of file z_spm_matrixvector.c.

Function Documentation

◆ __fct_id()

static spm_complex64_t __fct_id ( spm_complex64_t  val)
static

Identity function.

Parameters
[in]valTODO
Returns
id(val)

Definition at line 62 of file z_spm_matrixvector.c.

◆ z_spmm_build_Ctmp()

static void z_spmm_build_Ctmp ( int  nrhs,
const spmatrix_t spm,
const spm_complex64_t *  Cloc,
spm_int_t  ldcl,
spm_complex64_t **  Cglb,
spm_int_t ldcg 
)
static

Build a global C RHS, set to 0 for remote datas.

Parameters
[in]nrhsThe number of RHS.
[in]spmThe pointer to the sparse matrix structure.
[in]ClocThe local matrix of size ldcl -by- nrhs
[in]ldclThe leading dimension of Cloc. ldcl >= max( 1, spm->nexp )
[out]CglbOn exit, contains the centralized version of the Cloc matrix.
[out]ldcgOn exit, contains the leading dimension of the Cglb matrix. ldcg >= max(1, spm->gNexp )

Definition at line 948 of file z_spm_matrixvector.c.

References spmatrix_s::baseval, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::gNexp, spmatrix_s::loc2glob, and spmatrix_s::n.

Referenced by spm_zspmm(), and spm_zspmv().

◆ z_spmm_build_Btmp()

static void z_spmm_build_Btmp ( int  nrhs,
const spmatrix_t spm,
const spm_complex64_t *  Bloc,
spm_int_t  ldbl,
spm_complex64_t **  Bglb,
spm_int_t ldbg 
)
static

Build a global B vector by gathering datas from all nodes.

Parameters
[in]spmThe pointer to the sparse matrix structure.
[in]nrhsThe number of RHS.
[in]BlocThe local B vector.
[in,out]ldblThe leading dimension of the local B vector.
[out]BglbThe global B vector.
[out]ldbgThe leading dimension of the global B vector.

Definition at line 1012 of file z_spm_matrixvector.c.

References spmatrix_s::gNexp, and z_spmGatherRHS().

Referenced by spm_zspmm(), and spm_zspmv().