PaStiX Handbook  6.3.2
pastixdata.h
Go to the documentation of this file.
1 /**
2  *
3  * @file pastixdata.h
4  *
5  * @copyright 2004-2023 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
6  * Univ. Bordeaux. All rights reserved.
7  *
8  * @version 6.3.2
9  * @author Mathieu Faverge
10  * @author Pierre Ramet
11  * @author Xavier Lacoste
12  * @author Tony Delarue
13  * @date 2023-07-21
14  *
15  **/
16 #ifndef _pastixdata_h_
17 #define _pastixdata_h_
18 
19 #include "common/isched.h"
20 #include "symbol/symbol.h"
21 #include "kernels/queue.h"
22 
23 /*
24  * Steps of the pastix solver
25  */
26 #ifndef DOXYGEN_SHOULD_SKIP_THIS
27 #define STEP_INIT (1 << 0)
28 #define STEP_ORDERING (1 << 1)
29 #define STEP_SYMBFACT (1 << 2)
30 #define STEP_ANALYSE (1 << 3)
31 #define STEP_CSC2BCSC (1 << 4)
32 #define STEP_BCSC2CTAB (1 << 5)
33 #define STEP_NUMFACT (1 << 6)
34 #define STEP_SOLVE (1 << 7)
35 #define STEP_REFINE (1 << 8)
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37 
38 /*
39  * Scheduler family
40  */
41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
42 #define PASTIX_SCHED_FAMILY_RUNTIME ((1 << PastixSchedParsec) | (1 << PastixSchedStarPU))
43 #define PASTIX_SCHED_FAMILY_PTHREAD ((1 << PastixSchedSequential) | (1 << PastixSchedStatic) | (1 << PastixSchedDynamic))
44 
45 #define isSchedRuntime( _runtime_ ) ( (1 << (_runtime_)) & PASTIX_SCHED_FAMILY_RUNTIME )
46 #define isSchedPthread( _runtime_ ) ( (1 << (_runtime_)) & PASTIX_SCHED_FAMILY_PTHREAD )
47 #define isSchedValid( _runtime_, _family_ ) ( (1 << (_runtime_)) & (_family_) )
48 
49 struct pastix_bcsc_s;
50 typedef struct pastix_bcsc_s pastix_bcsc_t;
51 
52 struct pastix_model_s;
53 typedef struct pastix_model_s pastix_model_t;
54 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
55 
56 /**
57  *
58  * @ingroup pastix_users
59  *
60  * @brief Main PaStiX data structure
61  *
62  * This structure holds all informations related to the library and problem
63  * instance. It stores information from one step to another.
64  * @warning This structure should not be modified directly by the user.
65  *
66  */
67 struct pastix_data_s {
68  pastix_int_t id; /**< Unique identifier of the pastix instance */
69  pastix_int_t *iparm; /**< Store integer parameters (input/output) */
70  double *dparm; /**< Store floating parameters (input/output) */
71 
72  pastix_int_t steps; /**< Bitmask of the steps performed or not */
73  pastix_scheduler_t sched; /**< Indicates the scheduler used for the factorization step */
74 
75  PASTIX_Comm pastix_comm; /**< PaStiX MPI communicator used for the ordering step */
76  PASTIX_Comm intra_node_comm; /**< PaStiX intra node MPI communicator used for synchronizations */
77  PASTIX_Comm inter_node_comm; /**< PaStiX inter node MPI communicator used for the factorization */
78  int procnbr; /**< Total number of MPI processes */
79  int procnum; /**< Local MPI rank */
80  int intra_node_procnbr; /**< Number of MPI tasks in intra node communicator */
81  int intra_node_procnum; /**< Local MPI rank in intra node communicator */
82  int inter_node_procnbr; /**< Number of MPI tasks in inter node communicator */
83  int inter_node_procnum; /**< Local MPI rank in inter node communicator */
84 
85  isched_t *isched; /**< Internal scheduler structure that is always available */
86  void *parsec; /**< PaRSEC context if available */
87  void *starpu; /**< StarPU context if available */
88 
89  const spmatrix_t *csc; /**< Pointer to the user csc structure used as input */
90 
91  pastix_graph_t *graph; /**< Symmetrized graph of the problem used within ordering
92  and symbolic factorization steps. */
93  pastix_int_t schur_n; /**< Number of entries for the Schur complement */
94  pastix_int_t *schur_list; /**< List of entries for the schur complement */
95  pastix_int_t zeros_n; /**< Number of diagonal entries considered as zeros */
96  pastix_int_t *zeros_list; /**< List of diagonal entries considered as zeros */
97  pastix_order_t *ordemesh; /**< Ordering structure */
98 
99  symbol_matrix_t *symbmtx; /**< Symbol Matrix */
100 
101  pastix_bcsc_t *bcsc; /**< Csc after reordering grouped by cblk */
102  SolverMatrix *solvmatr; /**< Solver informations associated to the matrix problem */
103  SolverMatrix *solvloc; /**< Solver informations associated to the matrix problem - Local */
104  SolverMatrix *solvglob; /**< Solver informations associated to the matrix problem - Global */
105 
106  pastix_model_t *cpu_models; /**< CPU model coefficients for the kernels */
107  pastix_model_t *gpu_models; /**< GPU model coefficients for the kernels */
108 
109  char *dir_global; /**< Unique directory name to store output files */
110  char *dir_local; /**< Unique directory name to store output specific to a MPI process */
111 
112  /* Backup for old pastix interface */
113  void *b;
114  void *x0;
115 
116  /**
117  * Former fields that are no longer used for now
118  */
119  int *bindtab; /*+ Tabular giving for each thread a CPU to bind it too */
120  void *schur_tab;
121  pastix_int_t schur_tab_set;
122  int cscInternFilled;
123  int scaling; /*+ Indicates if the matrix has been scaled */
124  void *scalerowtab; /*+ Describes how the matrix has been scaled */
125  void *iscalerowtab;
126  void *scalecoltab;
127  void *iscalecoltab;
128 #ifdef WITH_SEM_BARRIER
129  sem_t *sem_barrier; /*+ Semaphore used for AUTOSPLIT_COMM barrier */
130 #endif
131  pastix_int_t pastix_id; /*+ Id of the pastix instance (PID of first MPI task) */
132 };
133 
134 #ifndef DOXYGEN_SHOULD_SKIP_THIS
135 struct bvec_handle_comm_s;
137 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
138 
139 /**
140  *
141  * @ingroup pastix_users
142  *
143  * @brief Main PaStiX RHS structure
144  *
145  * This structure holds all informations about a set of permuted
146  * right-hand-sides to be used in the solve/refinement steps.
147  * @warning This structure should not be modified directly by the user.
148  *
149  */
150 struct pastix_rhs_s {
151  int8_t allocated; /**< Flag to know if the vector b is allocated internally or not. */
152  pastix_coeftype_t flttype; /**< Floating type of the vector. */
153  pastix_int_t m; /**< Local number of rows in the right hand sides. */
154  pastix_int_t n; /**< Number of columns in the right hand sides. */
155  pastix_int_t ld; /**< Leading dimension of the right hand side matrix. */
156  void *b; /**< Right hand sides of size ldb-by-n. */
157  void **cblkb; /**< Array to store the temporary buffers associated to fanin/recv. */
158  bvec_handle_comm_t *rhs_comm; /**< Structure which handles the MPI communication (= NULL if PASTIX_WITH_MPI=OFF). */
159  pastix_int_t *Ploc2Pglob; /**< Array containing the local permuted index corresponding to the global permuted index. */
160 };
161 
162 #endif /* _pastixdata_h_ */
BEGIN_C_DECLS typedef int pastix_int_t
Definition: datatypes.h:51
Structure to manage communications with distributed rhs.
Definition: bvec.h:66
Internal column block distributed CSC matrix.
Definition: bcsc.h:119
spm_coeftype_t pastix_coeftype_t
Arithmetic types.
Definition: api.h:294
enum pastix_scheduler_e pastix_scheduler_t
Scheduler.
Order structure.
Definition: order.h:47
Symbol matrix structure.
Definition: symbol.h:77
PASTIX_Comm pastix_comm
Definition: pastixdata.h:75
int inter_node_procnum
Definition: pastixdata.h:83
pastix_model_t * cpu_models
Definition: pastixdata.h:106
pastix_model_t * gpu_models
Definition: pastixdata.h:107
void ** cblkb
Definition: pastixdata.h:157
SolverMatrix * solvmatr
Definition: pastixdata.h:102
int inter_node_procnbr
Definition: pastixdata.h:82
pastix_scheduler_t sched
Definition: pastixdata.h:73
void * starpu
Definition: pastixdata.h:87
SolverMatrix * solvglob
Definition: pastixdata.h:104
void * parsec
Definition: pastixdata.h:86
SolverMatrix * solvloc
Definition: pastixdata.h:103
pastix_int_t zeros_n
Definition: pastixdata.h:95
int intra_node_procnbr
Definition: pastixdata.h:80
pastix_int_t * Ploc2Pglob
Definition: pastixdata.h:159
pastix_order_t * ordemesh
Definition: pastixdata.h:97
pastix_int_t * iparm
Definition: pastixdata.h:69
pastix_int_t ld
Definition: pastixdata.h:155
char * dir_local
Definition: pastixdata.h:110
pastix_int_t id
Definition: pastixdata.h:68
double * dparm
Definition: pastixdata.h:70
bvec_handle_comm_t * rhs_comm
Definition: pastixdata.h:158
const spmatrix_t * csc
Definition: pastixdata.h:89
pastix_coeftype_t flttype
Definition: pastixdata.h:152
pastix_int_t schur_n
Definition: pastixdata.h:93
pastix_graph_t * graph
Definition: pastixdata.h:91
pastix_int_t * schur_list
Definition: pastixdata.h:94
isched_t * isched
Definition: pastixdata.h:85
symbol_matrix_t * symbmtx
Definition: pastixdata.h:99
pastix_int_t * zeros_list
Definition: pastixdata.h:96
PASTIX_Comm intra_node_comm
Definition: pastixdata.h:76
PASTIX_Comm inter_node_comm
Definition: pastixdata.h:77
pastix_int_t m
Definition: pastixdata.h:153
pastix_bcsc_t * bcsc
Definition: pastixdata.h:101
int intra_node_procnum
Definition: pastixdata.h:81
char * dir_global
Definition: pastixdata.h:109
pastix_int_t steps
Definition: pastixdata.h:72
pastix_int_t n
Definition: pastixdata.h:154
int8_t allocated
Definition: pastixdata.h:151
Main PaStiX data structure.
Definition: pastixdata.h:67
Main PaStiX RHS structure.
Definition: pastixdata.h:150
Solver column block structure.
Definition: solver.h:200