PaStiX Handbook  6.2.1
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-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8  * Univ. Bordeaux. All rights reserved.
9  *
10  * @version 6.2.0
11  * @author Pascal Henon
12  * @author Xavier Lacoste
13  * @author Pierre Ramet
14  * @author Mathieu Faverge
15  * @author Gregoire Pichon
16  * @date 2020-03-02
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
53 pastix_task_analyze( pastix_data_t *pastix_data,
54  const spmatrix_t *spm )
55 {
56  Clock timer;
57  int rc;
58 
59  /*
60  * Check parameters
61  */
62  if (pastix_data == NULL) {
63  errorPrint("pastix_task_analyze: wrong pastix_data parameter");
65  }
66  if ( !(pastix_data->steps & STEP_INIT) ) {
67  errorPrint("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 }
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
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
PastixVerboseNot
@ PastixVerboseNot
Definition: api.h:207
PASTIX_SUCCESS
@ PASTIX_SUCCESS
Definition: api.h:344
IPARM_VERBOSE
@ IPARM_VERBOSE
Definition: api.h:36
DPARM_ANALYZE_TIME
@ DPARM_ANALYZE_TIME
Definition: api.h:161
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
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_ERR_BADPARAMETER
@ PASTIX_ERR_BADPARAMETER
Definition: api.h:351