PaStiX Handbook  6.2.1
pastix.h
Go to the documentation of this file.
1 /**
2  *
3  * @file pastix.h
4  *
5  * PaStiX main header file.
6  *
7  * @copyright 2004-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8  * Univ. Bordeaux. All rights reserved.
9  *
10  * @version 6.2.0
11  * @author David Goudin
12  * @author Francois Pellegrini
13  * @author Gregoire Pichon
14  * @author Mathieu Faverge
15  * @author Pascal Henon
16  * @author Pierre Ramet
17  * @author Xavier Lacoste
18  * @author Theophile Terraz
19  * @author Tony Delarue
20  * @date 2021-03-05
21  *
22  **/
23 #ifndef _pastix_h_
24 #define _pastix_h_
25 
26 #include "pastix/config.h"
27 #include <spm.h>
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <string.h>
31 #include <stdarg.h>
32 #include <assert.h>
33 #include <math.h>
34 
35 #if defined(PASTIX_WITH_MPI)
36 #include <mpi.h>
37 typedef MPI_Comm PASTIX_Comm;
38 #else
39 typedef uintptr_t PASTIX_Comm;
40 #ifndef MPI_COMM_WORLD
41 #define MPI_COMM_WORLD 0
42 #endif
43 #endif
44 
45 #include "pastix/api.h"
46 #include "pastix/datatypes.h"
47 #include "pastix/order.h"
48 
49 BEGIN_C_DECLS
50 
51 /*
52  * Main function for compatibility with former versions
53  */
54 int pastix( pastix_data_t **pastix_data,
55  PASTIX_Comm pastix_comm,
56  pastix_int_t n,
57  pastix_int_t *colptr,
58  pastix_int_t *rowptr,
59  void *values,
60  pastix_int_t *perm,
61  pastix_int_t *invp,
62  void *B,
63  pastix_int_t nrhs,
64  pastix_int_t *iparm,
65  double *dparm );
66 
67 /*
68  * Solver initialization
69  */
70 void pastixInitParam( pastix_int_t *iparm,
71  double *dparm );
72 void pastixInit ( pastix_data_t **pastix_data,
73  PASTIX_Comm pastix_comm,
74  pastix_int_t *iparm,
75  double *dparm );
76 void pastixInitWithAffinity( pastix_data_t **pastix_data,
77  PASTIX_Comm pastix_comm,
78  pastix_int_t *iparm,
79  double *dparm,
80  const int *bindtab );
81 void pastixFinalize ( pastix_data_t **pastix_data );
82 
83 /*
84  * Main steps of the solver
85  */
86 int pastix_task_analyze( pastix_data_t *pastix_data,
87  const spmatrix_t *spm );
88 int pastix_task_numfact( pastix_data_t *pastix_data,
89  spmatrix_t *spm );
90 int pastix_task_solve ( pastix_data_t *pastix_data,
91  pastix_int_t nrhs,
92  void *B,
93  pastix_int_t ldb );
94 int pastix_task_refine( pastix_data_t *pastix_data,
95  pastix_int_t n, pastix_int_t nrhs,
96  void *B, pastix_int_t ldb,
97  void *X, pastix_int_t ldx );
98 
99 /*
100  * Analyze subtasks
101  */
102 int pastix_subtask_order ( pastix_data_t *pastix_data,
103  const spmatrix_t *spm,
104  pastix_order_t *myorder );
105 int pastix_subtask_symbfact ( pastix_data_t *pastix_data );
106 int pastix_subtask_reordering( pastix_data_t *pastix_data );
107 int pastix_subtask_blend ( pastix_data_t *pastix_data );
108 
109 /*
110  * Numerical factorization subtasks
111  */
112 int pastix_subtask_spm2bcsc ( pastix_data_t *pastix_data,
113  spmatrix_t *spm );
114 int pastix_subtask_bcsc2ctab ( pastix_data_t *pastix_data );
115 int pastix_subtask_sopalin ( pastix_data_t *pastix_data );
116 
117 /*
118  * Numerical solve and refinement subtasks
119  */
120 int pastix_subtask_applyorder( pastix_data_t *pastix_data,
121  pastix_coeftype_t flttype,
122  pastix_dir_t dir,
123  pastix_int_t m,
124  pastix_int_t n,
125  void *B,
126  pastix_int_t ldb );
127 int pastix_subtask_trsm( pastix_data_t *pastix_data,
128  pastix_coeftype_t flttype,
129  pastix_side_t side,
130  pastix_uplo_t uplo,
131  pastix_trans_t trans,
132  pastix_diag_t diag,
133  pastix_int_t nrhs,
134  void *B,
135  pastix_int_t ldb );
136 int pastix_subtask_diag( pastix_data_t *pastix_data,
137  pastix_coeftype_t flttype,
138  pastix_int_t nrhs,
139  void *B,
140  pastix_int_t ldb );
141 int pastix_subtask_solve( pastix_data_t *pastix_data,
142  pastix_int_t nrhs,
143  void *B,
144  pastix_int_t ldb );
145 int pastix_subtask_refine( pastix_data_t *pastix_data,
146  pastix_int_t n, pastix_int_t nrhs,
147  const void *B, pastix_int_t ldb,
148  void *X, pastix_int_t ldx );
149 int pastix_subtask_solve_adv( pastix_data_t *pastix_data,
150  pastix_trans_t transA,
151  pastix_int_t nrhs,
152  void *B,
153  pastix_int_t ldb );
154 /*
155  * Schur complement manipulation routines.
156  */
157 void pastixSetSchurUnknownList( pastix_data_t *pastix_data,
158  pastix_int_t n,
159  const pastix_int_t *list );
160 int pastixGetSchur ( const pastix_data_t *pastix_data,
161  void *S,
162  pastix_int_t lds );
163 
164 void pastixExpand ( const pastix_data_t *pastix_data,
165  spmatrix_t *spm );
166 
167 /*
168  * Function to provide access to the diagonal
169  */
170 int pastixGetDiag( const pastix_data_t *pastix_data,
171  void *x,
172  pastix_int_t incx );
173 
174 /*
175  * Function to provide a common way to read binary options in examples/testings
176  */
177 void pastixGetOptions( int argc, char **argv,
178  pastix_int_t *iparm, double *dparm,
179  int *check, spm_driver_t *driver, char **filename );
180 
181 /*
182  * Function to provide a common way to output
183  * the iparm/dparm parameters in a CSV file.
184  */
185 void pastixDumpParam ( const pastix_data_t *pastix_data );
186 int pastixCheckParam( const pastix_int_t *iparm,
187  const double *dparm );
188 
189 END_C_DECLS
190 
191 #endif /* _pastix_h_ */
pastix_uplo_t
enum pastix_uplo_e pastix_uplo_t
Upper/Lower part.
pastix_subtask_applyorder
int pastix_subtask_applyorder(pastix_data_t *pastix_data, pastix_coeftype_t flttype, pastix_dir_t dir, pastix_int_t m, pastix_int_t n, void *B, pastix_int_t ldb)
Apply a permutation on the right-and-side vector before the solve step.
Definition: pastix_task_solve.c:122
pastix_subtask_reordering
int pastix_subtask_reordering(pastix_data_t *pastix_data)
Apply the reordering step to compact off-diagonal blocks.
Definition: pastix_subtask_reordering.c:60
pastixSetSchurUnknownList
void pastixSetSchurUnknownList(pastix_data_t *pastix_data, pastix_int_t n, const pastix_int_t *list)
Set the list of unknowns that belongs to the schur complement.
Definition: schur.c:49
pastix_order_s
Order structure.
Definition: order.h:45
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_trans_t
enum pastix_trans_e pastix_trans_t
Transpostion.
pastix_subtask_diag
int pastix_subtask_diag(pastix_data_t *pastix_data, pastix_coeftype_t flttype, pastix_int_t nrhs, void *B, pastix_int_t ldb)
Apply a diagonal operation on the right-and-side vectors.
Definition: pastix_task_solve.c:369
pastix_task_solve
int pastix_task_solve(pastix_data_t *pastix_data, pastix_int_t nrhs, void *B, pastix_int_t ldb)
Solve the given problem.
Definition: pastix_task_solve.c:681
pastix_subtask_spm2bcsc
int pastix_subtask_spm2bcsc(pastix_data_t *pastix_data, spmatrix_t *spm)
Fill the internal block CSC structure.
Definition: pastix_task_sopalin.c:85
pastixCheckParam
int pastixCheckParam(const pastix_int_t *iparm, const double *dparm)
Check the values of iparm and dparm arrays.
Definition: api.c:1035
pastix_subtask_symbfact
int pastix_subtask_symbfact(pastix_data_t *pastix_data)
Computes the symbolic factorization step.
Definition: pastix_subtask_symbfact.c:90
pastix_subtask_blend
int pastix_subtask_blend(pastix_data_t *pastix_data)
Compute the proportional mapping and the final solver structure.
Definition: pastix_subtask_blend.c:121
pastixExpand
void pastixExpand(const pastix_data_t *pastix_data, spmatrix_t *spm)
Expand an spm structure and the already computed data structure associated if any.
Definition: pastix.c:506
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:859
pastixInitWithAffinity
void pastixInitWithAffinity(pastix_data_t **pastix_data, PASTIX_Comm pastix_comm, pastix_int_t *iparm, double *dparm, const int *bindtab)
Initialize the solver instance with a bintab array to specify the thread binding.
Definition: api.c:682
pastix_dir_t
enum pastix_dir_e pastix_dir_t
Direction.
pastixDumpParam
void pastixDumpParam(const pastix_data_t *pastix_data)
Dump the iparm and dparm parameters in a CSV file.
Definition: api.c:987
pastix_diag_t
enum pastix_diag_e pastix_diag_t
Diagonal.
pastix
BEGIN_C_DECLS int pastix(pastix_data_t **pastix_data, PASTIX_Comm pastix_comm, pastix_int_t n, pastix_int_t *colptr, pastix_int_t *rowptr, void *values, 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.
Definition: pastix.c:103
order.h
pastix_subtask_bcsc2ctab
int pastix_subtask_bcsc2ctab(pastix_data_t *pastix_data)
Fill the internal solver matrix structure.
Definition: pastix_task_sopalin.c:226
pastixInitParam
void pastixInitParam(pastix_int_t *iparm, double *dparm)
Initialize the iparm and dparm arrays to their default values.
Definition: api.c:401
pastixGetSchur
int pastixGetSchur(const pastix_data_t *pastix_data, void *S, pastix_int_t lds)
Return the Schur complement.
Definition: schur.c:89
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:882
pastix_subtask_order
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.
Definition: pastix_subtask_order.c:97
pastix_coeftype_t
#define pastix_coeftype_t
Arithmetic types.
Definition: api.h:283
pastix_subtask_trsm
int pastix_subtask_trsm(pastix_data_t *pastix_data, pastix_coeftype_t flttype, pastix_side_t side, pastix_uplo_t uplo, pastix_trans_t trans, pastix_diag_t diag, pastix_int_t nrhs, void *B, pastix_int_t ldb)
Apply a triangular solve on the right-and-side vectors.
Definition: pastix_task_solve.c:236
pastix_task_refine
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.
Definition: pastix_task_refine.c:226
pastix_subtask_solve_adv
int pastix_subtask_solve_adv(pastix_data_t *pastix_data, pastix_trans_t transA, pastix_int_t nrhs, void *B, pastix_int_t ldb)
Solve the given problem without applying the permutation.
Definition: pastix_task_solve.c:470
pastix_side_t
enum pastix_side_e pastix_side_t
Side of the operation.
pastix_task_numfact
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...
Definition: pastix_task_sopalin.c:623
pastix_subtask_solve
int pastix_subtask_solve(pastix_data_t *pastix_data, pastix_int_t nrhs, void *B, pastix_int_t ldb)
Solve the given problem without applying the permutation.
Definition: pastix_task_solve.c:641
pastix_subtask_sopalin
int pastix_subtask_sopalin(pastix_data_t *pastix_data)
Factorize the given problem using Cholesky or LU decomposition.
Definition: pastix_task_sopalin.c:406
api.h
pastix_subtask_refine
int pastix_subtask_refine(pastix_data_t *pastix_data, pastix_int_t n, pastix_int_t nrhs, const void *B, pastix_int_t ldb, void *X, pastix_int_t ldx)
Perform the iterative refinement without apply the permutations.
Definition: pastix_task_refine.c:115