31 integer(kind=kint),
parameter :: MF_RELAX_COLS = 16
33 integer(kind=kint),
parameter :: MF_TILE = 256
35 integer(kind=kint),
parameter :: MF_IR_STEPS = 5
37 real(kind=
kreal),
parameter :: mf_ir_tol = 1.0d-8
39 type(hecmwST_mf_symbolic),
save :: SYM
40 type(hecmwST_mf_factor),
save :: FCT
41 type(hecmwST_mf_map),
save :: MAP
42 type(hecmwST_mf_gmat),
save :: GMAT
50 integer(kind=kint),
intent(in) :: imsg
51 type(hecmwst_mf_graph) :: graph
52 integer(kind=kint),
allocatable :: perm(:), invp(:)
53 integer(kind=kint) :: loglevel, iterlog, timelog, ordering, n, nerr, relax, tile, ierr, idof, node, nthreads, irmax, it, eta
54 real(kind=
kreal) :: t1, t2, irtol, bnrm, rnrm, rprev, tcomm
55 real(kind=
kreal),
allocatable :: rr(:), dd(:), xp(:)
62 if (loglevel < 0) loglevel = 0
71 if (hecmesh%PETOT > 1)
then
72 call hecmw_solve_direct_mf_dist(hecmesh, hecmat, imsg, loglevel, iterlog, timelog)
76 if (hecmat%Iarray(98) == 1)
then
80 allocate(perm(n), invp(n))
81 ordering = hecmat%Iarray(41)
82 call hecmw_ordering_gen(n, n + (graph%xadj(n+1)-1)/2, graph%xadj, graph%adjncy, perm, invp, ordering, loglevel)
83 relax = hecmat%Iarray(46)
84 if (relax <= 0) relax = mf_relax_cols
85 relax = max(1, relax / hecmat%NDOF)
94 tile = hecmat%Iarray(45)
95 if (tile <= 0) tile = mf_tile
96 eta = hecmat%Iarray(47)
102 if (timelog > 0)
write(*,
'(a,f10.3,a)')
'[DIRECTmf]: symbolic fct done (', t2 - t1,
' sec)'
103 if (loglevel > 0)
then
104 if (clustered)
write(*,
'(a)')
'[DIRECTmf]: separator nodes clustered for BLR'
108 if (loglevel > 1)
then
110 write(*,
'(a,i0)')
'[DIRECTmf]: self check violations = ', nerr
111 if (.not. clustered)
then
113 write(*,
'(a,i0)')
'[DIRECTmf]: mismatches against built-in DIRECT = ', nerr
116 deallocate(perm, invp)
120 hecmat%Iarray(98) = 0
122 if (hecmat%Iarray(97) == 1)
then
123 fct%mode = hecmat%Iarray(42)
124 if (fct%mode < 0 .or. fct%mode > 2)
then
126 '[DIRECTmf]: WARNING: MF_Mode ', fct%mode,
' is outside 0-2; using the automatic mode'
129 fct%scan = loglevel > 1
130 fct%blr = hecmat%Iarray(43) /= 0
131 fct%eps = hecmat%Rarray(41)
132 fct%pivot_u = hecmat%Rarray(43)
134 if (fct%pivot_u > 0.5d0)
then
136 '[DIRECTmf]: WARNING: MF_PivotThreshold ', fct%pivot_u,
' is above 0.5; using 0.5'
139 fct%pivot_zero = hecmat%Rarray(44)
140 fct%blr_beta = hecmat%Rarray(45)
141 if (fct%blr_beta <= 0.0d0) fct%blr_beta = 1.0d0
142 fct%blr_reuse = hecmat%Iarray(48) /= 0
146 if (
hecmw_comm_get_rank() == 0)
write(*,
'(a)')
'[DIRECTmf]: BLR disabled (built without LAPACK)'
153 idof = fct%pdof(ierr)
156 node = (idof-1)/hecmat%NDOF + 1
157 if (hecmat%NP == hecmesh%n_node) node = hecmesh%global_node_ID(node)
158 write(imsg,
'(a,i0,a,i0,a)')
'ERROR: DIRECTmf: no acceptable pivot at node ', node, &
159 ' dof ', mod(idof-1, hecmat%NDOF) + 1,
' (the matrix may be singular)'
160 write(*,
'(a,i0,a,i0,a)')
'ERROR: DIRECTmf: no acceptable pivot at node ', node, &
161 ' dof ', mod(idof-1, hecmat%NDOF) + 1,
' (the matrix may be singular)'
162 else if (ierr == -1)
then
163 write(imsg,*)
'ERROR: DIRECTmf: block size of the matrix does not match the symbolic structure'
164 write(*,*)
'ERROR: DIRECTmf: block size of the matrix does not match the symbolic structure'
166 write(imsg,*)
'ERROR: DIRECTmf: the nonzero structure of the matrix is not symmetric'
167 write(*,*)
'ERROR: DIRECTmf: the nonzero structure of the matrix is not symmetric'
171 hecmat%Iarray(97) = 0
172 if (timelog > 0)
write(*,
'(a,f10.3,a)')
'[DIRECTmf]: numeric fct done (', t2 - t1,
' sec)'
173 if (loglevel > 0)
then
176 write(*,
'(a,i0)')
'[DIRECTmf]: threads = ', nthreads
177 write(*,
'(a,1pe9.2,a,1pe9.2)')
'[DIRECTmf]: options: pivot u = ', fct%pivot_u, &
178 ', zero pivot factor = ', fct%pivot_zero
180 if (fct%mode == 2)
then
181 write(*,
'(a)')
'[DIRECTmf]: mode = LU (forced by option)'
183 write(*,
'(a)')
'[DIRECTmf]: mode = LU (unsymmetric matrix)'
185 if (loglevel > 1)
write(*,
'(a,1pe9.2)')
'[DIRECTmf]: asymmetry = ', fct%asym
186 write(*,
'(a,i0,a,i0,a,i0,a)')
'[DIRECTmf]: row swaps = ', fct%n_swap,
', delayed = ', fct%n_delay, &
187 ' (max front growth = ', fct%max_growth,
' dofs)'
189 if (fct%mode == 1)
then
190 write(*,
'(a)')
'[DIRECTmf]: mode = LDLt (forced by option)'
192 write(*,
'(a)')
'[DIRECTmf]: mode = LDLt'
194 if (loglevel > 1)
write(*,
'(a,1pe9.2)')
'[DIRECTmf]: asymmetry = ', fct%asym
195 write(*,
'(a,i0,a,i0,a,i0,a,i0,a,i0,a,i0,a)')
'[DIRECTmf]: inertia (+,-) = (', fct%n_pos,
',', fct%n_neg, &
196 '), 2x2 pivots = ', fct%n_2x2,
', swaps = ', fct%n_swap,
', delayed = ', fct%n_delay, &
197 ' (max front growth = ', fct%max_growth,
' dofs)'
199 write(*,
'(a,i0,a,f10.3,a,i0,a,i0)')
'[DIRECTmf]: factor words = ', fct%factor_words_act,
' (', &
200 real(fct%factor_words_act, kind=
kreal)*8.0d0/1024.0d0**3,
' GB), stack peak words = ', fct%stack_peak_act, &
201 ', front words = ', fct%front_words_act
203 write(*,
'(a,1pe9.2,a,i0,a,0pf6.1,a)')
'[DIRECTmf]: BLR: eps = ', fct%eps, &
204 ', factor words full rank = ', fct%blr_words_fr,
' (', &
205 100.0d0*(1.0d0 - real(fct%factor_words_act, kind=
kreal)/max(real(fct%blr_words_fr, kind=
kreal), 1.0d0)), &
207 write(*,
'(a,i0,a,f5.2,a,l1)')
'[DIRECTmf]: BLR: skip eta = ', fct%blr_eta, &
208 ', gain cap beta = ', fct%blr_beta,
', rank reuse = ', fct%blr_reuse
209 write(*,
'(a,i0,a,i0,a,i0,a,i0,a,f8.1)')
'[DIRECTmf]: BLR: tiles compressed = ', fct%blr_tiles_lr,
' of ', &
210 fct%blr_tiles,
', skipped = ', fct%blr_tiles_skip,
', rank max = ', fct%blr_rank_max,
', rank avg = ', &
211 real(fct%blr_rank_sum, kind=
kreal)/max(real(fct%blr_tiles_lr, kind=
kreal), 1.0d0)
213 write(*,
'(a,i0,a,f10.3,a)')
'[DIRECTmf]: front words held concurrently (peak) = ', fct%front_peak,
' (', &
214 real(fct%front_peak, kind=
kreal)*8.0d0/1024.0d0**3,
' GB)'
218 if (.not. fct%factored)
then
219 write(imsg,*)
'ERROR: DIRECTmf: numeric factorization not performed'
220 write(*,*)
'ERROR: DIRECTmf: numeric factorization not performed'
226 if (timelog > 0)
write(*,
'(a,f10.3,a)')
'[DIRECTmf]: solve done (', t2 - t1,
' sec)'
228 irmax = hecmat%Iarray(44)
229 if (fct%blr .and. irmax == 0) irmax = mf_ir_steps
231 irtol = hecmat%Rarray(42)
232 if (.not. (irtol > 0.0d0)) irtol = mf_ir_tol
233 n = hecmat%NP * hecmat%NDOF
234 allocate(rr(n), dd(n), xp(n))
240 call hecmw_matresid(hecmesh, hecmat, hecmat%X, hecmat%B, rr, tcomm)
242 rnrm = sqrt(rnrm / max(bnrm, tiny(bnrm)))
243 if (iterlog > 0)
write(*,
'(a,i0,a,1pe11.4)')
'[DIRECTmf]: refinement ', it - 1,
': residual = ', rnrm
244 if (rnrm <= irtol)
exit
247 if (rnrm > rprev)
then
248 hecmat%X(1:n) = xp(1:n)
250 '[DIRECTmf]: WARNING: refinement diverged, reverted to residual = ', rprev
254 xp(1:n) = hecmat%X(1:n)
256 hecmat%X(1:n) = hecmat%X(1:n) + dd(1:n)
259 if (timelog > 0)
write(*,
'(a,f10.3,a)')
'[DIRECTmf]: refinement done (', t2 - t1,
' sec)'
260 deallocate(rr, dd, xp)
261 else if (irmax == 0 .and. iterlog > 0)
then
264 n = hecmat%NP * hecmat%NDOF
268 call hecmw_matresid(hecmesh, hecmat, hecmat%X, hecmat%B, rr, tcomm)
270 rnrm = sqrt(rnrm / max(bnrm, tiny(bnrm)))
271 write(*,
'(a,1pe11.4)')
'[DIRECTmf]: residual = ', rnrm
284 subroutine hecmw_solve_direct_mf_dist(hecMESH, hecMAT, imsg, loglevel, iterlog, timelog)
288 integer(kind=kint),
intent(in) :: imsg, loglevel, iterlog, timelog
289 type(hecmwst_mf_graph) :: graph
290 integer(kind=kint),
allocatable :: perm(:), invp(:)
291 real(kind=
kreal),
allocatable :: gb(:), gx(:), rr(:), wpr(:), wmr(:), xp(:)
292 integer(kind=kint) :: ordering, n, nerr, relax, tile, ierr, idof, nthreads, irmax, it, i, ofs, eta, gnode, d
293 integer(kind=8) :: wrepl
294 real(kind=
kreal) :: t1, t2, irtol, bnrm, rnrm, rprev, tcomm
298 if (hecmat%Iarray(98) == 1)
then
302 relax = hecmat%Iarray(46)
303 if (relax <= 0) relax = mf_relax_cols
304 relax = max(1, relax / hecmat%NDOF)
309 allocate(perm(n), invp(n))
310 ordering = hecmat%Iarray(41)
311 call hecmw_ordering_gen(n, n + (graph%xadj(n+1)-1)/2, graph%xadj, graph%adjncy, perm, invp, ordering, loglevel)
318 if (loglevel > 1)
then
320 write(*,
'(a,i0)')
'[DIRECTmf]: self check violations = ', nerr
322 deallocate(perm, invp)
328 allocate(wmr(map%nprocs))
329 call mf_gather_matwords(gmat, wmr, wrepl)
330 tile = hecmat%Iarray(45)
331 if (tile <= 0) tile = mf_tile
332 eta = hecmat%Iarray(47)
340 if (timelog > 0)
write(*,
'(a,f10.3,a)')
'[DIRECTmf]: symbolic fct done (', t2 - t1,
' sec)'
341 if (loglevel > 0)
then
342 if (clustered)
write(*,
'(a)')
'[DIRECTmf]: separator nodes clustered for BLR'
343 write(*,
'(a,i0,a,i0)')
'[DIRECTmf]: MPI ranks = ', map%nprocs,
', upper fronts = ', map%nupper
344 write(*,
'(a,i0,a,*(i0,1x))')
'[DIRECTmf]: matrix words replicated = ', wrepl,
', held per rank = ', &
345 (nint(wmr(i), kind=8), i = 1, map%nprocs)
350 hecmat%Iarray(98) = 0
353 if (hecmat%Iarray(97) == 1)
then
354 fct%mode = hecmat%Iarray(42)
355 if (fct%mode < 0 .or. fct%mode > 2)
then
357 '[DIRECTmf]: WARNING: MF_Mode ', fct%mode,
' is outside 0-2; using the automatic mode'
360 fct%scan = loglevel > 1
361 fct%blr = hecmat%Iarray(43) /= 0
362 fct%eps = hecmat%Rarray(41)
363 fct%pivot_u = hecmat%Rarray(43)
365 if (fct%pivot_u > 0.5d0)
then
367 '[DIRECTmf]: WARNING: MF_PivotThreshold ', fct%pivot_u,
' is above 0.5; using 0.5'
370 fct%pivot_zero = hecmat%Rarray(44)
371 fct%blr_beta = hecmat%Rarray(45)
372 if (fct%blr_beta <= 0.0d0) fct%blr_beta = 1.0d0
373 fct%blr_reuse = hecmat%Iarray(48) /= 0
377 if (
hecmw_comm_get_rank() == 0)
write(*,
'(a)')
'[DIRECTmf]: BLR disabled (built without LAPACK)'
386 idof = fct%pdof(ierr)
388 write(imsg,
'(a,i0,a,i0,a)')
'ERROR: DIRECTmf: no acceptable pivot at node ', &
389 gmat%gid((idof-1)/hecmat%NDOF + 1), &
390 ' dof ', mod(idof-1, hecmat%NDOF) + 1,
' (the matrix may be singular)'
391 write(*,
'(a,i0,a,i0,a)')
'ERROR: DIRECTmf: no acceptable pivot at node ', &
392 gmat%gid((idof-1)/hecmat%NDOF + 1), &
393 ' dof ', mod(idof-1, hecmat%NDOF) + 1,
' (the matrix may be singular)'
394 else if (ierr == -1)
then
395 write(imsg,*)
'ERROR: DIRECTmf: block size of the matrix does not match the symbolic structure'
396 write(*,*)
'ERROR: DIRECTmf: block size of the matrix does not match the symbolic structure'
398 write(imsg,*)
'ERROR: DIRECTmf: the nonzero structure of the matrix is not symmetric'
399 write(*,*)
'ERROR: DIRECTmf: the nonzero structure of the matrix is not symmetric'
404 hecmat%Iarray(97) = 0
405 allocate(wpr(map%nprocs))
406 call mf_reduce_stats(fct, wpr)
407 if (timelog > 0)
write(*,
'(a,f10.3,a)')
'[DIRECTmf]: numeric fct done (', t2 - t1,
' sec)'
408 if (loglevel > 0)
then
411 write(*,
'(a,i0,a,i0)')
'[DIRECTmf]: ranks = ', map%nprocs,
', threads per rank = ', nthreads
412 write(*,
'(a,1pe9.2,a,1pe9.2)')
'[DIRECTmf]: options: pivot u = ', fct%pivot_u, &
413 ', zero pivot factor = ', fct%pivot_zero
415 if (fct%mode == 2)
then
416 write(*,
'(a)')
'[DIRECTmf]: mode = LU (forced by option)'
418 write(*,
'(a)')
'[DIRECTmf]: mode = LU (unsymmetric matrix)'
420 if (loglevel > 1)
write(*,
'(a,1pe9.2)')
'[DIRECTmf]: asymmetry = ', fct%asym
421 write(*,
'(a,i0,a,i0,a,i0,a)')
'[DIRECTmf]: row swaps = ', fct%n_swap,
', delayed = ', fct%n_delay, &
422 ' (max front growth = ', fct%max_growth,
' dofs)'
424 if (fct%mode == 1)
then
425 write(*,
'(a)')
'[DIRECTmf]: mode = LDLt (forced by option)'
427 write(*,
'(a)')
'[DIRECTmf]: mode = LDLt'
429 if (loglevel > 1)
write(*,
'(a,1pe9.2)')
'[DIRECTmf]: asymmetry = ', fct%asym
430 write(*,
'(a,i0,a,i0,a,i0,a,i0,a,i0,a,i0,a)')
'[DIRECTmf]: inertia (+,-) = (', fct%n_pos,
',', fct%n_neg, &
431 '), 2x2 pivots = ', fct%n_2x2,
', swaps = ', fct%n_swap,
', delayed = ', fct%n_delay, &
432 ' (max front growth = ', fct%max_growth,
' dofs)'
434 write(*,
'(a,i0,a,f10.3,a,i0,a,i0)')
'[DIRECTmf]: factor words = ', fct%factor_words_act,
' (', &
435 real(fct%factor_words_act, kind=
kreal)*8.0d0/1024.0d0**3,
' GB), stack peak words = ', fct%stack_peak_act, &
436 ', front words = ', fct%front_words_act
437 write(*,
'(a,*(i0,1x))')
'[DIRECTmf]: factor words per rank = ', (nint(wpr(i), kind=8), i = 1, map%nprocs)
439 write(*,
'(a,1pe9.2,a,i0,a,0pf6.1,a)')
'[DIRECTmf]: BLR: eps = ', fct%eps, &
440 ', factor words full rank = ', fct%blr_words_fr,
' (', &
441 100.0d0*(1.0d0 - real(fct%factor_words_act, kind=
kreal)/max(real(fct%blr_words_fr, kind=
kreal), 1.0d0)), &
443 write(*,
'(a,i0,a,f5.2,a,l1)')
'[DIRECTmf]: BLR: skip eta = ', fct%blr_eta, &
444 ', gain cap beta = ', fct%blr_beta,
', rank reuse = ', fct%blr_reuse
445 write(*,
'(a,i0,a,i0,a,i0,a,i0,a,f8.1)')
'[DIRECTmf]: BLR: tiles compressed = ', fct%blr_tiles_lr,
' of ', &
446 fct%blr_tiles,
', skipped = ', fct%blr_tiles_skip,
', rank max = ', fct%blr_rank_max,
', rank avg = ', &
447 real(fct%blr_rank_sum, kind=
kreal)/max(real(fct%blr_tiles_lr, kind=
kreal), 1.0d0)
449 write(*,
'(a,i0,a,f10.3,a)')
'[DIRECTmf]: front words held concurrently (peak) = ', fct%front_peak,
' (', &
450 real(fct%front_peak, kind=
kreal)*8.0d0/1024.0d0**3,
' GB)'
455 if (.not. fct%factored)
then
457 write(imsg,*)
'ERROR: DIRECTmf: numeric factorization not performed'
458 write(*,*)
'ERROR: DIRECTmf: numeric factorization not performed'
462 allocate(gb(fct%ndof_tot), gx(fct%ndof_tot))
469 if (timelog > 0)
write(*,
'(a,f10.3,a)')
'[DIRECTmf]: solve done (', t2 - t1,
' sec)'
471 gnode = gmat%g2s(ofs + i)
472 do d = 1, hecmat%NDOF
473 hecmat%X((i-1)*hecmat%NDOF + d) = gx((gnode-1)*hecmat%NDOF + d)
477 irmax = hecmat%Iarray(44)
478 if (fct%blr .and. irmax == 0) irmax = mf_ir_steps
480 irtol = hecmat%Rarray(42)
481 if (.not. (irtol > 0.0d0)) irtol = mf_ir_tol
482 n = hecmat%NP * hecmat%NDOF
483 allocate(rr(n), xp(hecmat%N * hecmat%NDOF))
489 call hecmw_matresid(hecmesh, hecmat, hecmat%X, hecmat%B, rr, tcomm)
491 rnrm = sqrt(rnrm / max(bnrm, tiny(bnrm)))
492 if (iterlog > 0)
write(*,
'(a,i0,a,1pe11.4)')
'[DIRECTmf]: refinement ', it - 1,
': residual = ', rnrm
493 if (rnrm <= irtol)
exit
496 if (rnrm > rprev)
then
497 hecmat%X(1:hecmat%N * hecmat%NDOF) = xp(1:hecmat%N * hecmat%NDOF)
499 '[DIRECTmf]: WARNING: refinement diverged, reverted to residual = ', rprev
503 xp(1:hecmat%N * hecmat%NDOF) = hecmat%X(1:hecmat%N * hecmat%NDOF)
507 gnode = gmat%g2s(ofs + i)
508 do d = 1, hecmat%NDOF
509 hecmat%X((i-1)*hecmat%NDOF + d) = hecmat%X((i-1)*hecmat%NDOF + d) + gx((gnode-1)*hecmat%NDOF + d)
514 if (timelog > 0)
write(*,
'(a,f10.3,a)')
'[DIRECTmf]: refinement done (', t2 - t1,
' sec)'
519 n = hecmat%NP * hecmat%NDOF
523 call hecmw_matresid(hecmesh, hecmat, hecmat%X, hecmat%B, rr, tcomm)
525 rnrm = sqrt(rnrm / max(bnrm, tiny(bnrm)))
526 if (iterlog > 0)
write(*,
'(a,1pe11.4)')
'[DIRECTmf]: residual = ', rnrm
531 end subroutine hecmw_solve_direct_mf_dist
535 subroutine mf_gather_matwords(gmat, wmr, wrepl)
537 type(hecmwst_mf_gmat),
intent(in) :: gmat
538 real(kind=
kreal),
intent(out) :: wmr(:)
539 integer(kind=8),
intent(out) :: wrepl
540 real(kind=
kreal) :: w1(1)
541 integer(kind=kint),
allocatable :: rcs(:), disp(:)
542 integer(kind=kint) :: comm, np, r
543 integer(kind=8) :: wpart
548 allocate(rcs(np), disp(np))
553 w1(1) = real(wpart, kind=
kreal)
555 deallocate(rcs, disp)
556 end subroutine mf_gather_matwords
562 subroutine mf_reduce_stats(fct, wpr)
564 type(hecmwst_mf_factor),
intent(inout) :: fct
565 real(kind=
kreal),
intent(out) :: wpr(:)
566 real(kind=
kreal) :: rs(13), rm(3), w1(1)
567 integer(kind=kint),
allocatable :: rcs(:), disp(:)
568 integer(kind=kint) :: comm, np, r
572 allocate(rcs(np), disp(np))
577 w1(1) = real(fct%factor_words_act, kind=
kreal)
579 deallocate(rcs, disp)
580 rs(1) = real(fct%n_pos, kind=
kreal)
581 rs(2) = real(fct%n_neg, kind=
kreal)
582 rs(3) = real(fct%n_2x2, kind=
kreal)
583 rs(4) = real(fct%n_swap, kind=
kreal)
584 rs(5) = real(fct%n_delay, kind=
kreal)
585 rs(6) = real(fct%factor_words_act, kind=
kreal)
586 rs(7) = real(fct%stack_peak_act, kind=
kreal)
587 rs(8) = real(fct%front_peak, kind=
kreal)
588 rs(9) = real(fct%blr_words_fr, kind=
kreal)
589 rs(10) = real(fct%blr_tiles, kind=
kreal)
590 rs(11) = real(fct%blr_tiles_lr, kind=
kreal)
591 rs(12) = real(fct%blr_rank_sum, kind=
kreal)
592 rs(13) = real(fct%blr_tiles_skip, kind=
kreal)
594 rm(1) = real(fct%max_growth, kind=
kreal)
595 rm(2) = real(fct%front_words_act, kind=
kreal)
596 rm(3) = real(fct%blr_rank_max, kind=
kreal)
598 fct%n_pos = nint(rs(1), kind=
kint)
599 fct%n_neg = nint(rs(2), kind=
kint)
600 fct%n_2x2 = nint(rs(3), kind=
kint)
601 fct%n_swap = nint(rs(4), kind=
kint)
602 fct%n_delay = nint(rs(5), kind=
kint)
603 fct%factor_words_act = nint(rs(6), kind=8)
604 fct%stack_peak_act = nint(rs(7), kind=8)
605 fct%front_peak = nint(rs(8), kind=8)
606 fct%blr_words_fr = nint(rs(9), kind=8)
607 fct%blr_tiles = nint(rs(10), kind=8)
608 fct%blr_tiles_lr = nint(rs(11), kind=8)
609 fct%blr_rank_sum = nint(rs(12), kind=8)
610 fct%blr_tiles_skip = nint(rs(13), kind=8)
611 fct%max_growth = nint(rm(1), kind=
kint)
612 fct%front_words_act = nint(rm(2), kind=8)
613 fct%blr_rank_max = nint(rm(3), kind=
kint)
614 end subroutine mf_reduce_stats
623 type(hecmwst_mf_graph),
intent(in) :: graph
624 integer(kind=kint),
intent(in) :: ordering
625 integer(kind=kint),
intent(out) :: nerr
626 type(cholesky_factor) :: fct
627 type(hecmwst_mf_symbolic) :: ref
628 integer(kind=kint),
allocatable :: cnt(:)
629 integer(kind=kint) :: n, k, l, ir, pb, myk, mp, nbad_tree, nbad_cnt
632 call setij(hecmesh, hecmat, fct)
633 call matini(fct, ordering, 0, ir)
635 write(*,
'(a,i0)')
'[DIRECTmf] compare: built-in MATINI failed, ir = ', ir
645 myk = ref%invp(fct%IPErm(k))
647 if (pb == 0 .or. pb == n + 1)
then
648 if (mp /= 0) nbad_tree = nbad_tree + 1
651 nbad_tree = nbad_tree + 1
652 else if (ref%perm(mp) /= fct%IPErm(pb))
then
653 nbad_tree = nbad_tree + 1
661 do l = fct%XLNzr(k), fct%XLNzr(k+1) - 1
662 cnt(fct%COLno(l)) = cnt(fct%COLno(l)) + 1
667 if (cnt(k) /= ref%colcnt(ref%invp(fct%IPErm(k)))) nbad_cnt = nbad_cnt + 1
669 if (nbad_tree > 0)
write(*,
'(a,i0)')
'[DIRECTmf] compare: elimination tree mismatches = ', nbad_tree
670 if (nbad_cnt > 0)
write(*,
'(a,i0)')
'[DIRECTmf] compare: column count mismatches = ', nbad_cnt
671 nerr = nbad_tree + nbad_cnt
675 deallocate(fct%IROw, fct%JCOl, fct%IPErm, fct%INVp, fct%PARent, fct%NCH, fct%XLNzr, fct%COLno)
integer(kind=kint) function, public hecmw_mat_get_iterlog(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_timelog(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_loglevel(hecMAT)
MPI distribution layer of the multifrontal solver: the supernode-to-rank mapping and the broadcast of...
subroutine, public hecmw_mf_dist_gather_vec(gmat, v, gv)
Gather the internal parts of a distributed nodal vector into the replicated global vector,...
subroutine, public hecmw_mf_dist_map_build(sym, map)
Build the mapping from the symbolic structure. The roots share all ranks (several roots split them pr...
subroutine, public hecmw_mf_dist_symbolic_bcast(sym, root)
Broadcast the symbolic structure built on the root rank to all ranks. The int8 estimates (factor_nnz,...
subroutine, public hecmw_mf_dist_gmat_part(sym, map, gmat)
Derive from the mapping the partial profile of this rank and the value routing, and drop the gathered...
subroutine, public hecmw_mf_dist_gmat_words(gmat, wpart, wrepl)
Words this rank holds for the matrix (the values with the integer structure and routing at two intege...
subroutine, public hecmw_mf_dist_gmat_vals(hecMAT, gmat)
Move the values of the internal rows to their holding ranks through the routing of hecmw_mf_dist_gmat...
subroutine, public hecmw_mf_dist_map_finalize(map)
subroutine, public hecmw_mf_dist_gmat_build(hecMESH, hecMAT, gmat)
Gather the nonzero structure of the internal rows of every rank. The stream carries,...
Compressed (node level) graph of a block sparse matrix for the multifrontal solver.
subroutine, public hecmw_mf_graph_from_hecmat(hecMAT, graph)
Build the node graph from the nonzero pattern of hecMAT (values are not referenced)....
subroutine, public hecmw_mf_graph_finalize(graph)
Dense kernels of the multifrontal solver, symmetric (LDLt) and unsymmetric (LU) mode.
logical function, public hecmw_mf_kernel_blr_available()
Whether the BLR compression is available (LAPACK build).
Numeric factorization (tiled multifrontal LDLt with threshold pivoting and delayed pivots) and the tr...
subroutine, public hecmw_mf_numeric_solve_mpi(sym, map, fct, b, x)
x = A^-1 b on the supernodes distributed by map; b and x are the replicated global vectors in the ori...
subroutine, public hecmw_mf_numeric_finalize(fct)
subroutine, public hecmw_mf_numeric_print(fct)
integer(kind=kint), parameter, public mf_blr_eta
BLR admissibility: default cluster distance threshold, a contribution tile within it of the pivot clu...
subroutine, public hecmw_mf_numeric_factor(hecMAT, sym, fct, ierr)
Factor the matrix of hecMAT in the order of sym, in LDLt mode (lower part referenced) or in LU mode w...
subroutine, public hecmw_mf_numeric_admis_bcast(fct, root)
Broadcast the admissibility cache from the rank that built it (the distributed driver builds the grap...
subroutine, public hecmw_mf_numeric_solve(sym, fct, b, x)
x = A^-1 b with the factor; b and x are in the original DOF numbering. The forward solve works on the...
subroutine, public hecmw_mf_numeric_init(graph, sym, tile, blr, eta, fct)
Estimates of the factor and stack sizes from the symbolic structure and the work space; tile is the t...
subroutine, public hecmw_mf_numeric_factor_mpi(hecMAT, sym, map, fct, ierr)
Factor the matrix with the supernodes distributed by map: every rank first factors its subtrees with ...
Symbolic factorization (elimination tree, column counts, supernodes, row structure) for the multifron...
subroutine, public hecmw_mf_symbolic_cluster(graph, sym, perm)
Refined permutation for the BLR compression: the own nodes of every supernode are reordered by a BFS ...
subroutine, public hecmw_mf_symbolic_finalize(sym)
subroutine, public hecmw_mf_symbolic_print(sym)
subroutine, public hecmw_mf_symbolic_build(graph, perm, relax_nodes, sym)
perm(k) is the original node placed at position k by a fill reducing ordering; any topological reorde...
subroutine, public hecmw_mf_symbolic_check(graph, sym, nerr)
Consistency checks of a built structure against its graph; every violation is reported on unit 6 and ...
HECMW_ORDERING is a program for fill-reducing ordering.
subroutine, public hecmw_ordering_gen(Neqns, Nttbr, Xadj, Adj0, Perm, Invp, opt, loglevel)
hecmw_ordering_gen
Multifrontal direct solver (METHOD=DIRECTmf): LDLt with threshold pivoting for symmetric (possibly in...
subroutine, public hecmw_solve_direct_mf(hecMESH, hecMAT, imsg)
subroutine, public hecmw_mf_compare_builtin(hecMESH, hecMAT, graph, ordering, nerr)
Compare the elimination tree and the column counts with the symbolic stage of the built-in direct sol...
HECMW_SOLVE_DIRECT is a program for the matrix direct solver.
subroutine, public matini(FCT, ordering, loglevel, Ir)
MATINI initializes storage for sparse matrix solver.
subroutine, public setij(hecMESH, hecMAT, FCT)
SETIJ.
subroutine, public hecmw_matresid(hecMESH, hecMAT, X, B, R, COMMtime)
subroutine hecmw_innerproduct_r(hecMESH, ndof, X, Y, sum, COMMtime)
integer(kind=kint), parameter hecmw_sum
subroutine hecmw_abort(comm, code)
integer(kind=kint) function hecmw_comm_get_size()
integer(kind=4), parameter kint
integer(kind=kint) function hecmw_comm_get_comm()
integer(kind=kint), parameter hecmw_max
integer(kind=4), parameter kreal
integer(kind=kint) function hecmw_comm_get_rank()
real(kind=kreal) function hecmw_wtime()
subroutine hecmw_update_r(hecMESH, val, n, m)
subroutine hecmw_allgatherv_real(sbuf, sc, rbuf, rcs, disp, comm)
subroutine hecmw_allreduce_r_comm(val, n, ntag, comm)