|
|
@ -147,7 +147,7 @@ subroutine psb_c_map_X2Y_vect(alpha,x,beta,y,map,info,work,vtx,vty)
|
|
|
|
if (present(vty)) then
|
|
|
|
if (present(vty)) then
|
|
|
|
pty => vty
|
|
|
|
pty => vty
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call yt%bld(nc2,mold=x%v)
|
|
|
|
call psb_geasb(yt,map%p_desc_Y,info,scratch=.true.,mold=x%v)
|
|
|
|
pty => yt
|
|
|
|
pty => yt
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (info == psb_success_) call psb_halo(x,map%p_desc_X,info,work=work)
|
|
|
|
if (info == psb_success_) call psb_halo(x,map%p_desc_X,info,work=work)
|
|
|
@ -178,13 +178,13 @@ subroutine psb_c_map_X2Y_vect(alpha,x,beta,y,map,info,work,vtx,vty)
|
|
|
|
ptx => vtx
|
|
|
|
ptx => vtx
|
|
|
|
pty => vty
|
|
|
|
pty => vty
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call xt%bld(nc1,mold=x%v)
|
|
|
|
call psb_geasb(xt,map%desc_X,info,scratch=.true.,mold=x%v)
|
|
|
|
call yt%bld(nc2,mold=y%v)
|
|
|
|
call psb_geasb(yt,map%desc_Y,info,scratch=.true.,mold=x%v)
|
|
|
|
ptx => xt
|
|
|
|
ptx => xt
|
|
|
|
pty => yt
|
|
|
|
pty => yt
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
call psb_geaxpby(cone,x,@XZERO,ptx,map%desc_X,info)
|
|
|
|
call psb_geaxpby(cone,x,czero,ptx,map%desc_X,info)
|
|
|
|
if (info == psb_success_) call psb_halo(ptx,map%desc_X,info,work=work)
|
|
|
|
if (info == psb_success_) call psb_halo(ptx,map%desc_X,info,work=work)
|
|
|
|
if (info == psb_success_) call psb_csmm(cone,map%map_X2Y,ptx,czero,pty,info)
|
|
|
|
if (info == psb_success_) call psb_csmm(cone,map%map_X2Y,ptx,czero,pty,info)
|
|
|
|
if ((info == psb_success_) .and. map%desc_Y%is_repl().and.(np>1)) then
|
|
|
|
if ((info == psb_success_) .and. map%desc_Y%is_repl().and.(np>1)) then
|
|
|
@ -197,8 +197,10 @@ subroutine psb_c_map_X2Y_vect(alpha,x,beta,y,map,info,work,vtx,vty)
|
|
|
|
write(psb_err_unit,*) trim(name),' Error from inner routines',info
|
|
|
|
write(psb_err_unit,*) trim(name),' Error from inner routines',info
|
|
|
|
info = -1
|
|
|
|
info = -1
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (.not.present(vtx)) call xt%free(info)
|
|
|
|
if (.not.(present(vtx).and.present(vty) )) then
|
|
|
|
if (.not.present(vty)) call yt%free(info)
|
|
|
|
call xt%free(info)
|
|
|
|
|
|
|
|
call yt%free(info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
case default
|
|
|
|
case default
|
|
|
@ -290,7 +292,7 @@ subroutine psb_c_map_Y2X(alpha,x,beta,y,map,info,work)
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine psb_c_map_Y2X
|
|
|
|
end subroutine psb_c_map_Y2X
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_c_map_Y2X_vect(alpha,x,beta,y,map,info,work)
|
|
|
|
subroutine psb_c_map_Y2X_vect(alpha,x,beta,y,map,info,work,vtx,vty)
|
|
|
|
use psb_base_mod, psb_protect_name => psb_c_map_Y2X_vect
|
|
|
|
use psb_base_mod, psb_protect_name => psb_c_map_Y2X_vect
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
type(psb_clinmap_type), intent(in) :: map
|
|
|
|
type(psb_clinmap_type), intent(in) :: map
|
|
|
@ -298,8 +300,10 @@ subroutine psb_c_map_Y2X_vect(alpha,x,beta,y,map,info,work)
|
|
|
|
type(psb_c_vect_type), intent(inout) :: x,y
|
|
|
|
type(psb_c_vect_type), intent(inout) :: x,y
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
complex(psb_spk_), optional :: work(:)
|
|
|
|
complex(psb_spk_), optional :: work(:)
|
|
|
|
!
|
|
|
|
type(psb_c_vect_type), optional, target, intent(inout) :: vtx,vty
|
|
|
|
type(psb_c_vect_type) :: xt, yt
|
|
|
|
! Local
|
|
|
|
|
|
|
|
type(psb_c_vect_type), target :: xt, yt
|
|
|
|
|
|
|
|
type(psb_c_vect_type),pointer :: ptx, pty
|
|
|
|
complex(psb_spk_), allocatable :: xta(:), yta(:)
|
|
|
|
complex(psb_spk_), allocatable :: xta(:), yta(:)
|
|
|
|
integer(psb_ipk_) :: i, j, nr1, nc1,nr2, nc2,&
|
|
|
|
integer(psb_ipk_) :: i, j, nr1, nc1,nr2, nc2,&
|
|
|
|
& map_kind, nr, ictxt
|
|
|
|
& map_kind, nr, ictxt
|
|
|
@ -320,20 +324,25 @@ subroutine psb_c_map_Y2X_vect(alpha,x,beta,y,map,info,work)
|
|
|
|
ictxt = map%p_desc_X%get_context()
|
|
|
|
ictxt = map%p_desc_X%get_context()
|
|
|
|
nr2 = map%p_desc_X%get_global_rows()
|
|
|
|
nr2 = map%p_desc_X%get_global_rows()
|
|
|
|
nc2 = map%p_desc_X%get_local_cols()
|
|
|
|
nc2 = map%p_desc_X%get_local_cols()
|
|
|
|
call yt%bld(nc2,mold=y%v)
|
|
|
|
if (present(vty)) then
|
|
|
|
|
|
|
|
pty => vty
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_geasb(yt,map%p_desc_X,info,scratch=.true.,mold=x%v)
|
|
|
|
|
|
|
|
pty => yt
|
|
|
|
|
|
|
|
end if
|
|
|
|
if (info == psb_success_) call psb_halo(x,map%p_desc_Y,info,work=work)
|
|
|
|
if (info == psb_success_) call psb_halo(x,map%p_desc_Y,info,work=work)
|
|
|
|
if (info == psb_success_) call psb_csmm(cone,map%map_Y2X,x,czero,yt,info)
|
|
|
|
if (info == psb_success_) call psb_csmm(cone,map%map_Y2X,x,czero,pty,info)
|
|
|
|
if ((info == psb_success_) .and. map%p_desc_X%is_repl()) then
|
|
|
|
if ((info == psb_success_) .and. map%p_desc_X%is_repl().and.(np>1)) then
|
|
|
|
yta = yt%get_vect()
|
|
|
|
yta = pty%get_vect()
|
|
|
|
call psb_sum(ictxt,yta(1:nr2))
|
|
|
|
call psb_sum(ictxt,yta(1:nr2))
|
|
|
|
call yt%set(yta)
|
|
|
|
call pty%set(yta)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (info == psb_success_) call psb_geaxpby(alpha,yt,beta,y,map%p_desc_X,info)
|
|
|
|
if (info == psb_success_) call psb_geaxpby(alpha,pty,beta,y,map%p_desc_X,info)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
write(psb_err_unit,*) trim(name),' Error from inner routines',info
|
|
|
|
write(psb_err_unit,*) trim(name),' Error from inner routines',info
|
|
|
|
info = -1
|
|
|
|
info = -1
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call yt%free(info)
|
|
|
|
if (.not.present(vty)) call yt%free(info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
case(psb_map_gen_linear_)
|
|
|
|
case(psb_map_gen_linear_)
|
|
|
@ -343,26 +352,35 @@ subroutine psb_c_map_Y2X_vect(alpha,x,beta,y,map,info,work)
|
|
|
|
nc1 = map%desc_Y%get_local_cols()
|
|
|
|
nc1 = map%desc_Y%get_local_cols()
|
|
|
|
nr2 = map%desc_X%get_global_rows()
|
|
|
|
nr2 = map%desc_X%get_global_rows()
|
|
|
|
nc2 = map%desc_X%get_local_cols()
|
|
|
|
nc2 = map%desc_X%get_local_cols()
|
|
|
|
call xt%bld(nc1,mold=x%v)
|
|
|
|
if (present(vtx).and.present(vty)) then
|
|
|
|
call yt%bld(nc2,mold=y%v)
|
|
|
|
ptx => vtx
|
|
|
|
xta = x%get_vect()
|
|
|
|
pty => vty
|
|
|
|
call xt%set(xta(1:nr1))
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_geasb(xt,map%desc_Y,info,scratch=.true.,mold=x%v)
|
|
|
|
|
|
|
|
call psb_geasb(yt,map%desc_X,info,scratch=.true.,mold=x%v)
|
|
|
|
|
|
|
|
ptx => xt
|
|
|
|
|
|
|
|
pty => yt
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (info == psb_success_) call psb_halo(xt,map%desc_Y,info,work=work)
|
|
|
|
call psb_geaxpby(cone,x,czero,ptx,map%desc_X,info)
|
|
|
|
if (info == psb_success_) call psb_csmm(cone,map%map_Y2X,xt,czero,yt,info)
|
|
|
|
|
|
|
|
if ((info == psb_success_) .and. map%desc_X%is_repl()) then
|
|
|
|
if (info == psb_success_) call psb_halo(ptx,map%desc_Y,info,work=work)
|
|
|
|
yta = yt%get_vect()
|
|
|
|
if (info == psb_success_) call psb_csmm(cone,map%map_Y2X,ptx,czero,pty,info)
|
|
|
|
|
|
|
|
if ((info == psb_success_) .and. map%desc_X%is_repl().and.(np>1)) then
|
|
|
|
|
|
|
|
yta = pty%get_vect()
|
|
|
|
call psb_sum(ictxt,yta(1:nr2))
|
|
|
|
call psb_sum(ictxt,yta(1:nr2))
|
|
|
|
call yt%set(yta)
|
|
|
|
call pty%set(yta)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (info == psb_success_) call psb_geaxpby(alpha,yt,beta,y,map%desc_X,info)
|
|
|
|
if (info == psb_success_) call psb_geaxpby(alpha,pty,beta,y,map%desc_X,info)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
write(psb_err_unit,*) trim(name),' Error from inner routines',info
|
|
|
|
write(psb_err_unit,*) trim(name),' Error from inner routines',info
|
|
|
|
info = -1
|
|
|
|
info = -1
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
if (.not.(present(vtx).and.present(vty) )) then
|
|
|
|
call xt%free(info)
|
|
|
|
call xt%free(info)
|
|
|
|
call yt%free(info)
|
|
|
|
call yt%free(info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
case default
|
|
|
|
case default
|
|
|
|
write(psb_err_unit,*) trim(name),' Invalid descriptor input'
|
|
|
|
write(psb_err_unit,*) trim(name),' Invalid descriptor input'
|
|
|
|