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
91 write(*,
'(a)')
'#### SA-AMG fatal error: '//trim(msg)
103 #ifdef HECMW_WITH_LAPACK
114 character(len=*),
intent(in) :: site
115 call hecmw_saamg_abort(
'SA-AMG (PRECOND=22) requires a LAPACK-enabled build ['//trim(site)// &
116 ']; rebuild with --with-lapack (setup.sh) or -DWITH_LAPACK=ON (cmake), or select another preconditioner')
126 integer(kind=kint),
intent(in) :: ier
127 character(len=*),
intent(in) :: what
137 type(hecmwst_saamg_comm),
intent(out) :: cmt
138 integer(kind=kint),
intent(in) :: nnode, nb
139 integer(kind=kint) :: i
151 allocate(cmt%gnode(nnode))
160 type(hecmwst_saamg_comm),
intent(in) :: cmt
161 integer(kind=kint),
intent(in) :: nb
162 real(kind=
kreal),
intent(inout) :: x(:)
164 real(kind=
kreal),
allocatable :: ws(:), wr(:)
165 integer(kind=kint),
allocatable :: req1(:), req2(:)
166 integer(kind=kint),
allocatable :: sta1(:,:), sta2(:,:)
167 integer(kind=kint) :: neib, istart, inum, k, kk, ii, nreq1, nreq2, ns, nr
169 type(c_devptr) :: ws_dev, wr_dev
172 if (cmt%n_neighbor == 0)
return
173 ns = cmt%export_index(cmt%n_neighbor)
174 nr = cmt%import_index(cmt%n_neighbor)
175 allocate(ws(nb*ns), wr(nb*nr))
176 allocate(req1(cmt%n_neighbor), req2(cmt%n_neighbor))
181 ws_dev = acc_malloc(
kreal * nb * ns)
182 wr_dev = acc_malloc(
kreal * nb * nr)
183 call acc_map_data(ws, ws_dev,
kreal * nb * ns)
184 call acc_map_data(wr, wr_dev,
kreal * nb * nr)
189 do neib = 1, cmt%n_neighbor
190 istart = cmt%export_index(neib-1)
191 inum = cmt%export_index(neib) - istart
196 do k = istart+1, istart+inum
198 ii = cmt%export_item(k)
199 ws(nb*(k-1)+kk) = x(nb*(ii-1)+kk)
205 call hecmw_isend_r(ws(nb*istart+1:nb*istart+nb*inum), nb*inum, &
206 cmt%neighbor(neib), 0, cmt%comm, req1(nreq1))
209 do k = istart+1, istart+inum
210 ii = cmt%export_item(k)
212 ws(nb*(k-1)+kk) = x(nb*(ii-1)+kk)
216 call hecmw_isend_r(ws(nb*istart+1:nb*istart+nb*inum), nb*inum, &
217 cmt%neighbor(neib), 0, cmt%comm, req1(nreq1))
223 do neib = 1, cmt%n_neighbor
224 istart = cmt%import_index(neib-1)
225 inum = cmt%import_index(neib) - istart
230 call hecmw_irecv_r(wr(nb*istart+1:nb*istart+nb*inum), nb*inum, &
231 cmt%neighbor(neib), 0, cmt%comm, req2(nreq2))
234 call hecmw_irecv_r(wr(nb*istart+1:nb*istart+nb*inum), nb*inum, &
235 cmt%neighbor(neib), 0, cmt%comm, req2(nreq2))
242 do neib = 1, cmt%n_neighbor
243 istart = cmt%import_index(neib-1)
244 inum = cmt%import_index(neib) - istart
248 do k = istart+1, istart+inum
250 ii = cmt%import_item(k)
251 x(nb*(ii-1)+kk) = wr(nb*(k-1)+kk)
256 do k = istart+1, istart+inum
257 ii = cmt%import_item(k)
259 x(nb*(ii-1)+kk) = wr(nb*(k-1)+kk)
267 call acc_unmap_data(ws)
268 call acc_unmap_data(wr)
269 call acc_free(ws_dev)
270 call acc_free(wr_dev)
272 deallocate(ws, wr, req1, req2, sta1, sta2)
275 if (nb < 0) x(1) = x(1)
285 type(hecmwst_saamg_comm),
intent(in) :: cmt
286 integer(kind=kint),
intent(in) :: nb
287 real(kind=
kreal),
intent(inout) :: x(:)
289 real(kind=
kreal),
allocatable :: ws(:), wr(:)
290 integer(kind=kint),
allocatable :: req1(:), req2(:), sta1(:,:), sta2(:,:)
291 integer(kind=kint) :: neib, istart, inum, k, kk, ii, nreq1, nreq2, ns, nr
293 type(c_devptr) :: ws_dev, wr_dev
296 if (cmt%n_neighbor == 0)
return
297 ns = cmt%import_index(cmt%n_neighbor)
298 nr = cmt%export_index(cmt%n_neighbor)
299 allocate(ws(nb*ns), wr(nb*nr))
300 allocate(req1(cmt%n_neighbor), req2(cmt%n_neighbor))
303 ws_dev = acc_malloc(
kreal * nb * ns)
304 wr_dev = acc_malloc(
kreal * nb * nr)
305 call acc_map_data(ws, ws_dev,
kreal * nb * ns)
306 call acc_map_data(wr, wr_dev,
kreal * nb * nr)
310 do neib = 1, cmt%n_neighbor
311 istart = cmt%import_index(neib-1)
312 inum = cmt%import_index(neib) - istart
317 do k = istart+1, istart+inum
319 ii = cmt%import_item(k)
320 ws(nb*(k-1)+kk) = x(nb*(ii-1)+kk)
326 call hecmw_isend_r(ws(nb*istart+1:nb*istart+nb*inum), nb*inum, &
327 cmt%neighbor(neib), 2, cmt%comm, req1(nreq1))
330 do k = istart+1, istart+inum
331 ii = cmt%import_item(k)
333 ws(nb*(k-1)+kk) = x(nb*(ii-1)+kk)
337 call hecmw_isend_r(ws(nb*istart+1:nb*istart+nb*inum), nb*inum, &
338 cmt%neighbor(neib), 2, cmt%comm, req1(nreq1))
342 do neib = 1, cmt%n_neighbor
343 istart = cmt%export_index(neib-1)
344 inum = cmt%export_index(neib) - istart
349 call hecmw_irecv_r(wr(nb*istart+1:nb*istart+nb*inum), nb*inum, &
350 cmt%neighbor(neib), 2, cmt%comm, req2(nreq2))
353 call hecmw_irecv_r(wr(nb*istart+1:nb*istart+nb*inum), nb*inum, &
354 cmt%neighbor(neib), 2, cmt%comm, req2(nreq2))
361 do neib = 1, cmt%n_neighbor
362 istart = cmt%export_index(neib-1)
363 inum = cmt%export_index(neib) - istart
367 do k = istart+1, istart+inum
369 ii = cmt%export_item(k)
370 x(nb*(ii-1)+kk) = x(nb*(ii-1)+kk) + wr(nb*(k-1)+kk)
375 do k = istart+1, istart+inum
376 ii = cmt%export_item(k)
378 x(nb*(ii-1)+kk) = x(nb*(ii-1)+kk) + wr(nb*(k-1)+kk)
385 call acc_unmap_data(ws)
386 call acc_unmap_data(wr)
387 call acc_free(ws_dev)
388 call acc_free(wr_dev)
390 deallocate(ws, wr, req1, req2, sta1, sta2)
392 if (nb < 0) x(1) = x(1)
400 type(hecmwst_saamg_comm),
intent(in) :: cmt
401 integer(kind=kint),
intent(in) :: nb
402 integer(kind=kint),
intent(inout) :: ix(:)
404 integer(kind=kint),
allocatable :: ws(:), wr(:)
405 integer(kind=kint),
allocatable :: req1(:), req2(:)
406 integer(kind=kint),
allocatable :: sta1(:,:), sta2(:,:)
407 integer(kind=kint) :: neib, istart, inum, k, kk, ii, nreq1, nreq2, ns, nr
409 if (cmt%n_neighbor == 0)
return
410 ns = cmt%export_index(cmt%n_neighbor)
411 nr = cmt%import_index(cmt%n_neighbor)
412 allocate(ws(nb*ns), wr(nb*nr))
413 allocate(req1(cmt%n_neighbor), req2(cmt%n_neighbor))
417 do neib = 1, cmt%n_neighbor
418 istart = cmt%export_index(neib-1)
419 inum = cmt%export_index(neib) - istart
421 do k = istart+1, istart+inum
422 ii = cmt%export_item(k)
424 ws(nb*(k-1)+kk) = ix(nb*(ii-1)+kk)
429 cmt%neighbor(neib), 0, cmt%comm, req1(nreq1))
432 do neib = 1, cmt%n_neighbor
433 istart = cmt%import_index(neib-1)
434 inum = cmt%import_index(neib) - istart
438 cmt%neighbor(neib), 0, cmt%comm, req2(nreq2))
441 do neib = 1, cmt%n_neighbor
442 istart = cmt%import_index(neib-1)
443 inum = cmt%import_index(neib) - istart
444 do k = istart+1, istart+inum
445 ii = cmt%import_item(k)
447 ix(nb*(ii-1)+kk) = wr(nb*(k-1)+kk)
452 deallocate(ws, wr, req1, req2, sta1, sta2)
454 if (nb < 0) ix(1) = ix(1)
466 type(hecmwst_saamg_comm),
intent(in) :: cmt
467 integer(kind=kint),
intent(in) :: pb
468 integer(kind=kint),
intent(in) :: cnt(:)
469 integer(kind=kint),
intent(in) :: off(:)
470 real(kind=
kreal),
intent(inout) :: x(:)
472 real(kind=
kreal),
allocatable :: ws(:), wr(:)
473 integer(kind=kint),
allocatable :: req1(:), req2(:)
474 integer(kind=kint),
allocatable :: sta1(:,:), sta2(:,:)
475 integer(kind=kint),
allocatable :: sdisp(:), rdisp(:)
476 integer(kind=kint) :: neib, k, ii, c, o, wp, nreq1, nreq2, b, nblk, astat
478 if (cmt%n_neighbor == 0)
return
479 allocate(sdisp(0:cmt%n_neighbor), rdisp(0:cmt%n_neighbor))
480 sdisp(0) = 0; rdisp(0) = 0
481 do neib = 1, cmt%n_neighbor
483 do k = cmt%export_index(neib-1)+1, cmt%export_index(neib)
484 nblk = nblk + cnt(cmt%export_item(k))
486 sdisp(neib) = sdisp(neib-1) + nblk
488 do k = cmt%import_index(neib-1)+1, cmt%import_index(neib)
489 nblk = nblk + cnt(cmt%import_item(k))
491 rdisp(neib) = rdisp(neib-1) + nblk
493 allocate(ws(sdisp(cmt%n_neighbor)*pb), wr(rdisp(cmt%n_neighbor)*pb), stat=astat)
495 allocate(req1(cmt%n_neighbor), req2(cmt%n_neighbor))
500 do neib = 1, cmt%n_neighbor
501 if (sdisp(neib) == sdisp(neib-1)) cycle
503 do k = cmt%export_index(neib-1)+1, cmt%export_index(neib)
504 ii = cmt%export_item(k); c = cnt(ii); o = off(ii)
506 ws(wp*pb+b) = x(o*pb+b)
512 (sdisp(neib)-sdisp(neib-1))*pb, cmt%neighbor(neib), 0, cmt%comm, req1(nreq1))
517 do neib = 1, cmt%n_neighbor
518 if (rdisp(neib) == rdisp(neib-1)) cycle
521 (rdisp(neib)-rdisp(neib-1))*pb, cmt%neighbor(neib), 0, cmt%comm, req2(nreq2))
527 do neib = 1, cmt%n_neighbor
529 do k = cmt%import_index(neib-1)+1, cmt%import_index(neib)
530 ii = cmt%import_item(k); c = cnt(ii); o = off(ii)
532 x(o*pb+b) = wr(wp*pb+b)
539 deallocate(ws, wr, req1, req2, sta1, sta2, sdisp, rdisp)
541 if (pb < 0) x(1) = x(1)
549 type(hecmwst_saamg_comm),
intent(in) :: cmt
550 integer(kind=kint),
intent(in) :: cnt(:)
551 integer(kind=kint),
intent(in) :: off(:)
552 integer(kind=kint),
intent(inout) :: ix(:)
554 integer(kind=kint),
allocatable :: ws(:), wr(:)
555 integer(kind=kint),
allocatable :: req1(:), req2(:)
556 integer(kind=kint),
allocatable :: sta1(:,:), sta2(:,:)
557 integer(kind=kint),
allocatable :: sdisp(:), rdisp(:)
558 integer(kind=kint) :: neib, k, ii, c, o, wp, nreq1, nreq2, b, nblk, astat
560 if (cmt%n_neighbor == 0)
return
561 allocate(sdisp(0:cmt%n_neighbor), rdisp(0:cmt%n_neighbor))
562 sdisp(0) = 0; rdisp(0) = 0
563 do neib = 1, cmt%n_neighbor
565 do k = cmt%export_index(neib-1)+1, cmt%export_index(neib)
566 nblk = nblk + cnt(cmt%export_item(k))
568 sdisp(neib) = sdisp(neib-1) + nblk
570 do k = cmt%import_index(neib-1)+1, cmt%import_index(neib)
571 nblk = nblk + cnt(cmt%import_item(k))
573 rdisp(neib) = rdisp(neib-1) + nblk
575 allocate(ws(sdisp(cmt%n_neighbor)), wr(rdisp(cmt%n_neighbor)), stat=astat)
577 allocate(req1(cmt%n_neighbor), req2(cmt%n_neighbor))
581 do neib = 1, cmt%n_neighbor
582 if (sdisp(neib) == sdisp(neib-1)) cycle
584 do k = cmt%export_index(neib-1)+1, cmt%export_index(neib)
585 ii = cmt%export_item(k); c = cnt(ii); o = off(ii)
593 sdisp(neib)-sdisp(neib-1), cmt%neighbor(neib), 0, cmt%comm, req1(nreq1))
597 do neib = 1, cmt%n_neighbor
598 if (rdisp(neib) == rdisp(neib-1)) cycle
601 rdisp(neib)-rdisp(neib-1), cmt%neighbor(neib), 0, cmt%comm, req2(nreq2))
606 do neib = 1, cmt%n_neighbor
608 do k = cmt%import_index(neib-1)+1, cmt%import_index(neib)
609 ii = cmt%import_item(k); c = cnt(ii); o = off(ii)
618 deallocate(ws, wr, req1, req2, sta1, sta2, sdisp, rdisp)
620 if (
size(cnt) < 0) ix(1) = ix(1)
626 type(hecmwst_saamg_comm),
intent(in) :: cmt
627 integer(kind=kint) :: np
632 if (cmt%my_rank < 0) np = 1
638 type(hecmwst_saamg_comm),
intent(in) :: cmt
639 integer(kind=kint),
intent(in) :: sval
640 integer(kind=kint),
intent(out) :: rbuf(:)
651 type(hecmwst_saamg_comm),
intent(in) :: cmt
652 integer(kind=kint),
intent(in) :: sendvals(:)
653 integer(kind=kint),
intent(out) :: recvvals(:)
655 integer(kind=kint),
allocatable :: req(:), sta(:,:)
656 integer(kind=kint) :: neib, nreq
657 if (cmt%n_neighbor == 0)
return
660 do neib = 1, cmt%n_neighbor
662 call hecmw_irecv_int(recvvals(neib:neib), 1, cmt%neighbor(neib), 1, cmt%comm, req(nreq))
664 do neib = 1, cmt%n_neighbor
666 call hecmw_isend_int(sendvals(neib:neib), 1, cmt%neighbor(neib), 1, cmt%comm, req(nreq))
671 if (
size(sendvals) > 0) recvvals = sendvals
677 type(hecmwst_saamg_comm),
intent(in) :: cmt
678 real(kind=
kreal),
intent(inout) :: s
680 real(kind=
kreal) :: buf(1)
683 if (cmt%my_rank < 0) s = s
689 type(hecmwst_saamg_comm),
intent(in) :: cmt
690 integer(kind=kint),
intent(inout) :: n
692 integer(kind=kint) :: buf(1)
695 if (cmt%my_rank < 0) n = n
701 type(hecmwst_saamg_comm),
intent(in) :: cmt
702 integer(kind=kint),
intent(inout) :: n
704 integer(kind=kint) :: buf(1)
707 if (cmt%my_rank < 0) n = n
713 type(hecmwst_saamg_comm),
intent(in) :: cmt
714 real(kind=
kreal),
intent(inout) :: s
716 real(kind=
kreal) :: buf(1)
719 if (cmt%my_rank < 0) s = s
727 type(hecmwst_saamg_comm),
intent(in) :: cmt
728 integer(kind=kint),
intent(in) :: nloc
729 integer(kind=kint),
intent(in) :: ti(:), tj(:)
730 real(kind=
kreal),
intent(in) :: tv(:)
731 integer(kind=kint),
intent(out) :: ntot
732 integer(kind=kint),
allocatable,
intent(out) :: gti(:), gtj(:)
733 real(kind=
kreal),
allocatable,
intent(out) :: gtv(:)
735 integer(kind=kint),
allocatable :: counts(:), displs(:)
736 integer(kind=kint) :: nprocs, p
738 allocate(counts(nprocs), displs(nprocs))
742 displs(p) = displs(p-1) + counts(p-1)
744 ntot = displs(nprocs) + counts(nprocs)
745 allocate(gti(max(ntot,1)), gtj(max(ntot,1)), gtv(max(ntot,1)))
749 deallocate(counts, displs)
752 allocate(gti(max(ntot,1)), gtj(max(ntot,1)), gtv(max(ntot,1)))
753 gti(1:nloc) = ti(1:nloc); gtj(1:nloc) = tj(1:nloc); gtv(1:nloc) = tv(1:nloc)
760 type(hecmwst_saamg_comm),
intent(in) :: cmt
761 integer(kind=kint),
intent(in) :: nloc
762 real(kind=
kreal),
intent(in) :: vloc(:)
763 integer(kind=kint),
intent(out) :: ntot
764 real(kind=
kreal),
allocatable,
intent(out) :: gv(:)
766 integer(kind=kint),
allocatable :: counts(:), displs(:)
767 integer(kind=kint) :: nprocs, p
769 allocate(counts(nprocs), displs(nprocs))
773 displs(p) = displs(p-1) + counts(p-1)
775 ntot = displs(nprocs) + counts(nprocs)
776 allocate(gv(max(ntot,1)))
778 deallocate(counts, displs)
781 allocate(gv(max(ntot,1)))
782 gv(1:nloc) = vloc(1:nloc)
789 type(hecmwst_saamg_comm),
intent(in) :: cmt
790 integer(kind=kint),
intent(in) :: scnt(:)
791 integer(kind=kint),
intent(out) :: rcnt(:)
803 type(hecmwst_saamg_comm),
intent(in) :: cmt
804 integer(kind=kint),
intent(in) :: scnt(:), sbuf(:)
805 integer(kind=kint),
intent(out) :: ntot
806 integer(kind=kint),
allocatable,
intent(out) :: rbuf(:)
808 integer(kind=kint),
allocatable :: rcnt(:), sdis(:), rdis(:)
809 integer(kind=kint) :: nprocs, p
811 allocate(rcnt(nprocs), sdis(nprocs), rdis(nprocs))
813 sdis(1) = 0; rdis(1) = 0
815 sdis(p) = sdis(p-1) + scnt(p-1); rdis(p) = rdis(p-1) + rcnt(p-1)
817 ntot = rdis(nprocs) + rcnt(nprocs)
818 allocate(rbuf(max(ntot,1)))
820 deallocate(rcnt, sdis, rdis)
822 ntot = scnt(1);
allocate(rbuf(max(ntot,1)))
823 if (ntot > 0) rbuf(1:ntot) = sbuf(1:ntot)
832 type(hecmwst_saamg_comm),
intent(in) :: cmt
833 integer(kind=kint),
intent(in) :: scnt(:), si(:), sj(:)
834 real(kind=
kreal),
intent(in) :: sv(:)
835 integer(kind=kint),
intent(out) :: ntot
836 integer(kind=kint),
allocatable,
intent(out) :: ri(:), rj(:)
837 real(kind=
kreal),
allocatable,
intent(out) :: rv(:)
839 integer(kind=kint),
allocatable :: rcnt(:), sdis(:), rdis(:)
840 integer(kind=kint) :: nprocs, p
842 allocate(rcnt(nprocs), sdis(nprocs), rdis(nprocs))
844 sdis(1) = 0; rdis(1) = 0
846 sdis(p) = sdis(p-1) + scnt(p-1); rdis(p) = rdis(p-1) + rcnt(p-1)
848 ntot = rdis(nprocs) + rcnt(nprocs)
849 allocate(ri(max(ntot,1)), rj(max(ntot,1)), rv(max(ntot,1)))
853 deallocate(rcnt, sdis, rdis)
855 ntot = scnt(1);
allocate(ri(max(ntot,1)), rj(max(ntot,1)), rv(max(ntot,1)))
856 if (ntot > 0) then; ri(1:ntot) = si(1:ntot); rj(1:ntot) = sj(1:ntot); rv(1:ntot) = sv(1:ntot);
end if
865 type(hecmwst_saamg_comm),
intent(in) :: cmt
866 integer(kind=kint),
intent(in) :: scnt(:)
867 real(kind=
kreal),
intent(in) :: sval(:)
868 integer(kind=kint),
intent(out) :: ntot
869 real(kind=
kreal),
allocatable,
intent(out) :: rval(:)
871 integer(kind=kint),
allocatable :: rcnt(:), sdis(:), rdis(:)
872 integer(kind=kint) :: nprocs, p
874 allocate(rcnt(nprocs), sdis(nprocs), rdis(nprocs))
876 sdis(1) = 0; rdis(1) = 0
878 sdis(p) = sdis(p-1) + scnt(p-1); rdis(p) = rdis(p-1) + rcnt(p-1)
880 ntot = rdis(nprocs) + rcnt(nprocs)
881 allocate(rval(max(ntot,1)))
883 deallocate(rcnt, sdis, rdis)
885 ntot = scnt(1);
allocate(rval(max(ntot,1)))
886 if (ntot > 0) rval(1:ntot) = sval(1:ntot)
892 type(hecmwst_saamg_comm),
intent(in) :: src
893 type(hecmwst_saamg_comm),
intent(out) :: dst
894 integer(kind=kint) :: nnb
896 dst%comm = src%comm; dst%my_rank = src%my_rank
897 dst%nint = src%nint; dst%nnode = src%nnode; dst%nb = src%nb
898 dst%n_neighbor = src%n_neighbor
899 if (
allocated(src%gnode))
then
900 allocate(dst%gnode(
size(src%gnode))); dst%gnode = src%gnode
904 allocate(dst%neighbor(nnb), dst%import_index(0:nnb), dst%export_index(0:nnb))
905 dst%neighbor = src%neighbor
906 dst%import_index = src%import_index
907 dst%export_index = src%export_index
908 allocate(dst%import_item(
size(src%import_item)), dst%export_item(
size(src%export_item)))
909 dst%import_item = src%import_item
910 dst%export_item = src%export_item
914 type(hecmwst_saamg_comm),
intent(inout) :: cmt
915 if (
allocated(cmt%neighbor))
deallocate(cmt%neighbor)
916 if (
allocated(cmt%import_index))
deallocate(cmt%import_index)
917 if (
allocated(cmt%import_item))
deallocate(cmt%import_item)
918 if (
allocated(cmt%export_index))
deallocate(cmt%export_index)
919 if (
allocated(cmt%export_item))
deallocate(cmt%export_item)
920 if (
allocated(cmt%gnode))
deallocate(cmt%gnode)
921 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)....