25 int main (
int argc,
char **argv)
29 double dparm[DPARM_SIZE];
31 char *filename = NULL;
32 spmatrix_t *spm, spm2;
33 void *x, *b, *x0 = NULL;
50 &check, &scatter, &driver, &filename );
64 pastixInit( &pastix_data, MPI_COMM_WORLD, iparm, dparm );
69 spm = malloc(
sizeof( spmatrix_t ) );
71 rc = spmReadDriverDist( driver, filename, spm, MPI_COMM_WORLD );
74 rc = spmReadDriver( driver, filename, spm );
77 if ( rc != SPM_SUCCESS ) {
82 spmPrintInfo( spm, stdout );
84 rc = spmCheckAndCorrect( spm, &spm2 );
94 if ( spm->flttype == SpmPattern ) {
95 spmGenFakeValues( spm );
106 double normA = spmNorm( SpmFrobeniusNorm, spm );
107 spmScal( 1./normA, spm );
118 size = pastix_size_of( spm->flttype ) * spm->nexp * nrhs;
127 spmGenRHS( SpmRhsRndX, nrhs, spm, x0, spm->nexp, b, spm->nexp );
128 memcpy( x, b, size );
131 spmGenRHS( SpmRhsRndB, nrhs, spm, NULL, spm->nexp, x, spm->nexp );
134 spmScalMat( 1./normA, spm, nrhs, b, spm->nexp );
137 memcpy( b, x, size );
BEGIN_C_DECLS typedef int pastix_int_t
void pastixFinalize(pastix_data_t **pastix_data)
Finalize the solver instance.
void pastixInitParam(pastix_int_t *iparm, double *dparm)
Initialize the iparm and dparm arrays to their default values.
void pastixInit(pastix_data_t **pastix_data, PASTIX_Comm pastix_comm, pastix_int_t *iparm, double *dparm)
Initialize the solver instance.
@ DPARM_EPSILON_REFINEMENT
@ DPARM_COMPRESS_TOLERANCE
@ IPARM_COMPRESS_MIN_WIDTH
@ IPARM_COMPRESS_MIN_HEIGHT
@ PastixCompressMethodPQRCP
void pastixGetOptions(int argc, char **argv, pastix_int_t *iparm, double *dparm, int *check, int *scatter, spm_driver_t *driver, char **filename)
PaStiX helper function to read command line options in examples.
int pastix_task_refine(pastix_data_t *pastix_data, pastix_int_t n, pastix_int_t nrhs, void *B, pastix_int_t ldb, void *X, pastix_int_t ldx)
Perform iterative refinement.
int pastix_task_analyze(pastix_data_t *pastix_data, const spmatrix_t *spm)
Perform all the preprocessing steps: ordering, symbolic factorization, reordering,...
int pastix_task_solve(pastix_data_t *pastix_data, pastix_int_t m, pastix_int_t nrhs, void *B, pastix_int_t ldb)
Solve the given problem.
int pastix_task_numfact(pastix_data_t *pastix_data, spmatrix_t *spm)
Perform all the numerical factorization steps: fill the internal block CSC and the solver matrix stru...
Main PaStiX data structure.