39 public :: hecmwst_saamg_comm
67 type hecmwst_saamg_comm
68 integer(kind=kint) :: comm = 0
69 integer(kind=kint) :: my_rank = 0
70 integer(kind=kint) :: nint = 0
71 integer(kind=kint) :: nnode = 0
72 integer(kind=kint) :: nb = 0
73 integer(kind=kint) :: n_neighbor = 0
74 integer(kind=kint),
allocatable :: neighbor(:)
75 integer(kind=kint),
allocatable :: import_index(:)
76 integer(kind=kint),
allocatable :: import_item(:)
77 integer(kind=kint),
allocatable :: export_index(:)
78 integer(kind=kint),
allocatable :: export_item(:)
79 integer(kind=kint),
allocatable :: gnode(:)
80 end type hecmwst_saamg_comm
90 character(len=*),
intent(in) :: msg
92 write(*,
'(a)')
'#### SA-AMG fatal error: '//trim(msg)
105 #ifdef HECMW_WITH_LAPACK
116 character(len=*),
intent(in) :: site
117 call hecmw_saamg_abort(
'SA-AMG (PRECOND=22) requires a LAPACK-enabled build ['//trim(site)// &
118 ']; rebuild with --with-lapack (setup.sh) or -DWITH_LAPACK=ON (cmake), or select another preconditioner')
128 integer(kind=kint),
intent(in) :: ier
129 character(len=*),
intent(in) :: what
139 type(hecmwst_saamg_comm),
intent(out) :: cmt
140 integer(kind=kint),
intent(in) :: nnode, nb
141 integer(kind=kint) :: i
153 allocate(cmt%gnode(nnode))
162 type(hecmwst_saamg_comm),
intent(in) :: cmt
163 integer(kind=kint),
intent(in) :: nb
164 real(kind=
kreal),
intent(inout) :: x(:)
166 real(kind=
kreal),
allocatable :: ws(:), wr(:)
167 integer(kind=kint),
allocatable :: req1(:), req2(:)
168 integer(kind=kint),
allocatable :: sta1(:,:), sta2(:,:)
169 integer(kind=kint) :: neib, istart, inum, k, kk, ii, nreq1, nreq2, ns, nr
171 type(c_devptr) :: ws_dev, wr_dev
174 if (cmt%n_neighbor == 0)
return
175 ns = cmt%export_index(cmt%n_neighbor)
176 nr = cmt%import_index(cmt%n_neighbor)
177 allocate(ws(nb*ns), wr(nb*nr))
178 allocate(req1(cmt%n_neighbor), req2(cmt%n_neighbor))
183 ws_dev = acc_malloc(
kreal * nb * ns)
184 wr_dev = acc_malloc(
kreal * nb * nr)
185 call acc_map_data(ws, ws_dev,
kreal * nb * ns)
186 call acc_map_data(wr, wr_dev,
kreal * nb * nr)
191 do neib = 1, cmt%n_neighbor
192 istart = cmt%export_index(neib-1)
193 inum = cmt%export_index(neib) - istart
198 do k = istart+1, istart+inum
200 ii = cmt%export_item(k)
201 ws(nb*(k-1)+kk) = x(nb*(ii-1)+kk)
207 call hecmw_isend_r(ws(nb*istart+1:nb*istart+nb*inum), nb*inum, &
208 cmt%neighbor(neib), 0, cmt%comm, req1(nreq1))
211 do k = istart+1, istart+inum
212 ii = cmt%export_item(k)
214 ws(nb*(k-1)+kk) = x(nb*(ii-1)+kk)
218 call hecmw_isend_r(ws(nb*istart+1:nb*istart+nb*inum), nb*inum, &
219 cmt%neighbor(neib), 0, cmt%comm, req1(nreq1))
225 do neib = 1, cmt%n_neighbor
226 istart = cmt%import_index(neib-1)
227 inum = cmt%import_index(neib) - istart
232 call hecmw_irecv_r(wr(nb*istart+1:nb*istart+nb*inum), nb*inum, &
233 cmt%neighbor(neib), 0, cmt%comm, req2(nreq2))
236 call hecmw_irecv_r(wr(nb*istart+1:nb*istart+nb*inum), nb*inum, &
237 cmt%neighbor(neib), 0, cmt%comm, req2(nreq2))
244 do neib = 1, cmt%n_neighbor
245 istart = cmt%import_index(neib-1)
246 inum = cmt%import_index(neib) - istart
250 do k = istart+1, istart+inum
252 ii = cmt%import_item(k)
253 x(nb*(ii-1)+kk) = wr(nb*(k-1)+kk)
258 do k = istart+1, istart+inum
259 ii = cmt%import_item(k)
261 x(nb*(ii-1)+kk) = wr(nb*(k-1)+kk)
269 call acc_unmap_data(ws)
270 call acc_unmap_data(wr)
271 call acc_free(ws_dev)
272 call acc_free(wr_dev)
274 deallocate(ws, wr, req1, req2, sta1, sta2)
277 if (nb < 0) x(1) = x(1)
287 type(hecmwst_saamg_comm),
intent(in) :: cmt
288 integer(kind=kint),
intent(in) :: nb
289 real(kind=
kreal),
intent(inout) :: x(:)
291 real(kind=
kreal),
allocatable :: ws(:), wr(:)
292 integer(kind=kint),
allocatable :: req1(:), req2(:), sta1(:,:), sta2(:,:)
293 integer(kind=kint) :: neib, istart, inum, k, kk, ii, nreq1, nreq2, ns, nr
295 type(c_devptr) :: ws_dev, wr_dev
298 if (cmt%n_neighbor == 0)
return
299 ns = cmt%import_index(cmt%n_neighbor)
300 nr = cmt%export_index(cmt%n_neighbor)
301 allocate(ws(nb*ns), wr(nb*nr))
302 allocate(req1(cmt%n_neighbor), req2(cmt%n_neighbor))
305 ws_dev = acc_malloc(
kreal * nb * ns)
306 wr_dev = acc_malloc(
kreal * nb * nr)
307 call acc_map_data(ws, ws_dev,
kreal * nb * ns)
308 call acc_map_data(wr, wr_dev,
kreal * nb * nr)
312 do neib = 1, cmt%n_neighbor
313 istart = cmt%import_index(neib-1)
314 inum = cmt%import_index(neib) - istart
319 do k = istart+1, istart+inum
321 ii = cmt%import_item(k)
322 ws(nb*(k-1)+kk) = x(nb*(ii-1)+kk)
328 call hecmw_isend_r(ws(nb*istart+1:nb*istart+nb*inum), nb*inum, &
329 cmt%neighbor(neib), 2, cmt%comm, req1(nreq1))
332 do k = istart+1, istart+inum
333 ii = cmt%import_item(k)
335 ws(nb*(k-1)+kk) = x(nb*(ii-1)+kk)
339 call hecmw_isend_r(ws(nb*istart+1:nb*istart+nb*inum), nb*inum, &
340 cmt%neighbor(neib), 2, cmt%comm, req1(nreq1))
344 do neib = 1, cmt%n_neighbor
345 istart = cmt%export_index(neib-1)
346 inum = cmt%export_index(neib) - istart
351 call hecmw_irecv_r(wr(nb*istart+1:nb*istart+nb*inum), nb*inum, &
352 cmt%neighbor(neib), 2, cmt%comm, req2(nreq2))
355 call hecmw_irecv_r(wr(nb*istart+1:nb*istart+nb*inum), nb*inum, &
356 cmt%neighbor(neib), 2, cmt%comm, req2(nreq2))
363 do neib = 1, cmt%n_neighbor
364 istart = cmt%export_index(neib-1)
365 inum = cmt%export_index(neib) - istart
369 do k = istart+1, istart+inum
371 ii = cmt%export_item(k)
372 x(nb*(ii-1)+kk) = x(nb*(ii-1)+kk) + wr(nb*(k-1)+kk)
377 do k = istart+1, istart+inum
378 ii = cmt%export_item(k)
380 x(nb*(ii-1)+kk) = x(nb*(ii-1)+kk) + wr(nb*(k-1)+kk)
387 call acc_unmap_data(ws)
388 call acc_unmap_data(wr)
389 call acc_free(ws_dev)
390 call acc_free(wr_dev)
392 deallocate(ws, wr, req1, req2, sta1, sta2)
394 if (nb < 0) x(1) = x(1)
402 type(hecmwst_saamg_comm),
intent(in) :: cmt
403 integer(kind=kint),
intent(in) :: nb
404 integer(kind=kint),
intent(inout) :: ix(:)
406 integer(kind=kint),
allocatable :: ws(:), wr(:)
407 integer(kind=kint),
allocatable :: req1(:), req2(:)
408 integer(kind=kint),
allocatable :: sta1(:,:), sta2(:,:)
409 integer(kind=kint) :: neib, istart, inum, k, kk, ii, nreq1, nreq2, ns, nr
411 if (cmt%n_neighbor == 0)
return
412 ns = cmt%export_index(cmt%n_neighbor)
413 nr = cmt%import_index(cmt%n_neighbor)
414 allocate(ws(nb*ns), wr(nb*nr))
415 allocate(req1(cmt%n_neighbor), req2(cmt%n_neighbor))
419 do neib = 1, cmt%n_neighbor
420 istart = cmt%export_index(neib-1)
421 inum = cmt%export_index(neib) - istart
423 do k = istart+1, istart+inum
424 ii = cmt%export_item(k)
426 ws(nb*(k-1)+kk) = ix(nb*(ii-1)+kk)
431 cmt%neighbor(neib), 0, cmt%comm, req1(nreq1))
434 do neib = 1, cmt%n_neighbor
435 istart = cmt%import_index(neib-1)
436 inum = cmt%import_index(neib) - istart
440 cmt%neighbor(neib), 0, cmt%comm, req2(nreq2))
443 do neib = 1, cmt%n_neighbor
444 istart = cmt%import_index(neib-1)
445 inum = cmt%import_index(neib) - istart
446 do k = istart+1, istart+inum
447 ii = cmt%import_item(k)
449 ix(nb*(ii-1)+kk) = wr(nb*(k-1)+kk)
454 deallocate(ws, wr, req1, req2, sta1, sta2)
456 if (nb < 0) ix(1) = ix(1)
468 type(hecmwst_saamg_comm),
intent(in) :: cmt
469 integer(kind=kint),
intent(in) :: pb
470 integer(kind=kint),
intent(in) :: cnt(:)
471 integer(kind=kint),
intent(in) :: off(:)
472 real(kind=
kreal),
intent(inout) :: x(:)
474 real(kind=
kreal),
allocatable :: ws(:), wr(:)
475 integer(kind=kint),
allocatable :: req1(:), req2(:)
476 integer(kind=kint),
allocatable :: sta1(:,:), sta2(:,:)
477 integer(kind=kint),
allocatable :: sdisp(:), rdisp(:)
478 integer(kind=kint) :: neib, k, ii, c, o, wp, nreq1, nreq2, b, nblk, astat
480 if (cmt%n_neighbor == 0)
return
481 allocate(sdisp(0:cmt%n_neighbor), rdisp(0:cmt%n_neighbor))
482 sdisp(0) = 0; rdisp(0) = 0
483 do neib = 1, cmt%n_neighbor
485 do k = cmt%export_index(neib-1)+1, cmt%export_index(neib)
486 nblk = nblk + cnt(cmt%export_item(k))
488 sdisp(neib) = sdisp(neib-1) + nblk
490 do k = cmt%import_index(neib-1)+1, cmt%import_index(neib)
491 nblk = nblk + cnt(cmt%import_item(k))
493 rdisp(neib) = rdisp(neib-1) + nblk
495 allocate(ws(sdisp(cmt%n_neighbor)*pb), wr(rdisp(cmt%n_neighbor)*pb), stat=astat)
497 allocate(req1(cmt%n_neighbor), req2(cmt%n_neighbor))
502 do neib = 1, cmt%n_neighbor
503 if (sdisp(neib) == sdisp(neib-1)) cycle
505 do k = cmt%export_index(neib-1)+1, cmt%export_index(neib)
506 ii = cmt%export_item(k); c = cnt(ii); o = off(ii)
508 ws(wp*pb+b) = x(o*pb+b)
514 (sdisp(neib)-sdisp(neib-1))*pb, cmt%neighbor(neib), 0, cmt%comm, req1(nreq1))
519 do neib = 1, cmt%n_neighbor
520 if (rdisp(neib) == rdisp(neib-1)) cycle
523 (rdisp(neib)-rdisp(neib-1))*pb, cmt%neighbor(neib), 0, cmt%comm, req2(nreq2))
529 do neib = 1, cmt%n_neighbor
531 do k = cmt%import_index(neib-1)+1, cmt%import_index(neib)
532 ii = cmt%import_item(k); c = cnt(ii); o = off(ii)
534 x(o*pb+b) = wr(wp*pb+b)
541 deallocate(ws, wr, req1, req2, sta1, sta2, sdisp, rdisp)
543 if (pb < 0) x(1) = x(1)
551 type(hecmwst_saamg_comm),
intent(in) :: cmt
552 integer(kind=kint),
intent(in) :: cnt(:)
553 integer(kind=kint),
intent(in) :: off(:)
554 integer(kind=kint),
intent(inout) :: ix(:)
556 integer(kind=kint),
allocatable :: ws(:), wr(:)
557 integer(kind=kint),
allocatable :: req1(:), req2(:)
558 integer(kind=kint),
allocatable :: sta1(:,:), sta2(:,:)
559 integer(kind=kint),
allocatable :: sdisp(:), rdisp(:)
560 integer(kind=kint) :: neib, k, ii, c, o, wp, nreq1, nreq2, b, nblk, astat
562 if (cmt%n_neighbor == 0)
return
563 allocate(sdisp(0:cmt%n_neighbor), rdisp(0:cmt%n_neighbor))
564 sdisp(0) = 0; rdisp(0) = 0
565 do neib = 1, cmt%n_neighbor
567 do k = cmt%export_index(neib-1)+1, cmt%export_index(neib)
568 nblk = nblk + cnt(cmt%export_item(k))
570 sdisp(neib) = sdisp(neib-1) + nblk
572 do k = cmt%import_index(neib-1)+1, cmt%import_index(neib)
573 nblk = nblk + cnt(cmt%import_item(k))
575 rdisp(neib) = rdisp(neib-1) + nblk
577 allocate(ws(sdisp(cmt%n_neighbor)), wr(rdisp(cmt%n_neighbor)), stat=astat)
579 allocate(req1(cmt%n_neighbor), req2(cmt%n_neighbor))
583 do neib = 1, cmt%n_neighbor
584 if (sdisp(neib) == sdisp(neib-1)) cycle
586 do k = cmt%export_index(neib-1)+1, cmt%export_index(neib)
587 ii = cmt%export_item(k); c = cnt(ii); o = off(ii)
595 sdisp(neib)-sdisp(neib-1), cmt%neighbor(neib), 0, cmt%comm, req1(nreq1))
599 do neib = 1, cmt%n_neighbor
600 if (rdisp(neib) == rdisp(neib-1)) cycle
603 rdisp(neib)-rdisp(neib-1), cmt%neighbor(neib), 0, cmt%comm, req2(nreq2))
608 do neib = 1, cmt%n_neighbor
610 do k = cmt%import_index(neib-1)+1, cmt%import_index(neib)
611 ii = cmt%import_item(k); c = cnt(ii); o = off(ii)
620 deallocate(ws, wr, req1, req2, sta1, sta2, sdisp, rdisp)
622 if (
size(cnt) < 0) ix(1) = ix(1)
628 type(hecmwst_saamg_comm),
intent(in) :: cmt
629 integer(kind=kint) :: np
634 if (cmt%my_rank < 0) np = 1
640 type(hecmwst_saamg_comm),
intent(in) :: cmt
641 integer(kind=kint),
intent(in) :: sval
642 integer(kind=kint),
intent(out) :: rbuf(:)
653 type(hecmwst_saamg_comm),
intent(in) :: cmt
654 integer(kind=kint),
intent(in) :: sendvals(:)
655 integer(kind=kint),
intent(out) :: recvvals(:)
657 integer(kind=kint),
allocatable :: req(:), sta(:,:)
658 integer(kind=kint) :: neib, nreq
659 if (cmt%n_neighbor == 0)
return
662 do neib = 1, cmt%n_neighbor
664 call hecmw_irecv_int(recvvals(neib:neib), 1, cmt%neighbor(neib), 1, cmt%comm, req(nreq))
666 do neib = 1, cmt%n_neighbor
668 call hecmw_isend_int(sendvals(neib:neib), 1, cmt%neighbor(neib), 1, cmt%comm, req(nreq))
673 if (
size(sendvals) > 0) recvvals = sendvals
679 type(hecmwst_saamg_comm),
intent(in) :: cmt
680 real(kind=
kreal),
intent(inout) :: s
682 real(kind=
kreal) :: buf(1)
685 if (cmt%my_rank < 0) s = s
691 type(hecmwst_saamg_comm),
intent(in) :: cmt
692 integer(kind=kint),
intent(inout) :: n
694 integer(kind=kint) :: buf(1)
697 if (cmt%my_rank < 0) n = n
703 type(hecmwst_saamg_comm),
intent(in) :: cmt
704 integer(kind=kint),
intent(inout) :: n
706 integer(kind=kint) :: buf(1)
709 if (cmt%my_rank < 0) n = n
715 type(hecmwst_saamg_comm),
intent(in) :: cmt
716 real(kind=
kreal),
intent(inout) :: s
718 real(kind=
kreal) :: buf(1)
721 if (cmt%my_rank < 0) s = s
729 type(hecmwst_saamg_comm),
intent(in) :: cmt
730 integer(kind=kint),
intent(in) :: nloc
731 integer(kind=kint),
intent(in) :: ti(:), tj(:)
732 real(kind=
kreal),
intent(in) :: tv(:)
733 integer(kind=kint),
intent(out) :: ntot
734 integer(kind=kint),
allocatable,
intent(out) :: gti(:), gtj(:)
735 real(kind=
kreal),
allocatable,
intent(out) :: gtv(:)
737 integer(kind=kint),
allocatable :: counts(:), displs(:)
738 integer(kind=kint) :: nprocs, p
740 allocate(counts(nprocs), displs(nprocs))
744 displs(p) = displs(p-1) + counts(p-1)
746 ntot = displs(nprocs) + counts(nprocs)
747 allocate(gti(max(ntot,1)), gtj(max(ntot,1)), gtv(max(ntot,1)))
751 deallocate(counts, displs)
754 allocate(gti(max(ntot,1)), gtj(max(ntot,1)), gtv(max(ntot,1)))
755 gti(1:nloc) = ti(1:nloc); gtj(1:nloc) = tj(1:nloc); gtv(1:nloc) = tv(1:nloc)
762 type(hecmwst_saamg_comm),
intent(in) :: cmt
763 integer(kind=kint),
intent(in) :: nloc
764 real(kind=
kreal),
intent(in) :: vloc(:)
765 integer(kind=kint),
intent(out) :: ntot
766 real(kind=
kreal),
allocatable,
intent(out) :: gv(:)
768 integer(kind=kint),
allocatable :: counts(:), displs(:)
769 integer(kind=kint) :: nprocs, p
771 allocate(counts(nprocs), displs(nprocs))
775 displs(p) = displs(p-1) + counts(p-1)
777 ntot = displs(nprocs) + counts(nprocs)
778 allocate(gv(max(ntot,1)))
780 deallocate(counts, displs)
783 allocate(gv(max(ntot,1)))
784 gv(1:nloc) = vloc(1:nloc)
791 type(hecmwst_saamg_comm),
intent(in) :: cmt
792 integer(kind=kint),
intent(in) :: scnt(:)
793 integer(kind=kint),
intent(out) :: rcnt(:)
805 type(hecmwst_saamg_comm),
intent(in) :: cmt
806 integer(kind=kint),
intent(in) :: scnt(:), sbuf(:)
807 integer(kind=kint),
intent(out) :: ntot
808 integer(kind=kint),
allocatable,
intent(out) :: rbuf(:)
810 integer(kind=kint),
allocatable :: rcnt(:), sdis(:), rdis(:)
811 integer(kind=kint) :: nprocs, p
813 allocate(rcnt(nprocs), sdis(nprocs), rdis(nprocs))
815 sdis(1) = 0; rdis(1) = 0
817 sdis(p) = sdis(p-1) + scnt(p-1); rdis(p) = rdis(p-1) + rcnt(p-1)
819 ntot = rdis(nprocs) + rcnt(nprocs)
820 allocate(rbuf(max(ntot,1)))
822 deallocate(rcnt, sdis, rdis)
824 ntot = scnt(1);
allocate(rbuf(max(ntot,1)))
825 if (ntot > 0) rbuf(1:ntot) = sbuf(1:ntot)
834 type(hecmwst_saamg_comm),
intent(in) :: cmt
835 integer(kind=kint),
intent(in) :: scnt(:), si(:), sj(:)
836 real(kind=
kreal),
intent(in) :: sv(:)
837 integer(kind=kint),
intent(out) :: ntot
838 integer(kind=kint),
allocatable,
intent(out) :: ri(:), rj(:)
839 real(kind=
kreal),
allocatable,
intent(out) :: rv(:)
841 integer(kind=kint),
allocatable :: rcnt(:), sdis(:), rdis(:)
842 integer(kind=kint) :: nprocs, p
844 allocate(rcnt(nprocs), sdis(nprocs), rdis(nprocs))
846 sdis(1) = 0; rdis(1) = 0
848 sdis(p) = sdis(p-1) + scnt(p-1); rdis(p) = rdis(p-1) + rcnt(p-1)
850 ntot = rdis(nprocs) + rcnt(nprocs)
851 allocate(ri(max(ntot,1)), rj(max(ntot,1)), rv(max(ntot,1)))
855 deallocate(rcnt, sdis, rdis)
857 ntot = scnt(1);
allocate(ri(max(ntot,1)), rj(max(ntot,1)), rv(max(ntot,1)))
858 if (ntot > 0) then; ri(1:ntot) = si(1:ntot); rj(1:ntot) = sj(1:ntot); rv(1:ntot) = sv(1:ntot);
end if
867 type(hecmwst_saamg_comm),
intent(in) :: cmt
868 integer(kind=kint),
intent(in) :: scnt(:)
869 real(kind=
kreal),
intent(in) :: sval(:)
870 integer(kind=kint),
intent(out) :: ntot
871 real(kind=
kreal),
allocatable,
intent(out) :: rval(:)
873 integer(kind=kint),
allocatable :: rcnt(:), sdis(:), rdis(:)
874 integer(kind=kint) :: nprocs, p
876 allocate(rcnt(nprocs), sdis(nprocs), rdis(nprocs))
878 sdis(1) = 0; rdis(1) = 0
880 sdis(p) = sdis(p-1) + scnt(p-1); rdis(p) = rdis(p-1) + rcnt(p-1)
882 ntot = rdis(nprocs) + rcnt(nprocs)
883 allocate(rval(max(ntot,1)))
885 deallocate(rcnt, sdis, rdis)
887 ntot = scnt(1);
allocate(rval(max(ntot,1)))
888 if (ntot > 0) rval(1:ntot) = sval(1:ntot)
894 type(hecmwst_saamg_comm),
intent(in) :: src
895 type(hecmwst_saamg_comm),
intent(out) :: dst
896 integer(kind=kint) :: nnb
898 dst%comm = src%comm; dst%my_rank = src%my_rank
899 dst%nint = src%nint; dst%nnode = src%nnode; dst%nb = src%nb
900 dst%n_neighbor = src%n_neighbor
901 if (
allocated(src%gnode))
then
902 allocate(dst%gnode(
size(src%gnode))); dst%gnode = src%gnode
906 allocate(dst%neighbor(nnb), dst%import_index(0:nnb), dst%export_index(0:nnb))
907 dst%neighbor = src%neighbor
908 dst%import_index = src%import_index
909 dst%export_index = src%export_index
910 allocate(dst%import_item(
size(src%import_item)), dst%export_item(
size(src%export_item)))
911 dst%import_item = src%import_item
912 dst%export_item = src%export_item
916 type(hecmwst_saamg_comm),
intent(inout) :: cmt
917 if (
allocated(cmt%neighbor))
deallocate(cmt%neighbor)
918 if (
allocated(cmt%import_index))
deallocate(cmt%import_index)
919 if (
allocated(cmt%import_item))
deallocate(cmt%import_item)
920 if (
allocated(cmt%export_index))
deallocate(cmt%export_index)
921 if (
allocated(cmt%export_item))
deallocate(cmt%export_item)
922 if (
allocated(cmt%gnode))
deallocate(cmt%gnode)
923 cmt%n_neighbor = 0; cmt%nint = 0; cmt%nnode = 0
Smoothed Aggregation AMG preconditioner : lightweight comm table.
subroutine, public hecmw_saamg_comm_update_var_i(cmt, cnt, off, IX)
Variable-length integer halo exchange (1 int per block). Companion to comm_update_var for the per-blo...
subroutine, public hecmw_saamg_comm_init_serial(cmt, nnode, nb)
Build a trivial single-rank communication table for nnode nodes of block size nb: no neighbors,...
subroutine, public hecmw_saamg_comm_allgatherv_triplets(cmt, nloc, ti, tj, tv, ntot, gti, gtj, gtv)
Allgatherv a triplet stream (ti,tj,tv)[1:nloc] from every rank into the globally-concatenated (gti,...
logical function, public hecmw_saamg_lapack_available()
Whether this build links LAPACK (SA-AMG's setup needs it: dense coarsest factorization,...
subroutine, public hecmw_saamg_comm_update(cmt, nb, X)
Halo exchange of a block vector X (length nb*nnode): fill the halo region nb*nint+1....
subroutine, public hecmw_saamg_check_alloc(ier, what)
Report a failed allocation (stat /= 0) with a clear message and a collective abort,...
subroutine, public hecmw_saamg_comm_allgather_int(cmt, sval, rbuf)
Allgather one integer from every rank into rbuf (size must be #ranks).
subroutine, public hecmw_saamg_comm_allreduce_sum_r(cmt, s)
Global sum-reduction of a scalar over the communicator (no-op when serial).
subroutine, public hecmw_saamg_comm_allreduce_max_r(cmt, s)
Global max-reduction of a scalar over the communicator (no-op when serial).
subroutine, public hecmw_saamg_abort(msg)
Fatal-error termination with a clear message. Under MPI this is a COLLECTIVE abort (hecmw_abort -> MP...
subroutine, public hecmw_saamg_require_lapack(site)
Abort with a uniform message when a LAPACK-only code path is reached in a build without LAPACK....
subroutine, public hecmw_saamg_comm_allreduce_sum_int(cmt, n)
Global sum-reduction of an integer over the communicator (no-op when serial).
subroutine, public hecmw_saamg_comm_alltoall_int(cmt, scnt, rcnt)
MPI_Alltoall of one integer per rank: scnt(r) (count this rank sends to rank r-1) -> rcnt(r) (count t...
subroutine, public hecmw_saamg_comm_alltoallv_triplets(cmt, scnt, si, sj, sv, ntot, ri, rj, rv)
MPI_Alltoallv of triplets (2 int + 1 real). scnt(#ranks) = send counts per destination; si/sj/sv orde...
subroutine, public hecmw_saamg_comm_alltoallv_int(cmt, scnt, sbuf, ntot, rbuf)
MPI_Alltoallv of integers. scnt(#ranks) = send counts per destination rank; sbuf must already be orde...
subroutine, public hecmw_saamg_comm_update_i(cmt, nb, IX)
Integer halo exchange of a block vector IX (length nb*cmtnnode): fill the halo region from owners....
subroutine, public hecmw_saamg_comm_allreduce_max_int(cmt, n)
Global max-reduction of an integer over the communicator (no-op when serial).
subroutine, public hecmw_saamg_comm_exchange_neighbor_int(cmt, sendvals, recvvals)
Exchange one integer with each neighbor: sendvals(k) is sent to neighbor(k), recvvals(k) is received ...
subroutine, public hecmw_saamg_comm_free(cmt)
subroutine, public hecmw_saamg_comm_update_var(cmt, pb, cnt, off, X)
Variable-length real halo exchange. Node i carries cnt(i) blocks of pb reals each,...
subroutine, public hecmw_saamg_comm_allgatherv_real(cmt, nloc, vloc, ntot, gv)
Allgatherv a real vector vloc[1:nloc] from every rank into gv[1:ntot] (allocated here)....
integer(kind=kint) function, public hecmw_saamg_comm_size(cmt)
Number of ranks in this level's communicator (1 when serial).
subroutine, public hecmw_saamg_comm_copy(src, dst)
Deep copy a communication table: dst = src.
subroutine, public hecmw_saamg_comm_alltoallv_real(cmt, scnt, sval, ntot, rval)
MPI_Alltoallv of reals only, reusing a fixed routing (same scnt as a prior _alltoallv_triplets call)....
subroutine, public hecmw_saamg_comm_reverse_add(cmt, nb, X)
Reverse halo exchange with accumulation: send each halo (import) node's value to its owner and ADD it...
Smoothed Aggregation AMG preconditioner : kind parameters.
integer(kind=4), parameter kreal
integer(kind=kint), parameter hecmw_sum
subroutine hecmw_abort(comm, code)
integer(kind=kint) function hecmw_comm_get_comm()
integer(kind=kint), parameter hecmw_max
integer(kind=kint), parameter hecmw_status_size
subroutine hecmw_isend_int(sbuf, sc, dest, tag, comm, req)
subroutine hecmw_allgatherv_int(sbuf, sc, rbuf, rcs, disp, comm)
subroutine hecmw_alltoallv_real(sbuf, scs, sdisp, rbuf, rcs, rdisp, comm)
subroutine hecmw_allgatherv_real(sbuf, sc, rbuf, rcs, disp, comm)
subroutine hecmw_isend_r(sbuf, sc, dest, tag, comm, req)
subroutine hecmw_allgather_int_1(sval, rbuf, comm)
subroutine hecmw_waitall(cnt, reqs, stats)
subroutine hecmw_comm_size(comm, isize)
Number of ranks in an explicit communicator (1 when serial).
subroutine hecmw_alltoallv_int(sbuf, scs, sdisp, rbuf, rcs, rdisp, comm)
subroutine hecmw_irecv_int(rbuf, rc, source, tag, comm, req)
subroutine hecmw_irecv_r(rbuf, rc, source, tag, comm, req)
subroutine hecmw_allreduce_r_comm(val, n, ntag, comm)
subroutine hecmw_alltoall_int(sbuf, sc, rbuf, rc, comm)
subroutine hecmw_allreduce_i_comm(val, n, ntag, comm)
Allreduce over an explicit communicator (ntag = hecmw_sum / hecmw_max / hecmw_min)....