Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 0296e03d authored by Pierre Ramet's avatar Pierre Ramet
Browse files

cleanup new api

parent 53682ac4
No related branches found
No related tags found
No related merge requests found
...@@ -1344,7 +1344,7 @@ int writeHB_mat_char(const char* filename, int M, int N, ...@@ -1344,7 +1344,7 @@ int writeHB_mat_char(const char* filename, int M, int N,
int Ptrperline, Ptrwidth, Indperline, Indwidth; int Ptrperline, Ptrwidth, Indperline, Indwidth;
int Rhsperline, Rhswidth, Rhsprec; int Rhsperline, Rhswidth, Rhsprec;
char Rhsflag; char Rhsflag;
int Valperline, Valwidth, Valprec; int Valperline=0, Valwidth, Valprec;
char Valflag; /* Indicates 'E','D', or 'F' float format */ char Valflag; /* Indicates 'E','D', or 'F' float format */
char pformat[16],iformat[16],vformat[19],rformat[19]; char pformat[16],iformat[16],vformat[19],rformat[19];
......
...@@ -845,13 +845,13 @@ spmPrintInfo( const pastix_spm_t* spm, FILE *stream ) ...@@ -845,13 +845,13 @@ spmPrintInfo( const pastix_spm_t* spm, FILE *stream )
mtxtypestr[mtxtype], mtxtypestr[mtxtype],
flttypestr[flttype], flttypestr[flttype],
fmttypestr[fmttype], fmttypestr[fmttype],
spm->gN, spm->gnnz ); (long)spm->gN, (long)spm->gnnz );
if ( spm->dof != 1 ) { if ( spm->dof != 1 ) {
if ( spm->dof > 1 ) { if ( spm->dof > 1 ) {
fprintf(stream, fprintf(stream,
" Dof: %ld\n", " Dof: %ld\n",
spm->dof ); (long)spm->dof );
} }
else { else {
fprintf(stream, fprintf(stream,
...@@ -861,7 +861,7 @@ spmPrintInfo( const pastix_spm_t* spm, FILE *stream ) ...@@ -861,7 +861,7 @@ spmPrintInfo( const pastix_spm_t* spm, FILE *stream )
fprintf(stream, fprintf(stream,
" N expanded: %ld\n" " N expanded: %ld\n"
" NNZ expanded: %ld\n", " NNZ expanded: %ld\n",
spm->gNexp, spm->gnnzexp ); (long)spm->gNexp, (long)spm->gnnzexp );
} }
} }
...@@ -1076,12 +1076,12 @@ spmMatVec(const pastix_trans_t trans, ...@@ -1076,12 +1076,12 @@ spmMatVec(const pastix_trans_t trans,
* *
*******************************************************************************/ *******************************************************************************/
int int
spmGenRHS( int type, int nrhs, spmGenRHS( pastix_rhstype_t type, int nrhs,
const pastix_spm_t *spm, const pastix_spm_t *spm,
void *x, int ldx, void *x, int ldx,
void *b, int ldb ) void *b, int ldb )
{ {
static int (*ptrfunc[4])(int, int, static int (*ptrfunc[4])(pastix_rhstype_t, int,
const pastix_spm_t *, const pastix_spm_t *,
void *, int, void *, int) = void *, int, void *, int) =
{ {
......
...@@ -53,6 +53,16 @@ typedef enum pastix_driver_e { ...@@ -53,6 +53,16 @@ typedef enum pastix_driver_e {
/* PastixDriverBRGMD, /\**< Not supported yet *\/ */ /* PastixDriverBRGMD, /\**< Not supported yet *\/ */
} pastix_driver_t; } pastix_driver_t;
/**
* @brief How to generate RHS
*/
typedef enum pastix_rhstype_e {
PastixRhsOne,
PastixRhsI,
PastixRhsRndX,
PastixRhsRndB
} pastix_rhstype_t;
/** /**
* *
* @brief The sparse matrix data structure * @brief The sparse matrix data structure
...@@ -87,7 +97,7 @@ typedef struct pastix_spm_s { ...@@ -87,7 +97,7 @@ typedef struct pastix_spm_s {
otherwise, irregular degree of freedom (refer to dofs) */ otherwise, irregular degree of freedom (refer to dofs) */
pastix_int_t *dofs; /**< Array of the first column of each element in the pastix_int_t *dofs; /**< Array of the first column of each element in the
expanded matrix [+baseval] */ expanded matrix [+baseval] */
pastix_order_t layout; /**< PastixColMajor, or PastixRowMajor */ pastix_layout_t layout; /**< PastixColMajor, or PastixRowMajor */
pastix_int_t *colptr; /**< List of indirections to rows for each vertex [+baseval] */ pastix_int_t *colptr; /**< List of indirections to rows for each vertex [+baseval] */
pastix_int_t *rowptr; /**< List of edges for each vertex [+baseval] */ pastix_int_t *rowptr; /**< List of edges for each vertex [+baseval] */
...@@ -131,7 +141,7 @@ pastix_spm_t *spmCheckAndCorrect( pastix_spm_t *spm ); ...@@ -131,7 +141,7 @@ pastix_spm_t *spmCheckAndCorrect( pastix_spm_t *spm );
* @name SPM subroutines to check factorization/solve * @name SPM subroutines to check factorization/solve
* @{ * @{
*/ */
int spmGenRHS( int type, int nrhs, const pastix_spm_t *spm, void *x, int ldx, void *b, int ldb ); int spmGenRHS( pastix_rhstype_t type, int nrhs, const pastix_spm_t *spm, void *x, int ldx, void *b, int ldb );
int spmCheckAxb( int nrhs, const pastix_spm_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx ); int spmCheckAxb( int nrhs, const pastix_spm_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx );
/** /**
......
...@@ -152,13 +152,9 @@ spmReadDriver( pastix_driver_t driver, ...@@ -152,13 +152,9 @@ spmReadDriver( pastix_driver_t driver,
if ( mpiinit ) if ( mpiinit )
{ {
pastix_int_t nnz; pastix_int_t nnz = spm->nnz;
if (mpirank == 0) { MPI_Bcast( spm, sizeof(pastix_spm_t), MPI_CHAR, 0, comm );
nnz = spm->nnz;
}
MPI_Bcast( spm, 2*sizeof(int)+3*sizeof(pastix_int_t), MPI_CHAR, 0, comm );
MPI_Bcast( &nnz, 1, PASTIX_MPI_INT, 0, comm ); MPI_Bcast( &nnz, 1, PASTIX_MPI_INT, 0, comm );
fprintf(stderr, "%d: mtxtype=%d, flttype=%d, nnz=%ld, gN=%ld\n", fprintf(stderr, "%d: mtxtype=%d, flttype=%d, nnz=%ld, gN=%ld\n",
......
...@@ -57,7 +57,7 @@ void z_spmSort( pastix_spm_t *spm ); ...@@ -57,7 +57,7 @@ void z_spmSort( pastix_spm_t *spm );
pastix_int_t z_spmMergeDuplicate( pastix_spm_t *spm ); pastix_int_t z_spmMergeDuplicate( pastix_spm_t *spm );
pastix_int_t z_spmSymmetrize( pastix_spm_t *spm ); pastix_int_t z_spmSymmetrize( pastix_spm_t *spm );
int z_spmGenRHS(int type, int nrhs, const pastix_spm_t *spm, void *x, int ldx, void *b, int ldb ); int z_spmGenRHS(pastix_rhstype_t type, int nrhs, const pastix_spm_t *spm, void *x, int ldx, void *b, int ldb );
int z_spmCheckAxb( int nrhs, const pastix_spm_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx ); int z_spmCheckAxb( int nrhs, const pastix_spm_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx );
/** /**
......
...@@ -414,7 +414,7 @@ z_spmIJVExpand(const pastix_spm_t *spm) ...@@ -414,7 +414,7 @@ z_spmIJVExpand(const pastix_spm_t *spm)
pastix_spm_t *newspm; pastix_spm_t *newspm;
pastix_int_t i, j, k, ii, jj, dofi, dofj, col, row, baseval; pastix_int_t i, j, k, ii, jj, dofi, dofj, col, row, baseval;
pastix_int_t *newcol, *newrow, *oldcol, *oldrow, *dofs; pastix_int_t *newcol, *newrow, *oldcol, *oldrow, *dofs;
pastix_complex64_t *newval, *oldval; pastix_complex64_t *newval, *oldval=NULL;
assert( spm->fmttype == PastixIJV ); assert( spm->fmttype == PastixIJV );
assert( spm->flttype == PastixComplex64 ); assert( spm->flttype == PastixComplex64 );
......
...@@ -193,7 +193,7 @@ z_spmRndVect( double scale, int m, int n, pastix_complex64_t *A, int lda, ...@@ -193,7 +193,7 @@ z_spmRndVect( double scale, int m, int n, pastix_complex64_t *A, int lda,
* *
*******************************************************************************/ *******************************************************************************/
int int
z_spmGenRHS( int type, int nrhs, z_spmGenRHS( pastix_rhstype_t type, int nrhs,
const pastix_spm_t *spm, const pastix_spm_t *spm,
void *x, int ldx, void *x, int ldx,
void *b, int ldb ) void *b, int ldb )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment