SuperLU Distributed 8.2.1
Distributed memory sparse direct solver
superlu_defs.h
Go to the documentation of this file.
1
38#ifndef __SUPERLU_DEFS /* allow multiple inclusions */
39#define __SUPERLU_DEFS
40
41/*
42 * File name: superlu_defs.h
43 * Purpose: Definitions which are precision-neutral
44 */
45#ifdef _CRAY
46 #include <fortran.h>
47#endif
48
49#ifdef _OPENMP
50 #include <omp.h>
51#endif
52
53
54#include <mpi.h>
55#include <stdlib.h>
56#include <stdio.h>
57#include <limits.h>
58#include <string.h>
59#include <ctype.h>
60// #include <stdatomic.h>
61#include <math.h>
62#include <stdint.h>
63//#include <malloc.h> Sherry: not available on Mac OS
64// /* Following is for vtune */
65// #if 0
66// #include <ittnotify.h>
67// #define USE_VTUNE
68// #endif
69#if defined(VTUNE) && VTUNE>=1
70#include <ittnotify.h>
71#endif
72
73/*************************************************************************
74 * Constants
75 **************************************************************************/
76/*
77 * You can support older version of SuperLU_DIST.
78 * At compile-time, you can catch the new release as:
79 * #ifdef SUPERLU_DIST_MAIN_VERSION == 5
80 * use the new interface
81 * #else
82 * use the old interface
83 * #endif
84 * Versions 4.x and earlier do not include a #define'd version numbers.
85 */
86#define SUPERLU_DIST_MAJOR_VERSION 8
87#define SUPERLU_DIST_MINOR_VERSION 2
88#define SUPERLU_DIST_PATCH_VERSION 1
89#define SUPERLU_DIST_RELEASE_DATE "November 17, 2023"
90
91#include "superlu_dist_config.h"
92
93#ifdef HAVE_CUDA
94#define GPU_ACC
95//#include "cublas_utils.h"
96#endif
97
98#ifdef HAVE_HIP
99#ifndef GPU_ACC
100#define GPU_ACC
101#endif
102#endif
103
104#ifdef GPU_ACC
105#include "gpu_api_utils.h"
106#endif
107
108
109/* Define my integer size int_t */
110#ifdef _CRAY
111 typedef short int_t;
112 /*#undef int Revert back to int of default size. */
113 #define mpi_int_t MPI_SHORT
114#elif defined (_LONGINT)
115 typedef int64_t int_t;
116 #define mpi_int_t MPI_LONG_LONG_INT
117 #define IFMT "%lld"
118#else /* Default */
119 typedef int int_t;
120 #define mpi_int_t MPI_INT
121 #define IFMT "%8d"
122#endif
123
124
125/* MPI C complex datatype */
126#define SuperLU_MPI_COMPLEX MPI_C_COMPLEX
127#define SuperLU_MPI_DOUBLE_COMPLEX MPI_C_DOUBLE_COMPLEX
128
129/* MPI_Datatype cannot be used in C typedef
130typedef MPI_C_COMPLEX SuperLU_MPI_COMPLEX;
131typedef MPI_C_DOUBLE_COMPLEX SuperLU_MPI_DOUBLE_COMPLEX;
132*/
133
135#include "superlu_FCnames.h"
136#include "superlu_enum_consts.h"
137#include "supermatrix.h"
138#include "util_dist.h"
139#include "psymbfact.h"
140
141
142#define MAX_SUPER_SIZE 512 /* Sherry: moved from superlu_gpu.cu */
143
144
145#define ISORT /* NOTE: qsort() has bug on Mac */
146
147/***********************************************************************
148 * Constants
149 ***********************************************************************/
150/*
151 * For each block column of L, the index[] array contains both the row
152 * subscripts and the integers describing the size of the blocks.
153 * The organization of index[] looks like:
154 *
155 * [ BLOCK COLUMN HEADER (size BC_HEADER)
156 * number of blocks
157 * number of row subscripts, i.e., LDA of nzval[]
158 * BLOCK 0 <----
159 * BLOCK DESCRIPTOR (of size LB_DESCRIPTOR) |
160 * block number (global) |
161 * number of full rows in the block |
162 * actual row subscripts |
163 * BLOCK 1 | Repeat ...
164 * BLOCK DESCRIPTOR | number of blocks
165 * block number (global) |
166 * number of full rows in the block |
167 * actual row subscripts |
168 * . |
169 * . |
170 * . <----
171 * ]
172 *
173 * For each block row of U, the organization of index[] looks like:
174 *
175 * [ BLOCK ROW HEADER (of size BR_HEADER)
176 * number of blocks
177 * number of entries in nzval[]
178 * number of entries in index[]
179 * BLOCK 0 <----
180 * BLOCK DESCRIPTOR (of size UB_DESCRIPTOR) |
181 * block number (global) |
182 * number of nonzeros in the block |
183 * actual fstnz subscripts |
184 * BLOCK 1 | Repeat ...
185 * BLOCK DESCRIPTOR | number of blocks
186 * block number (global) |
187 * number of nonzeros in the block |
188 * actual fstnz subscripts |
189 * . |
190 * . |
191 * . <----
192 * ]
193 *
194 */
195#define BC_HEADER 2
196#define LB_DESCRIPTOR 2
197#define BR_HEADER 3
198#define UB_DESCRIPTOR 2
199#define BC_HEADER_NEWU 3
200#define UB_DESCRIPTOR_NEWU 2
201#define NBUFFERS 5
202
203/*
204 * Communication tags
205 */
206/* Return the mpi_tag assuming 5 pairs of communications and MPI_TAG_UB >= 5 *
207 * for each supernodal column "num", the five communications are: *
208 * 0,1: for sending L to "right" *
209 * 2,3: for sending off-diagonal blocks of U "down" *
210 * 4 : for sending the diagonal blcok down (in pxgstrf2) */
211//#define SLU_MPI_TAG(id,num) ( (5*(num)+id) % tag_ub )
212
213 /* For numeric factorization. */
214#if 0
215#define NTAGS 10000
216#else
217#define NTAGS INT_MAX
218#endif
219#define UjROW 10
220#define UkSUB 11
221#define UkVAL 12
222#define LkSUB 13
223#define LkVAL 14
224#define LkkDIAG 15
225 /* For triangular solves. */
226#define XK_H 2 /* The header preceding each X block. */
227#define LSUM_H 2 /* The header preceding each MOD block. */
228#define GSUM 20
229#define Xk 21
230#define Yk 22
231#define LSUM 23
232
233
234static const int BC_L=1; /* MPI tag for x in L-solve*/
235static const int RD_L=2; /* MPI tag for lsum in L-solve*/
236static const int BC_U=3; /* MPI tag for x in U-solve*/
237static const int RD_U=4; /* MPI tag for lsum in U-solve*/
238
239/*
240 * Communication scopes
241 */
242#define COMM_ALL 100
243#define COMM_COLUMN 101
244#define COMM_ROW 102
245
246/*
247 * Matrix distribution for sparse matrix-vector multiplication
248 */
249#define SUPER_LINEAR 11
250#define SUPER_BLOCK 12
251
252/*
253 * No of marker arrays used in the symbolic factorization, each of size n
254 */
255#define NO_MARKER 3
256
257
258
259/***********************************************************************
260 * Macros
261 ***********************************************************************/
262#define IAM(comm) { int rank; MPI_Comm_rank ( comm, &rank ); rank};
263#define MYROW(iam,grid) ( (iam) / grid->npcol )
264#define MYCOL(iam,grid) ( (iam) % grid->npcol )
265#define BlockNum(i) ( supno[i] )
266#define FstBlockC(bnum) ( xsup[bnum] )
267#define SuperSize(bnum) ( xsup[bnum+1]-xsup[bnum] )
268#define LBi(bnum,grid) ( (bnum)/grid->nprow )/* Global to local block rowwise */
269#define LBj(bnum,grid) ( (bnum)/grid->npcol )/* Global to local block columnwise*/
270#define PROW(bnum,grid) ( (bnum) % grid->nprow )
271#define PCOL(bnum,grid) ( (bnum) % grid->npcol )
272#define PNUM(i,j,grid) ( (i)*grid->npcol + j ) /* Process number at coord(i,j) */
273#define CEILING(a,b) ( ((a)%(b)) ? ((a)/(b) + 1) : ((a)/(b)) )
274 /* For triangular solves */
275#define RHS_ITERATE(i) \
276 for (i = 0; i < nrhs; ++i)
277#define X_BLK(i) \
278 ilsum[i] * nrhs + (i+1) * XK_H
279#define LSUM_BLK(i) \
280 ilsum[i] * nrhs + (i+1) * LSUM_H
281
282#define SuperLU_timer_ SuperLU_timer_dist_
283#define LOG2(x) (log10((double) x) / log10(2.0))
284
285#if defined(VAMPIR) && VAMPIR>=1
286#define VT_TRACEON VT_traceon()
287#define VT_TRACEOFF VT_traceoff()
288#else
289#define VT_TRACEON
290#define VT_TRACEOFF
291#endif
292
293/* Support Windows */
294#ifndef SUPERLU_DIST_EXPORT
295#if defined(MSVC) && MSVC
296#ifdef SUPERLU_DIST_EXPORTS
297#define SUPERLU_DIST_EXPORT __declspec(dllexport)
298#else
299#define SUPERLU_DIST_EXPORT __declspec(dllimport)
300#endif /* SUPERLU_DIST_EXPORTS */
301#else
302#define SUPERLU_DIST_EXPORT
303#endif /* MSVC */
304#endif /* SUPERLU_DIST_EXPORT */
305
306
307/*
308 * CONSTANTS in MAGMA
309 */
310#ifndef MAGMA_CONST
311#define MAGMA_CONST
312
313// #define DIM_X 32
314// #define DIM_Y 16
315
316#define DIM_X 16
317#define DIM_Y 16
318
319
320#define BLK_M DIM_X*4
321#define BLK_N DIM_Y*4
322#define BLK_K 2048/(BLK_M)
323
324#define DIM_XA DIM_X
325#define DIM_YA DIM_Y
326#define DIM_XB DIM_X
327#define DIM_YB DIM_Y
328
329#define NWARP DIM_X*DIM_Y/32
330
331// // // // // // #define TILE_SIZE 32
332
333
334#define THR_M ( BLK_M / DIM_X )
335#define THR_N ( BLK_N / DIM_Y )
336
337#define fetch(A, m, n, bound) offs_d##A[min(n*LD##A+m, bound)]
338#define fma(A, B, C) C += (A*B)
339#endif
340/*---- end MAGMA ----*/
341
342#ifdef __cplusplus
343extern "C" {
344#endif
345
346
347#ifndef max
348 #define cmax(a,b) ((a) > (b) ? (a) : (b))
349#endif
350
351#ifdef __cplusplus
352 }
353#endif
354
355
356/***********************************************************************
357 * New data types
358 ***********************************************************************/
359
360/*
361 * Define the 2D mapping of matrix blocks to process grid.
362 *
363 * Process grid:
364 * Processes are numbered (0 : P-1).
365 * P = Pr x Pc, where Pr, Pc are the number of process rows and columns.
366 * (pr,pc) is the coordinate of IAM; 0 <= pr < Pr, 0 <= pc < Pc.
367 *
368 * Matrix blocks:
369 * Matrix is partitioned according to supernode partitions, both
370 * column and row-wise.
371 * The k-th block columns (rows) contains columns (rows) (s:t), where
372 * s=xsup[k], t=xsup[k+1]-1.
373 * Block A(I,J) contains
374 * rows from (xsup[I]:xsup[I+1]-1) and
375 * columns from (xsup[J]:xsup[J+1]-1)
376 *
377 * Mapping of matrix entry (i,j) to matrix block (I,J):
378 * (I,J) = ( supno[i], supno[j] )
379 *
380 * Mapping of matrix block (I,J) to process grid (pr,pc):
381 * (pr,pc) = ( MOD(I,NPROW), MOD(J,NPCOL) )
382 *
383 * (xsup[nsupers],supno[n]) are replicated on all processors.
384 *
385 */
386
387/*-- Communication subgroup */
388typedef struct {
389 MPI_Comm comm; /* MPI communicator */
390 int Np; /* number of processes */
391 int Iam; /* my process number */
393
394/*-- 2D process grid definition */
395typedef struct {
396 MPI_Comm comm; /* MPI communicator */
397 superlu_scope_t rscp; /* process scope in rowwise, horizontal directon */
398 superlu_scope_t cscp; /* process scope in columnwise, vertical direction */
399 int iam; /* my process number in this grid */
400 int_t nprow; /* number of process rows */
401 int_t npcol; /* number of process columns */
402} gridinfo_t;
403
404/*-- 3D process grid definition */
405typedef struct {
406 MPI_Comm comm; /* MPI communicator */
407 superlu_scope_t rscp; /* row scope */
408 superlu_scope_t cscp; /* column scope */
409 superlu_scope_t zscp; /* scope in third dimension */
410 gridinfo_t grid2d; /* for using 2D functions */
411 int iam; /* my process number in this grid */
412 int_t nprow; /* number of process rows */
413 int_t npcol; /* number of process columns */
414 int_t npdep; /* number of replication factor in Z-dimension */
415 int rankorder; /* = 0: Z-major ( default )
416 * e.g. 1x3x4 grid: layer0 layer1 layer2 layer3
417 * 0 3 6 9
418 * 1 4 7 10
419 * 2 5 8 11
420 * = 1: XY-major (need set env. var.: SUPERLU_RANKORDER=XY)
421 * e.g. 1x3x4 grid: layer0 layer1 layer2 layer3
422 * 0 1 2 3
423 * 4 5 6 7
424 * 8 9 10 11
425 */
427
428
429/*
430 *-- The structures are determined by SYMBFACT and used thereafter.
431 *
432 * (xsup,supno) describes mapping between supernode and column:
433 * xsup[s] is the leading column of the s-th supernode.
434 * supno[i] is the supernode no to which column i belongs;
435 * e.g. supno 0 1 2 2 3 3 3 4 4 4 4 4 (n=12)
436 * xsup 0 1 2 4 7 12
437 * Note: dfs will be performed on supernode rep. relative to the new
438 * row pivoting ordering
439 *
440 * This is allocated during symbolic factorization SYMBFACT.
441 */
442typedef struct {
443 int_t *xsup;
444 int_t *supno;
446
447/*
448 *-- The structures are determined by SYMBFACT and used by DDISTRIBUTE.
449 *
450 * (xlsub,lsub): lsub[*] contains the compressed subscript of
451 * rectangular supernodes; xlsub[j] points to the starting
452 * location of the j-th column in lsub[*]. Note that xlsub
453 * is indexed by column.
454 * Storage: original row subscripts
455 *
456 * During the course of sparse LU factorization, we also use
457 * (xlsub,lsub) for the purpose of symmetric pruning. For each
458 * supernode {s,s+1,...,t=s+r} with first column s and last
459 * column t, the subscript set
460 * lsub[j], j=xlsub[s], .., xlsub[s+1]-1
461 * is the structure of column s (i.e. structure of this supernode).
462 * It is used for the storage of numerical values.
463 * Furthermore,
464 * lsub[j], j=xlsub[t], .., xlsub[t+1]-1
465 * is the structure of the last column t of this supernode.
466 * It is for the purpose of symmetric pruning. Therefore, the
467 * structural subscripts can be rearranged without making physical
468 * interchanges among the numerical values.
469 *
470 * However, if the supernode has only one column, then we
471 * only keep one set of subscripts. For any subscript interchange
472 * performed, similar interchange must be done on the numerical
473 * values.
474 *
475 * The last column structures (for pruning) will be removed
476 * after the numercial LU factorization phase.
477 *
478 * (xusub,usub): xusub[i] points to the starting location of column i
479 * in usub[]. For each U-segment, only the row index of first nonzero
480 * is stored in usub[].
481 *
482 * Each U column consists of a number of full segments. Each full segment
483 * starts from a leading nonzero, running up to the supernode (block)
484 * boundary. (Recall that the column-wise supernode partition is also
485 * imposed on the rows.) Because the segment is full, we don't store all
486 * the row indices. Instead, only the leading nonzero index is stored.
487 * The rest can be found together with xsup/supno pair.
488 * For example,
489 * usub[xsub[j+1]] - usub[xsub[j]] = number of segments in column j.
490 * for any i in usub[],
491 * supno[i] = block number in which i belongs to
492 * xsup[supno[i]+1] = first row of the next block
493 * The nonzeros of this segment are:
494 * i, i+1 ... xsup[supno[i]+1]-1 (only i is stored in usub[])
495 *
496 */
497typedef struct {
498 int_t *lsub; /* compressed L subscripts */
499 int_t *xlsub;
500 int_t *usub; /* compressed U subscripts */
501 int_t *xusub;
502 int_t nzlmax; /* current max size of lsub */
503 int_t nzumax; /* " " " usub */
504 LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */
505 //int_t *llvl; /* keep track of level in L for level-based ILU */
506 //int_t *ulvl; /* keep track of level in U for level-based ILU */
507 int64_t nnzLU; /* number of nonzeros in L+U*/
509
510#if 0 // Sherry: move to precision-dependent file
511/*
512 *-- The structure used to store matrix A of the linear system and
513 * several vectors describing the transformations done to matrix A.
514 *
515 * A (SuperMatrix*)
516 * Matrix A in A*X=B, of dimension (A->nrow, A->ncol).
517 * The number of linear equations is A->nrow. The type of A can be:
518 * Stype = SLU_NC; Dtype = SLU_D; Mtype = SLU_GE.
519 *
520 * DiagScale (DiagScale_t)
521 * Specifies the form of equilibration that was done.
522 * = NOEQUIL: No equilibration.
523 * = ROW: Row equilibration, i.e., A was premultiplied by diag(R).
524 * = COL: Column equilibration, i.e., A was postmultiplied by diag(C).
525 * = BOTH: Both row and column equilibration, i.e., A was replaced
526 * by diag(R)*A*diag(C).
527 *
528 * R double*, dimension (A->nrow)
529 * The row scale factors for A.
530 * If DiagScale = ROW or BOTH, A is multiplied on the left by diag(R).
531 * If DiagScale = NOEQUIL or COL, R is not defined.
532 *
533 * C double*, dimension (A->ncol)
534 * The column scale factors for A.
535 * If DiagScale = COL or BOTH, A is multiplied on the right by diag(C).
536 * If DiagScale = NOEQUIL or ROW, C is not defined.
537 *
538 * perm_r (int*) dimension (A->nrow)
539 * Row permutation vector which defines the permutation matrix Pr,
540 * perm_r[i] = j means row i of A is in position j in Pr*A.
541 *
542 * perm_c (int*) dimension (A->ncol)
543 * Column permutation vector, which defines the
544 * permutation matrix Pc; perm_c[i] = j means column i of A is
545 * in position j in A*Pc.
546 *
547 */
548typedef struct {
549 DiagScale_t DiagScale;
550 double *R;
551 double *C;
552 int_t *perm_r;
553 int_t *perm_c;
554} ScalePermstruct_t;
555#endif
556
557/*-- Data structure for redistribution of B and X --*/
558typedef struct {
559 int *B_to_X_SendCnt;
560 int *X_to_B_SendCnt;
561 int *ptr_to_ibuf, *ptr_to_dbuf;
562
563 /* the following are needed in the hybrid solver PDSLin */
564 int *X_to_B_iSendCnt;
565 int *X_to_B_vSendCnt;
566 int *disp_ibuf;
567 int_t *send_ibuf;
568 void *send_dbuf;
569
570 int_t x2b, b2x;
571 int_t *send_ibuf2;
572 int_t *recv_ibuf2;
573 void *send_dbuf2;
574 void *recv_dbuf2;
576
577/*
578 *-- This contains the options used to control the solution process.
579 *
580 * Fact (fact_t)
581 * Specifies whether or not the factored form of the matrix
582 * A is supplied on entry, and if not, how the matrix A should
583 * be factorizaed.
584 * = DOFACT: The matrix A will be factorized from scratch, and the
585 * factors will be stored in L and U.
586 * = SamePattern: The matrix A will be factorized assuming
587 * that a factorization of a matrix with the same sparsity
588 * pattern was performed prior to this one. Therefore, this
589 * factorization will reuse column permutation vector
590 * ScalePermstruct->perm_c and the column elimination tree
591 * LUstruct->etree.
592 * = SamePattern_SameRowPerm: The matrix A will be factorized
593 * assuming that a factorization of a matrix with the same
594 * sparsity pattern and similar numerical values was performed
595 * prior to this one. Therefore, this factorization will reuse
596 * both row and column scaling factors R and C, both row and
597 * column permutation vectors perm_r and perm_c, and the
598 * data structure set up from the previous symbolic factorization.
599 * = FACTORED: On entry, L, U, perm_r and perm_c contain the
600 * factored form of A. If DiagScale is not NOEQUIL, the matrix
601 * A has been equilibrated with scaling factors R and C.
602 *
603 * Equil (yes_no_t)
604 * Specifies whether to equilibrate the system (scale A's row and
605 * columns to have unit norm).
606 *
607 * DiagInv (yes_no_t)
608 * Specifies whether to invert the diagonal blocks of the LU
609 * triangular matrices.
610 *
611 * ColPerm (colperm_t)
612 * Specifies what type of column permutation to use to reduce fill.
613 * = NATURAL: use the natural ordering
614 * = MMD_ATA: use minimum degree ordering on structure of A'*A
615 * = MMD_AT_PLUS_A: use minimum degree ordering on structure of A'+A
616 * = COLAMD: use approximate minimum degree column ordering
617 * = MY_PERMC: use the ordering specified by the user
618 *
619 * Trans (trans_t)
620 * Specifies the form of the system of equations:
621 * = NOTRANS: A * X = B (No transpose)
622 * = TRANS: A**T * X = B (Transpose)
623 * = CONJ: A**H * X = B (Transpose)
624 *
625 * IterRefine (IterRefine_t)
626 * Specifies whether to perform iterative refinement.
627 * = NO: no iterative refinement
628 * = SINGLE: perform iterative refinement in single precision
629 * = DOUBLE: perform iterative refinement in double precision
630 * = EXTRA: perform iterative refinement in extra precision
631 *
632 * DiagPivotThresh (double, in [0.0, 1.0]) (only for serial SuperLU)
633 * Specifies the threshold used for a diagonal entry to be an
634 * acceptable pivot.
635 *
636 * SymmetricMode (yest_no_t) (only for serial SuperLU)
637 * Specifies whether to use symmetric mode. Symmetric mode gives
638 * preference to diagonal pivots, and uses an (A'+A)-based column
639 * permutation algorithm.
640 *
641 * PivotGrowth (yes_no_t) (only for serial SuperLU)
642 * Specifies whether to compute the reciprocal pivot growth.
643 *
644 * ConditionNumber (ues_no_t) (only for serial SuperLU)
645 * Specifies whether to compute the reciprocal condition number.
646 *
647 * RowPerm (rowperm_t) (only for SuperLU_DIST or ILU in serial SuperLU)
648 * Specifies whether to permute rows of the original matrix.
649 * = NO: not to permute the rows
650 * = LargeDiag: make the diagonal large relative to the off-diagonal
651 * = MY_PERMR: use the permutation given by the user
652 *
653 * ILU_DropRule (int) (only for serial SuperLU)
654 * Specifies the dropping rule:
655 * = DROP_BASIC: Basic dropping rule, supernodal based ILUTP(tau).
656 * = DROP_PROWS: Supernodal based ILUTP(p,tau), p = gamma * nnz(A)/n.
657 * = DROP_COLUMN: Variant of ILUTP(p,tau), for j-th column,
658 * p = gamma * nnz(A(:,j)).
659 * = DROP_AREA: Variation of ILUTP, for j-th column, use
660 * nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
661 * = DROP_DYNAMIC: Modify the threshold tau during factorizaion:
662 * If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
663 * tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
664 * Otherwise
665 * tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
666 * tau_U(j) uses the similar rule.
667 * NOTE: the thresholds used by L and U are separate.
668 * = DROP_INTERP: Compute the second dropping threshold by
669 * interpolation instead of sorting (default).
670 * In this case, the actual fill ratio is not
671 * guaranteed to be smaller than gamma.
672 * Note: DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
673 * ( Default: DROP_BASIC | DROP_AREA )
674 *
675 * ILU_DropTol (double) (only for serial SuperLU)
676 * numerical threshold for dropping.
677 *
678 * ILU_FillFactor (double) (only for serial SuperLU)
679 * Gamma in the secondary dropping.
680 *
681 * ILU_Norm (norm_t) (only for serial SuperLU)
682 * Specify which norm to use to measure the row size in a
683 * supernode: infinity-norm, 1-norm, or 2-norm.
684 *
685 * ILU_FillTol (double) (only for serial SuperLU)
686 * numerical threshold for zero pivot perturbation.
687 *
688 * ILU_MILU (milu_t) (only for serial SuperLU)
689 * Specifies which version of MILU to use.
690 *
691 * ILU_MILU_Dim (double)
692 * Dimension of the PDE if available.
693 *
694 * ReplaceTinyPivot (yes_no_t) (only for SuperLU_DIST)
695 * Specifies whether to replace the tiny diagonals by
696 * sqrt(epsilon)*||A|| during LU factorization.
697 *
698 * SolveInitialized (yes_no_t) (only for SuperLU_DIST)
699 * Specifies whether the initialization has been performed to the
700 * triangular solve.
701 *
702 * RefineInitialized (yes_no_t) (only for SuperLU_DIST)
703 * Specifies whether the initialization has been performed to the
704 * sparse matrix-vector multiplication routine needed in iterative
705 * refinement.
706 *
707 * num_lookaheads (int) (only for SuperLU_DIST)
708 * Specifies the number of levels in the look-ahead factorization
709 *
710 * lookahead_etree (yes_no_t) (only for SuperLU_DIST)
711 * Specifies whether to use the elimination tree computed from the
712 * serial symbolic factorization to perform scheduling.
713 *
714 * SymPattern (yes_no_t) (only for SuperLU_DIST)
715 * Gives the scheduling algorithm a hint whether the matrix
716 * would have symmetric pattern.
717 *
718 */
719typedef struct {
720 fact_t Fact;
721 yes_no_t Equil;
722 yes_no_t DiagInv;
723 colperm_t ColPerm;
724 trans_t Trans;
725 IterRefine_t IterRefine;
726 double DiagPivotThresh;
727 yes_no_t SymmetricMode;
728 yes_no_t PivotGrowth;
729 yes_no_t ConditionNumber;
730 rowperm_t RowPerm;
731 int ILU_DropRule;
732 double ILU_DropTol; /* threshold for dropping */
733 double ILU_FillFactor; /* gamma in the secondary dropping */
734 norm_t ILU_Norm; /* infinity-norm, 1-norm, or 2-norm */
735 double ILU_FillTol; /* threshold for zero pivot perturbation */
736 milu_t ILU_MILU;
737 double ILU_MILU_Dim; /* Dimension of PDE (if available) */
738 yes_no_t ParSymbFact;
739 yes_no_t ReplaceTinyPivot; /* used in SuperLU_DIST */
740 yes_no_t SolveInitialized;
741 yes_no_t RefineInitialized;
742 yes_no_t PrintStat;
743 //int nnzL, nnzU; /* used to store nnzs for now */
744 yes_no_t lookahead_etree; /* use etree computed from the
745 serial symbolic factorization */
746 int num_lookaheads; /* num of levels in look-ahead */
747 int superlu_relax; /* max. allowed relaxed supernode size; see sp_ienv(2) */
748 int superlu_maxsup; /* max. allowed supernode size; see sp_ienv(3) */
749 char superlu_rankorder[4]; /* Z-major or XY-majir order in 3D grid */
750 char superlu_lbs[4]; /* etree load balancing strategy in 3D algorithm */
751 int superlu_n_gemm; /* one of GEMM offload criteria; see sp_ienv(7) */
752 int superlu_max_buffer_size; /* max. buffer size on GPU; see sp_ienv(8) */
753 int superlu_num_gpu_streams; /* number of GPU streams; see sp_ienv(9) */
754 int superlu_acc_offload; /* whether to offload work to GPU; see sp_ienv(10) */
755 yes_no_t SymPattern; /* symmetric factorization */
756 yes_no_t Use_TensorCore; /* Use Tensor Core or not */
757 yes_no_t Algo3d; /* use 3D factorization/solve algorithms */
759
760typedef struct {
761 float for_lu;
762 float total;
763 int expansions;
764 int64_t nnzL, nnzU;
766
767/*-- Auxiliary data type used in PxGSTRS/PxGSTRS1. */
768typedef struct {
769 int_t lbnum; /* Row block number (local). */
770 int_t indpos; /* Starting position in Uindex[]. */
772
773/*
774 *-- The new structures added in the hybrid GPU + OpenMP + MPI code.
775 */
776typedef struct {
777 int_t rukp;
778 int_t iukp;
779 int_t jb;
780 int_t full_u_cols;
781 int_t eo; /* order of elimination. For 3D algorithm */
782 int_t ncols;
783 int_t StCol;
785
786typedef struct {
787 int_t lptr;
788 int_t ib;
789 int_t eo; /* order of elimination, for 3D code */
790 int_t nrows;
791 int_t FullRow;
792 int_t StRow;
794
795typedef struct
796{
797 int id, key;
798 void *next;
799} etree_node;
800
801struct superlu_pair
802{
803 int ind;
804 int val;
805};
806
809/*==== For 3D code ====*/
810
811typedef struct
812{
813 int_t nub;
814 int_t klst;
815 int_t ldu;
816 int_t* usub;
817 //double *uval;
819
820typedef struct
821{
822 int_t *lsub;
823 //double *lusup;
824 void *lusup;
825 int_t luptr0;
826 int_t nlb; //number of l blocks
827 int_t nsupr;
829
830typedef struct
831{
832 Ublock_info_t* Ublock_info;
833 Remain_info_t* Remain_info;
834 uPanelInfo_t* uPanelInfo;
835 lPanelInfo_t* lPanelInfo;
837
838
839/* HyP_t is the data structure to assist HALO offload of Schur-complement. */
840typedef struct
841{
842 Remain_info_t *lookAhead_info, *Remain_info;
843 Ublock_info_t *Ublock_info, *Ublock_info_Phi;
844
845 int_t first_l_block_acc , first_u_block_acc;
846 int_t last_offload ;
847 int_t *Lblock_dirty_bit, * Ublock_dirty_bit;
848 void *lookAhead_L_buff, *Remain_L_buff;
849 int_t lookAheadBlk; /* number of blocks in look-ahead window */
850 int_t RemainBlk ; /* number of blocks outside look-ahead window */
851 int_t num_look_aheads, nsupers;
852 int_t ldu, ldu_Phi;
853 int_t num_u_blks, num_u_blks_Phi;
854
855 int_t jj_cpu;
856 void *bigU_Phi;
858 int_t Lnbrow;
859 int_t Rnbrow;
860
861 int_t buffer_size;
862 int_t bigu_size;
866} HyP_t;
867
868
869
870/* return the mpi_tag assuming 5 pairs of communications and MPI_TAG_UB >= 5 *
871 * for each supernodal column, the five communications are: *
872 * 0,1: for sending L to "right" *
873 * 2,3: for sending off-diagonal blocks of U "down" *
874 * 4 : for sending the diagonal blcok down (in pxgstrf2) */
875// int tag_ub;
876// #define SLU_MPI_TAG(id,num) ( (5*(num)+id) % tag_ub )
877
878// #undef SLU_MPI_TAG
879/*defining my own MPI tags */
880/* return the mpi_tag assuming 5 pairs of communications and MPI_TAG_UB >= 5 *
881 * for each supernodal column, the five communications are: *
882 * 0,1: for sending L to "right" *
883 * 2,3: for sending off-diagonal blocks of U "down" *
884 * 4 : for sending the diagonal blcok down (in pxgstrf2) *
885 * 5 : for sending the diagonal L block right () : added by piyush */
886#define SLU_MPI_TAG(id,num) ( (6*(num)+id) % tag_ub )
887
888/*structs for quick look up */
889typedef struct
890{
891 int_t luptrj;
892 int_t lptrj;
893 int_t lib;
895
896typedef struct
897{
898 int_t iuip;
899 int_t ruip;
900 int_t ljb;
902
903
904//global variable
905// extern double CPU_CLOCK_RATE;
906
907typedef struct
908{
909 int_t *perm_c_supno;
910 int_t *iperm_c_supno;
912
913typedef struct
914{
916 int_t* factored_D;
917 int_t* factored_L;
918 int_t* factored_U;
919 int_t* IrecvPlcd_D;
920 int_t* IbcastPanel_L; /*I bcast and recv placed for the k-th L panel*/
921 int_t* IbcastPanel_U; /*I bcast and recv placed for the k-th U panel*/
922 int_t* numChildLeft; /*number of children left to be factored*/
923 int_t* gpuLUreduced; /*New for GPU acceleration*/
925
926typedef struct
927{
928 int_t next_col;
929 int_t next_k;
930 int_t kljb;
931 int_t kijb;
932 int_t copyL_kljb;
933 int_t copyU_kljb;
934 int_t l_copy_len;
935 int_t u_copy_len;
936 int_t *kindexL;
937 int_t *kindexU;
938 int_t mkrow;
939 int_t mkcol;
940 int_t ksup_size;
942
943typedef struct{
944 int_t numChild;
945 int_t numDescendents;
946 int_t left;
947 int_t right;
948 int_t extra;
949 int_t* childrenList;
950 int_t depth; // distance from the top
951 double weight; // weight of the supernode
952 double iWeight; // weight of the whole subtree below
953 double scuWeight; // weight of schur complement update = max|n_k||L_k||U_k|
954} treeList_t;
955
956typedef struct
957{
958 int_t numLvl; // number of level in tree;
959 int_t* eTreeTopLims; // boundaries of each level of size
960 int_t* myIperm; // Iperm for my tree size nsupers;
961
963
964typedef struct
965{
966 int_t* setree; // global supernodal elimination tree
967 int_t* numChildLeft;
968} gEtreeInfo_t;
969
970typedef enum treePartStrat{
971 ND, // nested dissection ordering or natural ordering
972 GD // greedy load balance stregy
974
975typedef struct
976{
977 /* data */
978 int_t nNodes; // total number of nodes
979 int_t* nodeList; // list of nodes, should be in order of factorization
980#if 0 // Sherry: the following array is used on rForest_t. ???
981 int_t* treeHeads;
982#endif
983 /*topological information about the tree*/
984 int_t numLvl; // number of Topological levels in the forest
985 int_t numTrees; // number of tree in the forest
986 treeTopoInfo_t topoInfo; //
987#if 0 // Sherry fix: the following two structures are in treeTopoInfo_t. ???
988 int_t* eTreeTopLims; // boundaries of each level of size
989 int_t* myIperm; // Iperm for my tree size nsupers;
990#endif
991
992 /*information about load balance*/
993 double weight; // estimated cost
994 double cost; // measured cost
995
996} sForest_t;
997
998typedef struct
999{
1000 /* data */
1001 MPI_Request* L_diag_blk_recv_req;
1002 MPI_Request* L_diag_blk_send_req;
1003 MPI_Request* U_diag_blk_recv_req;
1004 MPI_Request* U_diag_blk_send_req;
1005 MPI_Request* recv_req;
1006 MPI_Request* recv_requ;
1007 MPI_Request* send_req;
1008 MPI_Request* send_requ;
1010
1011typedef struct
1012{
1013 int_t *iperm_c_supno;
1014 int_t *iperm_u;
1015 int_t *perm_u;
1016 int *indirect;
1017 int *indirect2;
1019
1020typedef struct
1021{
1022 int* msgcnt;
1023 int* msgcntU;
1024} msgs_t;
1025
1026typedef struct xtrsTimer_t
1027{
1028 double trsDataSendXY;
1029 double trsDataSendZ;
1030 double trsDataRecvXY;
1031 double trsDataRecvZ;
1034 double t_forwardSolve;
1035 double tfs_compute;
1036 double tfs_comm;
1037 double t_backwardSolve;
1038 double tbs_compute;
1039 double tbs_comm;
1040 double tbs_tree[2*MAX_3D_LEVEL];
1041 double tfs_tree[2*MAX_3D_LEVEL];
1042
1043 // counters for communication and computation volume
1044
1049
1050 double ppXmem; // perprocess X-memory
1052
1053/*==== end For 3D code ====*/
1054
1055/*====================*/
1056
1057/***********************************************************************
1058 * Function prototypes
1059 ***********************************************************************/
1060
1061#ifdef __cplusplus
1062extern "C" {
1063#endif
1064
1065extern void superlu_gridinit(MPI_Comm, int, int, gridinfo_t *);
1066extern void superlu_gridmap(MPI_Comm, int, int, int [], int, gridinfo_t *);
1067extern void superlu_gridexit(gridinfo_t *);
1068extern void superlu_gridinit3d(MPI_Comm Bcomm, int nprow, int npcol, int npdep,
1069 gridinfo3d_t *grid) ;
1070extern void superlu_gridmap3d(MPI_Comm, int, int, int, int [], gridinfo3d_t *);
1071extern void superlu_gridexit3d(gridinfo3d_t *grid);
1072
1083 SuperMatrix*);
1084extern int sp_symetree_dist(int_t *, int_t *, int_t *, int_t, int_t *);
1085extern int sp_coletree_dist (int_t *, int_t *, int_t *, int_t, int_t, int_t *);
1086extern void get_perm_c_dist(int_t, int_t, SuperMatrix *, int_t *);
1087extern void at_plus_a_dist(const int_t, const int_t, int_t *, int_t *,
1088 int_t *, int_t **, int_t **);
1089extern int genmmd_dist_(int_t *, int_t *, int_t *a,
1090 int_t *, int_t *, int_t *, int_t *,
1091 int_t *, int_t *, int_t *, int_t *, int_t *);
1092extern void bcast_tree(void *, int, MPI_Datatype, int, int,
1093 gridinfo_t *, int, int *);
1097 fact_t, void *, int_t, int_t, int_t, int_t,
1100 Glu_freeable_t *);
1102extern void countnz_dist (const int_t, int_t *, int_t *, int_t *,
1104extern int64_t fixupL_dist (const int_t, const int_t *, Glu_persist_t *,
1105 Glu_freeable_t *);
1106extern int_t *TreePostorder_dist (int_t, int_t *);
1107extern float smach_dist(char *);
1108extern double dmach_dist(char *);
1109extern void *superlu_malloc_dist (size_t);
1110extern void superlu_free_dist (void*);
1111extern int *int32Malloc_dist (int);
1112extern int *int32Calloc_dist (int);
1113extern int_t *intMalloc_dist (int_t);
1114extern int_t *intCalloc_dist (int_t);
1115extern int mc64id_dist(int *);
1116extern void arrive_at_ublock (int_t, int_t *, int_t *, int_t *,
1117 int_t *, int_t *, int_t, int_t,
1118 int_t *, int_t *, int_t *, gridinfo_t *);
1120 gridinfo_t *, int_t *, int_t*);
1121
1122/* Auxiliary routines */
1123extern double SuperLU_timer_ (void);
1124extern void superlu_abort_and_exit_dist(char *);
1125extern int sp_ienv_dist (int, superlu_dist_options_t *);
1126extern void ifill_dist (int_t *, int_t, int_t);
1127extern void super_stats_dist (int_t, int_t *);
1129 int_t **, int_t **);
1131extern int xerr_dist (char *, int *);
1132extern void pxerr_dist (char *, gridinfo_t *, int_t);
1133extern void PStatInit(SuperLUStat_t *);
1134extern void PStatClear(SuperLUStat_t *);
1135extern void PStatFree(SuperLUStat_t *);
1137extern void log_memory(int64_t, SuperLUStat_t *);
1138extern void print_memorylog(SuperLUStat_t *, char *);
1139extern int superlu_dist_GetVersionNumber(int *, int *, int *);
1140extern void quickSort( int_t*, int_t, int_t, int_t);
1141extern void quickSortM( int_t*, int_t, int_t, int_t, int_t, int_t);
1142extern int_t partition( int_t*, int_t, int_t, int_t);
1144
1145/* Prototypes for parallel symbolic factorization */
1146extern float symbfact_dist
1147(superlu_dist_options_t *, int, int,
1148 SuperMatrix *, int_t *, int_t *, int_t *, int_t *,
1149 Pslu_freeable_t *, MPI_Comm *, MPI_Comm *, superlu_dist_mem_usage_t *);
1150
1151/* Get the column permutation using parmetis */
1152extern float get_perm_c_parmetis
1153(SuperMatrix *, int_t *, int_t *, int, int,
1154 int_t **, int_t **, gridinfo_t *, MPI_Comm *);
1155
1156/* Auxiliary routines for memory expansions used during
1157 the parallel symbolic factorization routine */
1158
1160(int, int_t, int_t, int_t, int_t, int, int, int,
1162
1166
1170
1173
1174#ifdef ISORT
1175extern void isort (int_t N, int_t *ARRAY1, int_t *ARRAY2);
1176extern void isort1 (int_t N, int_t *ARRAY);
1177#else
1178int superlu_sort_perm (const void *arg1, const void *arg2)
1179{
1180 const int_t *val1 = (const int_t *) arg1;
1181 const int_t *val2 = (const int_t *) arg2;
1182 return (*val2 < *val1);
1183}
1184#endif
1185
1186#ifdef GPU_ACC /* GPU related */
1188 int *, int *, int *, int,
1189 int, int, int *, int, int_t);
1190extern int_t get_gpublas_nb (void);
1191extern int_t get_num_gpu_streams (void);
1192extern int getnGPUStreams(void);
1193extern int get_mpi_process_per_gpu (void);
1194/*to print out various statistics from GPU activities*/
1195extern void printGPUStats(int nsupers, SuperLUStat_t *stat, gridinfo3d_t*);
1196#endif
1197
1198extern double estimate_cpu_time(int m, int n , int k);
1199
1200extern int get_thread_per_process(void);
1201extern int_t get_max_buffer_size (void);
1202extern int_t get_min (int_t *, int_t);
1203extern int compare_pair (const void *, const void *);
1204extern int_t static_partition (struct superlu_pair *, int_t, int_t *, int_t,
1205 int_t *, int_t *, int);
1206extern int get_acc_offload(void);
1207
1208
1209/* Routines for debugging */
1210extern void print_panel_seg_dist(int_t, int_t, int_t, int_t, int_t *, int_t *);
1211extern void check_repfnz_dist(int_t, int_t, int_t, int_t *);
1212extern int_t CheckZeroDiagonal(int_t, int_t *, int_t *, int_t *);
1213extern int check_perm_dist(char *what, int_t n, int_t *perm);
1214extern void PrintDouble5(char *, int_t, double *);
1215extern void PrintInt10(char *, int_t, int_t *);
1216extern void PrintInt32(char *, int, int *);
1217extern int file_PrintInt10(FILE *, char *, int_t, int_t *);
1218extern int file_PrintInt32(FILE *, char *, int, int *);
1219extern int file_PrintLong10(FILE *, char *, int_t, int_t *);
1220
1221/* Routines for Async_tree communication*/
1222
1223#ifndef __SUPERLU_ASYNC_TREE /* allow multiple inclusions */
1224#define __SUPERLU_ASYNC_TREE
1225typedef struct
1226{
1227 MPI_Request sendRequests_[2];
1228 MPI_Comm comm_;
1229 int myRoot_;
1230 int destCnt_;
1231 int myDests_[2];
1232 int myRank_;
1233 int msgSize_;
1234 int tag_;
1235 yes_no_t empty_;
1236 MPI_Datatype type_;
1237} C_Tree;
1238
1239#ifndef DEG_TREE
1240#define DEG_TREE 2
1241#endif
1242
1243#endif
1244
1245extern void C_RdTree_Create(C_Tree* tree, MPI_Comm comm, int* ranks, int rank_cnt, int msgSize, char precision);
1246extern void C_RdTree_Nullify(C_Tree* tree);
1247extern yes_no_t C_RdTree_IsRoot(C_Tree* tree);
1248extern void C_RdTree_forwardMessageSimple(C_Tree* Tree, void* localBuffer, int msgSize);
1249extern void C_RdTree_waitSendRequest(C_Tree* Tree);
1250
1251extern void C_BcTree_Create(C_Tree* tree, MPI_Comm comm, int* ranks, int rank_cnt, int msgSize, char precision);
1252extern void C_BcTree_Nullify(C_Tree* tree);
1253extern yes_no_t C_BcTree_IsRoot(C_Tree* tree);
1254extern void C_BcTree_forwardMessageSimple(C_Tree* tree, void* localBuffer, int msgSize);
1255extern void C_BcTree_waitSendRequest(C_Tree* tree);
1256
1257/*==== For 3D code ====*/
1258
1259extern void DistPrint(char* function_name, double value, char* Units, gridinfo_t* grid);
1260extern void DistPrint3D(char* function_name, double value, char* Units, gridinfo3d_t* grid3d);
1261extern void treeImbalance3D(gridinfo3d_t *grid3d, SCT_t* SCT);
1262extern void SCT_printComm3D(gridinfo3d_t *grid3d, SCT_t* SCT);
1263
1264// permutation from superLU default
1266 int_t *etree, Glu_persist_t *Glu_persist,
1267 int_t** Lrowind_bc_ptr, int_t** Ufstnz_br_ptr,
1268 gridinfo_t *);
1269
1270/* Manipulate counters */
1271extern void SCT_init(SCT_t*);
1272extern void SCT_print(gridinfo_t *grid, SCT_t* SCT);
1273extern void SCT_print3D(gridinfo3d_t *grid3d, SCT_t* SCT);
1274extern void SCT_free(SCT_t*);
1275
1276extern treeList_t* setree2list(int_t nsuper, int_t* setree );
1277extern int free_treelist(int_t nsuper, treeList_t* treeList);
1278
1279// int_t calcTreeWeight(int_t nsupers, treeList_t* treeList, int_t* xsup);
1280extern int_t calcTreeWeight(int_t nsupers, int_t*setree, treeList_t* treeList, int_t* xsup);
1281extern int_t getDescendList(int_t k, int_t*dlist, treeList_t* treeList);
1282extern int_t getCommonAncestorList(int_t k, int_t* alist, int_t* seTree, treeList_t* treeList);
1283extern int_t getCommonAncsCount(int_t k, treeList_t* treeList);
1284extern int_t* getPermNodeList(int_t nnode, // number of nodes
1285 int_t* nlist, int_t* perm_c_sup,int_t* iperm_c_sup);
1286extern int_t* getEtreeLB(int_t nnodes, int_t* perm_l, int_t* gTopOrder);
1287extern int_t* getSubTreeRoots(int_t k, treeList_t* treeList);
1288// int_t* treeList2perm(treeList_t* , ..);
1289extern int_t* merg_perms(int_t nperms, int_t* nnodes, int_t** perms);
1290// returns a concatenated permutation for three permutation arrays
1291
1292extern int_t* getGlobal_iperm(int_t nsupers, int_t nperms, int_t** perms,
1293 int_t* nnodes);
1294extern int_t log2i(int_t index);
1295extern int_t *supernodal_etree(int_t nsuper, int_t * etree, int_t* supno, int_t *xsup);
1296extern int_t testSubtreeNodelist(int_t nsupers, int_t numList, int_t** nodeList, int_t* nodeCount);
1297extern int_t testListPerm(int_t nodeCount, int_t* nodeList, int_t* permList, int_t* gTopLevel);
1298
1299/*takes supernodal elimination tree and for each
1300 supernode calculates "level" in elimination tree*/
1301extern int_t* topological_ordering(int_t nsuper, int_t* setree);
1302extern int_t* Etree_LevelBoundry(int_t* perm,int_t* tsort_etree, int_t nsuper);
1303
1304/*calculated boundries of the topological levels*/
1305extern int_t* calculate_num_children(int_t nsuper, int_t* setree);
1306extern void Print_EtreeLevelBoundry(int_t *Etree_LvlBdry, int_t max_level, int_t nsuper);
1307extern void print_etree_leveled(int_t *setree, int_t* tsort_etree, int_t nsuper);
1308extern void print_etree(int_t *setree, int_t* iperm, int_t nsuper);
1309extern int_t printFileList(char* sname, int_t nnodes, int_t*dlist, int_t*setree);
1310int* getLastDepBtree( int_t nsupers, treeList_t* treeList);
1311
1312/*returns array R with of size maxLevel with either 0 or 1
1313 R[i] = 1; then Tree[level-i] is set to zero= to only
1314 accumulate the results */
1315extern int_t* getReplicatedTrees( gridinfo3d_t* grid3d);
1316
1317/*returns indices in gNodeList of trees that belongs to my layer*/
1318extern int_t* getGridTrees( gridinfo3d_t* grid3d);
1319
1320
1321/*returns global nodelist*/
1322extern int_t** getNodeList(int_t maxLvl, int_t* setree, int_t* nnodes,
1323 int_t* treeHeads, treeList_t* treeList);
1324
1325/* calculate number of nodes in subtrees starting from treeHead[i]*/
1326extern int_t* calcNumNodes(int_t maxLvl, int_t* treeHeads, treeList_t* treeList);
1327
1328/*Returns list of (last) node of the trees */
1329extern int_t* getTreeHeads(int_t maxLvl, int_t nsupers, treeList_t* treeList);
1330
1331extern int_t* getMyIperm(int_t nnodes, int_t nsupers, int_t* myPerm);
1332
1333extern int_t* getMyTopOrder(int_t nnodes, int_t* myPerm, int_t* myIperm, int_t* setree );
1334
1335extern int_t* getMyEtLims(int_t nnodes, int_t* myTopOrder);
1336
1337
1338extern treeTopoInfo_t getMyTreeTopoInfo(int_t nnodes, int_t nsupers,
1339 int_t* myPerm,int_t* setree);
1340
1341extern sForest_t** getNestDissForests( int_t maxLvl, int_t nsupers, int_t*setree, treeList_t* treeList);
1342
1343extern int_t** getTreePermForest( int_t* myTreeIdxs, int_t* myZeroTrIdxs,
1344 sForest_t* sForests,
1345 int_t* perm_c_supno, int_t* iperm_c_supno,
1346 gridinfo3d_t* grid3d);
1347extern int_t** getTreePermFr( int_t* myTreeIdxs,
1348 sForest_t** sForests, gridinfo3d_t* grid3d);
1349extern int_t* getMyNodeCountsFr(int_t maxLvl, int_t* myTreeIdxs,
1350 sForest_t** sForests);
1351extern int_t** getNodeListFr(int_t maxLvl, sForest_t** sForests);
1352extern int_t* getNodeCountsFr(int_t maxLvl, sForest_t** sForests);
1353// int_t* getNodeToForstMap(int_t nsupers, sForest_t** sForests, gridinfo3d_t* grid3d);
1354extern int* getIsNodeInMyGrid(int_t nsupers, int_t maxLvl, int_t* myNodeCount, int_t** treePerm);
1355extern void printForestWeightCost(sForest_t** sForests, SCT_t* SCT, gridinfo3d_t* grid3d);
1356extern sForest_t** getGreedyLoadBalForests( int_t maxLvl, int_t nsupers, int_t* setree, treeList_t* treeList);
1357extern sForest_t** getForests( int_t maxLvl, int_t nsupers, int_t*setree, treeList_t* treeList);
1358
1359 /* from trfAux.h */
1361 gridinfo_t *grid, int_t **Lrowind_bc_ptr);
1362extern void getSCUweight(int_t nsupers, treeList_t* treeList, int_t* xsup,
1363 int_t** Lrowind_bc_ptr, int_t** Ufstnz_br_ptr,
1364 gridinfo3d_t * grid3d);
1365extern int Wait_LUDiagSend(int_t k, MPI_Request *U_diag_blk_send_req,
1366 MPI_Request *L_diag_blk_send_req,
1367 gridinfo_t *grid, SCT_t *SCT);
1368
1369extern int getNsupers(int n, Glu_persist_t *Glu_persist);
1370extern int set_tag_ub(void);
1371extern int getNumThreads(int);
1372extern int_t num_full_cols_U(int_t kk, int_t **Ufstnz_br_ptr, int_t *xsup,
1373 gridinfo_t *, int_t *, int_t *);
1374
1375#if 0 // Sherry: conflicting with existing routine
1376extern int_t estimate_bigu_size(int_t nsupers, int_t ldt, int_t**Ufstnz_br_ptr,
1377 Glu_persist_t *, gridinfo_t*, int_t* perm_u);
1378#endif
1379
1380extern int_t* getFactPerm(int_t);
1381extern int_t* getFactIperm(int_t*, int_t);
1382
1383extern int_t initCommRequests(commRequests_t* comReqs, gridinfo_t * grid);
1384extern int_t initFactStat(int_t nsupers, factStat_t* factStat);
1385extern int freeFactStat(factStat_t* factStat);
1387extern int freeFactNodelists(factNodelists_t* fNlists);
1388extern int_t initMsgs(msgs_t* msgs);
1390extern commRequests_t** initCommRequestsArr(int_t mxLeafNode, int_t ldt, gridinfo_t* grid);
1391extern int freeCommRequestsArr(int_t mxLeafNode, commRequests_t** comReqss);
1392
1393extern msgs_t** initMsgsArr(int_t numLA);
1394extern int freeMsgsArr(int_t numLA, msgs_t **msgss);
1395
1398
1399 /* from sec_structs.h */
1400extern int Cmpfunc_R_info (const void * a, const void * b);
1401extern int Cmpfunc_U_info (const void * a, const void * b);
1402extern int sort_R_info( Remain_info_t* Remain_info, int n );
1403extern int sort_U_info( Ublock_info_t* Ublock_info, int n );
1404extern int sort_R_info_elm( Remain_info_t* Remain_info, int n );
1405extern int sort_U_info_elm( Ublock_info_t* Ublock_info, int n );
1406
1407 /* from pdgstrs.h */
1408extern void printTRStimer(xtrsTimer_t *xtrsTimer, gridinfo3d_t *grid3d);
1409extern void initTRStimer(xtrsTimer_t *xtrsTimer, gridinfo_t *grid);
1410
1411 /* from p3dcomm.c */
1412extern int_t** getTreePerm( int_t* myTreeIdxs, int_t* myZeroTrIdxs,
1413 int_t* nodeCount, int_t** nodeList,
1414 int_t* perm_c_supno, int_t* iperm_c_supno,
1415 gridinfo3d_t* grid3d);
1416extern int_t* getMyNodeCounts(int_t maxLvl, int_t* myTreeIdxs, int_t* gNodeCount);
1417extern int_t checkIntVector3d(int_t* vec, int_t len, gridinfo3d_t* grid3d);
1418extern int_t reduceStat(PhaseType PHASE, SuperLUStat_t *stat, gridinfo3d_t * grid3d);
1419
1420 /* from communication_aux.h */
1421extern int_t Wait_LSend(int_t k, gridinfo_t *grid, int **ToSendR,
1422 MPI_Request *s, SCT_t*);
1423extern int_t Wait_USend(MPI_Request *, gridinfo_t *, SCT_t *);
1424extern int_t Check_LRecv(MPI_Request*, int* msgcnt);
1425extern int_t Wait_UDiagBlockSend(MPI_Request *, gridinfo_t *, SCT_t *);
1426extern int_t Wait_LDiagBlockSend(MPI_Request *, gridinfo_t *, SCT_t *);
1427extern int_t Wait_UDiagBlock_Recv(MPI_Request *, SCT_t *);
1428extern int_t Test_UDiagBlock_Recv(MPI_Request *, SCT_t *);
1429extern int_t Wait_LDiagBlock_Recv(MPI_Request *, SCT_t *);
1430extern int_t Test_LDiagBlock_Recv(MPI_Request *, SCT_t *);
1431extern int_t LDiagBlockRecvWait( int_t k, int_t* factored_U, MPI_Request *, gridinfo_t *);
1432
1433/*=====================*/
1434
1435#ifdef __cplusplus
1436 }
1437#endif
1438
1439#endif /* __SUPERLU_DEFS */
void superlu_free_dist(void *)
Definition: memory.c:168
void ifill_dist(int_t *, int_t, int_t)
Fills an integer array with a given value.
Definition: util.c:488
int_t Wait_USend(MPI_Request *, gridinfo_t *, SCT_t *)
Definition: communication_aux.c:56
void superlu_gridinit3d(MPI_Comm Bcomm, int nprow, int npcol, int npdep, gridinfo3d_t *grid)
All processes in the MPI communicator must call this routine.
Definition: superlu_grid3d.c:25
void PrintDouble5(char *, int_t, double *)
int_t num_full_cols_U(int_t kk, int_t **Ufstnz_br_ptr, int_t *xsup, gridinfo_t *, int_t *, int_t *)
Definition: util.c:944
int_t ** getTreePermForest(int_t *myTreeIdxs, int_t *myZeroTrIdxs, sForest_t *sForests, int_t *perm_c_supno, int_t *iperm_c_supno, gridinfo3d_t *grid3d)
void print_options_dist(superlu_dist_options_t *)
Print the options setting.
Definition: util.c:228
void C_BcTree_forwardMessageSimple(C_Tree *tree, void *localBuffer, int msgSize)
Definition: comm_tree.c:75
treePartStrat
Definition: superlu_defs.h:895
@ GD
Definition: superlu_defs.h:897
@ ND
Definition: superlu_defs.h:896
int getNsupers(int n, Glu_persist_t *Glu_persist)
Definition: trfAux.c:42
void superlu_gridexit3d(gridinfo3d_t *grid)
Definition: superlu_grid3d.c:256
int xerr_dist(char *, int *)
Definition: xerr_dist.c:26
void treeImbalance3D(gridinfo3d_t *grid3d, SCT_t *SCT)
Definition: sec_structs.c:532
int_t psymbfact_LUXpand_RL(int_t, int_t, int_t, int_t, int_t, int_t, Pslu_freeable_t *, Llu_symbfact_t *, vtcsInfo_symbfact_t *, psymbfact_stat_t *)
Definition: psymbfact_util.c:384
void print_etree(int_t *setree, int_t *iperm, int_t nsuper)
Definition: supernodal_etree.c:1045
int_t log2i(int_t index)
Definition: supernodal_etree.c:17
int_t partitionM(int_t *, int_t, int_t, int_t, int_t, int_t)
Definition: util.c:1125
void Destroy_CompCol_Matrix_dist(SuperMatrix *)
Definition: util.c:34
int_t getDescendList(int_t k, int_t *dlist, treeList_t *treeList)
Definition: supernodal_etree.c:259
void arrive_at_ublock(int_t, int_t *, int_t *, int_t *, int_t *, int_t *, int_t, int_t, int_t *, int_t *, int_t *, gridinfo_t *)
Definition: util.c:890
int_t * getMyNodeCountsFr(int_t maxLvl, int_t *myTreeIdxs, sForest_t **sForests)
Definition: supernodalForest.c:276
int_t Wait_UDiagBlockSend(MPI_Request *, gridinfo_t *, SCT_t *)
Definition: communication_aux.c:112
int_t * getMyTopOrder(int_t nnodes, int_t *myPerm, int_t *myIperm, int_t *setree)
Definition: supernodal_etree.c:852
int_t * getFactPerm(int_t)
Definition: trfAux.c:208
int free_treelist(int_t nsuper, treeList_t *treeList)
Definition: supernodal_etree.c:114
void C_BcTree_Nullify(C_Tree *tree)
Definition: comm_tree.c:56
int_t * getEtreeLB(int_t nnodes, int_t *perm_l, int_t *gTopOrder)
Definition: supernodal_etree.c:339
int_t initCommRequests(commRequests_t *comReqs, gridinfo_t *grid)
Definition: treeFactorization.c:227
int_t * calcNumNodes(int_t maxLvl, int_t *treeHeads, treeList_t *treeList)
Definition: supernodal_etree.c:733
int_t * getFactIperm(int_t *, int_t)
Definition: trfAux.c:221
void DistPrint(char *function_name, double value, char *Units, gridinfo_t *grid)
Definition: sec_structs.c:313
int_t * getPerm_c_supno(int_t nsupers, superlu_dist_options_t *, int_t *etree, Glu_persist_t *Glu_persist, int_t **Lrowind_bc_ptr, int_t **Ufstnz_br_ptr, gridinfo_t *)
Definition: trfAux.c:234
int_t * intMalloc_dist(int_t)
Definition: memory.c:219
int_t reduceStat(PhaseType PHASE, SuperLUStat_t *stat, gridinfo3d_t *grid3d)
Definition: util.c:1256
int_t * merg_perms(int_t nperms, int_t *nnodes, int_t **perms)
Definition: supernodal_etree.c:482
int sp_ienv_dist(int)
Definition: sp_ienv.c:73
int_t static_partition(struct superlu_pair *, int_t, int_t *, int_t, int_t *, int_t *, int)
Definition: util.c:864
int_t Wait_LDiagBlock_Recv(MPI_Request *, SCT_t *)
Definition: communication_aux.c:172
sForest_t ** getNestDissForests(int_t maxLvl, int_t nsupers, int_t *setree, treeList_t *treeList)
Definition: supernodalForest.c:62
int_t ** getNodeListFr(int_t maxLvl, sForest_t **sForests)
Definition: supernodalForest.c:232
void SCT_free(SCT_t *)
Definition: sec_structs.c:294
int_t get_min(int_t *, int_t)
Definition: util.c:847
double estimate_cpu_time(int m, int n, int k)
Definition: acc_aux.c:214
void countnz_dist(const int_t, int_t *, int_t *, int_t *, Glu_persist_t *, Glu_freeable_t *)
Definition: util.c:95
int sort_R_info(Remain_info_t *Remain_info, int n)
Definition: sec_structs.c:54
int_t * getTreeHeads(int_t maxLvl, int_t nsupers, treeList_t *treeList)
Definition: supernodal_etree.c:705
void log_memory(int64_t, SuperLUStat_t *)
Definition: util.c:783
int freeMsgsArr(int_t numLA, msgs_t **msgss)
Definition: treeFactorization.c:356
sForest_t ** getForests(int_t maxLvl, int_t nsupers, int_t *setree, treeList_t *treeList)
Definition: supernodalForest.c:29
int_t getCommonAncestorList(int_t k, int_t *alist, int_t *seTree, treeList_t *treeList)
Definition: supernodal_etree.c:290
void print_panel_seg_dist(int_t, int_t, int_t, int_t, int_t *, int_t *)
Diagnostic print of segment info after panel_dfs().
Definition: util.c:276
void superlu_abort_and_exit_dist(char *)
Definition: memory.c:48
int sort_R_info_elm(Remain_info_t *Remain_info, int n)
Definition: sec_structs.c:82
void Destroy_SuperNode_Matrix_dist(SuperMatrix *)
Definition: util.c:61
int_t initFactStat(int_t nsupers, factStat_t *factStat)
Definition: treeFactorization.c:274
int_t * getReplicatedTrees(gridinfo3d_t *grid3d)
Definition: supernodal_etree.c:815
void SCT_init(SCT_t *)
Definition: sec_structs.c:165
int sp_symetree_dist(int_t *, int_t *, int_t *, int_t, int_t *)
Symmetric elimination tree.
Definition: etree.c:156
int_t getBigUSize(int_t nsupers, gridinfo_t *grid, int_t **Lrowind_bc_ptr)
Definition: trfAux.c:162
int_t symbfact_SubXpand(int_t, int_t, int_t, MemType, int_t *, Glu_freeable_t *)
Definition: memory.c:433
void C_BcTree_Create(C_Tree *tree, MPI_Comm comm, int *ranks, int rank_cnt, int msgSize, char precision)
Definition: comm_tree.c:5
int_t symbfact_SubFree(Glu_freeable_t *)
Definition: memory.c:479
int freeFactNodelists(factNodelists_t *fNlists)
Definition: treeFactorization.c:327
float smach_dist(char *)
Definition: smach_dist.c:16
int_t ** getTreePerm(int_t *myTreeIdxs, int_t *myZeroTrIdxs, int_t *nodeCount, int_t **nodeList, int_t *perm_c_supno, int_t *iperm_c_supno, gridinfo3d_t *grid3d)
Definition: util.c:1190
int compare_pair(const void *, const void *)
Definition: util.c:799
void Destroy_CompCol_Permuted_dist(SuperMatrix *)
A is of type Stype==NCP.
Definition: util.c:73
int file_PrintInt10(FILE *, char *, int_t, int_t *)
Definition: util.c:628
int_t partition(int_t *, int_t, int_t, int_t)
Definition: util.c:1057
void super_stats_dist(int_t, int_t *)
Definition: util.c:542
int_t * getMyEtLims(int_t nnodes, int_t *myTopOrder)
Definition: supernodal_etree.c:886
void PStatPrint(superlu_dist_options_t *, SuperLUStat_t *, gridinfo_t *)
Definition: util.c:308
void get_perm_c_dist(int_t, int_t, SuperMatrix *, int_t *)
Definition: get_perm_c.c:464
int_t * getNodeCountsFr(int_t maxLvl, sForest_t **sForests)
Definition: supernodalForest.c:214
yes_no_t C_BcTree_IsRoot(C_Tree *tree)
Definition: comm_tree.c:71
void PStatInit(SuperLUStat_t *)
Definition: util.c:290
void C_RdTree_waitSendRequest(C_Tree *Tree)
Definition: comm_tree.c:186
void print_sp_ienv_dist(superlu_dist_options_t *)
Print the blocking parameters.
Definition: util.c:252
int_t testSubtreeNodelist(int_t nsupers, int_t numList, int_t **nodeList, int_t *nodeCount)
Definition: supernodal_etree.c:407
int_t symbfact(superlu_dist_options_t *, int, SuperMatrix *, int_t *, int_t *, Glu_persist_t *, Glu_freeable_t *)
Definition: symbfact.c:82
int Wait_LUDiagSend(int_t k, MPI_Request *U_diag_blk_send_req, MPI_Request *L_diag_blk_send_req, gridinfo_t *grid, SCT_t *SCT)
Definition: communication_aux.c:195
int sort_U_info_elm(Ublock_info_t *Ublock_info, int n)
Definition: sec_structs.c:90
void PStatFree(SuperLUStat_t *)
Definition: util.c:480
float get_perm_c_parmetis(SuperMatrix *, int_t *, int_t *, int, int, int_t **, int_t **, gridinfo_t *, MPI_Comm *)
Definition: get_perm_c_parmetis.c:104
int mc64id_dist(int *)
Definition: mc64ad_dist.c:57
int_t QuerySpace_dist(int_t, int_t, Glu_freeable_t *, superlu_dist_mem_usage_t *)
Definition: memory.c:617
int_t Test_UDiagBlock_Recv(MPI_Request *, SCT_t *)
Definition: communication_aux.c:161
void at_plus_a_dist(const int_t, const int_t, int_t *, int_t *, int_t *, int_t **, int_t **)
Definition: get_perm_c.c:301
double dmach_dist(char *)
Definition: dmach_dist.c:16
void get_diag_procs(int_t, Glu_persist_t *, gridinfo_t *, int_t *, int_t **, int_t **)
Definition: util.c:495
int sp_coletree_dist(int_t *, int_t *, int_t *, int_t, int_t, int_t *)
Nonsymmetric elimination tree.
Definition: etree.c:223
int_t Wait_LDiagBlockSend(MPI_Request *, gridinfo_t *, SCT_t *)
Definition: communication_aux.c:132
int_t Trs2_InitUblock_info(int_t klst, int_t nb, Ublock_info_t *, int_t *usub, Glu_persist_t *, SuperLUStat_t *)
Definition: trfAux.c:1172
int_t ** getNodeList(int_t maxLvl, int_t *setree, int_t *nnodes, int_t *treeHeads, treeList_t *treeList)
Definition: supernodal_etree.c:759
int * int32Calloc_dist(int)
Definition: memory.c:209
int Cmpfunc_U_info(const void *a, const void *b)
Definition: sec_structs.c:48
int_t getNumLookAhead(superlu_dist_options_t *)
Definition: treeFactorization.c:385
int superlu_dist_GetVersionNumber(int *, int *, int *)
Definition: superlu_dist_version.c:22
int_t Check_LRecv(MPI_Request *, int *msgcnt)
Definition: communication_aux.c:79
struct xtrsTimer_t xtrsTimer_t
int set_tag_ub()
Definition: trfAux.c:48
void C_RdTree_forwardMessageSimple(C_Tree *Tree, void *localBuffer, int msgSize)
Definition: comm_tree.c:169
int get_acc_offload()
Definition: sec_structs.c:582
void printForestWeightCost(sForest_t **sForests, SCT_t *SCT, gridinfo3d_t *grid3d)
Definition: supernodalForest.c:352
yes_no_t C_RdTree_IsRoot(C_Tree *tree)
Definition: comm_tree.c:164
int * int32Malloc_dist(int)
Definition: memory.c:202
void Destroy_CompRow_Matrix_dist(SuperMatrix *)
Definition: util.c:53
void PrintInt32(char *, int, int *)
Definition: util.c:614
int_t LDiagBlockRecvWait(int_t k, int_t *factored_U, MPI_Request *, gridinfo_t *)
Definition: communication_aux.c:218
float symbfact_dist(int, int, SuperMatrix *, int_t *, int_t *, int_t *, int_t *, Pslu_freeable_t *, MPI_Comm *, MPI_Comm *, superlu_dist_mem_usage_t *)
Definition: psymbfact.c:142
void getSCUweight(int_t nsupers, treeList_t *treeList, int_t *xsup, int_t **Lrowind_bc_ptr, int_t **Ufstnz_br_ptr, gridinfo3d_t *grid3d)
Definition: trfAux.c:1205
treeList_t * setree2list(int_t nsuper, int_t *setree)
Definition: supernodal_etree.c:71
int_t Wait_UDiagBlock_Recv(MPI_Request *, SCT_t *)
Definition: communication_aux.c:152
int_t checkIntVector3d(int_t *vec, int_t len, gridinfo3d_t *grid3d)
Definition: util.c:1219
int_t ** getTreePermFr(int_t *myTreeIdxs, sForest_t **sForests, gridinfo3d_t *grid3d)
Definition: supernodalForest.c:290
void print_memorylog(SuperLUStat_t *, char *)
Definition: util.c:793
int64_t fixupL_dist(const int_t, const int_t *, Glu_persist_t *, Glu_freeable_t *)
Definition: util.c:158
void printTRStimer(xtrsTimer_t *xtrsTimer, gridinfo3d_t *grid3d)
int_t * getSubTreeRoots(int_t k, treeList_t *treeList)
Definition: supernodal_etree.c:378
void SCT_print(gridinfo_t *grid, SCT_t *SCT)
Definition: sec_structs.c:433
void superlu_gridmap(MPI_Comm, int, int, int[], int, gridinfo_t *)
All processes in the MPI communicator must call this routine.
Definition: superlu_grid.c:87
int_t calcTreeWeight(int_t nsupers, int_t *setree, treeList_t *treeList, int_t *xsup)
Definition: supernodal_etree.c:183
int get_mpi_process_per_gpu()
Definition: util.c:1528
int_t * getGridTrees(gridinfo3d_t *grid3d)
Definition: supernodal_etree.c:802
int_t * topological_ordering(int_t nsuper, int_t *setree)
Definition: supernodal_etree.c:54
int_t * calculate_num_children(int_t nsuper, int_t *setree)
Definition: supernodal_etree.c:958
int * getIsNodeInMyGrid(int_t nsupers, int_t maxLvl, int_t *myNodeCount, int_t **treePerm)
Definition: supernodalForest.c:305
void pxerr_dist(char *, gridinfo_t *, int_t)
Definition: pxerr_dist.c:27
int_t * getPermNodeList(int_t nnode, int_t *nlist, int_t *perm_c_sup, int_t *iperm_c_sup)
Definition: supernodal_etree.c:317
int_t * getMyNodeCounts(int_t maxLvl, int_t *myTreeIdxs, int_t *gNodeCount)
Definition: util.c:1208
int * getLastDepBtree(int_t nsupers, treeList_t *treeList)
int freeCommRequestsArr(int_t mxLeafNode, commRequests_t **comReqss)
Definition: treeFactorization.c:257
int getNumThreads(int)
Definition: trfAux.c:61
int_t psymbfact_LUXpandMem(int_t, int_t, int_t, int_t, int_t, int_t, int_t, int_t, Pslu_freeable_t *, Llu_symbfact_t *, vtcsInfo_symbfact_t *, psymbfact_stat_t *)
Definition: psymbfact_util.c:91
int file_PrintInt32(FILE *, char *, int, int *)
Definition: util.c:643
int_t testListPerm(int_t nodeCount, int_t *nodeList, int_t *permList, int_t *gTopLevel)
Definition: supernodal_etree.c:436
int_t * getMyIperm(int_t nnodes, int_t nsupers, int_t *myPerm)
Definition: supernodal_etree.c:835
int sort_U_info(Ublock_info_t *Ublock_info, int n)
Definition: sec_structs.c:61
int file_PrintLong10(FILE *, char *, int_t, int_t *)
void PrintInt10(char *, int_t, int_t *)
Definition: util.c:600
treeTopoInfo_t getMyTreeTopoInfo(int_t nnodes, int_t nsupers, int_t *myPerm, int_t *setree)
Definition: supernodal_etree.c:913
void superlu_gridexit(gridinfo_t *)
Definition: superlu_grid.c:200
int_t printFileList(char *sname, int_t nnodes, int_t *dlist, int_t *setree)
Definition: supernodal_etree.c:241
int_t initMsgs(msgs_t *msgs)
Definition: treeFactorization.c:336
int int_t
Definition: superlu_defs.h:114
void DistPrint3D(char *function_name, double value, char *Units, gridinfo3d_t *grid3d)
Definition: sec_structs.c:341
int_t symbfact_SubInit(fact_t, void *, int_t, int_t, int_t, int_t, Glu_persist_t *, Glu_freeable_t *)
Definition: memory.c:304
int_t psymbfact_LUXpand(int_t, int_t, int_t, int_t, int_t *, int_t, int_t, int_t, int_t, Pslu_freeable_t *, Llu_symbfact_t *, vtcsInfo_symbfact_t *, psymbfact_stat_t *)
Definition: psymbfact_util.c:213
void SCT_printComm3D(gridinfo3d_t *grid3d, SCT_t *SCT)
Definition: sec_structs.c:563
void C_RdTree_Nullify(C_Tree *tree)
Definition: comm_tree.c:148
void C_BcTree_waitSendRequest(C_Tree *tree)
Definition: comm_tree.c:90
void initTRStimer(xtrsTimer_t *xtrsTimer, gridinfo_t *grid)
void SCT_print3D(gridinfo3d_t *grid3d, SCT_t *SCT)
Definition: sec_structs.c:508
void * superlu_malloc_dist(size_t)
Definition: memory.c:163
void isort1(int_t N, int_t *ARRAY)
Definition: util.c:738
int_t * TreePostorder_dist(int_t, int_t *)
Definition: etree.c:393
int_t getCommonAncsCount(int_t k, treeList_t *treeList)
Definition: supernodal_etree.c:278
int_t psymbfact_prLUXpand(int_t, int_t, int, Llu_symbfact_t *, psymbfact_stat_t *)
Definition: psymbfact_util.c:502
commRequests_t ** initCommRequestsArr(int_t mxLeafNode, int_t ldt, gridinfo_t *grid)
Definition: treeFactorization.c:243
int_t initFactNodelists(int_t, int_t, int_t, factNodelists_t *)
Definition: treeFactorization.c:312
void Destroy_SuperMatrix_Store_dist(SuperMatrix *)
Deallocate the structure pointing to the actual storage of the matrix.
Definition: util.c:29
void Print_EtreeLevelBoundry(int_t *Etree_LvlBdry, int_t max_level, int_t nsuper)
Definition: supernodal_etree.c:974
void quickSortM(int_t *, int_t, int_t, int_t, int_t, int_t)
Definition: util.c:1109
int_t Wait_LSend(int_t k, gridinfo_t *grid, int **ToSendR, MPI_Request *s, SCT_t *)
Definition: communication_aux.c:32
int_t get_max_buffer_size()
Definition: util.c:815
void C_RdTree_Create(C_Tree *tree, MPI_Comm comm, int *ranks, int rank_cnt, int msgSize, char precision)
Definition: comm_tree.c:100
int get_thread_per_process()
Definition: util.c:804
int_t * intCalloc_dist(int_t)
Definition: memory.c:226
int Cmpfunc_R_info(const void *a, const void *b)
Definition: sec_structs.c:41
int_t * Etree_LevelBoundry(int_t *perm, int_t *tsort_etree, int_t nsuper)
Definition: supernodal_etree.c:927
void set_default_options_dist(superlu_dist_options_t *)
Set the default values for the options argument.
Definition: util.c:198
int genmmd_dist_(int_t *, int_t *, int_t *a, int_t *, int_t *, int_t *, int_t *, int_t *, int_t *, int_t *, int_t *, int_t *)
Definition: mmd.c:64
void isort(int_t N, int_t *ARRAY1, int_t *ARRAY2)
Definition: util.c:687
int_t * getGlobal_iperm(int_t nsupers, int_t nperms, int_t **perms, int_t *nnodes)
Definition: supernodal_etree.c:679
void quickSort(int_t *, int_t, int_t, int_t)
Definition: util.c:1044
msgs_t ** initMsgsArr(int_t numLA)
Definition: treeFactorization.c:343
void print_etree_leveled(int_t *setree, int_t *tsort_etree, int_t nsuper)
Definition: supernodal_etree.c:986
int_t CheckZeroDiagonal(int_t, int_t *, int_t *, int_t *)
Definition: util.c:658
int_t Test_LDiagBlock_Recv(MPI_Request *, SCT_t *)
Definition: communication_aux.c:182
void sp_colorder(superlu_dist_options_t *, SuperMatrix *, int_t *, int_t *, SuperMatrix *)
Definition: sp_colorder.c:81
void check_repfnz_dist(int_t, int_t, int_t, int_t *)
Check whether repfnz[] == EMPTY after reset.
Definition: util.c:586
void superlu_gridinit(MPI_Comm, int, int, gridinfo_t *)
All processes in the MPI communicator must call this routine.
Definition: superlu_grid.c:37
sForest_t ** getGreedyLoadBalForests(int_t maxLvl, int_t nsupers, int_t *setree, treeList_t *treeList)
Definition: supernodalForest.c:794
int_t estimate_bigu_size(int_t, int_t **, Glu_persist_t *, gridinfo_t *, int_t *, int_t *)
Definition: util.c:991
void Destroy_CompRowLoc_Matrix_dist(SuperMatrix *)
Definition: util.c:44
int freeFactStat(factStat_t *factStat)
Definition: treeFactorization.c:299
int getnGPUStreams()
Definition: util.c:1512
int_t * supernodal_etree(int_t nsuper, int_t *etree, int_t *supno, int_t *xsup)
Definition: supernodal_etree.c:32
void bcast_tree(void *, int, MPI_Datatype, int, int, gridinfo_t *, int, int *)
Definition: comm.c:72
trans_t
Definition: superlu_enum_consts.h:34
milu_t
Definition: superlu_enum_consts.h:46
LU_space_t
Definition: superlu_enum_consts.h:40
DiagScale_t
Definition: superlu_enum_consts.h:35
IterRefine_t
Definition: superlu_enum_consts.h:36
rowperm_t
Definition: superlu_enum_consts.h:31
colperm_t
Definition: superlu_enum_consts.h:32
MemType
Definition: superlu_enum_consts.h:38
fact_t
Definition: superlu_enum_consts.h:30
norm_t
Definition: superlu_enum_consts.h:41
yes_no_t
Definition: superlu_enum_consts.h:29
PhaseType
Definition: superlu_enum_consts.h:66
#define MAX_3D_LEVEL
Definition: util_dist.h:77
int_t get_gpublas_nb()
Definition: util.c:826
int_t get_num_gpu_streams()
Definition: util.c:837
void gemm_division_cpu_gpu(superlu_dist_options_t *options, int *num_streams_used, int *stream_end_col, int *ncpu_blks, int nbrow, int ldu, int nstreams, int *full_u_cols, int num_blks, int_t gemmBufferSize)
Definition: util.c:1330
integer, parameter, public lsub
Definition: superlupara.f90:35
integer, parameter, public usub
Definition: superlupara.f90:35
Definitions for parallel symbolic factorization routine.
Definition: superlu_defs.h:1142
Definition: superlu_defs.h:490
Definition: superlu_defs.h:435
Definition: superlu_ddefs.h:329
void * lookAhead_L_buff
Definition: superlu_defs.h:848
int nGPUStreams
Definition: superlu_defs.h:865
int offloadCondition
Definition: superlu_defs.h:863
void * bigU_host
Definition: superlu_defs.h:857
void * bigU_Phi
Definition: superlu_defs.h:856
int superlu_acc_offload
Definition: superlu_defs.h:864
Definition: psymbfact.h:106
Definition: psymbfact.h:57
Definition: superlu_defs.h:770
Definition: util_dist.h:172
Definition: util_dist.h:95
Definition: supermatrix.h:54
Definition: superlu_defs.h:760
Definition: superlu_defs.h:752
Definition: superlu_defs.h:924
Definition: superlu_defs.h:852
Definition: superlu_defs.h:780
Definition: superlu_defs.h:937
Definition: superlu_defs.h:839
int * factored
Definition: superlu_defs.h:915
Definition: superlu_defs.h:890
Definition: superlu_defs.h:398
Definition: superlu_defs.h:388
Definition: superlu_ddefs.h:317
void * lusup
Definition: superlu_defs.h:824
Definition: superlu_defs.h:815
Definition: superlu_defs.h:822
Definition: superlu_defs.h:947
Definition: superlu_ddefs.h:397
Definition: superlu_defs.h:833
statistics collected during parallel symbolic factorization
Definition: psymbfact.h:194
Definition: superlu_defs.h:551
Definition: superlu_defs.h:901
Definition: superlu_defs.h:744
Definition: superlu_defs.h:712
int superlu_acc_offload
Definition: superlu_defs.h:754
yes_no_t Use_TensorCore
Definition: superlu_defs.h:756
int superlu_maxsup
Definition: superlu_defs.h:748
int superlu_relax
Definition: superlu_defs.h:747
int superlu_num_gpu_streams
Definition: superlu_defs.h:753
int superlu_max_buffer_size
Definition: superlu_defs.h:752
int superlu_n_gemm
Definition: superlu_defs.h:751
Definition: superlu_defs.h:786
int val
Definition: superlu_defs.h:788
int ind
Definition: superlu_defs.h:787
Definition: superlu_defs.h:381
Definition: superlu_defs.h:868
Definition: superlu_defs.h:882
Definition: superlu_ddefs.h:308
Local information on vertices distribution.
Definition: psymbfact.h:140
Definition: superlu_defs.h:953
int_t trsMsgRecvZ
Definition: superlu_defs.h:974
double t_forwardSolve
Definition: superlu_defs.h:960
double tbs_comm
Definition: superlu_defs.h:965
double t_pdReDistribute_X_to_B
Definition: superlu_defs.h:958
int_t trsMsgRecvXY
Definition: superlu_defs.h:973
double tfs_comm
Definition: superlu_defs.h:962
int_t trsMsgSentZ
Definition: superlu_defs.h:972
double trsDataSendZ
Definition: superlu_defs.h:955
double trsDataRecvZ
Definition: superlu_defs.h:957
double trsDataSendXY
Definition: superlu_defs.h:954
double t_pdReDistribute_B_to_X
Definition: superlu_defs.h:959
double ppXmem
Definition: superlu_defs.h:976
double tbs_compute
Definition: superlu_defs.h:964
double tfs_tree[2 *MAX_3D_LEVEL]
Definition: superlu_defs.h:967
double tbs_tree[2 *MAX_3D_LEVEL]
Definition: superlu_defs.h:966
int_t trsMsgSentXY
Definition: superlu_defs.h:971
double t_backwardSolve
Definition: superlu_defs.h:963
double trsDataRecvXY
Definition: superlu_defs.h:956
double tfs_compute
Definition: superlu_defs.h:961
Macro definitions.
void PStatClear(SuperLUStat_t *)
Definition: util.c:336
static const int RD_U
Definition: superlu_defs.h:237
#define SuperLU_timer_
Definition: superlu_defs.h:282
int check_perm_dist(char *what, int_t n, int_t *perm)
Definition: sp_colorder.c:224
static const int BC_U
Definition: superlu_defs.h:236
void superlu_gridmap3d(MPI_Comm, int, int, int, int[], gridinfo3d_t *)
All processes in the MPI communicator must call this routine. On output, if a process is not in the S...
Definition: superlu_grid3d.c:66
static const int BC_L
Definition: superlu_defs.h:234
static const int RD_L
Definition: superlu_defs.h:235
enum constants header file
Matrix type definitions.
Header for utilities.