PaStiX Handbook  6.3.2
pastix_task_analyze.c
Go to the documentation of this file.
1 /**
2  *
3  * @file pastix_task_analyze.c
4  *
5  * PaStiX analyse task function
6  *
7  * @copyright 2004-2023 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8  * Univ. Bordeaux. All rights reserved.
9  *
10  * @version 6.3.2
11  * @author Pascal Henon
12  * @author Xavier Lacoste
13  * @author Pierre Ramet
14  * @author Mathieu Faverge
15  * @author Gregoire Pichon
16  * @date 2023-07-21
17  *
18  **/
19 #include "common.h"
20 
21 /**
22  *******************************************************************************
23  *
24  * @ingroup pastix_users
25  *
26  * @brief Perform all the preprocessing steps: ordering, symbolic factorization,
27  * reordering, proportionnal mapping, ...
28  *
29  * This function combines the calls to all the preprocessing steps. See
30  * pastix_subtask_order() for further details on the ordering step,
31  * pastix_subtask_symbfact() for further details on the symbolic factotrization
32  * step, pastix_subtask_reordering() for further details on the reordering process,
33  * and pastix_subtask_blend() for the final analyse step that performs
34  * proportionnal mapin and generates the numerical factorization data
35  * structures.
36  *
37  *******************************************************************************
38  *
39  * @param[inout] pastix_data
40  * The pastix_data structure that describes the solver instance.
41  *
42  * @param[in] spm
43  * The sparse matrix descriptor that describes problem instance.
44  *
45  *******************************************************************************
46  *
47  * @retval PASTIX_SUCCESS on successful exit
48  * @retval PASTIX_ERR_BADPARAMETER if one parameter is incorrect.
49  * @retval PASTIX_ERR_OUTOFMEMORY if one allocation failed.
50  *
51  *******************************************************************************/
52 int
54  const spmatrix_t *spm )
55 {
56  Clock timer;
57  int rc;
58 
59  /*
60  * Check parameters
61  */
62  if (pastix_data == NULL) {
63  pastix_print_error( "pastix_task_analyze: wrong pastix_data parameter" );
65  }
66  if ( !(pastix_data->steps & STEP_INIT) ) {
67  pastix_print_error( "pastix_task_analyze: pastixInit() has to be called before calling this function" );
69  }
70 
71  clockStart( timer );
72 
73  /*
74  * Ordering step
75  */
76  rc = pastix_subtask_order( pastix_data, spm, NULL );
77  if (rc != PASTIX_SUCCESS) {
78  return rc;
79  }
80 
81  /*
82  * Symbolic factorization step
83  */
84  rc = pastix_subtask_symbfact( pastix_data );
85  if (rc != PASTIX_SUCCESS) {
86  return rc;
87  }
88 
89  /*
90  * Reordering step
91  */
92  rc = pastix_subtask_reordering( pastix_data );
93  if (rc != PASTIX_SUCCESS) {
94  return rc;
95  }
96 
97  /*
98  * Blend step (Proportional mapping)
99  */
100  rc = pastix_subtask_blend( pastix_data );
101  if (rc != PASTIX_SUCCESS) {
102  return rc;
103  }
104 
105  clockStop( timer );
106  pastix_data->dparm[DPARM_ANALYZE_TIME] = clockVal(timer);
107 
108  if ( pastix_data->iparm[IPARM_VERBOSE] > PastixVerboseNot ) {
109  pastix_print( pastix_data->procnum, 0,
110  OUT_STEP_ANALYZE, clockVal(timer) );
111  }
112 
113  return PASTIX_SUCCESS;
114 }
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.
int pastix_subtask_reordering(pastix_data_t *pastix_data)
Apply the reordering step to compact off-diagonal blocks.
@ DPARM_ANALYZE_TIME
Definition: api.h:168
@ IPARM_VERBOSE
Definition: api.h:36
@ PastixVerboseNot
Definition: api.h:220
@ PASTIX_SUCCESS
Definition: api.h:367
@ PASTIX_ERR_BADPARAMETER
Definition: api.h:374
pastix_int_t * iparm
Definition: pastixdata.h:69
double * dparm
Definition: pastixdata.h:70
pastix_int_t steps
Definition: pastixdata.h:72
int pastix_task_analyze(pastix_data_t *pastix_data, const spmatrix_t *spm)
Perform all the preprocessing steps: ordering, symbolic factorization, reordering,...
Main PaStiX data structure.
Definition: pastixdata.h:67