SpM Handbook 1.2.4
|
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 ] ). | |
RHS routines.
Subroutines for random vector generation to be used in testings.
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.
[in] | type | Defines how to compute the vector b.
|
[in] | nrhs | Defines the number of right hand side that must be generated. |
[in] | spm | The sparse matrix uses to generate the right hand side, and the solution of the full problem. |
[out] | x | On 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] | ldx | Defines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n. |
[in,out] | b | b must be an allocated matrix of size at least ldb * nrhs. On exit, b is initialized as defined by the type parameter. |
[in] | ldb | Defines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n. |
SPM_SUCCESS | if the b vector has been computed succesfully, |
SPM_ERR_BADPARAMETER | otherwise. |
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().
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.
[in] | type | Defines how to compute the vector b.
|
[in] | nrhs | Defines the number of right hand side that must be generated. |
[in] | spm | The sparse matrix uses to generate the right hand side, and the solution of the full problem. |
[in] | alphaptr | The pointer to the scaling factor of the matrix. |
[in] | seed | Random seed generator. |
[out] | A | The generated matrix. It has to be preallocated with a size lda -by- nrhs. |
[in] | lda | Defines the leading dimension of A when multiple right hand sides are available. lda >= spm->nexp. |
SPM_SUCCESS | if the b vector has been computed succesfully, |
SPM_ERR_BADPARAMETER | otherwise. |
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().
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.
[in] | eps | The epsilon threshold used for the refinement step. -1. to use the machine precision. |
[in] | nrhs | Defines the number of right hand side that must be generated. |
[in] | spm | The sparse matrix uses to generate the right hand side, and the solution of the full problem. |
[in,out] | x0 | If x0 != NULL, the forward error is computed. On exit, x0 stores (x0-x) |
[in] | ldx0 | Defines the leading dimension of x0 when multiple right hand sides are available. ldx0 >= spm->n. |
[in,out] | b | b is a matrix of size at least ldb * nrhs. On exit, b stores Ax-b. |
[in] | ldb | Defines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n. |
[in] | x | Contains the solution computed by the solver. |
[in] | ldx | Defines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n. |
SPM_SUCCESS | if the tests are succesfull |
1,if | one 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().
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.
[in] | spm | The sparse matrix spm |
[in] | nrhs | Number of rhs vectors. |
[in] | b | The local RHS array of size ldb-by-nrhs. |
[in] | ldb | The leading dimension of the b array. ldb >= max(1, spm->nexp) |
[in] | root | Clustnum where the complete vector will be gathered. -1 if you want to gather the data on all nodes. |
[in,out] | bg | On entry, the allocated ldbg-by-nrhs array to store the gathered RHS. |
[in] | ldbg | The 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().
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.
[in] | nrhs | Number of rhs vectors. |
[in] | spm | The sparse matrix spm |
[in,out] | bglob | The global rhs to reduce. |
[in] | ldbg | Leading dimension of the global bglob matrix. |
[in,out] | bloc | Local rhs matrix. |
[in] | ldbl | Leading 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().
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.
[in] | nrhs | Number of rhs vectors. |
[in] | spm | The sparse matrix spm |
[in,out] | bglob | The global RHS. |
[in] | ldbg | Leading dimension of the global bglob matrix. |
[in,out] | bloc | Local rhs matrix. |
[in] | ldbl | Leading 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().
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.
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | scale | Scaling factor for each value of the vector. |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
[in] | shift | The initial shift in the random sequence. |
[in] | seed | The seed used for random generation. Must be the same for all tiles initialized with this routine. |
SPM_SUCCESS | to 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().
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.
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | alpha | Scaling factor for each value of the vector. |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
[in] | shift | The initial shift in the random sequence. |
[in] | seed | The seed used for random generation. Must be the same for all tiles initialized with this routine. |
SPM_SUCCESS | on success |
SPM_ERR_BADPARAMETER | if 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().
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.
[in] | type | Defines how to compute the vector b.
|
[in] | nrhs | Defines the number of right hand side that must be generated. |
[in] | spm | The sparse matrix uses to generate the right hand side, and the solution of the full problem. |
[out] | x | On 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] | ldx | Defines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n. |
[in,out] | b | b must be an allocated matrix of size at least ldb * nrhs. On exit, b is initialized as defined by the type parameter. |
[in] | ldb | Defines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n. |
SPM_SUCCESS | if the b vector has been computed succesfully, |
SPM_ERR_BADPARAMETER | otherwise. |
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().
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.
[in] | type | Defines how to compute the vector b.
|
[in] | nrhs | Defines the number of right hand side that must be generated. |
[in] | spm | The sparse matrix uses to generate the right hand side, and the solution of the full problem. |
[in] | alphaptr | The pointer to the scaling factor of the matrix. |
[in] | seed | Random seed generator. |
[out] | A | The generated matrix. It has to be preallocated with a size lda -by- nrhs. |
[in] | lda | Defines the leading dimension of A when multiple right hand sides are available. lda >= spm->nexp. |
SPM_SUCCESS | if the b vector has been computed succesfully, |
SPM_ERR_BADPARAMETER | otherwise. |
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().
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.
[in] | eps | The epsilon threshold used for the refinement step. -1. to use the machine precision. |
[in] | nrhs | Defines the number of right hand side that must be generated. |
[in] | spm | The sparse matrix uses to generate the right hand side, and the solution of the full problem. |
[in,out] | x0 | If x0 != NULL, the forward error is computed. On exit, x0 stores (x0-x) |
[in] | ldx0 | Defines the leading dimension of x0 when multiple right hand sides are available. ldx0 >= spm->n. |
[in,out] | b | b is a matrix of size at least ldb * nrhs. On exit, b stores Ax-b. |
[in] | ldb | Defines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n. |
[in] | x | Contains the solution computed by the solver. |
[in] | ldx | Defines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n. |
SPM_SUCCESS | if the tests are succesfull |
1,if | one 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().
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.
[in] | spm | The sparse matrix spm |
[in] | nrhs | Number of rhs vectors. |
[in] | b | The local RHS array of size ldb-by-nrhs. |
[in] | ldb | The leading dimension of the b array. ldb >= max(1, spm->nexp) |
[in] | root | Clustnum where the complete vector will be gathered. -1 if you want to gather the data on all nodes. |
[in,out] | bg | On entry, the allocated ldbg-by-nrhs array to store the gathered RHS. |
[in] | ldbg | The 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().
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.
[in] | nrhs | Number of rhs vectors. |
[in] | spm | The sparse matrix spm |
[in,out] | bglob | The global rhs to reduce. |
[in] | ldbg | Leading dimension of the global bglob matrix. |
[in,out] | bloc | Local rhs matrix. |
[in] | ldbl | Leading 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().
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.
[in] | nrhs | Number of rhs vectors. |
[in] | spm | The sparse matrix spm |
[in,out] | bglob | The global RHS. |
[in] | ldbg | Leading dimension of the global bglob matrix. |
[in,out] | bloc | Local rhs matrix. |
[in] | ldbl | Leading 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().
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.
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | scale | Scaling factor for each value of the vector. |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
[in] | shift | The initial shift in the random sequence. |
[in] | seed | The seed used for random generation. Must be the same for all tiles initialized with this routine. |
SPM_SUCCESS | to 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().
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.
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | alpha | Scaling factor for each value of the vector. |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
[in] | shift | The initial shift in the random sequence. |
[in] | seed | The seed used for random generation. Must be the same for all tiles initialized with this routine. |
SPM_SUCCESS | on success |
SPM_ERR_BADPARAMETER | if 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().
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.
[in] | type | Defines how to compute the vector b.
|
[in] | nrhs | Defines the number of right hand side that must be generated. |
[in] | spm | The sparse matrix uses to generate the right hand side, and the solution of the full problem. |
[out] | x | On 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] | ldx | Defines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n. |
[in,out] | b | b must be an allocated matrix of size at least ldb * nrhs. On exit, b is initialized as defined by the type parameter. |
[in] | ldb | Defines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n. |
SPM_SUCCESS | if the b vector has been computed succesfully, |
SPM_ERR_BADPARAMETER | otherwise. |
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().
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.
[in] | type | Defines how to compute the vector b.
|
[in] | nrhs | Defines the number of right hand side that must be generated. |
[in] | spm | The sparse matrix uses to generate the right hand side, and the solution of the full problem. |
[in] | alphaptr | The pointer to the scaling factor of the matrix. |
[in] | seed | Random seed generator. |
[out] | A | The generated matrix. It has to be preallocated with a size lda -by- nrhs. |
[in] | lda | Defines the leading dimension of A when multiple right hand sides are available. lda >= spm->nexp. |
SPM_SUCCESS | if the b vector has been computed succesfully, |
SPM_ERR_BADPARAMETER | otherwise. |
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().
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.
[in] | eps | The epsilon threshold used for the refinement step. -1. to use the machine precision. |
[in] | nrhs | Defines the number of right hand side that must be generated. |
[in] | spm | The sparse matrix uses to generate the right hand side, and the solution of the full problem. |
[in,out] | x0 | If x0 != NULL, the forward error is computed. On exit, x0 stores (x0-x) |
[in] | ldx0 | Defines the leading dimension of x0 when multiple right hand sides are available. ldx0 >= spm->n. |
[in,out] | b | b is a matrix of size at least ldb * nrhs. On exit, b stores Ax-b. |
[in] | ldb | Defines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n. |
[in] | x | Contains the solution computed by the solver. |
[in] | ldx | Defines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n. |
SPM_SUCCESS | if the tests are succesfull |
1,if | one 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().
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.
[in] | spm | The sparse matrix spm |
[in] | nrhs | Number of rhs vectors. |
[in] | b | The local RHS array of size ldb-by-nrhs. |
[in] | ldb | The leading dimension of the b array. ldb >= max(1, spm->nexp) |
[in] | root | Clustnum where the complete vector will be gathered. -1 if you want to gather the data on all nodes. |
[in,out] | bg | On entry, the allocated ldbg-by-nrhs array to store the gathered RHS. |
[in] | ldbg | The 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().
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.
[in] | nrhs | Number of rhs vectors. |
[in] | spm | The sparse matrix spm |
[in,out] | bglob | The global rhs to reduce. |
[in] | ldbg | Leading dimension of the global bglob matrix. |
[in,out] | bloc | Local rhs matrix. |
[in] | ldbl | Leading 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().
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.
[in] | nrhs | Number of rhs vectors. |
[in] | spm | The sparse matrix spm |
[in,out] | bglob | The global RHS. |
[in] | ldbg | Leading dimension of the global bglob matrix. |
[in,out] | bloc | Local rhs matrix. |
[in] | ldbl | Leading 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().
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.
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | scale | Scaling factor for each value of the vector. |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
[in] | shift | The initial shift in the random sequence. |
[in] | seed | The seed used for random generation. Must be the same for all tiles initialized with this routine. |
SPM_SUCCESS | to 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().
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.
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | alpha | Scaling factor for each value of the vector. |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
[in] | shift | The initial shift in the random sequence. |
[in] | seed | The seed used for random generation. Must be the same for all tiles initialized with this routine. |
SPM_SUCCESS | on success |
SPM_ERR_BADPARAMETER | if 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().
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.
[in] | type | Defines how to compute the vector b.
|
[in] | nrhs | Defines the number of right hand side that must be generated. |
[in] | spm | The sparse matrix uses to generate the right hand side, and the solution of the full problem. |
[out] | x | On 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] | ldx | Defines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n. |
[in,out] | b | b must be an allocated matrix of size at least ldb * nrhs. On exit, b is initialized as defined by the type parameter. |
[in] | ldb | Defines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n. |
SPM_SUCCESS | if the b vector has been computed succesfully, |
SPM_ERR_BADPARAMETER | otherwise. |
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().
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.
[in] | type | Defines how to compute the vector b.
|
[in] | nrhs | Defines the number of right hand side that must be generated. |
[in] | spm | The sparse matrix uses to generate the right hand side, and the solution of the full problem. |
[in] | alphaptr | The pointer to the scaling factor of the matrix. |
[in] | seed | Random seed generator. |
[out] | A | The generated matrix. It has to be preallocated with a size lda -by- nrhs. |
[in] | lda | Defines the leading dimension of A when multiple right hand sides are available. lda >= spm->nexp. |
SPM_SUCCESS | if the b vector has been computed succesfully, |
SPM_ERR_BADPARAMETER | otherwise. |
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().
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.
[in] | eps | The epsilon threshold used for the refinement step. -1. to use the machine precision. |
[in] | nrhs | Defines the number of right hand side that must be generated. |
[in] | spm | The sparse matrix uses to generate the right hand side, and the solution of the full problem. |
[in,out] | x0 | If x0 != NULL, the forward error is computed. On exit, x0 stores (x0-x) |
[in] | ldx0 | Defines the leading dimension of x0 when multiple right hand sides are available. ldx0 >= spm->n. |
[in,out] | b | b is a matrix of size at least ldb * nrhs. On exit, b stores Ax-b. |
[in] | ldb | Defines the leading dimension of b when multiple right hand sides are available. ldb >= spm->n. |
[in] | x | Contains the solution computed by the solver. |
[in] | ldx | Defines the leading dimension of x when multiple right hand sides are available. ldx >= spm->n. |
SPM_SUCCESS | if the tests are succesfull |
1,if | one 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().
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.
[in] | spm | The sparse matrix spm |
[in] | nrhs | Number of rhs vectors. |
[in] | b | The local RHS array of size ldb-by-nrhs. |
[in] | ldb | The leading dimension of the b array. ldb >= max(1, spm->nexp) |
[in] | root | Clustnum where the complete vector will be gathered. -1 if you want to gather the data on all nodes. |
[in,out] | bg | On entry, the allocated ldbg-by-nrhs array to store the gathered RHS. |
[in] | ldbg | The 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().
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.
[in] | nrhs | Number of rhs vectors. |
[in] | spm | The sparse matrix spm |
[in,out] | bglob | The global rhs to reduce. |
[in] | ldbg | Leading dimension of the global bglob matrix. |
[in,out] | bloc | Local rhs matrix. |
[in] | ldbl | Leading 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().
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.
[in] | nrhs | Number of rhs vectors. |
[in] | spm | The sparse matrix spm |
[in,out] | bglob | The global RHS. |
[in] | ldbg | Leading dimension of the global bglob matrix. |
[in,out] | bloc | Local rhs matrix. |
[in] | ldbl | Leading 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().
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.
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | scale | Scaling factor for each value of the vector. |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
[in] | shift | The initial shift in the random sequence. |
[in] | seed | The seed used for random generation. Must be the same for all tiles initialized with this routine. |
SPM_SUCCESS | to 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().
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.
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | alpha | Scaling factor for each value of the vector. |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
[in] | shift | The initial shift in the random sequence. |
[in] | seed | The seed used for random generation. Must be the same for all tiles initialized with this routine. |
SPM_SUCCESS | on success |
SPM_ERR_BADPARAMETER | if 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().
|
static |
Random generator from the HPL library.
[in] | n | Number of elements to jump over in the generator cycle. |
[in] | seed |
a | random 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().
|
static |
Generate a value of the RHS.
[in] | scale | Scaling factor for each randomized value. |
[in,out] | val | The value that will be updated |
[in,out] | ran | The 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().
|
static |
Generate a set of vectors of constant values.
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | alpha | Initialize each value to alpha [ + I * alpha ] |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
SPM_SUCCESS | to 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().
|
static |
Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ).
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | alpha | Scaling factor for each value of the vector. |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
SPM_SUCCESS | on success |
SPM_ERR_BADPARAMETER | if 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().
|
static |
Generate a value of the RHS.
[in] | scale | Scaling factor for each randomized value. |
[in,out] | val | The value that will be updated |
[in,out] | ran | The 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().
|
static |
Generate a set of vectors of constant values.
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | alpha | Initialize each value to alpha [ + I * alpha ] |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
SPM_SUCCESS | to 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().
|
static |
Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ).
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | alpha | Scaling factor for each value of the vector. |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
SPM_SUCCESS | on success |
SPM_ERR_BADPARAMETER | if 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().
|
static |
Generate a value of the RHS.
[in] | scale | Scaling factor for each randomized value. |
[in,out] | val | The value that will be updated |
[in,out] | ran | The 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().
|
static |
Generate a set of vectors of constant values.
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | alpha | Initialize each value to alpha [ + I * alpha ] |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
SPM_SUCCESS | to 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().
|
static |
Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ).
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | alpha | Scaling factor for each value of the vector. |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
SPM_SUCCESS | on success |
SPM_ERR_BADPARAMETER | if 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().
|
static |
Generate a value of the RHS.
[in] | scale | Scaling factor for each randomized value. |
[in,out] | val | The value that will be updated |
[in,out] | ran | The 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().
|
static |
Generate a set of vectors of constant values.
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | alpha | Initialize each value to alpha [ + I * alpha ] |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
SPM_SUCCESS | to 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().
|
static |
Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ).
[in] | spm | The sparse matrix associated to the right hand side. |
[in] | alpha | Scaling factor for each value of the vector. |
[in] | n | The number of columns in A. n >= 0. |
[in,out] | A | On entry, the lda-by-n matrix to be initialized. On exit, the matrix initialized. |
[in] | lda | The leading dimension of the matrix A. lda >= max(1,spm->nexp). |
SPM_SUCCESS | on success |
SPM_ERR_BADPARAMETER | if 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().