66 #define __FUNC__ "iluk_mpi_pilu"
73 int *rp, *cval, *diag, *fill;
74 int beg_row, beg_rowP, end_rowP;
76 int *CVAL, len, idx = 0, count;
82 bool bj, noValues, debug =
false;
116 for (i = from; i < to; ++i)
119 int row = n2o_row[i];
120 int globalRow = row + beg_row;
125 "\nILU_pilu global: %i old_Local: %i =========================================================\n",
126 i + 1 + beg_rowP, row + 1);
135 fprintf (
logFile,
"ILU_pilu EuclidGetRow:\n");
136 for (h = 0; h < len; ++h)
137 fprintf (
logFile,
" %i %g\n", 1 + CVAL[h], AVAL[h]);
155 extRows, slist, ctx, debug);
176 if (idx + count > F->
alloc)
180 SET_INFO (
"REALLOCATED from ilu_mpi_pilu");
195 if (col >= beg_rowP && col < end_rowP)
206 fill[idx] = sr->
level;
214 fprintf (
logFile,
"ILU_pilu ");
221 fill[idx] = sr->
level;
222 fprintf (
logFile,
"%i,%i,%g ; ", 1 + cval[idx], fill[idx],
237 fill[idx] = sr->
level;
251 if (cval[temp] == i + beg_rowP)
265 "Failed to find diag in localRow %i (globalRow %i; ct= %i)\n ",
266 1 + i, i + 1 + beg_rowP, rp[i + 1] - rp[i]);
267 for (k = rp[i]; k < rp[i + 1]; ++k)
269 fprintf (
logFile,
"%i ", cval[i] + 1);
273 sprintf (
msgBuf_dh,
"failed to find diagonal for localRow: %i",
288 sprintf (
msgBuf_dh,
"zero diagonal in local row %i", i + 1);
298 for (i = 0; i < nz; ++i)
306 #define __FUNC__ "iluk_symbolic_row_private"
315 int *cval = ctx->
F->
cval, *diag = ctx->
F->
diag;
316 int *rp = ctx->
F->
rp, *fill = ctx->
F->
fill;
318 int end_rowP = beg_rowP + m;
319 int level_1, level_2;
320 int *cvalPtr, *fillPtr;
327 scale = ctx->
scale[localRow];
332 for (j = 0; j < len; ++j)
335 sr.
val = scale * AVAL[j];
344 fprintf (
logFile,
"ILU_pilu inserted from A: col= %i val= %g\n",
345 1 + CVAL[j], sr.
val);
351 sr.
col = localRow + beg_rowP;
361 fprintf (
logFile,
"ILU_pilu inserted missing diagonal: %i\n",
362 1 + localRow + beg_row);
382 fprintf (
logFile,
"ILU_pilu sf updating from row: %i\n",
386 level_1 = srPtr->
level;
391 if (node >= beg_rowP && node < end_rowP)
394 len = rp[node + 1] - diag[node] - 1;
395 cvalPtr = cval + diag[node] + 1;
396 fillPtr = fill + diag[node] + 1;
406 if (debug && len == 0)
409 "ILU_pilu sf failed to get extern row: %i\n",
416 for (j = 0; j < len; ++j)
419 level_2 = 1 + level_1 + *fillPtr++;
420 if (level_2 <= level)
437 #define __FUNC__ "iluk_numeric_row_private"
444 int end_rowP = beg_rowP + m;
446 int *rp = ctx->
F->
rp, *cval = ctx->
F->
cval, *diag = ctx->
F->
diag;
449 double multiplier, pc, pv;
468 if (row >= beg_rowP && row < end_rowP)
470 int local_row = row - beg_rowP;
472 len = rp[local_row + 1] - diag[local_row];
473 cvalPtr = cval + diag[local_row];
474 avalPtr = aval + diag[local_row];
482 if (debug && len == 0)
484 fprintf (stderr,
"ILU_pilu failed to get extern row: %i\n",
499 "find failed for sr.col = %i while factoring local row= %i \n",
500 1 + sr.
col, new_row + 1);
511 multiplier = pc / pv;
512 srPtr->
val = multiplier;
517 "ILU_pilu nf updating from row: %i; multiplier = %g\n",
518 1 + srPtr->
col, multiplier);
530 srPtr->
val -= (multiplier * sr.
val);
540 "ILU_pilu NO UPDATE from row: %i; srPtr->val = 0.0\n",
static void iluk_symbolic_row_private(int localRow, int len, int *CVAL, double *AVAL, ExternalRows_dh extRows, SortedList_dh sList, Euclid_dh ctx, bool debug)
void SortedList_dhInsertOrUpdate(SortedList_dh sList, SRecord *sr)
void EuclidGetRow(void *A, int row, int *len, int **ind, double **val)
void SortedList_dhEnforceConstraint(SortedList_dh sList, SubdomainGraph_dh sg)
void compute_scaling_private(int row, int len, double *AVAL, Euclid_dh ctx)
void SortedList_dhReset(SortedList_dh sList, int row)
SRecord * SortedList_dhFind(SortedList_dh sList, SRecord *sr)
SRecord * SortedList_dhGetSmallest(SortedList_dh sList)
void SortedList_dhInsert(SortedList_dh sList, SRecord *sr)
bool Parser_dhHasSwitch(Parser_dh p, char *s)
void ExternalRows_dhGetRow(ExternalRows_dh er, int globalRow, int *len, int **cval, int **fill, REAL_DH **aval)
bool SortedList_dhPermuteAndInsert(SortedList_dh sList, SRecord *sr, double thresh)
int SortedList_dhReadCount(SortedList_dh sList)
void iluk_mpi_pilu(Euclid_dh ctx)
static void iluk_numeric_row_private(int new_row, ExternalRows_dh extRows, SortedList_dh slist, Euclid_dh ctx, bool debug)
SRecord * SortedList_dhGetSmallestLowerTri(SortedList_dh sList)
void SortedList_dhResetGetSmallest(SortedList_dh sList)
void EuclidRestoreRow(void *A, int row, int *len, int **ind, double **val)
void Factor_dhReallocate(Factor_dh F, int used, int additional)
char msgBuf_dh[MSG_BUF_SIZE_DH]