SpM Handbook 1.2.4
Loading...
Searching...
No Matches
Spm_dev_rhs

RHS routines. More...

Files

file  c_spm_rhs.c
 
file  s_spm_rhs.c
 
file  z_spm_rhs.c
 
file  d_spm_rhs.c
 

Functions

int s_spmGenRHS (spm_rhstype_t type, int nrhs, const spmatrix_t *spm, void *x, int ldx, void *b, int ldb)
 Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.
 
int s_spmGenMat (spm_rhstype_t type, int nrhs, const spmatrix_t *spm, void *alphaptr, unsigned long long int seed, void *A, int lda)
 Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.
 
int s_spmCheckAxb (spm_fixdbl_t eps, int nrhs, const spmatrix_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx)
 Check the backward error, and the forward error if x0 is provided.
 
void s_spmGatherRHS (int nrhs, const spmatrix_t *spm, const float *x, spm_int_t ldx, int root, float *gx, spm_int_t ldgx)
 Gather all the global C coefficients and store the good ones in local.
 
void s_spmReduceRHS (int nrhs, const spmatrix_t *spm, float *bglob, spm_int_t ldbg, float *bloc, spm_int_t ldbl)
 Reduce all the global coefficients of a rhs and store the local ones.
 
void s_spmExtractLocalRHS (int nrhs, const spmatrix_t *spm, const float *bglob, spm_int_t ldbg, float *bloc, spm_int_t ldbl)
 Stores the local values of a global RHS in the local one.
 
int s_spmRhsGenRndShm (const spmatrix_t *spm, float scale, spm_int_t n, float *A, spm_int_t lda, int shift, unsigned long long int seed)
 Generate a set of vectors of random values in shared memory.
 
int s_spmRhsGenRndDist (const spmatrix_t *spm, float alpha, spm_int_t n, float *A, spm_int_t lda, int shift, unsigned long long int seed)
 Generate a set of vectors of random values in distributed memory.
 
int d_spmGenRHS (spm_rhstype_t type, int nrhs, const spmatrix_t *spm, void *x, int ldx, void *b, int ldb)
 Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.
 
int d_spmGenMat (spm_rhstype_t type, int nrhs, const spmatrix_t *spm, void *alphaptr, unsigned long long int seed, void *A, int lda)
 Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.
 
int d_spmCheckAxb (spm_fixdbl_t eps, int nrhs, const spmatrix_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx)
 Check the backward error, and the forward error if x0 is provided.
 
void d_spmGatherRHS (int nrhs, const spmatrix_t *spm, const double *x, spm_int_t ldx, int root, double *gx, spm_int_t ldgx)
 Gather all the global C coefficients and store the good ones in local.
 
void d_spmReduceRHS (int nrhs, const spmatrix_t *spm, double *bglob, spm_int_t ldbg, double *bloc, spm_int_t ldbl)
 Reduce all the global coefficients of a rhs and store the local ones.
 
void d_spmExtractLocalRHS (int nrhs, const spmatrix_t *spm, const double *bglob, spm_int_t ldbg, double *bloc, spm_int_t ldbl)
 Stores the local values of a global RHS in the local one.
 
int d_spmRhsGenRndShm (const spmatrix_t *spm, double scale, spm_int_t n, double *A, spm_int_t lda, int shift, unsigned long long int seed)
 Generate a set of vectors of random values in shared memory.
 
int d_spmRhsGenRndDist (const spmatrix_t *spm, double alpha, spm_int_t n, double *A, spm_int_t lda, int shift, unsigned long long int seed)
 Generate a set of vectors of random values in distributed memory.
 
int c_spmGenRHS (spm_rhstype_t type, int nrhs, const spmatrix_t *spm, void *x, int ldx, void *b, int ldb)
 Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.
 
int c_spmGenMat (spm_rhstype_t type, int nrhs, const spmatrix_t *spm, void *alphaptr, unsigned long long int seed, void *A, int lda)
 Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.
 
int c_spmCheckAxb (spm_fixdbl_t eps, int nrhs, const spmatrix_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx)
 Check the backward error, and the forward error if x0 is provided.
 
void c_spmGatherRHS (int nrhs, const spmatrix_t *spm, const spm_complex32_t *x, spm_int_t ldx, int root, spm_complex32_t *gx, spm_int_t ldgx)
 Gather all the global C coefficients and store the good ones in local.
 
void c_spmReduceRHS (int nrhs, const spmatrix_t *spm, spm_complex32_t *bglob, spm_int_t ldbg, spm_complex32_t *bloc, spm_int_t ldbl)
 Reduce all the global coefficients of a rhs and store the local ones.
 
void c_spmExtractLocalRHS (int nrhs, const spmatrix_t *spm, const spm_complex32_t *bglob, spm_int_t ldbg, spm_complex32_t *bloc, spm_int_t ldbl)
 Stores the local values of a global RHS in the local one.
 
int c_spmRhsGenRndShm (const spmatrix_t *spm, spm_complex32_t scale, spm_int_t n, spm_complex32_t *A, spm_int_t lda, int shift, unsigned long long int seed)
 Generate a set of vectors of random values in shared memory.
 
int c_spmRhsGenRndDist (const spmatrix_t *spm, spm_complex32_t alpha, spm_int_t n, spm_complex32_t *A, spm_int_t lda, int shift, unsigned long long int seed)
 Generate a set of vectors of random values in distributed memory.
 
int z_spmGenRHS (spm_rhstype_t type, int nrhs, const spmatrix_t *spm, void *x, int ldx, void *b, int ldb)
 Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.
 
int z_spmGenMat (spm_rhstype_t type, int nrhs, const spmatrix_t *spm, void *alphaptr, unsigned long long int seed, void *A, int lda)
 Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.
 
int z_spmCheckAxb (spm_fixdbl_t eps, int nrhs, const spmatrix_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx)
 Check the backward error, and the forward error if x0 is provided.
 
void z_spmGatherRHS (int nrhs, const spmatrix_t *spm, const spm_complex64_t *x, spm_int_t ldx, int root, spm_complex64_t *gx, spm_int_t ldgx)
 Gather all the global C coefficients and store the good ones in local.
 
void z_spmReduceRHS (int nrhs, const spmatrix_t *spm, spm_complex64_t *bglob, spm_int_t ldbg, spm_complex64_t *bloc, spm_int_t ldbl)
 Reduce all the global coefficients of a rhs and store the local ones.
 
void z_spmExtractLocalRHS (int nrhs, const spmatrix_t *spm, const spm_complex64_t *bglob, spm_int_t ldbg, spm_complex64_t *bloc, spm_int_t ldbl)
 Stores the local values of a global RHS in the local one.
 
int z_spmRhsGenRndShm (const spmatrix_t *spm, spm_complex64_t scale, spm_int_t n, spm_complex64_t *A, spm_int_t lda, int shift, unsigned long long int seed)
 Generate a set of vectors of random values in shared memory.
 
int z_spmRhsGenRndDist (const spmatrix_t *spm, spm_complex64_t alpha, spm_int_t n, spm_complex64_t *A, spm_int_t lda, int shift, unsigned long long int seed)
 Generate a set of vectors of random values in distributed memory.
 
static unsigned long long int Rnd64_jump (unsigned long long int n, unsigned long long int seed)
 Random generator from the HPL library.
 
static void c_updateRndVal (spm_complex32_t scale, spm_complex32_t *val, unsigned long long int *ran)
 Generate a value of the RHS.
 
static int c_spmRhsGenOne (const spmatrix_t *spm, spm_complex32_t alpha, spm_int_t n, spm_complex32_t *A, spm_int_t lda)
 Generate a set of vectors of constant values.
 
static int c_spmRhsGenI (const spmatrix_t *spm, spm_complex32_t alpha, spm_int_t n, spm_complex32_t *A, spm_int_t lda)
 Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ).
 
static void s_updateRndVal (float scale, float *val, unsigned long long int *ran)
 Generate a value of the RHS.
 
static int s_spmRhsGenOne (const spmatrix_t *spm, float alpha, spm_int_t n, float *A, spm_int_t lda)
 Generate a set of vectors of constant values.
 
static int s_spmRhsGenI (const spmatrix_t *spm, float alpha, spm_int_t n, float *A, spm_int_t lda)
 Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ).
 
static void z_updateRndVal (spm_complex64_t scale, spm_complex64_t *val, unsigned long long int *ran)
 Generate a value of the RHS.
 
static int z_spmRhsGenOne (const spmatrix_t *spm, spm_complex64_t alpha, spm_int_t n, spm_complex64_t *A, spm_int_t lda)
 Generate a set of vectors of constant values.
 
static int z_spmRhsGenI (const spmatrix_t *spm, spm_complex64_t alpha, spm_int_t n, spm_complex64_t *A, spm_int_t lda)
 Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ).
 
static void d_updateRndVal (double scale, double *val, unsigned long long int *ran)
 Generate a value of the RHS.
 
static int d_spmRhsGenOne (const spmatrix_t *spm, double alpha, spm_int_t n, double *A, spm_int_t lda)
 Generate a set of vectors of constant values.
 
static int d_spmRhsGenI (const spmatrix_t *spm, double alpha, spm_int_t n, double *A, spm_int_t lda)
 Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ).
 

Detailed Description

RHS routines.

Subroutines for random vector generation to be used in testings.

Function Documentation

◆ s_spmGenRHS()

int s_spmGenRHS ( spm_rhstype_t  type,
int  nrhs,
const spmatrix_t spm,
void *  x,
int  ldx,
void *  b,
int  ldb 
)

Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.

Parameters
[in]typeDefines how to compute the vector b.
  • SpmRhsOne: b is computed such that x = 1 [ + I ]
  • SpmRhsI: b is computed such that x = i [ + i * I ]
  • SpmRhsRndX: b is computed by matrix-vector product, such that is a random vector in the range [-0.5, 0.5]
  • SpmRhsRndB: b is computed randomly and x is not computed.
[in]nrhsDefines the number of right hand side that must be generated.
[in]spmThe sparse matrix uses to generate the right hand side, and the solution of the full problem.
[out]xOn exit, if x != NULL, then the x vector(s) generated to compute b is returned. Must be of size at least ldx * spm->n.
[in]ldxDefines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n.
[in,out]bb must be an allocated matrix of size at least ldb * nrhs. On exit, b is initialized as defined by the type parameter.
[in]ldbDefines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n.
Return values
SPM_SUCCESSif the b vector has been computed succesfully,
SPM_ERR_BADPARAMETERotherwise.

Definition at line 73 of file s_spm_genrhs.c.

References spmatrix_s::gN, spmatrix_s::nexp, s_spmGenMat(), s_spmNorm(), SPM_ERR_BADPARAMETER, spm_sspmm(), SPM_SUCCESS, SpmFrobeniusNorm, SpmLeft, SpmNoTrans, and spmatrix_s::values.

Referenced by spmGenRHS().

◆ s_spmGenMat()

int s_spmGenMat ( spm_rhstype_t  type,
int  nrhs,
const spmatrix_t spm,
void *  alphaptr,
unsigned long long int  seed,
void *  A,
int  lda 
)

Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.

Parameters
[in]typeDefines how to compute the vector b.
  • SpmRhsOne: b is computed such that x = 1 [ + I ]
  • SpmRhsI: b is computed such that x = i [ + i * I ]
  • SpmRhsRndX: b is computed by matrix-vector product, such that is a random vector in the range [-0.5, 0.5]
  • SpmRhsRndB: b is computed randomly and x is not computed.
[in]nrhsDefines the number of right hand side that must be generated.
[in]spmThe sparse matrix uses to generate the right hand side, and the solution of the full problem.
[in]alphaptrThe pointer to the scaling factor of the matrix.
[in]seedRandom seed generator.
[out]AThe generated matrix. It has to be preallocated with a size lda -by- nrhs.
[in]ldaDefines the leading dimension of A when multiple right hand sides are available. lda >= spm->nexp.
Return values
SPM_SUCCESSif the b vector has been computed succesfully,
SPM_ERR_BADPARAMETERotherwise.

Definition at line 783 of file s_spm_genmat.c.

References spmatrix_s::nexp, spmatrix_s::replicated, s_spmRhsGenI(), s_spmRhsGenOne(), s_spmRhsGenRndDist(), s_spmRhsGenRndShm(), SPM_ERR_BADPARAMETER, and SPM_SUCCESS.

Referenced by s_spmGenRHS(), and spmGenMat().

◆ s_spmCheckAxb()

int s_spmCheckAxb ( spm_fixdbl_t  eps,
int  nrhs,
const spmatrix_t spm,
void *  x0,
int  ldx0,
void *  b,
int  ldb,
const void *  x,
int  ldx 
)

Check the backward error, and the forward error if x0 is provided.

Parameters
[in]epsThe epsilon threshold used for the refinement step. -1. to use the machine precision.
[in]nrhsDefines the number of right hand side that must be generated.
[in]spmThe sparse matrix uses to generate the right hand side, and the solution of the full problem.
[in,out]x0If x0 != NULL, the forward error is computed. On exit, x0 stores (x0-x)
[in]ldx0Defines the leading dimension of x0 when multiple right hand sides are available. ldx0 >= spm->n.
[in,out]bb is a matrix of size at least ldb * nrhs. On exit, b stores Ax-b.
[in]ldbDefines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n.
[in]xContains the solution computed by the solver.
[in]ldxDefines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n.
Return values
SPM_SUCCESSif the tests are succesfull
1,ifone of the test failed

Compute the starting norms

Compute r = b - A * x

Compute r = x0 - x

Definition at line 203 of file s_spm_genrhs.c.

References spmatrix_s::nexp, s_spmNormMat(), spm_sspmm(), SpmFrobeniusNorm, SpmInfNorm, SpmLeft, spmNorm(), SpmNoTrans, and SpmOneNorm.

Referenced by spmCheckAxb().

◆ s_spmGatherRHS()

void s_spmGatherRHS ( int  nrhs,
const spmatrix_t spm,
const float *  b,
spm_int_t  ldb,
int  root,
float *  bg,
spm_int_t  ldbg 
)

Gather all the global C coefficients and store the good ones in local.

Parameters
[in]spmThe sparse matrix spm
[in]nrhsNumber of rhs vectors.
[in]bThe local RHS array of size ldb-by-nrhs.
[in]ldbThe leading dimension of the b array. ldb >= max(1, spm->nexp)
[in]rootClustnum where the complete vector will be gathered. -1 if you want to gather the data on all nodes.
[in,out]bgOn entry, the allocated ldbg-by-nrhs array to store the gathered RHS.
[in]ldbgThe leading dimension of the bg array. ldbg >= max(1, spm->gNexp)

Definition at line 165 of file s_spm_rhs.c.

References spmatrix_s::baseval, spmatrix_s::clustnbr, spmatrix_s::clustnum, spmatrix_s::comm, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::gNexp, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nexp, spmatrix_s::replicated, and SPM_MPI_INT.

Referenced by s_spmm_build_Btmp(), and spmGatherRHS().

◆ s_spmReduceRHS()

void s_spmReduceRHS ( int  nrhs,
const spmatrix_t spm,
float *  bglob,
spm_int_t  ldbg,
float *  bloc,
spm_int_t  ldbl 
)

Reduce all the global coefficients of a rhs and store the local ones.

Parameters
[in]nrhsNumber of rhs vectors.
[in]spmThe sparse matrix spm
[in,out]bglobThe global rhs to reduce.
[in]ldbgLeading dimension of the global bglob matrix.
[in,out]blocLocal rhs matrix.
[in]ldblLeading dimension of the local bloc matrix.

Definition at line 109 of file s_spm_rhs.c.

References spmatrix_s::comm, spmatrix_s::gNexp, spmatrix_s::replicated, and s_spmExtractLocalRHS().

Referenced by spm_sspmm(), spm_sspmv(), and spmReduceRHS().

◆ s_spmExtractLocalRHS()

void s_spmExtractLocalRHS ( int  nrhs,
const spmatrix_t spm,
const float *  bglob,
spm_int_t  ldbg,
float *  bloc,
spm_int_t  ldbl 
)

Stores the local values of a global RHS in the local one.

Parameters
[in]nrhsNumber of rhs vectors.
[in]spmThe sparse matrix spm
[in,out]bglobThe global RHS.
[in]ldbgLeading dimension of the global bglob matrix.
[in,out]blocLocal rhs matrix.
[in]ldblLeading dimension of the local bloc vector.

Definition at line 51 of file s_spm_rhs.c.

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

Referenced by s_spmReduceRHS(), and spmExtractLocalRHS().

◆ s_spmRhsGenRndShm()

int s_spmRhsGenRndShm ( const spmatrix_t spm,
float  scale,
spm_int_t  n,
float *  A,
spm_int_t  lda,
int  shift,
unsigned long long int  seed 
)

Generate a set of vectors of random values in shared memory.

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]scaleScaling factor for each value of the vector.
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
[in]shiftThe initial shift in the random sequence.
[in]seedThe seed used for random generation. Must be the same for all tiles initialized with this routine.
Return values
SPM_SUCCESSto match prototype of equivalent function

Definition at line 149 of file s_spm_genmat.c.

References spmatrix_s::gNexp, spmatrix_s::nexp, Rnd64_jump(), s_updateRndVal(), and SPM_SUCCESS.

Referenced by s_spmGenMat().

◆ s_spmRhsGenRndDist()

int s_spmRhsGenRndDist ( const spmatrix_t spm,
float  alpha,
spm_int_t  n,
float *  A,
spm_int_t  lda,
int  shift,
unsigned long long int  seed 
)

Generate a set of vectors of random values in distributed memory.

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]alphaScaling factor for each value of the vector.
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
[in]shiftThe initial shift in the random sequence.
[in]seedThe seed used for random generation. Must be the same for all tiles initialized with this routine.
Return values
SPM_SUCCESSon success
SPM_ERR_BADPARAMETERif the provided spm is incorrect

Definition at line 422 of file s_spm_genmat.c.

References spmatrix_s::fmttype, s_spm_rhs_dist_genRnd_csx(), s_spm_rhs_dist_genRnd_ijv(), and SpmIJV.

Referenced by s_spmGenMat().

◆ d_spmGenRHS()

int d_spmGenRHS ( spm_rhstype_t  type,
int  nrhs,
const spmatrix_t spm,
void *  x,
int  ldx,
void *  b,
int  ldb 
)

Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.

Parameters
[in]typeDefines how to compute the vector b.
  • SpmRhsOne: b is computed such that x = 1 [ + I ]
  • SpmRhsI: b is computed such that x = i [ + i * I ]
  • SpmRhsRndX: b is computed by matrix-vector product, such that is a random vector in the range [-0.5, 0.5]
  • SpmRhsRndB: b is computed randomly and x is not computed.
[in]nrhsDefines the number of right hand side that must be generated.
[in]spmThe sparse matrix uses to generate the right hand side, and the solution of the full problem.
[out]xOn exit, if x != NULL, then the x vector(s) generated to compute b is returned. Must be of size at least ldx * spm->n.
[in]ldxDefines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n.
[in,out]bb must be an allocated matrix of size at least ldb * nrhs. On exit, b is initialized as defined by the type parameter.
[in]ldbDefines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n.
Return values
SPM_SUCCESSif the b vector has been computed succesfully,
SPM_ERR_BADPARAMETERotherwise.

Definition at line 73 of file d_spm_genrhs.c.

References d_spmGenMat(), d_spmNorm(), spmatrix_s::gN, spmatrix_s::nexp, spm_dspmm(), SPM_ERR_BADPARAMETER, SPM_SUCCESS, SpmFrobeniusNorm, SpmLeft, SpmNoTrans, and spmatrix_s::values.

Referenced by spmGenRHS().

◆ d_spmGenMat()

int d_spmGenMat ( spm_rhstype_t  type,
int  nrhs,
const spmatrix_t spm,
void *  alphaptr,
unsigned long long int  seed,
void *  A,
int  lda 
)

Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.

Parameters
[in]typeDefines how to compute the vector b.
  • SpmRhsOne: b is computed such that x = 1 [ + I ]
  • SpmRhsI: b is computed such that x = i [ + i * I ]
  • SpmRhsRndX: b is computed by matrix-vector product, such that is a random vector in the range [-0.5, 0.5]
  • SpmRhsRndB: b is computed randomly and x is not computed.
[in]nrhsDefines the number of right hand side that must be generated.
[in]spmThe sparse matrix uses to generate the right hand side, and the solution of the full problem.
[in]alphaptrThe pointer to the scaling factor of the matrix.
[in]seedRandom seed generator.
[out]AThe generated matrix. It has to be preallocated with a size lda -by- nrhs.
[in]ldaDefines the leading dimension of A when multiple right hand sides are available. lda >= spm->nexp.
Return values
SPM_SUCCESSif the b vector has been computed succesfully,
SPM_ERR_BADPARAMETERotherwise.

Definition at line 783 of file d_spm_genmat.c.

References d_spmRhsGenI(), d_spmRhsGenOne(), d_spmRhsGenRndDist(), d_spmRhsGenRndShm(), spmatrix_s::nexp, spmatrix_s::replicated, SPM_ERR_BADPARAMETER, and SPM_SUCCESS.

Referenced by d_spmGenRHS(), and spmGenMat().

◆ d_spmCheckAxb()

int d_spmCheckAxb ( spm_fixdbl_t  eps,
int  nrhs,
const spmatrix_t spm,
void *  x0,
int  ldx0,
void *  b,
int  ldb,
const void *  x,
int  ldx 
)

Check the backward error, and the forward error if x0 is provided.

Parameters
[in]epsThe epsilon threshold used for the refinement step. -1. to use the machine precision.
[in]nrhsDefines the number of right hand side that must be generated.
[in]spmThe sparse matrix uses to generate the right hand side, and the solution of the full problem.
[in,out]x0If x0 != NULL, the forward error is computed. On exit, x0 stores (x0-x)
[in]ldx0Defines the leading dimension of x0 when multiple right hand sides are available. ldx0 >= spm->n.
[in,out]bb is a matrix of size at least ldb * nrhs. On exit, b stores Ax-b.
[in]ldbDefines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n.
[in]xContains the solution computed by the solver.
[in]ldxDefines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n.
Return values
SPM_SUCCESSif the tests are succesfull
1,ifone of the test failed

Compute the starting norms

Compute r = b - A * x

Compute r = x0 - x

Definition at line 203 of file d_spm_genrhs.c.

References d_spmNormMat(), spmatrix_s::nexp, spm_dspmm(), SpmFrobeniusNorm, SpmInfNorm, SpmLeft, spmNorm(), SpmNoTrans, and SpmOneNorm.

Referenced by spmCheckAxb().

◆ d_spmGatherRHS()

void d_spmGatherRHS ( int  nrhs,
const spmatrix_t spm,
const double *  b,
spm_int_t  ldb,
int  root,
double *  bg,
spm_int_t  ldbg 
)

Gather all the global C coefficients and store the good ones in local.

Parameters
[in]spmThe sparse matrix spm
[in]nrhsNumber of rhs vectors.
[in]bThe local RHS array of size ldb-by-nrhs.
[in]ldbThe leading dimension of the b array. ldb >= max(1, spm->nexp)
[in]rootClustnum where the complete vector will be gathered. -1 if you want to gather the data on all nodes.
[in,out]bgOn entry, the allocated ldbg-by-nrhs array to store the gathered RHS.
[in]ldbgThe leading dimension of the bg array. ldbg >= max(1, spm->gNexp)

Definition at line 165 of file d_spm_rhs.c.

References spmatrix_s::baseval, spmatrix_s::clustnbr, spmatrix_s::clustnum, spmatrix_s::comm, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::gNexp, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nexp, spmatrix_s::replicated, and SPM_MPI_INT.

Referenced by d_spmm_build_Btmp(), and spmGatherRHS().

◆ d_spmReduceRHS()

void d_spmReduceRHS ( int  nrhs,
const spmatrix_t spm,
double *  bglob,
spm_int_t  ldbg,
double *  bloc,
spm_int_t  ldbl 
)

Reduce all the global coefficients of a rhs and store the local ones.

Parameters
[in]nrhsNumber of rhs vectors.
[in]spmThe sparse matrix spm
[in,out]bglobThe global rhs to reduce.
[in]ldbgLeading dimension of the global bglob matrix.
[in,out]blocLocal rhs matrix.
[in]ldblLeading dimension of the local bloc matrix.

Definition at line 109 of file d_spm_rhs.c.

References spmatrix_s::comm, d_spmExtractLocalRHS(), spmatrix_s::gNexp, and spmatrix_s::replicated.

Referenced by spm_dspmm(), spm_dspmv(), and spmReduceRHS().

◆ d_spmExtractLocalRHS()

void d_spmExtractLocalRHS ( int  nrhs,
const spmatrix_t spm,
const double *  bglob,
spm_int_t  ldbg,
double *  bloc,
spm_int_t  ldbl 
)

Stores the local values of a global RHS in the local one.

Parameters
[in]nrhsNumber of rhs vectors.
[in]spmThe sparse matrix spm
[in,out]bglobThe global RHS.
[in]ldbgLeading dimension of the global bglob matrix.
[in,out]blocLocal rhs matrix.
[in]ldblLeading dimension of the local bloc vector.

Definition at line 51 of file d_spm_rhs.c.

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

Referenced by d_spmReduceRHS(), and spmExtractLocalRHS().

◆ d_spmRhsGenRndShm()

int d_spmRhsGenRndShm ( const spmatrix_t spm,
double  scale,
spm_int_t  n,
double *  A,
spm_int_t  lda,
int  shift,
unsigned long long int  seed 
)

Generate a set of vectors of random values in shared memory.

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]scaleScaling factor for each value of the vector.
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
[in]shiftThe initial shift in the random sequence.
[in]seedThe seed used for random generation. Must be the same for all tiles initialized with this routine.
Return values
SPM_SUCCESSto match prototype of equivalent function

Definition at line 149 of file d_spm_genmat.c.

References d_updateRndVal(), spmatrix_s::gNexp, spmatrix_s::nexp, Rnd64_jump(), and SPM_SUCCESS.

Referenced by d_spmGenMat().

◆ d_spmRhsGenRndDist()

int d_spmRhsGenRndDist ( const spmatrix_t spm,
double  alpha,
spm_int_t  n,
double *  A,
spm_int_t  lda,
int  shift,
unsigned long long int  seed 
)

Generate a set of vectors of random values in distributed memory.

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]alphaScaling factor for each value of the vector.
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
[in]shiftThe initial shift in the random sequence.
[in]seedThe seed used for random generation. Must be the same for all tiles initialized with this routine.
Return values
SPM_SUCCESSon success
SPM_ERR_BADPARAMETERif the provided spm is incorrect

Definition at line 422 of file d_spm_genmat.c.

References d_spm_rhs_dist_genRnd_csx(), d_spm_rhs_dist_genRnd_ijv(), spmatrix_s::fmttype, and SpmIJV.

Referenced by d_spmGenMat().

◆ c_spmGenRHS()

int c_spmGenRHS ( spm_rhstype_t  type,
int  nrhs,
const spmatrix_t spm,
void *  x,
int  ldx,
void *  b,
int  ldb 
)

Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.

Parameters
[in]typeDefines how to compute the vector b.
  • SpmRhsOne: b is computed such that x = 1 [ + I ]
  • SpmRhsI: b is computed such that x = i [ + i * I ]
  • SpmRhsRndX: b is computed by matrix-vector product, such that is a random vector in the range [-0.5, 0.5]
  • SpmRhsRndB: b is computed randomly and x is not computed.
[in]nrhsDefines the number of right hand side that must be generated.
[in]spmThe sparse matrix uses to generate the right hand side, and the solution of the full problem.
[out]xOn exit, if x != NULL, then the x vector(s) generated to compute b is returned. Must be of size at least ldx * spm->n.
[in]ldxDefines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n.
[in,out]bb must be an allocated matrix of size at least ldb * nrhs. On exit, b is initialized as defined by the type parameter.
[in]ldbDefines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n.
Return values
SPM_SUCCESSif the b vector has been computed succesfully,
SPM_ERR_BADPARAMETERotherwise.

Definition at line 73 of file c_spm_genrhs.c.

References c_spmGenMat(), c_spmNorm(), spmatrix_s::gN, spmatrix_s::nexp, spm_cspmm(), SPM_ERR_BADPARAMETER, SPM_SUCCESS, SpmFrobeniusNorm, SpmLeft, SpmNoTrans, and spmatrix_s::values.

Referenced by spmGenRHS().

◆ c_spmGenMat()

int c_spmGenMat ( spm_rhstype_t  type,
int  nrhs,
const spmatrix_t spm,
void *  alphaptr,
unsigned long long int  seed,
void *  A,
int  lda 
)

Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.

Parameters
[in]typeDefines how to compute the vector b.
  • SpmRhsOne: b is computed such that x = 1 [ + I ]
  • SpmRhsI: b is computed such that x = i [ + i * I ]
  • SpmRhsRndX: b is computed by matrix-vector product, such that is a random vector in the range [-0.5, 0.5]
  • SpmRhsRndB: b is computed randomly and x is not computed.
[in]nrhsDefines the number of right hand side that must be generated.
[in]spmThe sparse matrix uses to generate the right hand side, and the solution of the full problem.
[in]alphaptrThe pointer to the scaling factor of the matrix.
[in]seedRandom seed generator.
[out]AThe generated matrix. It has to be preallocated with a size lda -by- nrhs.
[in]ldaDefines the leading dimension of A when multiple right hand sides are available. lda >= spm->nexp.
Return values
SPM_SUCCESSif the b vector has been computed succesfully,
SPM_ERR_BADPARAMETERotherwise.

Definition at line 783 of file c_spm_genmat.c.

References c_spmRhsGenI(), c_spmRhsGenOne(), c_spmRhsGenRndDist(), c_spmRhsGenRndShm(), spmatrix_s::nexp, spmatrix_s::replicated, SPM_ERR_BADPARAMETER, and SPM_SUCCESS.

Referenced by c_spmGenRHS(), and spmGenMat().

◆ c_spmCheckAxb()

int c_spmCheckAxb ( spm_fixdbl_t  eps,
int  nrhs,
const spmatrix_t spm,
void *  x0,
int  ldx0,
void *  b,
int  ldb,
const void *  x,
int  ldx 
)

Check the backward error, and the forward error if x0 is provided.

Parameters
[in]epsThe epsilon threshold used for the refinement step. -1. to use the machine precision.
[in]nrhsDefines the number of right hand side that must be generated.
[in]spmThe sparse matrix uses to generate the right hand side, and the solution of the full problem.
[in,out]x0If x0 != NULL, the forward error is computed. On exit, x0 stores (x0-x)
[in]ldx0Defines the leading dimension of x0 when multiple right hand sides are available. ldx0 >= spm->n.
[in,out]bb is a matrix of size at least ldb * nrhs. On exit, b stores Ax-b.
[in]ldbDefines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n.
[in]xContains the solution computed by the solver.
[in]ldxDefines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n.
Return values
SPM_SUCCESSif the tests are succesfull
1,ifone of the test failed

Compute the starting norms

Compute r = b - A * x

Compute r = x0 - x

Definition at line 203 of file c_spm_genrhs.c.

References c_spmNormMat(), CBLAS_SADDR, spmatrix_s::nexp, spm_cspmm(), SpmFrobeniusNorm, SpmInfNorm, SpmLeft, spmNorm(), SpmNoTrans, and SpmOneNorm.

Referenced by spmCheckAxb().

◆ c_spmGatherRHS()

void c_spmGatherRHS ( int  nrhs,
const spmatrix_t spm,
const spm_complex32_t b,
spm_int_t  ldb,
int  root,
spm_complex32_t bg,
spm_int_t  ldbg 
)

Gather all the global C coefficients and store the good ones in local.

Parameters
[in]spmThe sparse matrix spm
[in]nrhsNumber of rhs vectors.
[in]bThe local RHS array of size ldb-by-nrhs.
[in]ldbThe leading dimension of the b array. ldb >= max(1, spm->nexp)
[in]rootClustnum where the complete vector will be gathered. -1 if you want to gather the data on all nodes.
[in,out]bgOn entry, the allocated ldbg-by-nrhs array to store the gathered RHS.
[in]ldbgThe leading dimension of the bg array. ldbg >= max(1, spm->gNexp)

Definition at line 165 of file c_spm_rhs.c.

References spmatrix_s::baseval, spmatrix_s::clustnbr, spmatrix_s::clustnum, spmatrix_s::comm, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::gNexp, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nexp, spmatrix_s::replicated, and SPM_MPI_INT.

Referenced by c_spmm_build_Btmp(), and spmGatherRHS().

◆ c_spmReduceRHS()

void c_spmReduceRHS ( int  nrhs,
const spmatrix_t spm,
spm_complex32_t bglob,
spm_int_t  ldbg,
spm_complex32_t bloc,
spm_int_t  ldbl 
)

Reduce all the global coefficients of a rhs and store the local ones.

Parameters
[in]nrhsNumber of rhs vectors.
[in]spmThe sparse matrix spm
[in,out]bglobThe global rhs to reduce.
[in]ldbgLeading dimension of the global bglob matrix.
[in,out]blocLocal rhs matrix.
[in]ldblLeading dimension of the local bloc matrix.

Definition at line 109 of file c_spm_rhs.c.

References c_spmExtractLocalRHS(), spmatrix_s::comm, spmatrix_s::gNexp, and spmatrix_s::replicated.

Referenced by spm_cspmm(), spm_cspmv(), and spmReduceRHS().

◆ c_spmExtractLocalRHS()

void c_spmExtractLocalRHS ( int  nrhs,
const spmatrix_t spm,
const spm_complex32_t bglob,
spm_int_t  ldbg,
spm_complex32_t bloc,
spm_int_t  ldbl 
)

Stores the local values of a global RHS in the local one.

Parameters
[in]nrhsNumber of rhs vectors.
[in]spmThe sparse matrix spm
[in,out]bglobThe global RHS.
[in]ldbgLeading dimension of the global bglob matrix.
[in,out]blocLocal rhs matrix.
[in]ldblLeading dimension of the local bloc vector.

Definition at line 51 of file c_spm_rhs.c.

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

Referenced by c_spmReduceRHS(), and spmExtractLocalRHS().

◆ c_spmRhsGenRndShm()

int c_spmRhsGenRndShm ( const spmatrix_t spm,
spm_complex32_t  scale,
spm_int_t  n,
spm_complex32_t A,
spm_int_t  lda,
int  shift,
unsigned long long int  seed 
)

Generate a set of vectors of random values in shared memory.

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]scaleScaling factor for each value of the vector.
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
[in]shiftThe initial shift in the random sequence.
[in]seedThe seed used for random generation. Must be the same for all tiles initialized with this routine.
Return values
SPM_SUCCESSto match prototype of equivalent function

Definition at line 149 of file c_spm_genmat.c.

References c_updateRndVal(), spmatrix_s::gNexp, spmatrix_s::nexp, Rnd64_jump(), and SPM_SUCCESS.

Referenced by c_spmGenMat().

◆ c_spmRhsGenRndDist()

int c_spmRhsGenRndDist ( const spmatrix_t spm,
spm_complex32_t  alpha,
spm_int_t  n,
spm_complex32_t A,
spm_int_t  lda,
int  shift,
unsigned long long int  seed 
)

Generate a set of vectors of random values in distributed memory.

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]alphaScaling factor for each value of the vector.
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
[in]shiftThe initial shift in the random sequence.
[in]seedThe seed used for random generation. Must be the same for all tiles initialized with this routine.
Return values
SPM_SUCCESSon success
SPM_ERR_BADPARAMETERif the provided spm is incorrect

Definition at line 422 of file c_spm_genmat.c.

References c_spm_rhs_dist_genRnd_csx(), c_spm_rhs_dist_genRnd_ijv(), spmatrix_s::fmttype, and SpmIJV.

Referenced by c_spmGenMat().

◆ z_spmGenRHS()

int z_spmGenRHS ( spm_rhstype_t  type,
int  nrhs,
const spmatrix_t spm,
void *  x,
int  ldx,
void *  b,
int  ldb 
)

Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.

Parameters
[in]typeDefines how to compute the vector b.
  • SpmRhsOne: b is computed such that x = 1 [ + I ]
  • SpmRhsI: b is computed such that x = i [ + i * I ]
  • SpmRhsRndX: b is computed by matrix-vector product, such that is a random vector in the range [-0.5, 0.5]
  • SpmRhsRndB: b is computed randomly and x is not computed.
[in]nrhsDefines the number of right hand side that must be generated.
[in]spmThe sparse matrix uses to generate the right hand side, and the solution of the full problem.
[out]xOn exit, if x != NULL, then the x vector(s) generated to compute b is returned. Must be of size at least ldx * spm->n.
[in]ldxDefines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n.
[in,out]bb must be an allocated matrix of size at least ldb * nrhs. On exit, b is initialized as defined by the type parameter.
[in]ldbDefines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n.
Return values
SPM_SUCCESSif the b vector has been computed succesfully,
SPM_ERR_BADPARAMETERotherwise.

Definition at line 73 of file z_spm_genrhs.c.

References spmatrix_s::gN, spmatrix_s::nexp, SPM_ERR_BADPARAMETER, SPM_SUCCESS, spm_zspmm(), SpmFrobeniusNorm, SpmLeft, SpmNoTrans, spmatrix_s::values, z_spmGenMat(), and z_spmNorm().

Referenced by spmGenRHS().

◆ z_spmGenMat()

int z_spmGenMat ( spm_rhstype_t  type,
int  nrhs,
const spmatrix_t spm,
void *  alphaptr,
unsigned long long int  seed,
void *  A,
int  lda 
)

Generate nrhs right hand side vectors associated to a given matrix to test a problem with a solver.

Parameters
[in]typeDefines how to compute the vector b.
  • SpmRhsOne: b is computed such that x = 1 [ + I ]
  • SpmRhsI: b is computed such that x = i [ + i * I ]
  • SpmRhsRndX: b is computed by matrix-vector product, such that is a random vector in the range [-0.5, 0.5]
  • SpmRhsRndB: b is computed randomly and x is not computed.
[in]nrhsDefines the number of right hand side that must be generated.
[in]spmThe sparse matrix uses to generate the right hand side, and the solution of the full problem.
[in]alphaptrThe pointer to the scaling factor of the matrix.
[in]seedRandom seed generator.
[out]AThe generated matrix. It has to be preallocated with a size lda -by- nrhs.
[in]ldaDefines the leading dimension of A when multiple right hand sides are available. lda >= spm->nexp.
Return values
SPM_SUCCESSif the b vector has been computed succesfully,
SPM_ERR_BADPARAMETERotherwise.

Definition at line 783 of file z_spm_genmat.c.

References spmatrix_s::nexp, spmatrix_s::replicated, SPM_ERR_BADPARAMETER, SPM_SUCCESS, z_spmRhsGenI(), z_spmRhsGenOne(), z_spmRhsGenRndDist(), and z_spmRhsGenRndShm().

Referenced by spmGenMat(), and z_spmGenRHS().

◆ z_spmCheckAxb()

int z_spmCheckAxb ( spm_fixdbl_t  eps,
int  nrhs,
const spmatrix_t spm,
void *  x0,
int  ldx0,
void *  b,
int  ldb,
const void *  x,
int  ldx 
)

Check the backward error, and the forward error if x0 is provided.

Parameters
[in]epsThe epsilon threshold used for the refinement step. -1. to use the machine precision.
[in]nrhsDefines the number of right hand side that must be generated.
[in]spmThe sparse matrix uses to generate the right hand side, and the solution of the full problem.
[in,out]x0If x0 != NULL, the forward error is computed. On exit, x0 stores (x0-x)
[in]ldx0Defines the leading dimension of x0 when multiple right hand sides are available. ldx0 >= spm->n.
[in,out]bb is a matrix of size at least ldb * nrhs. On exit, b stores Ax-b.
[in]ldbDefines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n.
[in]xContains the solution computed by the solver.
[in]ldxDefines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n.
Return values
SPM_SUCCESSif the tests are succesfull
1,ifone of the test failed

Compute the starting norms

Compute r = b - A * x

Compute r = x0 - x

Definition at line 203 of file z_spm_genrhs.c.

References CBLAS_SADDR, spmatrix_s::nexp, spm_zspmm(), SpmFrobeniusNorm, SpmInfNorm, SpmLeft, spmNorm(), SpmNoTrans, SpmOneNorm, and z_spmNormMat().

Referenced by spmCheckAxb().

◆ z_spmGatherRHS()

void z_spmGatherRHS ( int  nrhs,
const spmatrix_t spm,
const spm_complex64_t *  b,
spm_int_t  ldb,
int  root,
spm_complex64_t *  bg,
spm_int_t  ldbg 
)

Gather all the global C coefficients and store the good ones in local.

Parameters
[in]spmThe sparse matrix spm
[in]nrhsNumber of rhs vectors.
[in]bThe local RHS array of size ldb-by-nrhs.
[in]ldbThe leading dimension of the b array. ldb >= max(1, spm->nexp)
[in]rootClustnum where the complete vector will be gathered. -1 if you want to gather the data on all nodes.
[in,out]bgOn entry, the allocated ldbg-by-nrhs array to store the gathered RHS.
[in]ldbgThe leading dimension of the bg array. ldbg >= max(1, spm->gNexp)

Definition at line 165 of file z_spm_rhs.c.

References spmatrix_s::baseval, spmatrix_s::clustnbr, spmatrix_s::clustnum, spmatrix_s::comm, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::gNexp, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nexp, spmatrix_s::replicated, and SPM_MPI_INT.

Referenced by spmGatherRHS(), and z_spmm_build_Btmp().

◆ z_spmReduceRHS()

void z_spmReduceRHS ( int  nrhs,
const spmatrix_t spm,
spm_complex64_t *  bglob,
spm_int_t  ldbg,
spm_complex64_t *  bloc,
spm_int_t  ldbl 
)

Reduce all the global coefficients of a rhs and store the local ones.

Parameters
[in]nrhsNumber of rhs vectors.
[in]spmThe sparse matrix spm
[in,out]bglobThe global rhs to reduce.
[in]ldbgLeading dimension of the global bglob matrix.
[in,out]blocLocal rhs matrix.
[in]ldblLeading dimension of the local bloc matrix.

Definition at line 109 of file z_spm_rhs.c.

References spmatrix_s::comm, spmatrix_s::gNexp, spmatrix_s::replicated, and z_spmExtractLocalRHS().

Referenced by spm_zspmm(), spm_zspmv(), and spmReduceRHS().

◆ z_spmExtractLocalRHS()

void z_spmExtractLocalRHS ( int  nrhs,
const spmatrix_t spm,
const spm_complex64_t *  bglob,
spm_int_t  ldbg,
spm_complex64_t *  bloc,
spm_int_t  ldbl 
)

Stores the local values of a global RHS in the local one.

Parameters
[in]nrhsNumber of rhs vectors.
[in]spmThe sparse matrix spm
[in,out]bglobThe global RHS.
[in]ldbgLeading dimension of the global bglob matrix.
[in,out]blocLocal rhs matrix.
[in]ldblLeading dimension of the local bloc vector.

Definition at line 51 of file z_spm_rhs.c.

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

Referenced by spmExtractLocalRHS(), and z_spmReduceRHS().

◆ z_spmRhsGenRndShm()

int z_spmRhsGenRndShm ( const spmatrix_t spm,
spm_complex64_t  scale,
spm_int_t  n,
spm_complex64_t *  A,
spm_int_t  lda,
int  shift,
unsigned long long int  seed 
)

Generate a set of vectors of random values in shared memory.

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]scaleScaling factor for each value of the vector.
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
[in]shiftThe initial shift in the random sequence.
[in]seedThe seed used for random generation. Must be the same for all tiles initialized with this routine.
Return values
SPM_SUCCESSto match prototype of equivalent function

Definition at line 149 of file z_spm_genmat.c.

References spmatrix_s::gNexp, spmatrix_s::nexp, Rnd64_jump(), SPM_SUCCESS, and z_updateRndVal().

Referenced by z_spmGenMat().

◆ z_spmRhsGenRndDist()

int z_spmRhsGenRndDist ( const spmatrix_t spm,
spm_complex64_t  alpha,
spm_int_t  n,
spm_complex64_t *  A,
spm_int_t  lda,
int  shift,
unsigned long long int  seed 
)

Generate a set of vectors of random values in distributed memory.

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]alphaScaling factor for each value of the vector.
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
[in]shiftThe initial shift in the random sequence.
[in]seedThe seed used for random generation. Must be the same for all tiles initialized with this routine.
Return values
SPM_SUCCESSon success
SPM_ERR_BADPARAMETERif the provided spm is incorrect

Definition at line 422 of file z_spm_genmat.c.

References spmatrix_s::fmttype, SpmIJV, z_spm_rhs_dist_genRnd_csx(), and z_spm_rhs_dist_genRnd_ijv().

Referenced by z_spmGenMat().

◆ Rnd64_jump()

static unsigned long long int Rnd64_jump ( unsigned long long int  n,
unsigned long long int  seed 
)
static

Random generator from the HPL library.

Parameters
[in]nNumber of elements to jump over in the generator cycle.
[in]seed
Return values
arandom integer value

Definition at line 49 of file c_spm_genmat.c.

Referenced by c_spm_rhs_dist_genRnd_csx(), c_spm_rhs_dist_genRnd_ijv(), and c_spmRhsGenRndShm().

◆ c_updateRndVal()

static void c_updateRndVal ( spm_complex32_t  scale,
spm_complex32_t val,
unsigned long long int *  ran 
)
static

Generate a value of the RHS.

Parameters
[in]scaleScaling factor for each randomized value.
[in,out]valThe value that will be updated
[in,out]ranThe current random value.

Definition at line 98 of file c_spm_genmat.c.

Referenced by c_spm_rhs_dist_genRnd_csx(), c_spm_rhs_dist_genRnd_ijv(), and c_spmRhsGenRndShm().

◆ c_spmRhsGenOne()

static int c_spmRhsGenOne ( const spmatrix_t spm,
spm_complex32_t  alpha,
spm_int_t  n,
spm_complex32_t A,
spm_int_t  lda 
)
static

Generate a set of vectors of constant values.

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]alphaInitialize each value to alpha [ + I * alpha ]
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
Return values
SPM_SUCCESSto match prototype of equivalent function

Definition at line 469 of file c_spm_genmat.c.

References spmatrix_s::nexp, and SPM_SUCCESS.

Referenced by c_spmGenMat().

◆ c_spmRhsGenI()

static int c_spmRhsGenI ( const spmatrix_t spm,
spm_complex32_t  alpha,
spm_int_t  n,
spm_complex32_t A,
spm_int_t  lda 
)
static

Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ).

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]alphaScaling factor for each value of the vector.
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
Return values
SPM_SUCCESSon success
SPM_ERR_BADPARAMETERif the provided spm is incorrect

Definition at line 723 of file c_spm_genmat.c.

References c_spm_rhs_genI_csx(), c_spm_rhs_genI_ijv(), spmatrix_s::fmttype, and SpmIJV.

Referenced by c_spmGenMat().

◆ s_updateRndVal()

static void s_updateRndVal ( float  scale,
float *  val,
unsigned long long int *  ran 
)
static

Generate a value of the RHS.

Parameters
[in]scaleScaling factor for each randomized value.
[in,out]valThe value that will be updated
[in,out]ranThe current random value.

Definition at line 98 of file s_spm_genmat.c.

Referenced by s_spm_rhs_dist_genRnd_csx(), s_spm_rhs_dist_genRnd_ijv(), and s_spmRhsGenRndShm().

◆ s_spmRhsGenOne()

static int s_spmRhsGenOne ( const spmatrix_t spm,
float  alpha,
spm_int_t  n,
float *  A,
spm_int_t  lda 
)
static

Generate a set of vectors of constant values.

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]alphaInitialize each value to alpha [ + I * alpha ]
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
Return values
SPM_SUCCESSto match prototype of equivalent function

Definition at line 469 of file s_spm_genmat.c.

References spmatrix_s::nexp, and SPM_SUCCESS.

Referenced by s_spmGenMat().

◆ s_spmRhsGenI()

static int s_spmRhsGenI ( const spmatrix_t spm,
float  alpha,
spm_int_t  n,
float *  A,
spm_int_t  lda 
)
static

Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ).

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]alphaScaling factor for each value of the vector.
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
Return values
SPM_SUCCESSon success
SPM_ERR_BADPARAMETERif the provided spm is incorrect

Definition at line 723 of file s_spm_genmat.c.

References spmatrix_s::fmttype, s_spm_rhs_genI_csx(), s_spm_rhs_genI_ijv(), and SpmIJV.

Referenced by s_spmGenMat().

◆ z_updateRndVal()

static void z_updateRndVal ( spm_complex64_t  scale,
spm_complex64_t *  val,
unsigned long long int *  ran 
)
static

Generate a value of the RHS.

Parameters
[in]scaleScaling factor for each randomized value.
[in,out]valThe value that will be updated
[in,out]ranThe current random value.

Definition at line 98 of file z_spm_genmat.c.

Referenced by z_spm_rhs_dist_genRnd_csx(), z_spm_rhs_dist_genRnd_ijv(), and z_spmRhsGenRndShm().

◆ z_spmRhsGenOne()

static int z_spmRhsGenOne ( const spmatrix_t spm,
spm_complex64_t  alpha,
spm_int_t  n,
spm_complex64_t *  A,
spm_int_t  lda 
)
static

Generate a set of vectors of constant values.

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]alphaInitialize each value to alpha [ + I * alpha ]
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
Return values
SPM_SUCCESSto match prototype of equivalent function

Definition at line 469 of file z_spm_genmat.c.

References spmatrix_s::nexp, and SPM_SUCCESS.

Referenced by z_spmGenMat().

◆ z_spmRhsGenI()

static int z_spmRhsGenI ( const spmatrix_t spm,
spm_complex64_t  alpha,
spm_int_t  n,
spm_complex64_t *  A,
spm_int_t  lda 
)
static

Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ).

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]alphaScaling factor for each value of the vector.
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
Return values
SPM_SUCCESSon success
SPM_ERR_BADPARAMETERif the provided spm is incorrect

Definition at line 723 of file z_spm_genmat.c.

References spmatrix_s::fmttype, SpmIJV, z_spm_rhs_genI_csx(), and z_spm_rhs_genI_ijv().

Referenced by z_spmGenMat().

◆ d_updateRndVal()

static void d_updateRndVal ( double  scale,
double *  val,
unsigned long long int *  ran 
)
static

Generate a value of the RHS.

Parameters
[in]scaleScaling factor for each randomized value.
[in,out]valThe value that will be updated
[in,out]ranThe current random value.

Definition at line 98 of file d_spm_genmat.c.

Referenced by d_spm_rhs_dist_genRnd_csx(), d_spm_rhs_dist_genRnd_ijv(), and d_spmRhsGenRndShm().

◆ d_spmRhsGenOne()

static int d_spmRhsGenOne ( const spmatrix_t spm,
double  alpha,
spm_int_t  n,
double *  A,
spm_int_t  lda 
)
static

Generate a set of vectors of constant values.

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]alphaInitialize each value to alpha [ + I * alpha ]
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
Return values
SPM_SUCCESSto match prototype of equivalent function

Definition at line 469 of file d_spm_genmat.c.

References spmatrix_s::nexp, and SPM_SUCCESS.

Referenced by d_spmGenMat().

◆ d_spmRhsGenI()

static int d_spmRhsGenI ( const spmatrix_t spm,
double  alpha,
spm_int_t  n,
double *  A,
spm_int_t  lda 
)
static

Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ).

Parameters
[in]spmThe sparse matrix associated to the right hand side.
[in]alphaScaling factor for each value of the vector.
[in]nThe number of columns in A. n >= 0.
[in,out]AOn entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized.
[in]ldaThe leading dimension of the matrix A. lda >= max(1,spm->nexp).
Return values
SPM_SUCCESSon success
SPM_ERR_BADPARAMETERif the provided spm is incorrect

Definition at line 723 of file d_spm_genmat.c.

References d_spm_rhs_genI_csx(), d_spm_rhs_genI_ijv(), spmatrix_s::fmttype, and SpmIJV.

Referenced by d_spmGenMat().