From 86872d99399f3ebb7656e20317cc9ae942298e04 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 23 Jan 2020 14:01:37 +0000 Subject: [PATCH] Define psb_simple_a2av --- base/modules/Makefile | 8 +++-- base/modules/penv/psi_c_collective_mod.F90 | 42 +++++++++++++++++++++- base/modules/penv/psi_d_collective_mod.F90 | 42 +++++++++++++++++++++- base/modules/penv/psi_e_collective_mod.F90 | 42 +++++++++++++++++++++- base/modules/penv/psi_m_collective_mod.F90 | 42 +++++++++++++++++++++- base/modules/penv/psi_s_collective_mod.F90 | 42 +++++++++++++++++++++- base/modules/penv/psi_z_collective_mod.F90 | 42 +++++++++++++++++++++- 7 files changed, 252 insertions(+), 8 deletions(-) diff --git a/base/modules/Makefile b/base/modules/Makefile index 21525a3c..6c19b247 100644 --- a/base/modules/Makefile +++ b/base/modules/Makefile @@ -153,9 +153,13 @@ penv/psi_collective_mod.o: penv/psi_e_collective_mod.o \ penv/psi_z_collective_mod.o penv/psi_m_p2p_mod.o penv/psi_e_p2p_mod.o penv/psi_s_p2p_mod.o \ -penv/psi_d_p2p_mod.o penv/psi_c_p2p_mod.o penv/psi_z_p2p_mod.o\ +penv/psi_d_p2p_mod.o penv/psi_c_p2p_mod.o penv/psi_z_p2p_mod.o: penv/psi_penv_mod.o + penv/psi_e_collective_mod.o penv/psi_m_collective_mod.o penv/psi_s_collective_mod.o \ -penv/psi_d_collective_mod.o penv/psi_c_collective_mod.o penv/psi_z_collective_mod.o: penv/psi_penv_mod.o +penv/psi_d_collective_mod.o penv/psi_c_collective_mod.o penv/psi_z_collective_mod.o: penv/psi_penv_mod.o \ + penv/psi_m_p2p_mod.o penv/psi_e_p2p_mod.o penv/psi_s_p2p_mod.o \ + penv/psi_d_p2p_mod.o penv/psi_c_p2p_mod.o penv/psi_z_p2p_mod.o + auxil/psb_string_mod.o desc/psb_desc_const_mod.o psi_comm_buffers_mod.o: psb_const_mod.o desc/psb_hash_mod.o: psb_realloc_mod.o psb_const_mod.o desc/psb_desc_const_mod.o diff --git a/base/modules/penv/psi_c_collective_mod.F90 b/base/modules/penv/psi_c_collective_mod.F90 index a69f4774..56a70850 100644 --- a/base/modules/penv/psi_c_collective_mod.F90 +++ b/base/modules/penv/psi_c_collective_mod.F90 @@ -62,7 +62,9 @@ module psi_c_collective_mod module procedure psb_cexscan_sums, psb_cexscan_sumv end interface psb_exscan_sum - + interface psb_simple_a2av + module procedure psb_c_simple_a2av + end interface psb_simple_a2av contains @@ -856,5 +858,43 @@ contains dat = czero #endif end subroutine psb_cexscan_sumv + + subroutine psb_c_simple_a2av(valsnd,sdsz,bsdindx,& + & valrcv,rvsz,brvindx,ictxt,info) + use psi_c_p2p_mod + implicit none + complex(psb_spk_), intent(in) :: valsnd(:) + complex(psb_spk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) + integer(psb_ipk_), intent(in) :: ictxt + integer(psb_ipk_), intent(out) :: info + + integer(psb_ipk_) :: iam, np, i,j,k, ip, ipx, idx, sz + + call psb_info(ictxt,iam,np) + + if (min(size(bsdindx),size(brvindx),size(sdsz),size(rvsz)) 0) then + idx = bsdindx(ip+1) + call psb_snd(ictxt,valsnd(idx+1:idx+sz),ip) + end if + end do + + do ip = 0, np-1 + sz = rvsz(ip+1) + if (sz > 0) then + idx = brvindx(ip+1) + call psb_rcv(ictxt,valrcv(idx+1:idx+sz),ip) + end if + end do + + end subroutine psb_c_simple_a2av + end module psi_c_collective_mod diff --git a/base/modules/penv/psi_d_collective_mod.F90 b/base/modules/penv/psi_d_collective_mod.F90 index fa022233..eaac1ac1 100644 --- a/base/modules/penv/psi_d_collective_mod.F90 +++ b/base/modules/penv/psi_d_collective_mod.F90 @@ -76,7 +76,9 @@ module psi_d_collective_mod module procedure psb_dexscan_sums, psb_dexscan_sumv end interface psb_exscan_sum - + interface psb_simple_a2av + module procedure psb_d_simple_a2av + end interface psb_simple_a2av contains @@ -1347,5 +1349,43 @@ contains dat = dzero #endif end subroutine psb_dexscan_sumv + + subroutine psb_d_simple_a2av(valsnd,sdsz,bsdindx,& + & valrcv,rvsz,brvindx,ictxt,info) + use psi_d_p2p_mod + implicit none + real(psb_dpk_), intent(in) :: valsnd(:) + real(psb_dpk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) + integer(psb_ipk_), intent(in) :: ictxt + integer(psb_ipk_), intent(out) :: info + + integer(psb_ipk_) :: iam, np, i,j,k, ip, ipx, idx, sz + + call psb_info(ictxt,iam,np) + + if (min(size(bsdindx),size(brvindx),size(sdsz),size(rvsz)) 0) then + idx = bsdindx(ip+1) + call psb_snd(ictxt,valsnd(idx+1:idx+sz),ip) + end if + end do + + do ip = 0, np-1 + sz = rvsz(ip+1) + if (sz > 0) then + idx = brvindx(ip+1) + call psb_rcv(ictxt,valrcv(idx+1:idx+sz),ip) + end if + end do + + end subroutine psb_d_simple_a2av + end module psi_d_collective_mod diff --git a/base/modules/penv/psi_e_collective_mod.F90 b/base/modules/penv/psi_e_collective_mod.F90 index 59e74280..2cdb9637 100644 --- a/base/modules/penv/psi_e_collective_mod.F90 +++ b/base/modules/penv/psi_e_collective_mod.F90 @@ -72,7 +72,9 @@ module psi_e_collective_mod module procedure psb_eexscan_sums, psb_eexscan_sumv end interface psb_exscan_sum - + interface psb_simple_a2av + module procedure psb_e_simple_a2av + end interface psb_simple_a2av contains @@ -1224,5 +1226,43 @@ contains dat = ezero #endif end subroutine psb_eexscan_sumv + + subroutine psb_e_simple_a2av(valsnd,sdsz,bsdindx,& + & valrcv,rvsz,brvindx,ictxt,info) + use psi_e_p2p_mod + implicit none + integer(psb_epk_), intent(in) :: valsnd(:) + integer(psb_epk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) + integer(psb_ipk_), intent(in) :: ictxt + integer(psb_ipk_), intent(out) :: info + + integer(psb_ipk_) :: iam, np, i,j,k, ip, ipx, idx, sz + + call psb_info(ictxt,iam,np) + + if (min(size(bsdindx),size(brvindx),size(sdsz),size(rvsz)) 0) then + idx = bsdindx(ip+1) + call psb_snd(ictxt,valsnd(idx+1:idx+sz),ip) + end if + end do + + do ip = 0, np-1 + sz = rvsz(ip+1) + if (sz > 0) then + idx = brvindx(ip+1) + call psb_rcv(ictxt,valrcv(idx+1:idx+sz),ip) + end if + end do + + end subroutine psb_e_simple_a2av + end module psi_e_collective_mod diff --git a/base/modules/penv/psi_m_collective_mod.F90 b/base/modules/penv/psi_m_collective_mod.F90 index 5959e468..3d6ca380 100644 --- a/base/modules/penv/psi_m_collective_mod.F90 +++ b/base/modules/penv/psi_m_collective_mod.F90 @@ -72,7 +72,9 @@ module psi_m_collective_mod module procedure psb_mexscan_sums, psb_mexscan_sumv end interface psb_exscan_sum - + interface psb_simple_a2av + module procedure psb_m_simple_a2av + end interface psb_simple_a2av contains @@ -1224,5 +1226,43 @@ contains dat = mzero #endif end subroutine psb_mexscan_sumv + + subroutine psb_m_simple_a2av(valsnd,sdsz,bsdindx,& + & valrcv,rvsz,brvindx,ictxt,info) + use psi_m_p2p_mod + implicit none + integer(psb_mpk_), intent(in) :: valsnd(:) + integer(psb_mpk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) + integer(psb_ipk_), intent(in) :: ictxt + integer(psb_ipk_), intent(out) :: info + + integer(psb_ipk_) :: iam, np, i,j,k, ip, ipx, idx, sz + + call psb_info(ictxt,iam,np) + + if (min(size(bsdindx),size(brvindx),size(sdsz),size(rvsz)) 0) then + idx = bsdindx(ip+1) + call psb_snd(ictxt,valsnd(idx+1:idx+sz),ip) + end if + end do + + do ip = 0, np-1 + sz = rvsz(ip+1) + if (sz > 0) then + idx = brvindx(ip+1) + call psb_rcv(ictxt,valrcv(idx+1:idx+sz),ip) + end if + end do + + end subroutine psb_m_simple_a2av + end module psi_m_collective_mod diff --git a/base/modules/penv/psi_s_collective_mod.F90 b/base/modules/penv/psi_s_collective_mod.F90 index 5de46599..c0e5a778 100644 --- a/base/modules/penv/psi_s_collective_mod.F90 +++ b/base/modules/penv/psi_s_collective_mod.F90 @@ -76,7 +76,9 @@ module psi_s_collective_mod module procedure psb_sexscan_sums, psb_sexscan_sumv end interface psb_exscan_sum - + interface psb_simple_a2av + module procedure psb_s_simple_a2av + end interface psb_simple_a2av contains @@ -1347,5 +1349,43 @@ contains dat = szero #endif end subroutine psb_sexscan_sumv + + subroutine psb_s_simple_a2av(valsnd,sdsz,bsdindx,& + & valrcv,rvsz,brvindx,ictxt,info) + use psi_s_p2p_mod + implicit none + real(psb_spk_), intent(in) :: valsnd(:) + real(psb_spk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) + integer(psb_ipk_), intent(in) :: ictxt + integer(psb_ipk_), intent(out) :: info + + integer(psb_ipk_) :: iam, np, i,j,k, ip, ipx, idx, sz + + call psb_info(ictxt,iam,np) + + if (min(size(bsdindx),size(brvindx),size(sdsz),size(rvsz)) 0) then + idx = bsdindx(ip+1) + call psb_snd(ictxt,valsnd(idx+1:idx+sz),ip) + end if + end do + + do ip = 0, np-1 + sz = rvsz(ip+1) + if (sz > 0) then + idx = brvindx(ip+1) + call psb_rcv(ictxt,valrcv(idx+1:idx+sz),ip) + end if + end do + + end subroutine psb_s_simple_a2av + end module psi_s_collective_mod diff --git a/base/modules/penv/psi_z_collective_mod.F90 b/base/modules/penv/psi_z_collective_mod.F90 index 33fe7764..b062a03e 100644 --- a/base/modules/penv/psi_z_collective_mod.F90 +++ b/base/modules/penv/psi_z_collective_mod.F90 @@ -62,7 +62,9 @@ module psi_z_collective_mod module procedure psb_zexscan_sums, psb_zexscan_sumv end interface psb_exscan_sum - + interface psb_simple_a2av + module procedure psb_z_simple_a2av + end interface psb_simple_a2av contains @@ -856,5 +858,43 @@ contains dat = zzero #endif end subroutine psb_zexscan_sumv + + subroutine psb_z_simple_a2av(valsnd,sdsz,bsdindx,& + & valrcv,rvsz,brvindx,ictxt,info) + use psi_z_p2p_mod + implicit none + complex(psb_dpk_), intent(in) :: valsnd(:) + complex(psb_dpk_), intent(out) :: valrcv(:) + integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:) + integer(psb_ipk_), intent(in) :: ictxt + integer(psb_ipk_), intent(out) :: info + + integer(psb_ipk_) :: iam, np, i,j,k, ip, ipx, idx, sz + + call psb_info(ictxt,iam,np) + + if (min(size(bsdindx),size(brvindx),size(sdsz),size(rvsz)) 0) then + idx = bsdindx(ip+1) + call psb_snd(ictxt,valsnd(idx+1:idx+sz),ip) + end if + end do + + do ip = 0, np-1 + sz = rvsz(ip+1) + if (sz > 0) then + idx = brvindx(ip+1) + call psb_rcv(ictxt,valrcv(idx+1:idx+sz),ip) + end if + end do + + end subroutine psb_z_simple_a2av + end module psi_z_collective_mod