Skip to content

Commit bd14489

Browse files
committed
Add options for user to input supernode partition.
1 parent 6dd430b commit bd14489

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

SRC/include/superlu_defs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,7 @@ typedef struct {
746746
double ILU_FillTol; /* threshold for zero pivot perturbation */
747747
milu_t ILU_MILU;
748748
double ILU_MILU_Dim; /* Dimension of PDE (if available) */
749+
yes_no_t UserDefineSupernode; /* Allow users to define supernodes */
749750
yes_no_t ParSymbFact;
750751
yes_no_t ReplaceTinyPivot; /* used in SuperLU_DIST */
751752
yes_no_t SolveInitialized;

SRC/prec-independent/ilu_level_symbfact.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,6 @@ int_t ilu_level_symbfact
6464
double t;
6565
int min_mn = SUPERLU_MIN(m, n);
6666

67-
/* Set up supernode partition */
68-
Glu_persist->supno = (int_t *) SUPERLU_MALLOC(n * sizeof(int_t));
69-
Glu_persist->xsup = (int_t *) SUPERLU_MALLOC((n+1) * sizeof(int_t));
70-
for (i = 0; i < n; i++) {
71-
Glu_persist->supno[i] = i;
72-
Glu_persist->xsup[i] = i;
73-
}
74-
Glu_persist->xsup[n] = n;
75-
7667

7768
NCPformat *GACstore = A->Store;
7869
int_t *colbeg, *colend, *rowind, irow;
@@ -84,6 +75,17 @@ int_t ilu_level_symbfact
8475
Glu_freeable->xusub = (int_t *) intCalloc_dist(n+1);
8576
int_t nnzL = 0, nnzU = 0;
8677

78+
/* Set up supernode partition */
79+
Glu_persist->supno = (int_t *) SUPERLU_MALLOC(n * sizeof(int_t));
80+
Glu_persist->xsup = (int_t *) SUPERLU_MALLOC((n+1) * sizeof(int_t));
81+
if ( options->UserDefineSupernode == NO ) {
82+
for (i = 0; i < n; i++) { /* set up trivial supernode for now. */
83+
Glu_persist->supno[i] = i;
84+
Glu_persist->xsup[i] = i;
85+
}
86+
Glu_persist->xsup[n] = n;
87+
}
88+
8789
/* Count nonzeros per column for L & U */
8890
for (int j = 0; j < n; ++j) {
8991
#if 0
@@ -135,6 +137,7 @@ int_t ilu_level_symbfact
135137
Glu_freeable->xusub[i] += Glu_freeable->xusub[i-1];
136138
}
137139

140+
138141
return ( -(Glu_freeable->xlsub[n] + Glu_freeable->xusub[n]) );
139142
}
140143

SRC/prec-independent/util.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ void set_default_options_dist(superlu_dist_options_t *options)
210210
options->Fact = DOFACT;
211211
options->Equil = YES;
212212
options->ILU_level = SLU_EMPTY;
213+
options->UserDefineSupernode = NO; /* detect supernodes internally */
213214
options->ParSymbFact = NO;
214215
#ifdef HAVE_PARMETIS
215216
options->ColPerm = METIS_AT_PLUS_A;
@@ -256,6 +257,7 @@ void print_options_dist(superlu_dist_options_t *options)
256257
printf("** Fact : %4d\n", options->Fact);
257258
printf("** Equil : %4d\n", options->Equil);
258259
printf("** DiagInv : %4d\n", options->DiagInv);
260+
printf("** UserDefineSupernode : %4d\n", options->UserDefineSupernode);
259261
printf("** ParSymbFact : %4d\n", options->ParSymbFact);
260262
printf("** ColPerm : %4d\n", options->ColPerm);
261263
printf("** RowPerm : %4d\n", options->RowPerm);

0 commit comments

Comments
 (0)