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;
177 if ( (pastix_data->
csc != NULL) &&
178 ((pastix_data->
csc->n != n) ||
179 (pastix_data->
csc->nnz != (colptr[n] - colptr[0])) ||
180 (pastix_data->
csc->colptr != colptr) ||
181 (pastix_data->
csc->rowptr != row)) )
187 memFree_null( pastix_data->
csc );
190 if ( pastix_data->
csc == NULL )
196 printf(
"Pastix old interface: you have to set iparm[IPARM_FLOAT]\n");
200 printf(
"Pastix old interface: you have to set iparm[IPARM_MTX_TYPE]\n");
205 "pastix: Variadic dofs are not supported in old pastix interface.\n"
206 " Please switch to the new interface to use this feature, \n"
207 " or set to a positive value\n");
211 spm = malloc(
sizeof( spmatrix_t ));
216 spm->fmttype = SpmCSC;
219 spm->nnz = colptr[n] - colptr[0];
222 spm->colptr = colptr;
226 spm->baseval = spmFindBase(spm);
227 spmUpdateComputedFields( spm );
229 pastix_data->
csc = spm;
233 spm = (spmatrix_t*)(pastix_data->
csc);
239 if ( spm->values == NULL ) {
245 spm = (spmatrix_t*)(pastix_data->
csc);
255 if ( (perm != NULL) || (invp != NULL) ) {
263 if ( perm != NULL ) {
268 if ( invp != NULL ) {
285 if ( perm != NULL ) {
290 if ( invp != NULL ) {
359 size = pastix_size_of( spm->flttype ) * spm->n;
360 if ( pastix_data->x0 ) {
361 free(pastix_data->x0);
362 pastix_data->x0 = NULL;
364 if ( pastix_data->b ) {
365 free(pastix_data->b);
366 pastix_data->b = NULL;
374 pastix_data->b = malloc(size);
375 memcpy(pastix_data->b, b, size);
385 pastix_data->x0 = malloc(size);
386 memcpy(pastix_data->x0, b, size);
398 void *refineB = pastix_data->b;
399 void *refineX0 = pastix_data->x0;
400 size = pastix_size_of( spm->flttype ) * spm->n;
418 fprintf(stderr,
"Neither b and x0 have been saved, this should never happen\n");
443 fprintf(stderr,
"Both b and x0 are defined, this should never happen\n");
448 refineB, spm->n, refineX0, spm->n );
454 if ( b != refineX0 ) {
455 memcpy(b, refineB, size);
459 if ( pastix_data->x0 != NULL ) {
460 free( pastix_data->x0 );
461 pastix_data->x0 = NULL;
463 if ( pastix_data->b != NULL ) {
464 free( pastix_data->b );
465 pastix_data->b = NULL;
476 if ( pastix_data->
csc != NULL ) {
477 spmatrix_t *spm = (spmatrix_t*)(pastix_data->
csc);
516 if ( spm->dof == 1 ) {
520 if ( ( pastix_data->
steps & STEP_ORDERING ) &&
528 if ( ( pastix_data->
steps & STEP_SYMBFACT ) &&
529 ( pastix_data->
symbmtx != NULL ) )
534 spmExpand( spm, &tmp );
536 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.