PaStiX Handbook  6.2.1
analyze.c File Reference

A simple example that performs only the analyses steps onto the given graph. More...

Go to the source code of this file.

Detailed Description

A simple example that performs only the analyses steps onto the given graph.

These tests doesn't require the values of the matrix.

Version
6.2.0
Author
Pierre Ramet
Gregoire Pichon
Mathieu Faverge
Theophile Terraz
Tony Delarue
Date
2021-04-07
/
#include <pastix.h>
#include <spm.h>
#include <limits.h>
int main (int argc, char **argv)
{
pastix_data_t *pastix_data = NULL; /*< Pointer to the storage structure required by pastix */
pastix_int_t iparm[IPARM_SIZE]; /*< Integer in/out parameters for pastix */
double dparm[DPARM_SIZE]; /*< Floating in/out parameters for pastix */
spm_driver_t driver;
char *filename;
spmatrix_t *spm, spm2;
int rc;
/**
* Initialize parameters to default values
*/
pastixInitParam( iparm, dparm );
/**
* Get options from command line
*/
pastixGetOptions( argc, argv,
iparm, dparm,
NULL, &driver, &filename );
/**
* Startup PaStiX
*/
pastixInit( &pastix_data, MPI_COMM_WORLD, iparm, dparm );
/**
* Read the sparse matrix with the driver
*/
spm = malloc( sizeof( spmatrix_t ) );
spmReadDriver( driver, filename, spm );
free( filename );
spmPrintInfo( spm, stdout );
rc = spmCheckAndCorrect( spm, &spm2 );
if ( rc != 0 ) {
spmExit( spm );
*spm = spm2;
rc = 0;
}
/**
* Perform ordering, symbolic factorization, and analyze steps
*/
pastix_task_analyze( pastix_data, spm );
spmExit( spm );
free( spm );
pastixFinalize( &pastix_data );
return EXIT_SUCCESS;
}
/**
*

Definition in file analyze.c.

pastixGetOptions
void pastixGetOptions(int argc, char **argv, pastix_int_t *iparm, double *dparm, int *check, spm_driver_t *driver, char **filename)
PaStiX helper function to read command line options in examples.
Definition: get_options.c:142
pastix.h
pastixInit
void pastixInit(pastix_data_t **pastix_data, PASTIX_Comm pastix_comm, pastix_int_t *iparm, double *dparm)
Initialize the solver instance.
Definition: api.c:857
main
int main(int argc, char *argv[])
Definition: binding_for_multimpi.c:49
pastixInitParam
void pastixInitParam(pastix_int_t *iparm, double *dparm)
Initialize the iparm and dparm arrays to their default values.
Definition: api.c:401
pastix_task_analyze
int pastix_task_analyze(pastix_data_t *pastix_data, const spmatrix_t *spm)
Perform all the preprocessing steps: ordering, symbolic factorization, reordering,...
Definition: pastix_task_analyze.c:53
pastixFinalize
void pastixFinalize(pastix_data_t **pastix_data)
Finalize the solver instance.
Definition: api.c:880