PaStiX Handbook  6.3.2
pastix_subtask_order.c
Go to the documentation of this file.
1 /**
2  *
3  * @file pastix_subtask_order.c
4  *
5  * PaStiX ordering task.
6  * Contains wrappers to build a good ordering for sparse direct solvers.
7  * Affected by the compilation time options:
8  * - PASTIX_ORDERING_SCOTCH: Enable Scotch graph partitioning library.
9  * - PASTIX_ORDERING_PTSCOTCH: Enable PT-Scotch graph partitioning library.
10  * - PASTIX_ORDERING_METIS: Enable Metis graph partitioning library.
11  *
12  * @copyright 2015-2023 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
13  * Univ. Bordeaux. All rights reserved.
14  *
15  * @version 6.3.2
16  * @author Xavier Lacoste
17  * @author Pierre Ramet
18  * @author Mathieu Faverge
19  * @author Gregoire Pichon
20  * @author Tony Delarue
21  * @date 2023-07-21
22  *
23  **/
24 #include "common.h"
25 #include <spm.h>
26 #include "graph/graph.h"
27 #include "blend/elimintree.h"
28 #include "order_internal.h"
29 
30 /**
31  *******************************************************************************
32  *
33  * @ingroup pastix_analyze
34  *
35  * @brief Computes the ordering of the given graph in parameters.
36  *
37  * The graph given by the user is used to generate a graph that can be used by
38  * ordering tools and symbolic factorization. This graph is stored in the
39  * pastix_data->graph to be pass over to the symbolic factorization. If it exists
40  * before to call this routine, then the current structure is cleaned and a new
41  * one is created. From this structure, an ordering is computed by the ordering
42  * tool chosen by IPARM_ORDERING and stored in pastix_data->ordemesh. At the end
43  * the full ordering stucture: pemutation, inverse permutation, partition, and
44  * partion tree is generated such that it can be used by any symbolic
45  * factorization algorithm.
46  * The user can get back the permutation generated by providing allocated ordering
47  * structure where the results is stored after computation.
48  *
49  * This routine is affected by the following parameters:
50  * IPARM_VERBOSE, IPARM_ORDERING, IPARM_IO_STRATEGY
51  *
52  *******************************************************************************
53  *
54  * @param[inout] pastix_data
55  * The pastix_data structure that describes the solver instance.
56  * On exit, the field ordemesh is initialize with the result of the
57  * ordering.
58  * - IPARM_ORDERING will determine which ordering tool is used.
59  * - IPARM_IO_STRATEGY:
60  * - If set to PastixIOSave, the results will be written on files on
61  * exit.
62  * - If set to PastixIOLoad and IPARM_ORDERING is set to personal,
63  * then the ordering is loaded from files and no ordering is
64  * called.
65  * - If the function pastix_setSchurUnknownList() function has been
66  * previously called to set the list of vertices to isolate in the
67  * schur complement, those vertices are isolated at the end of the
68  * matrix in a dedicated supernode..
69  * - If the function pastix_setZerosUnknownList() function has been
70  * previously called to set the list of diagonal elements that may
71  * cause problem during the factorization, those vertices are isolated
72  * at the end of the matrix in a dedicated supernode..
73  *
74  * @param[in] spm
75  * The sparse matrix given by the user on which the ordering will be
76  * computed.
77  *
78  *
79  * @param[inout] myorder
80  * On entry, the permutation provide by the user if IPARM_ORDERING
81  * parameter set to PastixOrderPersonal. Not read otherwise.
82  * On exit, if the structure attributs != NULL and IPARM_ORDERING parameter
83  * is not set to PastixOrderPersonal, contains the permutation generated.
84  * Otherwise, it is not referenced.
85  *
86  *******************************************************************************
87  *
88  * @retval PASTIX_SUCCESS on successful exit,
89  * @retval PASTIX_ERR_BADPARAMETER if one parameter is incorrect,
90  * @retval PASTIX_ERR_OUTOFMEMORY if one allocation failed,
91  * @retval PASTIX_ERR_INTEGER_TYPE if Scotch integer type is not the
92  * same size as PaStiX ones,
93  * @retval PASTIX_ERR_INTERNAL if an error occurs internally to Scotch.
94  *
95  *******************************************************************************/
96 int
98  const spmatrix_t *spm,
99  pastix_order_t *myorder )
100 {
101  pastix_int_t schur_gN;
102  pastix_int_t *schur_perm = NULL;
103  pastix_int_t *zeros_perm = NULL;
104  pastix_int_t *iparm;
105  pastix_graph_t *subgraph;
106  pastix_graph_t schurgraph;
107  pastix_graph_t zerosgraph;
108  pastix_graph_t *graph;
109  pastix_order_t *ordemesh;
110  Clock timer;
111  int procnum;
112  int retval = PASTIX_SUCCESS;
113  int retval_rcv;
114  int do_schur = 1;
115  int do_zeros = 1;
116  int subgraph_is_a_copy = 0;
117  int spmbase;
118 
119  /*
120  * Check parameters
121  */
122  if ( pastix_data == NULL ) {
123  pastix_print_error( "pastix_subtask_order: wrong pastix_data parameter" );
125  }
126  if ( spm == NULL ) {
127  pastix_print_error( "pastix_subtask_order: wrong spm parameter" );
129  }
130  if ( !(pastix_data->steps & STEP_INIT) ) {
131  pastix_print_error( "pastix_subtask_order: pastixInit() has to be called before calling this function" );
133  }
134 
135  iparm = pastix_data->iparm;
136  /* Backup flttype from the spm into iparm[IPARM_FLOAT] for later use */
137  iparm[IPARM_FLOAT] = spm->flttype;
138 
139  if ( pastix_data->schur_n > 0 )
140  {
141  /*
142  * If ordering is set to PastixOrderPersonal, we consider that the schur
143  * complement is already isolated at the end of the permutation array.
144  */
145  if ( iparm[IPARM_ORDERING] == PastixOrderPersonal ) {
146  do_schur = 0;
147  }
148  }
149  else {
150  do_schur = 0;
151  }
152 
153  if ( pastix_data->zeros_n > 0 )
154  {
155  /*
156  * If ordering is set to PastixOrderPersonal, we consider that the zeros
157  * on diagonal are already isolated at the end of the permutation array.
158  */
159  if ( iparm[IPARM_ORDERING] == PastixOrderPersonal ) {
160  do_zeros = 0;
161  }
162  }
163  else {
164  do_zeros = 0;
165  }
166 
167  /*
168  * Clean ordering if it exists
169  */
170  if ( pastix_data->ordemesh != NULL ) {
171  pastixOrderExit(pastix_data->ordemesh);
172  }
173  else {
174  MALLOC_INTERN( pastix_data->ordemesh, 1, pastix_order_t );
175  }
176 
177  ordemesh = pastix_data->ordemesh;
178  procnum = pastix_data->procnum;
179  pastixOrderAlloc( ordemesh, 0, 0 );
180 
181  if ( iparm[IPARM_VERBOSE] > PastixVerboseNot ) {
182  pastix_print( procnum, 0, "%s", OUT_STEP_ORDER );
183  }
184 
185  /*
186  * Prepare a copy of user's SPM
187  * Copy the given spm in pastix_data structure and performs basic required
188  * operations as symmetrizing the graph and removing the diagonal
189  * coefficients
190  */
191  if ( pastix_data->graph != NULL ) {
192  graphExit( pastix_data->graph );
193  memFree_null( pastix_data->graph );
194  }
195  graphPrepare( pastix_data, spm, &(pastix_data->graph) );
196  graph = pastix_data->graph;
197  spmbase = spmFindBase( spm );
198 
199  graphBase( graph, 0 );
200  subgraph = graph;
201 
202  /*
203  * Isolate Shur elements
204  */
205  if ( do_schur )
206  {
207  assert( pastix_data->schur_list != NULL );
208 
209  if ( spmbase != 0 ) {
210  /* We need to rebase the schur unknown list */
211  pastix_int_t i;
212 
213  for( i=0; i<pastix_data->schur_n; i++ ) {
214  pastix_data->schur_list[i] -= spmbase;
215  }
216  }
217 
218  graphIsolate( graph, &schurgraph,
219  pastix_data->schur_n,
220  pastix_data->schur_list,
221  &schur_perm,
222  NULL );
223 
224  subgraph_is_a_copy = 1;
225  subgraph = &schurgraph;
226  }
227 
228  /* Backup only the needed part */
229  schur_gN = subgraph->gN;
230 
231  /*
232  * Isolate diagonal elements close to 0.
233  */
234  if ( do_zeros )
235  {
236  assert( pastix_data->zeros_list != NULL );
237 
238  if ( spmbase != 0 ) {
239  /* We need to rebase the zeros unknown list */
240  pastix_int_t i;
241 
242  for( i=0; i<pastix_data->zeros_n; i++ ) {
243  pastix_data->zeros_list[i] -= spmbase;
244  }
245  }
246 
247  graphIsolate( subgraph, &zerosgraph,
248  pastix_data->zeros_n,
249  pastix_data->zeros_list,
250  &zeros_perm,
251  NULL );
252 
253  if ( subgraph_is_a_copy ) {
254  /* We do not longer require arrays from the schur subgraph */
255  graphExit( subgraph );
256  }
257  subgraph_is_a_copy = 1;
258  subgraph = &zerosgraph;
259  }
260 
261  if ( iparm[IPARM_VERBOSE] > PastixVerboseYes ) {
262  pastix_print( procnum, 0, "%s", OUT_ORDER_INIT );
263  }
264 
265  clockStart(timer);
266 
267  /* Select the ordering method chosen by the user */
268  switch ( iparm[IPARM_ORDERING] ) {
269  /*
270  * Scotch Ordering
271  */
272  case PastixOrderScotch:
273  if ( iparm[IPARM_VERBOSE] > PastixVerboseNot ) {
274  pastix_print( procnum, 0, OUT_ORDER_METHOD, "Scotch" );
275  }
276 #if defined(PASTIX_ORDERING_SCOTCH)
277  graphGatherInPlace( subgraph );
278  retval = orderComputeScotch( pastix_data, subgraph );
279 #else
280  pastix_print_error( "pastix_subtask_order: Ordering with Scotch requires to enable -DPASTIX_ORDERING_SCOTCH option" );
281  retval = PASTIX_ERR_BADPARAMETER;
282 #endif
283  break;
284 
285  /*
286  * PT-Scotch Ordering
287  */
288  case PastixOrderPtScotch:
289  if (iparm[IPARM_VERBOSE] > PastixVerboseNot) {
290  pastix_print(procnum, 0, OUT_ORDER_METHOD, "PT-Scotch" );
291  }
292 #if defined(PASTIX_ORDERING_PTSCOTCH)
293  graphScatterInPlace( subgraph, pastix_data->pastix_comm );
294  retval = orderComputePTScotch( pastix_data, subgraph );
295 #else
296  pastix_print_error( "pastix_subtask_order: Ordering with PT-Scotch requires to enable -DPASTIX_ORDERING_PTSCOTCH option" );
297  retval = PASTIX_ERR_BADPARAMETER;
298 #endif
299  break;
300 
301  /*
302  * METIS ordering
303  */
304  case PastixOrderMetis:
305  if (iparm[IPARM_VERBOSE] > PastixVerboseNot) {
306  pastix_print(procnum, 0, OUT_ORDER_METHOD, "Metis" );
307  }
308 #if defined(PASTIX_ORDERING_METIS)
309  graphGatherInPlace( subgraph );
310  retval = orderComputeMetis( pastix_data, subgraph );
311  assert( ordemesh->rangtab == NULL );
312 #else
313  pastix_print_error( "pastix_subtask_order: Ordering with Metis requires -DPASTIX_ORDERING_METIS flag at compile time" );
314  retval = PASTIX_ERR_BADPARAMETER;
315 #endif
316  break;
317 
318  /*
319  * Personal Ordering
320  */
321  case PastixOrderPersonal:
322  if ( iparm[IPARM_VERBOSE] > PastixVerboseNot ) {
323  pastix_print( procnum, 0, OUT_ORDER_METHOD, "Personal" );
324  }
325  retval = orderComputePersonal( pastix_data, subgraph, myorder );
326  break;
327 
328  default:
329  pastix_print_error( "pastix_subtask_order: Ordering not available (iparm[IPARM_ORDERING]=%d)\n",
330  (int)iparm[IPARM_ORDERING] );
331  retval = PASTIX_ERR_BADPARAMETER;
332  break;
333  }
334 
335  /*
336  * Reduce the error code
337  */
338  MPI_Allreduce( &retval, &retval_rcv, 1, MPI_INT, MPI_MAX,
339  pastix_data->pastix_comm );
340  if (retval_rcv != PASTIX_SUCCESS) {
341 
342  /* Cleanup memory */
343  if ( do_zeros ) {
344  graphExit( &zerosgraph );
345  memFree_null( zeros_perm );
346  }
347  if ( do_schur ) {
348  graphExit( &schurgraph );
349  memFree_null( schur_perm );
350  }
351 
352  return retval_rcv;
353  }
354 
355  /* Rebase the ordering to 0 (for orderFindSupernodes) */
356  pastixOrderBase( ordemesh, 0 );
357 
358  /*
359  * If the rangtab or the treetab are not initialized, let's find it ourself
360  */
361  if (( ordemesh->rangtab == NULL ) ||
362  ( ordemesh->treetab == NULL ) )
363  {
364  /* The ordering step may be distributed, but supernodes routines are not */
365  graphGatherInPlace( subgraph );
366 
367  /* TODO: if rangtab is provided, treetab could be easily calculated */
368  orderFindSupernodes( subgraph, ordemesh );
369 
370 #if !defined(NDEBUG) && defined(PASTIX_DEBUG_ORDERING)
371  assert( pastixOrderCheck( ordemesh ) == PASTIX_SUCCESS );
372 #endif
373 
375  iparm[IPARM_INCOMPLETE],
376  iparm[IPARM_LEVEL_OF_FILL],
379  subgraph,
380  ordemesh,
381  pastix_data->pastix_comm );
382  }
383 
384 #if !defined(NDEBUG) && defined(PASTIX_DEBUG_ORDERING)
385  assert( pastixOrderCheck( ordemesh ) == PASTIX_SUCCESS );
386 #endif
387 
388  /*
389  * The subgraph is no longer needed, let's free it if it was a copy
390  */
391  if ( subgraph_is_a_copy ) {
392  graphExit( subgraph );
393  }
394 
395  /*
396  * Reorder supernodes by level to get a better order for runtime systems,
397  * and for the reordering algorithm
398  */
399  orderApplyLevelOrder( ordemesh,
400  iparm[IPARM_TASKS2D_LEVEL],
401  iparm[IPARM_TASKS2D_WIDTH] );
402 
403 #if !defined(NDEBUG) && defined(PASTIX_DEBUG_ORDERING)
404  assert( pastixOrderCheck( ordemesh ) == PASTIX_SUCCESS );
405 #endif
406 
407  /*
408  * Add the isolated elements to the ordering structure
409  */
410  if ( do_zeros )
411  {
412  orderAddIsolate( ordemesh, schur_gN, zeros_perm );
413 
414  if ( zeros_perm != NULL ) { memFree_null( zeros_perm ); }
415  }
416 
417  /*
418  * Add the isolated elements to the ordering structure
419  */
420  if ( do_schur )
421  {
422  orderAddIsolate( ordemesh, graph->gN, schur_perm );
423 
424  if ( schur_perm != NULL ) { memFree_null( schur_perm ); }
425  }
426 
427  /*
428  * Backup of the original supernodes
429  */
430  ordemesh->sndenbr = ordemesh->cblknbr;
431  ordemesh->sndetab = malloc( (ordemesh->sndenbr+1) * sizeof(pastix_int_t) );
432  memcpy( ordemesh->sndetab, ordemesh->rangtab, (ordemesh->sndenbr+1) * sizeof(pastix_int_t) );
433 
434  /*
435  * Block Low-Rank clustering
436  */
437  if ( ( iparm[IPARM_COMPRESS_WHEN] != PastixCompressNever ) &&
439  {
440 #if !defined(PASTIX_ORDERING_SCOTCH)
441  pastix_print_warning( "Clustering is not available yet when Scotch is disabled" );
442 #else
443  EliminTree *etree;
444  pastix_int_t min_cblk = ordemesh->rangtab[ordemesh->cblknbr-1];
445  pastix_int_t ret;
446 
447  graphBase( graph, 0 );
448 
449  etree = orderBuildEtree( ordemesh );
450 
451  ret = orderSupernodes( graph, ordemesh,
452  etree, iparm, do_schur );
453 
454  eTreeExit( etree );
455 
456  (void)ret;
457  (void)min_cblk;
458 #endif /* !defined(PASTIX_ORDERING_SCOTCH) */
459  }
460 
461 #if defined(PASTIX_ORDER_DRAW_LASTSEP)
462  /*
463  * Draw last separator graph and xyz
464  */
465  orderDraw( pastix_data, NULL, ordemesh->sndenbr-1,
466  orderDrawGraph | orderDrawCoordinates );
467 #endif
468 
469  /* Reduce the error code */
470  MPI_Allreduce( &retval, &retval_rcv, 1, MPI_INT, MPI_MAX,
471  pastix_data->pastix_comm );
472  if ( retval_rcv != PASTIX_SUCCESS ) {
473  return retval_rcv;
474  }
475 
476  clockStop(timer);
477  pastix_data->dparm[DPARM_ORDER_TIME] = clockVal(timer);
478  if ( iparm[IPARM_VERBOSE] > PastixVerboseNot ) {
479  pastix_print(procnum, 0, OUT_ORDER_TIME, clockVal(timer));
480  }
481 
482  /*
483  * Save i/o strategy
484  */
485  if ( iparm[IPARM_IO_STRATEGY] & PastixIOSave ) {
486  if ( procnum == 0 ) {
487  retval = pastixOrderSave( pastix_data, ordemesh );
488  }
489 
490  MPI_Allreduce( &retval, &retval_rcv, 1, MPI_INT, MPI_MAX,
491  pastix_data->pastix_comm );
492  if ( retval_rcv != PASTIX_SUCCESS ) {
493  return retval_rcv;
494  }
495  }
496 
497  /*
498  * Return the ordering to user if structure is not NULL
499  * Remark: No need to copy back for personal
500  */
501  if ( ( iparm[IPARM_ORDERING] != PastixOrderPersonal ) &&
502  ( myorder != NULL ) )
503  {
504  if ( graph->loc2glob == NULL )
505  {
506  retval = pastixOrderCopy( myorder, ordemesh );
507  MPI_Allreduce( &retval, &retval_rcv, 1, MPI_INT, MPI_MAX,
508  pastix_data->pastix_comm );
509  if ( retval_rcv != PASTIX_SUCCESS ) {
510  return retval_rcv;
511  }
512  }
513  else
514  {
515  pastix_int_t *loc2glob;
516  pastix_int_t baseval = graph->baseval;
517  pastix_int_t i, n;
518 
519  n = graph->n;
520  if ( myorder->permtab != NULL ) {
521  pastix_int_t *permtab = ordemesh->permtab - baseval;
522 
523  loc2glob = graph->loc2glob;
524  for( i = 0; i < n; i++, loc2glob++ ) {
525  myorder->permtab[i] = permtab[*loc2glob];
526  }
527  }
528  if (myorder->peritab != NULL) {
529  pastix_int_t *peritab = ordemesh->peritab - baseval;
530  pastix_int_t i;
531 
532  loc2glob = graph->loc2glob;
533  for( i = 0; i < n; i++, loc2glob++ ) {
534  myorder->peritab[i] = peritab[*loc2glob];
535  }
536  }
537  /* TODO: Copy also rangtab and treetab ? */
538  }
539  }
540 
541  /*
542  * For now, what the rank 0 has will overwrite what the others have, even if
543  * they all computed something
544  */
545  pastixOrderBcast( pastix_data->ordemesh, 0, pastix_data->pastix_comm );
546 
547 #if !defined(NDEBUG)
548  assert( pastixOrderCheck( pastix_data->ordemesh ) == PASTIX_SUCCESS );
549 #endif
550 
551  /* Backup the spm pointer for further information */
552  pastix_data->csc = spm;
553 
554  /* Invalidate following steps, and add order step to the ones performed */
555  pastix_data->steps &= ~( STEP_SYMBFACT |
556  STEP_ANALYSE |
557  STEP_CSC2BCSC |
558  STEP_BCSC2CTAB |
559  STEP_NUMFACT |
560  STEP_SOLVE |
561  STEP_REFINE );
562  pastix_data->steps |= STEP_ORDERING;
563 
564  return PASTIX_SUCCESS;
565 }
BEGIN_C_DECLS typedef int pastix_int_t
Definition: datatypes.h:51
void eTreeExit(EliminTree *)
Free the elimination tree structure.
Definition: elimintree.c:89
Elimination tree.
Definition: elimintree.h:39
EliminTree * orderBuildEtree(const pastix_order_t *order)
This routine build the elimination tree associated to an ordering.
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.
@ PastixIOSave
Definition: api.h:231
@ DPARM_ORDER_TIME
Definition: api.h:164
@ PastixCompressNever
Definition: api.h:385
@ IPARM_COMPRESS_WHEN
Definition: api.h:131
@ IPARM_TASKS2D_LEVEL
Definition: api.h:90
@ IPARM_TASKS2D_WIDTH
Definition: api.h:91
@ IPARM_AMALGAMATION_LVLBLAS
Definition: api.h:74
@ IPARM_FLOAT
Definition: api.h:149
@ IPARM_ORDERING
Definition: api.h:50
@ IPARM_VERBOSE
Definition: api.h:36
@ IPARM_AMALGAMATION_LVLCBLK
Definition: api.h:75
@ IPARM_SPLITTING_STRATEGY
Definition: api.h:80
@ IPARM_IO_STRATEGY
Definition: api.h:37
@ IPARM_LEVEL_OF_FILL
Definition: api.h:96
@ IPARM_INCOMPLETE
Definition: api.h:95
@ PastixOrderPersonal
Definition: api.h:347
@ PastixOrderScotch
Definition: api.h:345
@ PastixOrderMetis
Definition: api.h:346
@ PastixOrderPtScotch
Definition: api.h:348
@ PastixVerboseYes
Definition: api.h:222
@ PastixVerboseNot
Definition: api.h:220
@ PASTIX_SUCCESS
Definition: api.h:367
@ PASTIX_ERR_BADPARAMETER
Definition: api.h:374
@ PastixSplitNot
Definition: api.h:416
int graphIsolate(const pastix_graph_t *ingraph, pastix_graph_t *outgraph, pastix_int_t isolate_n, pastix_int_t *isolate_list, pastix_int_t **new_perm, pastix_int_t **new_invp)
Isolate a subset of vertices from a given graph.
void graphExit(pastix_graph_t *graph)
Free the content of the graph structure.
Definition: graph.c:73
int graphScatterInPlace(pastix_graph_t *graph, PASTIX_Comm comm)
This routine scatter a graph from node root to the other nodes.
Definition: graph.c:194
int graphPrepare(pastix_data_t *pastix_data, const spmatrix_t *spm, pastix_graph_t **graph)
This routine initializes the graph.
int graphGatherInPlace(pastix_graph_t *graph)
This routine gather a distributed graph on each node in place.
Definition: graph.c:239
void graphBase(pastix_graph_t *graph, pastix_int_t baseval)
Rebase the graph to the given value.
Definition: graph.c:102
pastix_int_t * treetab
Definition: order.h:54
pastix_int_t * sndetab
Definition: order.h:57
pastix_int_t * permtab
Definition: order.h:51
pastix_int_t * peritab
Definition: order.h:52
pastix_int_t cblknbr
Definition: order.h:50
pastix_int_t sndenbr
Definition: order.h:56
pastix_int_t * rangtab
Definition: order.h:53
void orderDraw(pastix_data_t *pastix_data, const char *extname, pastix_int_t sndeidx, int dump)
Dump the last separator into an ivview file.
Definition: order_draw.c:52
int pastixOrderAlloc(pastix_order_t *ordeptr, pastix_int_t vertnbr, pastix_int_t cblknbr)
Allocate the order structure.
Definition: order.c:55
void orderFindSupernodes(const pastix_graph_t *graph, pastix_order_t *const ordeptr)
Computes the set of supernodes for a given permutation.
void pastixOrderBase(pastix_order_t *ordeptr, pastix_int_t baseval)
This routine sets the base of the given ordering structure to the given base value.
Definition: order.c:322
int orderApplyLevelOrder(pastix_order_t *order, pastix_int_t level_tasks2d, pastix_int_t width_tasks2d)
This routine reorder the elimination tree nodes per level.
pastix_int_t orderSupernodes(const pastix_graph_t *graph, pastix_order_t *order, EliminTree *etree, pastix_int_t *iparm, int do_schur)
Order the supernodes with one of the clustering strategies.
int orderComputePersonal(pastix_data_t *pastix_data, pastix_graph_t *graph, pastix_order_t *myorder)
Computes the personal ordering of the PaStiX instance.
int pastixOrderSave(pastix_data_t *pastix_data, const pastix_order_t *ordeptr)
Save an ordering to a file.
Definition: order_io.c:293
int orderComputeScotch(pastix_data_t *pastix_data, pastix_graph_t *graph)
Compute the ordering of the graph given as parameter with Scotch library.
int orderAmalgamate(int verbose, int ilu, int levelk, int rat_cblk, int rat_blas, pastix_graph_t *csc, pastix_order_t *orderptr, PASTIX_Comm pastix_comm)
Update the order structure with an amalgamation algorithm.
int orderComputePTScotch(pastix_data_t *pastix_data, pastix_graph_t *graph)
Compute the ordering of the graph given as parameter with PT-Scotch library.
int orderComputeMetis(pastix_data_t *pastix_data, pastix_graph_t *graph)
Compute the ordering of the graph given as parameter with Metis library.
int orderAddIsolate(pastix_order_t *ordemesh, pastix_int_t new_n, const pastix_int_t *perm)
This routine combines two permutation arrays when a subset of vertices has been isolated from the ori...
void pastixOrderBcast(pastix_order_t *ordemesh, int root, PASTIX_Comm pastix_comm)
This routine broadcast the ordemesh structure from node root to all the other nodes.
Definition: order.c:679
int pastixOrderCheck(const pastix_order_t *ordeptr)
This routine checks the correctness of the ordering structure.
Definition: order_check.c:39
int pastixOrderCopy(pastix_order_t *ordedst, const pastix_order_t *ordesrc)
This routine copy a given ordering in a new one.
Definition: order.c:570
void pastixOrderExit(pastix_order_t *ordeptr)
Free the arrays initialized in the order structure.
Definition: order.c:273
Order structure.
Definition: order.h:47
PASTIX_Comm pastix_comm
Definition: pastixdata.h:75
pastix_int_t zeros_n
Definition: pastixdata.h:95
pastix_order_t * ordemesh
Definition: pastixdata.h:97
pastix_int_t * iparm
Definition: pastixdata.h:69
double * dparm
Definition: pastixdata.h:70
const spmatrix_t * csc
Definition: pastixdata.h:89
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
pastix_int_t * zeros_list
Definition: pastixdata.h:96
pastix_int_t steps
Definition: pastixdata.h:72
Main PaStiX data structure.
Definition: pastixdata.h:67