PaStiX Handbook 6.4.0
Loading...
Searching...
No Matches
order.c
Go to the documentation of this file.
1/**
2 *
3 * @file order.c
4 *
5 * PaStiX order structure routines
6 *
7 * @copyright 2004-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8 * Univ. Bordeaux. All rights reserved.
9 *
10 * @version 6.4.0
11 * @author Francois Pellegrini
12 * @author Mathieu Faverge
13 * @author Pierre Ramet
14 * @author Vincent Bridonneau
15 * @date 2024-07-05
16 *
17 **/
18#include "common.h"
19#include "order/order_internal.h"
20
21/**
22 *******************************************************************************
23 *
24 * @ingroup pastix_order
25 *
26 * @brief Allocate the order structure.
27 *
28 * The base value is set to 0 by default.
29 *
30 *******************************************************************************
31 *
32 * @param[inout] ordeptr
33 * The data structure is set to 0 and then initialize.
34 * Need to call pastixOrderExit() to release the memory first if required to
35 * prevent memory leak.
36 *
37 * @param[in] vertnbr
38 * The number of nodes, this is the size of the internal permtab and
39 * peritab arrays.
40 * If vertnbr == 0, permtab and peritab are not allocated.
41 *
42 * @param[in] cblknbr
43 * The number of supernodes. The internal rangtab array is of size
44 * cblknbr+1, and treetab of size cblknbr.
45 * If cblknbr == 0, rangtab and treetab are not allocated.
46 *
47 *******************************************************************************
48 *
49 * @retval PASTIX_SUCCESS on successful exit,
50 * @retval PASTIX_ERR_BADPARAMETER if one parameter is incorrect,
51 * @retval PASTIX_ERR_OUTOFMEMORY if one allocation failed.
52 *
53 *******************************************************************************/
54int
56 pastix_int_t vertnbr,
57 pastix_int_t cblknbr )
58{
59 /* Parameter checks */
60 if ( ordeptr == NULL ) {
62 }
63 if ( vertnbr < 0 ) {
65 }
66 if ( cblknbr < 0 ) {
68 }
69 if ( cblknbr > vertnbr ) {
71 }
72
73 memset( ordeptr, 0, sizeof(pastix_order_t) );
74
75 ordeptr->vertnbr = vertnbr;
76 ordeptr->cblknbr = cblknbr;
77 ordeptr->sndenbr = cblknbr;
78 ordeptr->sndetab = NULL;
79
80 if ( vertnbr > 0 ) {
81 MALLOC_INTERN( ordeptr->permtab, vertnbr, pastix_int_t );
82 MALLOC_INTERN( ordeptr->peritab, vertnbr, pastix_int_t );
83 }
84
85 if ( cblknbr > 0 ) {
86 MALLOC_INTERN( ordeptr->rangtab, cblknbr+1, pastix_int_t );
87 MALLOC_INTERN( ordeptr->treetab, cblknbr, pastix_int_t );
88 }
89
90 return PASTIX_SUCCESS;
91}
92
93/**
94 *******************************************************************************
95 *
96 * @ingroup pastix_order
97 *
98 * @brief Allocate the order structure for a given number of vertices with no
99 * cblk, and id permutation.
100 *
101 * The base value is set to 0 by default.
102 *
103 *******************************************************************************
104 *
105 * @param[inout] ordeptr
106 * The data structure is set to 0 and then initialize.
107 * Need to call pastixOrderExit() to release the memory first if required to
108 * prevent memory leak.
109 *
110 * @param[in] vertnbr
111 * The number of nodes, this is the size of the internal permtab and
112 * peritab arrays.
113 * If vertnbr == 0, permtab and peritab are not allocated.
114 *
115 *******************************************************************************
116 *
117 * @retval PASTIX_SUCCESS on successful exit,
118 * @retval PASTIX_ERR_BADPARAMETER if one parameter is incorrect,
119 * @retval PASTIX_ERR_OUTOFMEMORY if one allocation failed.
120 *
121 *******************************************************************************/
122int
124 pastix_int_t vertnbr )
125{
126 pastix_int_t *perm;
127 pastix_int_t *invp;
128 pastix_int_t i;
129 int rc;
130
131 rc = pastixOrderAlloc( ordeptr, vertnbr, 1 );
132 if ( rc != PASTIX_SUCCESS ) {
133 return rc;
134 }
135
136 perm = ordeptr->permtab;
137 invp = ordeptr->peritab;
138
139 for(i=0; i<vertnbr; i++, perm++, invp++) {
140 *perm = i;
141 *invp = i;
142 }
143
144 ordeptr->rangtab[0] = 0;
145 ordeptr->rangtab[1] = vertnbr;
146 ordeptr->treetab[0] = -1;
147
148 return PASTIX_SUCCESS;
149}
150
151/**
152 *******************************************************************************
153 *
154 * @ingroup pastix_order
155 *
156 * @brief Initialize the order structure with the given values.
157 *
158 * The base value is set to 0 by default. This is useful to give a personal
159 * ordering to the pastix_task_order() function.
160 *
161 *******************************************************************************
162 *
163 * @param[inout] ordeptr
164 * The data structure is set to 0 and then initialize.
165 * Need to call orderExit to release the memory first if required to
166 * prevent memory leak.
167 *
168 * @param[in] baseval
169 * The base value used in the given arrays. Usually 0 for C, 1 for
170 * Fortran. Must be >= 0.
171 *
172 * @param[in] vertnbr
173 * The number of nodes, this is the size of the internal permtab and
174 * peritab arrays.
175 *
176 * @param[in] cblknbr
177 * The number of supernodes. The internal rangtab and treetab arrays
178 * are of size cblknbr+1.
179 *
180 * @param[in] permtab
181 * The permutation array which must be of size vertnbr, and based on
182 * baseval value.
183 * If NULL, the permtab field is not initialized.
184 *
185 * @param[in] peritab
186 * The inverse permutation array which must be of size vertnbr, and
187 * based on baseval value.
188 * If NULL, the peritab field is not initialized.
189 *
190 * @param[in] rangtab
191 * The rangtab array that describes the supernodes in the graph. This
192 * array must be of size cblknbr+1, and based on baseval value.
193 * If NULL, the rangtab field is not initialized.
194 *
195 * @param[in] treetab
196 * The treetab array that describes the elimination tree connecting the
197 * supernodes. This array must be defined as follow:
198 * - of size cblknbr;
199 * - based on baseval value;
200 * - each treetab[i] > i, unless i is a root and treetab[i] == -1
201 * - all roots of the tree must have -1 as father
202 * If NULL, the treetab field is not initialized.
203 *
204 *******************************************************************************
205 *
206 * @retval PASTIX_SUCCESS on successful exit
207 * @retval PASTIX_ERR_BADPARAMETER if one parameter is incorrect.
208 * @retval PASTIX_ERR_OUTOFMEMORY if one allocation failed.
209 *
210 *******************************************************************************/
211int
213 pastix_int_t baseval,
214 pastix_int_t vertnbr,
215 pastix_int_t cblknbr,
216 pastix_int_t * const permtab,
217 pastix_int_t * const peritab,
218 pastix_int_t * const rangtab,
219 pastix_int_t * const treetab )
220{
221 /* Parameter checks */
222 if ( ordeptr == NULL ) {
224 }
225 if ( vertnbr < 0 ) {
227 }
228 if ( cblknbr < 0 ) {
230 }
231
232 memset(ordeptr, 0, sizeof(pastix_order_t));
233
234 ordeptr->baseval = baseval;
235 ordeptr->vertnbr = vertnbr;
236 ordeptr->cblknbr = cblknbr;
237 ordeptr->sndenbr = cblknbr;
238 ordeptr->sndetab = NULL;
239
240 if ( permtab ) {
241 ordeptr->permtab = permtab;
242 }
243 if ( peritab ) {
244 ordeptr->peritab = peritab;
245 }
246 if ( rangtab ) {
247 ordeptr->rangtab = rangtab;
248 ordeptr->sndetab = malloc( (ordeptr->sndenbr+1) * sizeof(pastix_int_t) );
249 memcpy( ordeptr->sndetab, ordeptr->rangtab, (ordeptr->sndenbr+1) * sizeof(pastix_int_t) );
250 }
251 if ( treetab ) {
252 ordeptr->treetab = treetab;
253 }
254
255 return PASTIX_SUCCESS;
256}
257
258/**
259 *******************************************************************************
260 *
261 * @ingroup pastix_order
262 *
263 * @brief Free the arrays initialized in the order structure.
264 *
265 *******************************************************************************
266 *
267 * @param[inout] ordeptr
268 * The data structure to clean. All arrays of the structure are freed
269 * and the structure is set to 0.
270 *
271 *******************************************************************************/
272void
274{
275 /* Parameter check */
276 if ( ordeptr == NULL ) {
277 return;
278 }
279
280 if (ordeptr->permtab != NULL) {
281 memFree_null (ordeptr->permtab);
282 }
283 if (ordeptr->peritab != NULL) {
284 memFree_null (ordeptr->peritab);
285 }
286 if (ordeptr->rangtab != NULL) {
287 memFree_null (ordeptr->rangtab);
288 }
289 if (ordeptr->treetab != NULL) {
290 memFree_null (ordeptr->treetab);
291 }
292 if (ordeptr->selevtx != NULL) {
293 memFree_null (ordeptr->selevtx);
294 }
295 if (ordeptr->sndetab != NULL) {
296 memFree_null (ordeptr->sndetab);
297 }
298 if (ordeptr->peritab_exp != NULL) {
299 memFree_null (ordeptr->peritab_exp);
300 }
301 memset(ordeptr, 0, sizeof(pastix_order_t) );
302}
303
304/**
305 *******************************************************************************
306 *
307 * @ingroup pastix_order
308 *
309 * @brief This routine sets the base of the given ordering structure to the
310 * given base value.
311 *
312 *******************************************************************************
313 *
314 * @param[inout] ordeptr
315 * The ordering to rebase.
316 *
317 * @param[in] baseval
318 * The base value to be used (needs to be 0 or 1).
319 *
320 *******************************************************************************/
321void
323 pastix_int_t baseval )
324{
325 pastix_int_t baseadj; /* Base adjust */
326 pastix_int_t cblknum;
327 pastix_int_t vertnum;
328
329 /* Parameter checks */
330 if ( ordeptr == NULL ) {
331 pastix_print_error( "pastixOrderBase: ordeptr pointer is NULL" );
332 return;
333 }
334 if ( (baseval != 0) &&
335 (baseval != 1) )
336 {
337 pastix_print_error( "pastixOrderBase: baseval is incorrect, must be 0 or 1" );
338 return;
339 }
340
341 baseadj = baseval - ordeptr->baseval; /* Set base adjust */
342 if (baseadj == 0) /* If base already set */
343 return;
344
345 if (ordeptr->permtab != NULL) {
346 for (vertnum = 0; vertnum < ordeptr->vertnbr; vertnum ++) {
347 ordeptr->permtab[vertnum] += baseadj;
348 }
349 }
350 if (ordeptr->peritab != NULL) {
351 for (vertnum = 0; vertnum < ordeptr->vertnbr; vertnum ++) {
352 ordeptr->peritab[vertnum] += baseadj;
353 }
354 }
355
356 if (ordeptr->rangtab != NULL) {
357 for (cblknum = 0; cblknum <= ordeptr->cblknbr; cblknum ++) {
358 ordeptr->rangtab[cblknum] += baseadj;
359 }
360 }
361 if (ordeptr->treetab != NULL) {
362 for (cblknum = 0; cblknum < ordeptr->cblknbr; cblknum ++) {
363 ordeptr->treetab[cblknum] += baseadj;
364 }
365 }
366 if (ordeptr->sndetab != NULL) {
367 pastix_int_t sndenum;
368 for (sndenum = 0; sndenum <= ordeptr->sndenbr; sndenum ++) {
369 ordeptr->sndetab[sndenum] += baseadj;
370 }
371 }
372
373 ordeptr->baseval = baseval;
374}
375
376/**
377 *******************************************************************************
378 *
379 * @ingroup pastix_order
380 *
381 * @brief This routine expand the permutation arrays and the rangtab when the
382 * spm is using multiple dof per unknown.
383 *
384 *******************************************************************************
385 *
386 * @param[inout] ordeptr
387 * The ordering to expand. On entry, the order of the compressed
388 * matrix/graph. On exit, the ordering is 0-based and contains the
389 * permutation for the expanded matrix. peritab_ext remains untouched
390 * (=NULL) because peritab will already be expanded.
391 *
392 * @param[in] spm
393 * The sparse matrix structure providing dof information.
394 *
395 *******************************************************************************/
397 const spmatrix_t *spm )
398{
399 pastix_int_t *peritab;
400 pastix_int_t i, j, n;
401 pastix_int_t begin, end, sum_rang, sum_snde;
402 pastix_int_t *newperi;
403 pastix_int_t *rangtab;
404 pastix_int_t *sndetab;
405 pastix_int_t baseval;
406 const pastix_int_t *dofs;
407
408 baseval = spm->baseval;
409 pastixOrderBase( ordeptr, 0 );
410
411 n = spm->gNexp;
412
413 /*
414 * Initialize inverse permutation and rangtab
415 */
416 peritab = ordeptr->peritab;
417 rangtab = ordeptr->rangtab;
418 sndetab = ordeptr->sndetab;
419
420 MALLOC_INTERN( ordeptr->peritab, n, pastix_int_t );
421 newperi = ordeptr->peritab;
422
423 dofs = spm->dofs;
424
425 sum_rang = 0;
426 sum_snde = 0;
427 for (i=0; i<ordeptr->vertnbr; i++)
428 {
429 if ( spm->dof <= 0 ) {
430 begin = dofs[ peritab[i] ] - baseval;
431 end = dofs[ peritab[i] + 1 ] - baseval;
432 }
433 else {
434 begin = peritab[i] * spm->dof;
435 end = begin + spm->dof;
436 }
437
438 if ( i == rangtab[1] ) {
439 rangtab[1] = rangtab[0] + sum_rang;
440 rangtab++;
441 sum_rang = 0;
442 }
443 if ( i == sndetab[1] ) {
444 sndetab[1] = sndetab[0] + sum_snde;
445 sndetab++;
446 sum_snde = 0;
447 }
448
449 sum_rang += (end - begin);
450 sum_snde += (end - begin);
451
452 for ( j=begin; j<end; ++j, ++newperi ) {
453 *newperi = j;
454 }
455 }
456 rangtab[1] = rangtab[0] + sum_rang;
457 sndetab[1] = sndetab[0] + sum_snde;
458
459 ordeptr->vertnbr = n;
460 memFree_null( peritab );
461
462 /*
463 * Update permtab
464 */
465 memFree_null( ordeptr->permtab );
466 MALLOC_INTERN( ordeptr->permtab, n, pastix_int_t );
467 for( i=0; i<n; i++ ) {
468 j = ordeptr->peritab[i];
469 ordeptr->permtab[j] = i;
470 }
471}
472
473/**
474 *******************************************************************************
475 *
476 * @ingroup pastix_order
477 *
478 * @brief This routine expand the peritab array for multi-dof matrices.
479 *
480 *******************************************************************************
481 *
482 * @param[inout] ordeptr
483 * TODO
484 *
485 * @param[in] spm
486 * The sparse matrix structure providing the dof information.
487 *
488 *******************************************************************************
489 *
490 * @return The expanded peritab array.
491 *
492 *******************************************************************************/
495 const spmatrix_t *spm )
496{
497 pastix_int_t *peritab, *peritab_exp;
498 pastix_int_t i, j;
499 pastix_int_t begin, end;
500 pastix_int_t baseval_spm;
501 pastix_int_t baseval_ord;
502 const pastix_int_t *dofs;
503
504 assert( ordeptr != NULL );
505 assert( spm != NULL );
506 assert( spm->gN == ordeptr->vertnbr );
507
508 if ( spm->dof == 1 ) {
509 return ordeptr->peritab;
510 }
511
512 if ( ordeptr->peritab_exp != NULL ) {
513 return ordeptr->peritab_exp;
514 }
515
516 MALLOC_INTERN( peritab_exp, spm->gNexp, pastix_int_t );
517 ordeptr->peritab_exp = peritab_exp;
518
519 baseval_spm = spm->baseval;
520 baseval_ord = ordeptr->baseval;
521
522 /* Shift the dof ptr to take into account the baseval of peritab */
523 dofs = spm->dofs - baseval_ord;
524 peritab = ordeptr->peritab;
525
526 for ( i = 0; i < ordeptr->vertnbr; i++, peritab++ ) {
527 if ( spm->dof <= 0 ) {
528 begin = dofs[ peritab[0] ] - baseval_spm;
529 end = dofs[ peritab[0]+1 ] - baseval_spm;
530 }
531 else {
532 begin = (peritab[0] - baseval_ord) * spm->dof;
533 end = begin + spm->dof;
534 }
535 for ( j = begin; j < end; ++j, ++peritab_exp ) {
536 *peritab_exp = j;
537 }
538 }
539
540 return ordeptr->peritab_exp;
541}
542
543/**
544 *******************************************************************************
545 *
546 * @ingroup pastix_order
547 *
548 * @brief This routine copy a given ordering in a new one.
549 *
550 * This function copies an order structure into another one. If all subpointers
551 * are NULL, then they are all allocated and conatins the original ordesrc
552 * values on exit. If one or more array pointers are not NULL, then, only those
553 * are copied to the ordedst structure.
554 *
555 *******************************************************************************
556 *
557 * @param[inout] ordedst
558 * The destination ordering
559 *
560 * @param[in] ordesrc
561 * The source ordering
562 *
563 *******************************************************************************
564 *
565 * @retval PASTIX_SUCCESS on successful exit
566 * @retval PASTIX_ERR_BADPARAMETER if one parameter is incorrect.
567 *
568 *******************************************************************************/
569int
571 const pastix_order_t * const ordesrc )
572{
573 /* Parameter checks */
574 if ( ordedst == NULL ) {
576 }
577 if ( ordesrc == NULL ) {
579 }
580 if ( ordesrc == ordedst ) {
582 }
583
584 ordedst->baseval = ordesrc->baseval;
585 ordedst->vertnbr = ordesrc->vertnbr;
586 ordedst->cblknbr = ordesrc->cblknbr;
587 ordedst->sndenbr = ordesrc->sndenbr;
588
589 if ( (ordedst->permtab == NULL) &&
590 (ordedst->peritab == NULL) &&
591 (ordedst->rangtab == NULL) &&
592 (ordedst->treetab == NULL) )
593 {
594 pastixOrderAlloc( ordedst, ordedst->vertnbr, ordedst->cblknbr );
595 }
596
597 if ( (ordesrc->permtab != NULL) && (ordedst->permtab != NULL) )
598 {
599 memcpy( ordedst->permtab, ordesrc->permtab, ordesrc->vertnbr * sizeof(pastix_int_t) );
600 }
601
602 if ( (ordesrc->peritab != NULL) && (ordedst->peritab != NULL) )
603 {
604 memcpy( ordedst->peritab, ordesrc->peritab, ordesrc->vertnbr * sizeof(pastix_int_t) );
605 }
606
607 if ( (ordesrc->rangtab != NULL) && (ordedst->rangtab != NULL) )
608 {
609 memcpy( ordedst->rangtab, ordesrc->rangtab, (ordesrc->cblknbr+1) * sizeof(pastix_int_t) );
610 }
611
612 if ( (ordesrc->treetab != NULL) && (ordedst->treetab != NULL) )
613 {
614 memcpy( ordedst->treetab, ordesrc->treetab, ordesrc->cblknbr * sizeof(pastix_int_t) );
615 }
616
617 if ( (ordesrc->sndetab != NULL) && (ordedst->sndetab != NULL) )
618 {
619 memcpy( ordedst->sndetab, ordesrc->sndetab, (ordesrc->sndenbr+1) * sizeof(pastix_int_t) );
620 }
621
622 return PASTIX_SUCCESS;
623}
624
625/**
626 *******************************************************************************
627 *
628 * @ingroup pastix_order
629 *
630 * @brief This routine returns the pointer to the internal order structure to
631 * access permutation information.
632 *
633 * @warning The data returned by the routines must not be freed or modified by
634 * the user, and are valid as long as no operation on the ordering is performed
635 * (pastix_subtask_order(), pastix_subtask_reordering(), or pastixFinalize()).
636 *
637 *******************************************************************************
638 *
639 * @param[in] pastix_data
640 * The pastix_data structure of the problem
641 *
642 *******************************************************************************
643 *
644 * @return The pointer to the internal ordering structure with permutation
645 * information, or NULL if pastix_data is invalid.
646 *
647 *******************************************************************************/
649pastixOrderGet( const pastix_data_t * const pastix_data )
650{
651 /* Parameter checks */
652 if ( pastix_data == NULL ) {
653 return NULL;
654 }
655 return pastix_data->ordemesh;
656}
657
658/**
659 *******************************************************************************
660 *
661 * @ingroup pastix_order
662 *
663 * @brief This routine broadcast the ordemesh structure from node root to all
664 * the other nodes.
665 *
666 *******************************************************************************
667 *
668 * @param[inout] ordemesh
669 * The ordering structure of the problem.
670 *
671 * @param[in] root
672 * The node that will broadcast its ordemesh.
673 *
674 * @param[in] pastix_comm
675 * The MPI communicator of the problem.
676 *
677 *******************************************************************************/
678void
680 int root,
681 PASTIX_Comm pastix_comm )
682{
683 pastix_int_t vertnbr, cblknbr, sndenbr;
684 int clustnum;
685
686 MPI_Comm_rank( pastix_comm, &clustnum );
687
688 /* Free previous order structure */
689 if ( clustnum != root ) {
690 pastixOrderExit( ordemesh );
691 }
692
693 /* Copy ordemesh datas from node 0 */
694 MPI_Bcast( ordemesh, sizeof(pastix_order_t), MPI_BYTE,
695 root, pastix_comm );
696
697 vertnbr = ordemesh->vertnbr;
698 cblknbr = ordemesh->cblknbr;
699 sndenbr = ordemesh->sndenbr;
700
701 if ( ordemesh->permtab ) {
702 if ( clustnum != root ) {
703 MALLOC_INTERN( ordemesh->permtab, vertnbr, pastix_int_t );
704 }
705 MPI_Bcast( ordemesh->permtab, vertnbr, PASTIX_MPI_INT,
706 root, pastix_comm );
707 }
708
709 if ( ordemesh->peritab ) {
710 if ( clustnum != root ) {
711 MALLOC_INTERN( ordemesh->peritab, vertnbr, pastix_int_t );
712 }
713 MPI_Bcast( ordemesh->peritab, vertnbr, PASTIX_MPI_INT,
714 root, pastix_comm );
715 }
716
717 if ( ordemesh->rangtab ) {
718 if ( clustnum != root ) {
719 MALLOC_INTERN( ordemesh->rangtab, cblknbr+1, pastix_int_t );
720 }
721 MPI_Bcast( ordemesh->rangtab, cblknbr+1, PASTIX_MPI_INT,
722 root, pastix_comm );
723 }
724
725 if ( ordemesh->treetab ) {
726 if ( clustnum != root ) {
727 MALLOC_INTERN( ordemesh->treetab, cblknbr, pastix_int_t );
728 }
729 MPI_Bcast( ordemesh->treetab, cblknbr, PASTIX_MPI_INT,
730 root, pastix_comm );
731 }
732
733 if ( ordemesh->selevtx ) {
734 if ( clustnum != root ) {
735 MALLOC_INTERN( ordemesh->selevtx, cblknbr, int8_t );
736 }
737 MPI_Bcast( ordemesh->selevtx, cblknbr * sizeof(int8_t), MPI_BYTE,
738 root, pastix_comm );
739 }
740
741 if ( ordemesh->sndetab ) {
742 if ( clustnum != root ) {
743 MALLOC_INTERN( ordemesh->sndetab, sndenbr+1, pastix_int_t );
744 }
745 MPI_Bcast( ordemesh->sndetab, sndenbr+1, PASTIX_MPI_INT,
746 root, pastix_comm );
747 }
748}
BEGIN_C_DECLS typedef int pastix_int_t
Definition datatypes.h:51
@ PASTIX_SUCCESS
Definition api.h:367
@ PASTIX_ERR_BADPARAMETER
Definition api.h:374
pastix_int_t baseval
Definition order.h:48
pastix_int_t * peritab_exp
Definition order.h:58
pastix_int_t * treetab
Definition order.h:54
pastix_int_t * sndetab
Definition order.h:57
int8_t * selevtx
Definition order.h:55
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
pastix_int_t vertnbr
Definition order.h:49
void pastixOrderExpand(pastix_order_t *ordeptr, const spmatrix_t *spm)
This routine expand the permutation arrays and the rangtab when the spm is using multiple dof per unk...
Definition order.c:396
int pastixOrderAlloc(pastix_order_t *ordeptr, pastix_int_t vertnbr, pastix_int_t cblknbr)
Allocate the order structure.
Definition order.c:55
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
pastix_order_t * pastixOrderGet(const pastix_data_t *pastix_data)
This routine returns the pointer to the internal order structure to access permutation information.
Definition order.c:649
pastix_int_t * orderGetExpandedPeritab(pastix_order_t *ordeptr, const spmatrix_t *spm)
This routine expand the peritab array for multi-dof matrices.
Definition order.c:494
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 pastixOrderInit(pastix_order_t *ordeptr, pastix_int_t baseval, pastix_int_t vertnbr, pastix_int_t cblknbr, pastix_int_t *perm, pastix_int_t *invp, pastix_int_t *rang, pastix_int_t *tree)
Initialize the order structure with the given values.
Definition order.c:212
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
int pastixOrderAllocId(pastix_order_t *ordeptr, pastix_int_t vertnbr)
Allocate the order structure for a given number of vertices with no cblk, and id permutation.
Definition order.c:123
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_order_t * ordemesh
Definition pastixdata.h:98
Main PaStiX data structure.
Definition pastixdata.h:68