SpM Handbook 1.2.4
|
#include "common.h"
#include <cblas.h>
#include <lapacke.h>
Go to the source code of this file.
Functions | |
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 | s_updateRndVal (float scale, float *val, unsigned long long int *ran) |
Generate a value of the RHS. | |
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. | |
static int | s_spm_rhs_dist_genRnd_csx (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 for CSX format. | |
static int | s_spm_rhs_dist_genRnd_ijv (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 for IJV format. | |
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. | |
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_spm_rhs_genI_csx (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 ] ) for CSC format. | |
static int | s_spm_rhs_genI_ijv (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 ] ) for IJV format. | |
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 ] ). | |
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. | |
SParse Matrix package matrix generators.
Definition in file s_spm_genmat.c.
|
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 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 random values in distributed memory for CSX format.
[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 215 of file s_spm_genmat.c.
References spmatrix_s::baseval, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::gNexp, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::replicated, Rnd64_jump(), s_updateRndVal(), and SPM_SUCCESS.
Referenced by s_spmRhsGenRndDist().
|
static |
Generate a set of vectors of random values in distributed memory for IJV format.
[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 303 of file s_spm_genmat.c.
References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::gNexp, spmatrix_s::nnz, Rnd64_jump(), spmatrix_s::rowptr, s_updateRndVal(), SPM_ERR_BADPARAMETER, spm_get_distribution(), SPM_SUCCESS, SpmDistByColumn, and SpmDistByRow.
Referenced by s_spmRhsGenRndDist().
|
static |
Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ) for CSC format.
[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 529 of file s_spm_genmat.c.
References spmatrix_s::baseval, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nexp, spmatrix_s::replicated, and SPM_SUCCESS.
Referenced by s_spmRhsGenI().
|
static |
Generate a set of vectors x[i] = alpha * ( i [+ i* I ] ) for IJV format.
[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 |
If the spm is global, we have to know which vertice is sorted
Definition at line 607 of file s_spm_genmat.c.
References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::nexp, spmatrix_s::nnz, spmatrix_s::rowptr, SPM_ERR_BADPARAMETER, spm_get_distribution(), SPM_SUCCESS, SpmDistByColumn, and SpmDistByRow.
Referenced by s_spmRhsGenI().