104 PASTIX_Comm pastix_comm,
117 spmatrix_t *spm = NULL;
141 if (*pastix_data_ptr != NULL)
148 pastix_print( (*pastix_data_ptr)->inter_node_procnum, 0,
"WARNING: PaStiX schedulers restarted\n" );
156 pastixInit( pastix_data_ptr, pastix_comm, iparm, dparm );
168 pastix_data = *pastix_data_ptr;
169 if ( pastix_data == NULL ) {
170 printf(
"Pastix old interface: pastixTaskInit step not called before calling following steps\n");
181 if ( (pastix_data->
csc != NULL) &&
182 ((pastix_data->
csc->n != n) ||
183 (pastix_data->
csc->nnz != (colptr[n] - colptr[0])) ||
184 (pastix_data->
csc->colptr != colptr) ||
185 (pastix_data->
csc->rowptr != row)) )
191 memFree_null( pastix_data->
csc );
194 if ( pastix_data->
csc == NULL )
200 printf(
"Pastix old interface: you have to set iparm[IPARM_FLOAT]\n");
204 printf(
"Pastix old interface: you have to set iparm[IPARM_MTX_TYPE]\n");
209 "pastix: Variadic dofs are not supported in old pastix interface.\n"
210 " Please switch to the new interface to use this feature, \n"
211 " or set to a positive value\n");
215 spm = malloc(
sizeof( spmatrix_t ));
220 spm->fmttype = SpmCSC;
223 spm->nnz = colptr[n] - colptr[0];
226 spm->colptr = colptr;
230 spm->baseval = spmFindBase(spm);
231 spmUpdateComputedFields( spm );
233 pastix_data->
csc = spm;
237 spm = (spmatrix_t*)(pastix_data->
csc);
243 if ( spm->values == NULL ) {
249 spm = (spmatrix_t*)(pastix_data->
csc);
259 if ( (perm != NULL) || (invp != NULL) ) {
267 if ( perm != NULL ) {
272 if ( invp != NULL ) {
289 if ( perm != NULL ) {
294 if ( invp != NULL ) {
363 size = pastix_size_of( spm->flttype ) * spm->n;
364 if ( pastix_data->x0 ) {
365 free(pastix_data->x0);
366 pastix_data->x0 = NULL;
368 if ( pastix_data->b ) {
369 free(pastix_data->b);
370 pastix_data->b = NULL;
378 pastix_data->b = malloc(size);
379 memcpy(pastix_data->b, b, size);
389 pastix_data->x0 = malloc(size);
390 memcpy(pastix_data->x0, b, size);
402 void *refineB = pastix_data->b;
403 void *refineX0 = pastix_data->x0;
404 size = pastix_size_of( spm->flttype ) * spm->n;
422 fprintf(stderr,
"Neither b and x0 have been saved, this should never happen\n");
447 fprintf(stderr,
"Both b and x0 are defined, this should never happen\n");
452 refineB, spm->n, refineX0, spm->n );
458 if ( b != refineX0 ) {
459 memcpy(b, refineB, size);
463 if ( pastix_data->x0 != NULL ) {
464 free( pastix_data->x0 );
465 pastix_data->x0 = NULL;
467 if ( pastix_data->b != NULL ) {
468 free( pastix_data->b );
469 pastix_data->b = NULL;
480 if ( pastix_data->
csc != NULL ) {
481 spmatrix_t *spm = (spmatrix_t*)(pastix_data->
csc);
520 if ( spm->dof == 1 ) {
524 if ( ( pastix_data->
steps & STEP_ORDERING ) &&
532 if ( ( pastix_data->
steps & STEP_SYMBFACT ) &&
533 ( pastix_data->
symbmtx != NULL ) )
538 spmExpand( spm, &tmp );
540 memcpy( spm, &tmp,
sizeof(spmatrix_t) );
BEGIN_C_DECLS typedef int pastix_int_t
int pastix_subtask_symbfact(pastix_data_t *pastix_data)
Computes the symbolic factorization step.
int pastix_subtask_order(pastix_data_t *pastix_data, const spmatrix_t *spm, pastix_order_t *myorder)
Computes the ordering of the given graph in parameters.
int pastix_subtask_blend(pastix_data_t *pastix_data)
Compute the proportional mapping and the final solver structure.
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.
int pastix(pastix_data_t **pastix_data_ptr, PASTIX_Comm pastix_comm, pastix_int_t n, pastix_int_t *colptr, pastix_int_t *row, void *avals, pastix_int_t *perm, pastix_int_t *invp, void *b, pastix_int_t nrhs, pastix_int_t *iparm, double *dparm)
Main function for compatibility with former releases.
@ PASTIX_ERR_BADPARAMETER
void pastixOrderExpand(pastix_order_t *ordeptr, const spmatrix_t *spm)
This routine expand the permutation arrays and the rangtab when the spm is using multiple dof per unk...
int pastixOrderAlloc(pastix_order_t *ordeptr, pastix_int_t vertnbr, pastix_int_t cblknbr)
Allocate the order structure.
int pastixOrderCheck(const pastix_order_t *ordeptr)
This routine checks the correctness of the ordering structure.
void pastixOrderExit(pastix_order_t *ordeptr)
Free the arrays initialized in the order structure.
void pastixSymbolExpand(symbol_matrix_t *symbptr)
Expand the symbol matrix structure based on the dof information (compressed -> expanded)
pastix_order_t * ordemesh
symbol_matrix_t * symbmtx
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_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.
void pastixExpand(const pastix_data_t *pastix_data, spmatrix_t *spm)
Expand an spm structure and the already computed data structure associated if any.