pastix.h | |
PaStiX interface | Parallel Sparse matriX solver interface |
Main PaStiX functions | |
pastix | Computes steps of the resolution of Ax=b linear system, using direct methods. |
Example | from file simple.c : |
dpastix | Computes steps of the resolution of Ax=b linear system, using direct methods. |
Example | from file simple_dist.c : |
Thread functions | |
pastix_bindThreads | Set bindtab in pastix_data, it gives for each thread the CPU to bind in to. |
Checking the matrix. | |
pastix_checkMatrix | Check the matrix : |
Getting solver distribution. | |
pastix_getLocalNodeNbr | Return the node number in the new distribution computed by analyze step. |
pastix_getLocalNodeLst | Fill in nodelst with the list of local nodes/columns. |
pastix_getLocalUnknownNbr | Return the unknown number in the new distribution computed by analyze step. |
pastix_getLocalUnknownLst | Fill in unknownlst with the list of local unknowns/clumns. |
About the Schur complement. | |
pastix_setSchurUnknownList | Set the list of unknowns to isolate at the end of the matrix via permutations. |
pastix_getSchurLocalNodeNbr | Compute the number of nodes in the local part of the Schur. |
pastix_getSchurLocalUnkownNbr | Compute the number of unknowns in the local part of the Schur. |
pastix_getSchurLocalNodeList | Compute the list of nodes in the local part of the Schur. |
pastix_getSchurLocalUnkownList | Compute the list of unknowns in the local part of the Schur. |
pastix_setSchurArray | Give user memory area to store Schur in PaStiX. |
pastix_getSchur | Get the Schur complement from PaStiX. |
About parameters. | |
pastix_initParam | Sets default parameters for iparm and dparm |
About Scaling. | Working on it... |
ComplexFloat_
Parallel Sparse matriX solver interface
Astrid CASADEI | astrid.@inri a.fr casadei |
Mathieu FAVERGE | fav@labr i.fr erge |
Xavier LACOSTE | xavier.@inri a.fr lacoste |
Pierre RAMET | ra@labr i.fr met |
Blabla
void pastix( pastix_data_t ** pastix_data, MPI_Comm pastix_comm, INT n, INT * colptr, INT * row, FLOAT * avals, INT * perm, INT * invp, FLOAT * b, INT rhs, INT * iparm, double * dparm )
Computes steps of the resolution of Ax=b linear system, using direct methods.
The matrix is given in CSC format.
pastix_data | Data used for a step by step execution. |
pastix_comm | MPI communicator which compute the resolution. |
n | Size of the system. |
colptr | Tabular containing the start of each column in row and avals tabulars. |
row | Tabular containing the row number for each element sorted by column. |
avals | Tabular containing the values of each element sorted by column. |
perm | Permutation tabular for the renumerotation of the unknowns. |
invp | Reverse permutation tabular for the renumerotation of the unknowns. |
b | Right hand side vector(s). |
rhs | Number of right hand side vector(s). |
iparm | Integer parameters given to pastix. |
dparm | Double parameters given to pâstix. |
from file simple.c :
/\*******************************************\/ /\* Check Matrix format *\/ /\*******************************************\/ /\* * Matrix needs : * - to be in fortran numbering * - to have only the lower triangular part in symmetric case * - to have a graph with a symmetric structure in unsymmetric case *\/ pastix_checkMatrix( MPI_COMM_WORLD, verbosemode, (MTX_ISSYM(type) ? API_SYM_YES : API_SYM_NO), API_YES, ncol, &colptr, &rows, &values, NULL); /\*******************************************\/ /\* Initialize parameters to default values *\/ /\*******************************************\/ iparm[IPARM_MODIFY_PARAMETER] = API_NO; pastix(&pastix_data, MPI_COMM_WORLD, ncol, colptr, rows, values, perm, invp, rhs, 1, iparm, dparm); /\*******************************************\/ /\* Customize some parameters *\/ /\*******************************************\/ iparm[IPARM_THREAD_NBR] = nbthread; if (MTX_ISSYM(type)) { :wiparm[IPARM_SYM] = API_SYM_YES; iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; } else{ iparm[IPARM_SYM] = API_SYM_NO; iparm[IPARM_FACTORIZATION] = API_FACT_LU; } iparm[IPARM_START_TASK] = API_TASK_ORDERING; iparm[IPARM_END_TASK] = API_TASK_CLEAN; /\*******************************************\/ /\* Save the rhs *\/ /\* (it will be replaced by solution) *\/ /\*******************************************\/ rhssaved = malloc(ncol*sizeof(pastix_float_t)); memcpy(rhssaved, rhs, ncol*sizeof(pastix_float_t)); /\*******************************************\/ /\* Call pastix *\/ /\*******************************************\/ perm = malloc(ncol*sizeof(pastix_int_t)); invp = malloc(ncol*sizeof(pastix_int_t)); pastix(&pastix_data, MPI_COMM_WORLD, ncol, colptr, rows, values, perm, invp, rhs, 1, iparm, dparm);
Computes steps of the resolution of Ax=b linear system, using direct methods. Here the matrix is given distributed.
The matrix is given in CSCD format.
pastix_data | Data used for a step by step execution. |
pastix_comm | MPI communicator which compute the resolution. |
n | Size of the system. |
colptr | Tabular containing the start of each column in row and avals tabulars. |
row | Tabular containing the row number for each element sorted by column. |
avals | Tabular containing the values of each element sorted by column. |
loc2glob | Global column number of the local columns. |
perm | Permutation tabular for the renumerotation of the unknowns. |
invp | Reverse permutation tabular for the renumerotation of the unknowns. |
b | Right hand side vector(s). |
rhs | Number of right hand side vector(s). |
iparm | Integer parameters given to pastix. |
dparm | Double parameters given to pâstix. |
Example | from file simple_dist.c : |
Thread functions |
from file simple_dist.c :
/\*******************************************\/ /\* Check Matrix format *\/ /\*******************************************\/ /\* * Matrix needs : * - to be in fortran numbering * - to have only the lower triangular part in symmetric case * - to have a graph with a symmetric structure in unsymmetric case *\/ pastix_checkMatrix( MPI_COMM_WORLD, verbosemode, (MTX_ISSYM(type) ? API_SYM_YES : API_SYM_NO), API_YES, ncol, &colptr, &rows, &values, &loc2glob, 1); /\*******************************************\/ /\* Initialize parameters to default values *\/ /\*******************************************\/ iparm[IPARM_MODIFY_PARAMETER] = API_NO; dpastix(&pastix_data, MPI_COMM_WORLD, ncol, colptr, rows, values, loc2glob, perm, invp, rhs, 1, iparm, dparm); /\*******************************************\/ /\* Customize some parameters *\/ /\*******************************************\/ iparm[IPARM_THREAD_NBR] = nbthread; if (MTX_ISSYM(type)) { iparm[IPARM_SYM] = API_SYM_YES; iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; } else { iparm[IPARM_SYM] = API_SYM_NO; iparm[IPARM_FACTORIZATION] = API_FACT_LU; } iparm[IPARM_MATRIX_VERIFICATION] = API_NO; iparm[IPARM_START_TASK] = API_TASK_ORDERING; iparm[IPARM_END_TASK] = API_TASK_BLEND; /\*******************************************\/ /\* Call pastix *\/ /\*******************************************\/ perm = malloc(ncol*sizeof(pastix_int_t)); /\* No need to allocate invp in dpastix *\/ dpastix(&pastix_data, MPI_COMM_WORLD, ncol, colptr, rows, NULL, loc2glob, perm, NULL, NULL, 1, iparm, dparm); /\* Redistributing the matrix *\/ ncol2 = pastix_getLocalNodeNbr(&pastix_data); if (NULL == (loc2glob2 = malloc(ncol2 * sizeof(pastix_int_t)))) { fprintf(stderr, "Malloc error\n"); return EXIT_FAILURE; } pastix_getLocalNodeLst(&pastix_data, loc2glob2); if (EXIT_SUCCESS != cscd_redispatch(ncol, colptr, rows, values, rhs, loc2glob, ncol2, &colptr2, &rows2, &values2, &rhs2, loc2glob2, MPI_COMM_WORLD)) return EXIT_FAILURE; free(colptr); free(rows); free(values); free(rhs); free(loc2glob); free(perm); iparm[IPARM_START_TASK] = API_TASK_NUMFACT; iparm[IPARM_END_TASK] = API_TASK_CLEAN; dpastix(&pastix_data, MPI_COMM_WORLD, ncol2, colptr2, rows2, values2, loc2glob2, perm, invp, rhs2, 1, iparm, dparm);
Set bindtab in pastix_data, it gives for each thread the CPU to bind in to. bindtab follows this organisation :
bindtab[threadnum] = cpu to set thread threadnum.
pastix_data | Structure de donnée pour l’utilisation step by step |
thrdnbr | Nombre de threads / Taille du tableau |
bindtab | Tableau de correspondance entre chaque thread et coeur de la machine |
Check the matrix :
pastix_comm | PaStiX MPI communicator |
verb | Level of prints (API_VERBOSE_[NOT|NO|YES]) |
flagsym | Indicate if the given matrix is symetric (API_SYM_YES or API_SYM_NO) |
flagcor | Indicate if we permit the function to reallocate the matrix. |
n | Size of the matrix. |
colptr | First element of each row in row and avals. |
row | Row of each element of the matrix. |
avals | Value of each element of the matrix. |
loc2glob | Global column number of local columns. |
dof | Number of degrees of freedom. |
Fill in nodelst with the list of local nodes/columns. Needs nodelst to be allocated with nodenbr*sizeof(pastix_int_t), where nodenbr has been computed by pastix_getLocalNodeNbr.
pastix_data | Data used for a step by step execution. |
nodelst | An array where to write the list of local nodes/columns. |
Fill in unknownlst with the list of local unknowns/clumns. Needs unknownlst to be allocated with unknownnbr*sizeof(pastix_int_t), where unknownnbr has been computed by pastix_getLocalUnknownNbr.
pastix_data | Data used for a step by step execution. |
unknownlst | An array where to write the list of local unknowns/columns. |
Parallel Sparse matriX solver interface
ComplexFloat_
Computes steps of the resolution of Ax=b linear system, using direct methods.
void pastix( pastix_data_t ** pastix_data, MPI_Comm pastix_comm, INT n, INT * colptr, INT * row, FLOAT * avals, INT * perm, INT * invp, FLOAT * b, INT rhs, INT * iparm, double * dparm )