PaStiX Handbook  6.2.1
pastixdata.h
Go to the documentation of this file.
1 /**
2  *
3  * @file pastixdata.h
4  *
5  * @copyright 2004-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
6  * Univ. Bordeaux. All rights reserved.
7  *
8  * @version 6.2.1
9  * @author Mathieu Faverge
10  * @author Pierre Ramet
11  * @author Xavier Lacoste
12  * @author Tony Delarue
13  * @date 2021-07-02
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 #define STEP_INIT (1 << 0)
27 #define STEP_ORDERING (1 << 1)
28 #define STEP_SYMBFACT (1 << 2)
29 #define STEP_ANALYSE (1 << 3)
30 #define STEP_CSC2BCSC (1 << 4)
31 #define STEP_BCSC2CTAB (1 << 5)
32 #define STEP_NUMFACT (1 << 6)
33 #define STEP_SOLVE (1 << 7)
34 #define STEP_REFINE (1 << 8)
35 
36 /*
37  * Scheduler family
38  */
39 #define PASTIX_SCHED_FAMILY_RUNTIME ((1 << PastixSchedParsec) | (1 << PastixSchedStarPU))
40 #define PASTIX_SCHED_FAMILY_PTHREAD ((1 << PastixSchedSequential) | (1 << PastixSchedStatic) | (1 << PastixSchedDynamic))
41 
42 #define isSchedRuntime( _runtime_ ) ( (1 << (_runtime_)) & PASTIX_SCHED_FAMILY_RUNTIME )
43 #define isSchedPthread( _runtime_ ) ( (1 << (_runtime_)) & PASTIX_SCHED_FAMILY_PTHREAD )
44 #define isSchedValid( _runtime_, _family_ ) ( (1 << (_runtime_)) & (_family_) )
45 
46 struct pastix_bcsc_s;
47 typedef struct pastix_bcsc_s pastix_bcsc_t;
48 
49 struct pastix_model_s;
50 typedef struct pastix_model_s pastix_model_t;
51 
52 /**
53  *
54  * @ingroup pastix_users
55  *
56  * @brief Main PaStiX data structure
57  *
58  * This structure holds all informations related to the library and problem
59  * instance. It stores information from one step to another.
60  * @warning This structure should not be modified directly by the user.
61  *
62  */
63 struct pastix_data_s {
64  pastix_int_t id; /**< Unique identifier of the pastix instance */
65  pastix_int_t *iparm; /**< Store integer parameters (input/output) */
66  double *dparm; /**< Store floating parameters (input/output) */
67 
68  pastix_int_t steps; /**< Bitmask of the steps performed or not */
69  pastix_scheduler_t sched; /**< Indicates the scheduler used for the factorization step */
70 
71  PASTIX_Comm pastix_comm; /**< PaStiX MPI communicator used for the ordering step */
72  PASTIX_Comm intra_node_comm; /**< PaStiX intra node MPI communicator used for synchronizations */
73  PASTIX_Comm inter_node_comm; /**< PaStiX inter node MPI communicator used for the factorization */
74  int procnbr; /**< Total number of MPI processes */
75  int procnum; /**< Local MPI rank */
76  int intra_node_procnbr; /**< Number of MPI tasks in intra node communicator */
77  int intra_node_procnum; /**< Local MPI rank in intra node communicator */
78  int inter_node_procnbr; /**< Number of MPI tasks in inter node communicator */
79  int inter_node_procnum; /**< Local MPI rank in inter node communicator */
80 
81  isched_t *isched; /**< Internal scheduler structure that is always available */
82  void *parsec; /**< PaRSEC context if available */
83  void *starpu; /**< StarPU context if available */
84 
85  const spmatrix_t *csc; /**< Pointer to the user csc structure used as input */
86 
87  pastix_graph_t *graph; /**< Symmetrized graph of the problem used within ordering
88  and symbolic factorization steps. */
89  pastix_int_t schur_n; /**< Number of entries for the Schur complement */
90  pastix_int_t *schur_list; /**< List of entries for the schur complement */
91  pastix_int_t zeros_n; /**< Number of diagonal entries considered as zeros */
92  pastix_int_t *zeros_list; /**< List of diagonal entries considered as zeros */
93  pastix_order_t *ordemesh; /**< Ordering structure */
94 
95  symbol_matrix_t *symbmtx; /**< Symbol Matrix */
96 
97  pastix_bcsc_t *bcsc; /**< Csc after reordering grouped by cblk */
98  SolverMatrix *solvmatr; /**< Solver informations associated to the matrix problem */
99  SolverMatrix *solvloc; /**< Solver informations associated to the matrix problem - Local */
100  SolverMatrix *solvglob; /**< Solver informations associated to the matrix problem - Global */
101 
102  pastix_model_t *cpu_models; /**< CPU model coefficients for the kernels */
103  pastix_model_t *gpu_models; /**< GPU model coefficients for the kernels */
104 
105  char *dir_global; /**< Unique directory name to store output files */
106  char *dir_local; /**< Unique directory name to store output specific to a MPI process */
107 
108  /* Backup for old pastix interface */
109  void *b;
110  void *x0;
111 
112  /**
113  * Former fields that are no longer used for now
114  */
115  int *bindtab; /*+ Tabular giving for each thread a CPU to bind it too */
116  void *schur_tab;
117  pastix_int_t schur_tab_set;
118  int cscInternFilled;
119  int scaling; /*+ Indicates if the matrix has been scaled */
120  void *scalerowtab; /*+ Describes how the matrix has been scaled */
121  void *iscalerowtab;
122  void *scalecoltab;
123  void *iscalecoltab;
124 #ifdef WITH_SEM_BARRIER
125  sem_t *sem_barrier; /*+ Semaphore used for AUTOSPLIT_COMM barrier */
126 #endif
127  pastix_int_t pastix_id; /*+ Id of the pastix instance (PID of first MPI task) */
128 };
129 
130 #endif /* _pastixdata_h_ */
symbol_matrix_s
Symbol matrix structure.
Definition: symbol.h:75
pastix_data_s::iparm
pastix_int_t * iparm
Definition: pastixdata.h:65
pastix_bcsc_s
Internal column block distributed CSC matrix.
Definition: bcsc.h:37
pastix_data_s::zeros_n
pastix_int_t zeros_n
Definition: pastixdata.h:91
pastix_data_s::intra_node_procnum
int intra_node_procnum
Definition: pastixdata.h:77
pastix_order_s
Order structure.
Definition: order.h:45
pastix_scheduler_t
enum pastix_scheduler_e pastix_scheduler_t
Scheduler.
pastix_data_s::schur_list
pastix_int_t * schur_list
Definition: pastixdata.h:90
pastix_data_s::cpu_models
pastix_model_t * cpu_models
Definition: pastixdata.h:102
pastix_data_s::solvloc
SolverMatrix * solvloc
Definition: pastixdata.h:99
pastix_data_s::ordemesh
pastix_order_t * ordemesh
Definition: pastixdata.h:93
pastix_data_s::sched
pastix_scheduler_t sched
Definition: pastixdata.h:69
pastix_data_s::inter_node_procnbr
int inter_node_procnbr
Definition: pastixdata.h:78
pastix_data_s::dir_global
char * dir_global
Definition: pastixdata.h:105
pastix_data_s::intra_node_comm
PASTIX_Comm intra_node_comm
Definition: pastixdata.h:72
pastix_data_s::inter_node_comm
PASTIX_Comm inter_node_comm
Definition: pastixdata.h:73
pastix_data_s::graph
pastix_graph_t * graph
Definition: pastixdata.h:87
pastix_data_s::dir_local
char * dir_local
Definition: pastixdata.h:106
pastix_data_s::starpu
void * starpu
Definition: pastixdata.h:83
pastix_data_s::solvmatr
SolverMatrix * solvmatr
Definition: pastixdata.h:98
pastix_data_s::symbmtx
symbol_matrix_t * symbmtx
Definition: pastixdata.h:95
pastix_data_s::csc
const spmatrix_t * csc
Definition: pastixdata.h:85
pastix_data_s::solvglob
SolverMatrix * solvglob
Definition: pastixdata.h:100
pastix_data_s::isched
isched_t * isched
Definition: pastixdata.h:81
symbol.h
queue.h
pastix_data_s::pastix_comm
PASTIX_Comm pastix_comm
Definition: pastixdata.h:71
pastix_data_s::dparm
double * dparm
Definition: pastixdata.h:66
pastix_data_s::id
pastix_int_t id
Definition: pastixdata.h:64
pastix_data_s
Main PaStiX data structure.
Definition: pastixdata.h:63
pastix_data_s::steps
pastix_int_t steps
Definition: pastixdata.h:68
pastix_data_s::procnum
int procnum
Definition: pastixdata.h:75
pastix_data_s::inter_node_procnum
int inter_node_procnum
Definition: pastixdata.h:79
pastix_data_s::bcsc
pastix_bcsc_t * bcsc
Definition: pastixdata.h:97
pastix_data_s::gpu_models
pastix_model_t * gpu_models
Definition: pastixdata.h:103
pastix_data_s::schur_n
pastix_int_t schur_n
Definition: pastixdata.h:89
pastix_data_s::intra_node_procnbr
int intra_node_procnbr
Definition: pastixdata.h:76
pastix_data_s::zeros_list
pastix_int_t * zeros_list
Definition: pastixdata.h:92
pastix_data_s::parsec
void * parsec
Definition: pastixdata.h:82
pastix_data_s::procnbr
int procnbr
Definition: pastixdata.h:74
pastix_data_s::bindtab
int * bindtab
Definition: pastixdata.h:115