psblas3:
prec/Makefile prec/impl prec/impl/Makefile prec/impl/psb_c_prec_type_impl.f90 prec/impl/psb_d_prec_type_impl.f90 prec/impl/psb_s_prec_type_impl.f90 prec/impl/psb_z_prec_type_impl.f90 prec/psb_c_base_prec_mod.f90 prec/psb_c_prec_mod.f90 prec/psb_c_prec_type.f90 prec/psb_cprecset.f90 prec/psb_d_base_prec_mod.f90 prec/psb_d_prec_mod.f90 prec/psb_d_prec_type.f90 prec/psb_dprecset.f90 prec/psb_s_base_prec_mod.f90 prec/psb_s_prec_mod.f90 prec/psb_s_prec_type.f90 prec/psb_sprecset.f90 prec/psb_z_base_prec_mod.f90 prec/psb_z_prec_mod.f90 prec/psb_z_prec_type.f90 prec/psb_zprecset.f90 Start decoupling interface/impl for PSB preconditioners. Use IMPORT in interface definitions as much as possible.psblas3-type-indexed
parent
c8a5934771
commit
572e9e6b66
@ -0,0 +1,30 @@
|
||||
include ../../Make.inc
|
||||
|
||||
LIBDIR=../../lib
|
||||
HERE=..
|
||||
OBJS=psb_s_prec_type_impl.o psb_d_prec_type_impl.o \
|
||||
psb_c_prec_type_impl.o psb_z_prec_type_impl.o
|
||||
|
||||
|
||||
F90OBJS= psb_dilu_fct.o\
|
||||
psb_dprecbld.o psb_dprecset.o psb_dprecinit.o \
|
||||
psb_silu_fct.o\
|
||||
psb_sprecbld.o psb_sprecset.o psb_sprecinit.o \
|
||||
psb_cilu_fct.o\
|
||||
psb_cprecbld.o psb_cprecset.o psb_cprecinit.o \
|
||||
psb_zilu_fct.o\
|
||||
psb_zprecbld.o psb_zprecset.o psb_zprecinit.o
|
||||
|
||||
LIBNAME=$(PRECLIBNAME)
|
||||
COBJS=
|
||||
FINCLUDES=$(FMFLAG).. $(FMFLAG)$(LIBDIR)
|
||||
|
||||
lib: $(OBJS)
|
||||
$(AR) $(HERE)/$(LIBNAME) $(OBJS)
|
||||
$(RANLIB) $(HERE)/$(LIBNAME)
|
||||
|
||||
veryclean: clean
|
||||
|
||||
clean:
|
||||
/bin/rm -f $(OBJS) $(LOCAL_MODS)
|
||||
|
@ -0,0 +1,319 @@
|
||||
!!$
|
||||
!!$ Parallel Sparse BLAS version 3.0
|
||||
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010
|
||||
!!$ Salvatore Filippone University of Rome Tor Vergata
|
||||
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
|
||||
!!$
|
||||
!!$ Redistribution and use in source and binary forms, with or without
|
||||
!!$ modification, are permitted provided that the following conditions
|
||||
!!$ are met:
|
||||
!!$ 1. Redistributions of source code must retain the above copyright
|
||||
!!$ notice, this list of conditions and the following disclaimer.
|
||||
!!$ 2. Redistributions in binary form must reproduce the above copyright
|
||||
!!$ notice, this list of conditions, and the following disclaimer in the
|
||||
!!$ documentation and/or other materials provided with the distribution.
|
||||
!!$ 3. The name of the PSBLAS group or the names of its contributors may
|
||||
!!$ not be used to endorse or promote products derived from this
|
||||
!!$ software without specific written permission.
|
||||
!!$
|
||||
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
!!$ POSSIBILITY OF SUCH DAMAGE.
|
||||
!!$
|
||||
!!$
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
subroutine psb_c_apply2_vect(prec,x,y,desc_data,info,trans,work)
|
||||
use psb_base_mod
|
||||
use psb_c_prec_type, psb_protect_name => psb_c_apply2_vect
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_cprec_type), intent(inout) :: prec
|
||||
type(psb_c_vect_type),intent(inout) :: x
|
||||
type(psb_c_vect_type),intent(inout) :: y
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
complex(psb_spk_),intent(inout), optional, target :: work(:)
|
||||
|
||||
character :: trans_
|
||||
complex(psb_spk_), pointer :: work_(:)
|
||||
integer :: ictxt,np,me,err_act
|
||||
character(len=20) :: name
|
||||
|
||||
name = 'psb_c_apply2v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
ictxt = desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
|
||||
if (present(trans)) then
|
||||
trans_=psb_toupper(trans)
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (present(work)) then
|
||||
work_ => work
|
||||
else
|
||||
allocate(work_(4*desc_data%get_local_cols()),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call prec%prec%apply(cone,x,czero,y,desc_data,info,&
|
||||
& trans=trans_,work=work_)
|
||||
|
||||
if (present(work)) then
|
||||
else
|
||||
deallocate(work_,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_c_apply2_vect
|
||||
|
||||
subroutine psb_c_apply1_vect(prec,x,desc_data,info,trans,work)
|
||||
use psb_base_mod
|
||||
use psb_c_prec_type, psb_protect_name => psb_c_apply1_vect
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_cprec_type), intent(inout) :: prec
|
||||
type(psb_c_vect_type),intent(inout) :: x
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
complex(psb_spk_),intent(inout), optional, target :: work(:)
|
||||
|
||||
type(psb_c_vect_type) :: ww
|
||||
character :: trans_
|
||||
complex(psb_spk_), pointer :: work_(:)
|
||||
integer :: ictxt,np,me,err_act
|
||||
character(len=20) :: name
|
||||
|
||||
name = 'psb_c_apply1v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
ictxt = desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
|
||||
if (present(trans)) then
|
||||
trans_=psb_toupper(trans)
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (present(work)) then
|
||||
work_ => work
|
||||
else
|
||||
allocate(work_(4*desc_data%get_local_cols()),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call psb_geall(ww,desc_data,info)
|
||||
if (info == 0) call psb_geasb(ww,desc_data,info,mold=x%v)
|
||||
if (info == 0) call prec%prec%apply(cone,x,czero,ww,desc_data,info,&
|
||||
& trans=trans_,work=work_)
|
||||
if (info == 0) call psb_geaxpby(cone,ww,czero,x,desc_data,info)
|
||||
|
||||
if (present(work)) then
|
||||
else
|
||||
deallocate(work_,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_c_apply1_vect
|
||||
|
||||
subroutine psb_c_apply2v(prec,x,y,desc_data,info,trans,work)
|
||||
use psb_base_mod
|
||||
use psb_c_prec_type, psb_protect_name => psb_c_apply2v
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_cprec_type), intent(in) :: prec
|
||||
complex(psb_spk_),intent(inout) :: x(:)
|
||||
complex(psb_spk_),intent(inout) :: y(:)
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
complex(psb_spk_),intent(inout), optional, target :: work(:)
|
||||
|
||||
character :: trans_
|
||||
complex(psb_spk_), pointer :: work_(:)
|
||||
integer :: ictxt,np,me,err_act
|
||||
character(len=20) :: name
|
||||
|
||||
name='psb_c_apply2v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
ictxt = desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
|
||||
if (present(trans)) then
|
||||
trans_=trans
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (present(work)) then
|
||||
work_ => work
|
||||
else
|
||||
allocate(work_(4*desc_data%get_local_cols()),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
call prec%prec%apply(cone,x,czero,y,desc_data,info,trans_,work=work_)
|
||||
if (present(work)) then
|
||||
else
|
||||
deallocate(work_,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_c_apply2v
|
||||
|
||||
subroutine psb_c_apply1v(prec,x,desc_data,info,trans)
|
||||
use psb_base_mod
|
||||
use psb_c_prec_type, psb_protect_name => psb_c_apply1v
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_cprec_type), intent(in) :: prec
|
||||
complex(psb_spk_),intent(inout) :: x(:)
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
|
||||
character :: trans_
|
||||
integer :: ictxt,np,me, err_act
|
||||
complex(psb_spk_), pointer :: WW(:), w1(:)
|
||||
character(len=20) :: name
|
||||
name='psb_c_apply1v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
|
||||
ictxt=desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
if (present(trans)) then
|
||||
trans_=psb_toupper(trans)
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
allocate(ww(size(x)),w1(size(x)),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
call prec%prec%apply(cone,x,czero,ww,desc_data,info,&
|
||||
& trans_,work=w1)
|
||||
if(info /= psb_success_) goto 9999
|
||||
x(:) = ww(:)
|
||||
deallocate(ww,W1,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_errpush(info,name)
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_c_apply1v
|
||||
|
@ -0,0 +1,319 @@
|
||||
!!$
|
||||
!!$ Parallel Sparse BLAS version 3.0
|
||||
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010
|
||||
!!$ Salvatore Filippone University of Rome Tor Vergata
|
||||
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
|
||||
!!$
|
||||
!!$ Redistribution and use in source and binary forms, with or without
|
||||
!!$ modification, are permitted provided that the following conditions
|
||||
!!$ are met:
|
||||
!!$ 1. Redistributions of source code must retain the above copyright
|
||||
!!$ notice, this list of conditions and the following disclaimer.
|
||||
!!$ 2. Redistributions in binary form must reproduce the above copyright
|
||||
!!$ notice, this list of conditions, and the following disclaimer in the
|
||||
!!$ documentation and/or other materials provided with the distribution.
|
||||
!!$ 3. The name of the PSBLAS group or the names of its contributors may
|
||||
!!$ not be used to endorse or promote products derived from this
|
||||
!!$ software without specific written permission.
|
||||
!!$
|
||||
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
!!$ POSSIBILITY OF SUCH DAMAGE.
|
||||
!!$
|
||||
!!$
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
subroutine psb_d_apply2_vect(prec,x,y,desc_data,info,trans,work)
|
||||
use psb_base_mod
|
||||
use psb_d_prec_type, psb_protect_name => psb_d_apply2_vect
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_dprec_type), intent(inout) :: prec
|
||||
type(psb_d_vect_type),intent(inout) :: x
|
||||
type(psb_d_vect_type),intent(inout) :: y
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
real(psb_dpk_),intent(inout), optional, target :: work(:)
|
||||
|
||||
character :: trans_
|
||||
real(psb_dpk_), pointer :: work_(:)
|
||||
integer :: ictxt,np,me,err_act
|
||||
character(len=20) :: name
|
||||
|
||||
name = 'psb_d_apply2v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
ictxt = desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
|
||||
if (present(trans)) then
|
||||
trans_=psb_toupper(trans)
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (present(work)) then
|
||||
work_ => work
|
||||
else
|
||||
allocate(work_(4*desc_data%get_local_cols()),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call prec%prec%apply(done,x,dzero,y,desc_data,info,&
|
||||
& trans=trans_,work=work_)
|
||||
|
||||
if (present(work)) then
|
||||
else
|
||||
deallocate(work_,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_d_apply2_vect
|
||||
|
||||
subroutine psb_d_apply1_vect(prec,x,desc_data,info,trans,work)
|
||||
use psb_base_mod
|
||||
use psb_d_prec_type, psb_protect_name => psb_d_apply1_vect
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_dprec_type), intent(inout) :: prec
|
||||
type(psb_d_vect_type),intent(inout) :: x
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
real(psb_dpk_),intent(inout), optional, target :: work(:)
|
||||
|
||||
type(psb_d_vect_type) :: ww
|
||||
character :: trans_
|
||||
real(psb_dpk_), pointer :: work_(:)
|
||||
integer :: ictxt,np,me,err_act
|
||||
character(len=20) :: name
|
||||
|
||||
name = 'psb_d_apply1v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
ictxt = desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
|
||||
if (present(trans)) then
|
||||
trans_=psb_toupper(trans)
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (present(work)) then
|
||||
work_ => work
|
||||
else
|
||||
allocate(work_(4*desc_data%get_local_cols()),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call psb_geall(ww,desc_data,info)
|
||||
if (info == 0) call psb_geasb(ww,desc_data,info,mold=x%v)
|
||||
if (info == 0) call prec%prec%apply(done,x,dzero,ww,desc_data,info,&
|
||||
& trans=trans_,work=work_)
|
||||
if (info == 0) call psb_geaxpby(done,ww,dzero,x,desc_data,info)
|
||||
|
||||
if (present(work)) then
|
||||
else
|
||||
deallocate(work_,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_d_apply1_vect
|
||||
|
||||
subroutine psb_d_apply2v(prec,x,y,desc_data,info,trans,work)
|
||||
use psb_base_mod
|
||||
use psb_d_prec_type, psb_protect_name => psb_d_apply2v
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_dprec_type), intent(in) :: prec
|
||||
real(psb_dpk_),intent(inout) :: x(:)
|
||||
real(psb_dpk_),intent(inout) :: y(:)
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
real(psb_dpk_),intent(inout), optional, target :: work(:)
|
||||
|
||||
character :: trans_
|
||||
real(psb_dpk_), pointer :: work_(:)
|
||||
integer :: ictxt,np,me,err_act
|
||||
character(len=20) :: name
|
||||
|
||||
name='psb_d_apply2v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
ictxt = desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
|
||||
if (present(trans)) then
|
||||
trans_=trans
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (present(work)) then
|
||||
work_ => work
|
||||
else
|
||||
allocate(work_(4*desc_data%get_local_cols()),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
call prec%prec%apply(done,x,dzero,y,desc_data,info,trans_,work=work_)
|
||||
if (present(work)) then
|
||||
else
|
||||
deallocate(work_,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_d_apply2v
|
||||
|
||||
subroutine psb_d_apply1v(prec,x,desc_data,info,trans)
|
||||
use psb_base_mod
|
||||
use psb_d_prec_type, psb_protect_name => psb_d_apply1v
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_dprec_type), intent(in) :: prec
|
||||
real(psb_dpk_),intent(inout) :: x(:)
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
|
||||
character :: trans_
|
||||
integer :: ictxt,np,me, err_act
|
||||
real(psb_dpk_), pointer :: WW(:), w1(:)
|
||||
character(len=20) :: name
|
||||
name='psb_d_apply1v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
|
||||
ictxt=desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
if (present(trans)) then
|
||||
trans_=psb_toupper(trans)
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
allocate(ww(size(x)),w1(size(x)),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
call prec%prec%apply(done,x,dzero,ww,desc_data,info,&
|
||||
& trans_,work=w1)
|
||||
if(info /= psb_success_) goto 9999
|
||||
x(:) = ww(:)
|
||||
deallocate(ww,W1,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_errpush(info,name)
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_d_apply1v
|
||||
|
@ -0,0 +1,319 @@
|
||||
!!$
|
||||
!!$ Parallel Sparse BLAS version 3.0
|
||||
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010
|
||||
!!$ Salvatore Filippone University of Rome Tor Vergata
|
||||
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
|
||||
!!$
|
||||
!!$ Redistribution and use in source and binary forms, with or without
|
||||
!!$ modification, are permitted provided that the following conditions
|
||||
!!$ are met:
|
||||
!!$ 1. Redistributions of source code must retain the above copyright
|
||||
!!$ notice, this list of conditions and the following disclaimer.
|
||||
!!$ 2. Redistributions in binary form must reproduce the above copyright
|
||||
!!$ notice, this list of conditions, and the following disclaimer in the
|
||||
!!$ documentation and/or other materials provided with the distribution.
|
||||
!!$ 3. The name of the PSBLAS group or the names of its contributors may
|
||||
!!$ not be used to endorse or promote products derived from this
|
||||
!!$ software without specific written permission.
|
||||
!!$
|
||||
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
!!$ POSSIBILITY OF SUCH DAMAGE.
|
||||
!!$
|
||||
!!$
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
subroutine psb_s_apply2_vect(prec,x,y,desc_data,info,trans,work)
|
||||
use psb_base_mod
|
||||
use psb_s_prec_type, psb_protect_name => psb_s_apply2_vect
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_sprec_type), intent(inout) :: prec
|
||||
type(psb_s_vect_type),intent(inout) :: x
|
||||
type(psb_s_vect_type),intent(inout) :: y
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
real(psb_spk_),intent(inout), optional, target :: work(:)
|
||||
|
||||
character :: trans_
|
||||
real(psb_spk_), pointer :: work_(:)
|
||||
integer :: ictxt,np,me,err_act
|
||||
character(len=20) :: name
|
||||
|
||||
name = 'psb_s_apply2v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
ictxt = desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
|
||||
if (present(trans)) then
|
||||
trans_=psb_toupper(trans)
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (present(work)) then
|
||||
work_ => work
|
||||
else
|
||||
allocate(work_(4*desc_data%get_local_cols()),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call prec%prec%apply(sone,x,szero,y,desc_data,info,&
|
||||
& trans=trans_,work=work_)
|
||||
|
||||
if (present(work)) then
|
||||
else
|
||||
deallocate(work_,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_s_apply2_vect
|
||||
|
||||
subroutine psb_s_apply1_vect(prec,x,desc_data,info,trans,work)
|
||||
use psb_base_mod
|
||||
use psb_s_prec_type, psb_protect_name => psb_s_apply1_vect
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_sprec_type), intent(inout) :: prec
|
||||
type(psb_s_vect_type),intent(inout) :: x
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
real(psb_spk_),intent(inout), optional, target :: work(:)
|
||||
|
||||
type(psb_s_vect_type) :: ww
|
||||
character :: trans_
|
||||
real(psb_spk_), pointer :: work_(:)
|
||||
integer :: ictxt,np,me,err_act
|
||||
character(len=20) :: name
|
||||
|
||||
name = 'psb_s_apply1v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
ictxt = desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
|
||||
if (present(trans)) then
|
||||
trans_=psb_toupper(trans)
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (present(work)) then
|
||||
work_ => work
|
||||
else
|
||||
allocate(work_(4*desc_data%get_local_cols()),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call psb_geall(ww,desc_data,info)
|
||||
if (info == 0) call psb_geasb(ww,desc_data,info,mold=x%v)
|
||||
if (info == 0) call prec%prec%apply(sone,x,szero,ww,desc_data,info,&
|
||||
& trans=trans_,work=work_)
|
||||
if (info == 0) call psb_geaxpby(sone,ww,szero,x,desc_data,info)
|
||||
|
||||
if (present(work)) then
|
||||
else
|
||||
deallocate(work_,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_s_apply1_vect
|
||||
|
||||
subroutine psb_s_apply2v(prec,x,y,desc_data,info,trans,work)
|
||||
use psb_base_mod
|
||||
use psb_s_prec_type, psb_protect_name => psb_s_apply2v
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_sprec_type), intent(in) :: prec
|
||||
real(psb_spk_),intent(inout) :: x(:)
|
||||
real(psb_spk_),intent(inout) :: y(:)
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
real(psb_spk_),intent(inout), optional, target :: work(:)
|
||||
|
||||
character :: trans_
|
||||
real(psb_spk_), pointer :: work_(:)
|
||||
integer :: ictxt,np,me,err_act
|
||||
character(len=20) :: name
|
||||
|
||||
name='psb_s_apply2v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
ictxt = desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
|
||||
if (present(trans)) then
|
||||
trans_=trans
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (present(work)) then
|
||||
work_ => work
|
||||
else
|
||||
allocate(work_(4*desc_data%get_local_cols()),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
call prec%prec%apply(sone,x,szero,y,desc_data,info,trans_,work=work_)
|
||||
if (present(work)) then
|
||||
else
|
||||
deallocate(work_,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_s_apply2v
|
||||
|
||||
subroutine psb_s_apply1v(prec,x,desc_data,info,trans)
|
||||
use psb_base_mod
|
||||
use psb_s_prec_type, psb_protect_name => psb_s_apply1v
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_sprec_type), intent(in) :: prec
|
||||
real(psb_spk_),intent(inout) :: x(:)
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
|
||||
character :: trans_
|
||||
integer :: ictxt,np,me, err_act
|
||||
real(psb_spk_), pointer :: WW(:), w1(:)
|
||||
character(len=20) :: name
|
||||
name='psb_s_apply1v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
|
||||
ictxt=desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
if (present(trans)) then
|
||||
trans_=psb_toupper(trans)
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
allocate(ww(size(x)),w1(size(x)),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
call prec%prec%apply(sone,x,szero,ww,desc_data,info,&
|
||||
& trans_,work=w1)
|
||||
if(info /= psb_success_) goto 9999
|
||||
x(:) = ww(:)
|
||||
deallocate(ww,W1,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_errpush(info,name)
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_s_apply1v
|
||||
|
@ -0,0 +1,319 @@
|
||||
!!$
|
||||
!!$ Parallel Sparse BLAS version 3.0
|
||||
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010
|
||||
!!$ Salvatore Filippone University of Rome Tor Vergata
|
||||
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
|
||||
!!$
|
||||
!!$ Redistribution and use in source and binary forms, with or without
|
||||
!!$ modification, are permitted provided that the following conditions
|
||||
!!$ are met:
|
||||
!!$ 1. Redistributions of source code must retain the above copyright
|
||||
!!$ notice, this list of conditions and the following disclaimer.
|
||||
!!$ 2. Redistributions in binary form must reproduce the above copyright
|
||||
!!$ notice, this list of conditions, and the following disclaimer in the
|
||||
!!$ documentation and/or other materials provided with the distribution.
|
||||
!!$ 3. The name of the PSBLAS group or the names of its contributors may
|
||||
!!$ not be used to endorse or promote products derived from this
|
||||
!!$ software without specific written permission.
|
||||
!!$
|
||||
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
!!$ POSSIBILITY OF SUCH DAMAGE.
|
||||
!!$
|
||||
!!$
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
subroutine psb_z_apply2_vect(prec,x,y,desc_data,info,trans,work)
|
||||
use psb_base_mod
|
||||
use psb_z_prec_type, psb_protect_name => psb_z_apply2_vect
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_zprec_type), intent(inout) :: prec
|
||||
type(psb_z_vect_type),intent(inout) :: x
|
||||
type(psb_z_vect_type),intent(inout) :: y
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
complex(psb_dpk_),intent(inout), optional, target :: work(:)
|
||||
|
||||
character :: trans_
|
||||
complex(psb_dpk_), pointer :: work_(:)
|
||||
integer :: ictxt,np,me,err_act
|
||||
character(len=20) :: name
|
||||
|
||||
name = 'psb_z_apply2v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
ictxt = desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
|
||||
if (present(trans)) then
|
||||
trans_=psb_toupper(trans)
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (present(work)) then
|
||||
work_ => work
|
||||
else
|
||||
allocate(work_(4*desc_data%get_local_cols()),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call prec%prec%apply(zone,x,zzero,y,desc_data,info,&
|
||||
& trans=trans_,work=work_)
|
||||
|
||||
if (present(work)) then
|
||||
else
|
||||
deallocate(work_,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_z_apply2_vect
|
||||
|
||||
subroutine psb_z_apply1_vect(prec,x,desc_data,info,trans,work)
|
||||
use psb_base_mod
|
||||
use psb_z_prec_type, psb_protect_name => psb_z_apply1_vect
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_zprec_type), intent(inout) :: prec
|
||||
type(psb_z_vect_type),intent(inout) :: x
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
complex(psb_dpk_),intent(inout), optional, target :: work(:)
|
||||
|
||||
type(psb_z_vect_type) :: ww
|
||||
character :: trans_
|
||||
complex(psb_dpk_), pointer :: work_(:)
|
||||
integer :: ictxt,np,me,err_act
|
||||
character(len=20) :: name
|
||||
|
||||
name = 'psb_z_apply1v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
ictxt = desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
|
||||
if (present(trans)) then
|
||||
trans_=psb_toupper(trans)
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (present(work)) then
|
||||
work_ => work
|
||||
else
|
||||
allocate(work_(4*desc_data%get_local_cols()),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call psb_geall(ww,desc_data,info)
|
||||
if (info == 0) call psb_geasb(ww,desc_data,info,mold=x%v)
|
||||
if (info == 0) call prec%prec%apply(zone,x,zzero,ww,desc_data,info,&
|
||||
& trans=trans_,work=work_)
|
||||
if (info == 0) call psb_geaxpby(zone,ww,zzero,x,desc_data,info)
|
||||
|
||||
if (present(work)) then
|
||||
else
|
||||
deallocate(work_,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_z_apply1_vect
|
||||
|
||||
subroutine psb_z_apply2v(prec,x,y,desc_data,info,trans,work)
|
||||
use psb_base_mod
|
||||
use psb_z_prec_type, psb_protect_name => psb_z_apply2v
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_zprec_type), intent(in) :: prec
|
||||
complex(psb_dpk_),intent(inout) :: x(:)
|
||||
complex(psb_dpk_),intent(inout) :: y(:)
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
complex(psb_dpk_),intent(inout), optional, target :: work(:)
|
||||
|
||||
character :: trans_
|
||||
complex(psb_dpk_), pointer :: work_(:)
|
||||
integer :: ictxt,np,me,err_act
|
||||
character(len=20) :: name
|
||||
|
||||
name='psb_z_apply2v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
ictxt = desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
|
||||
if (present(trans)) then
|
||||
trans_=trans
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (present(work)) then
|
||||
work_ => work
|
||||
else
|
||||
allocate(work_(4*desc_data%get_local_cols()),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
call prec%prec%apply(zone,x,zzero,y,desc_data,info,trans_,work=work_)
|
||||
if (present(work)) then
|
||||
else
|
||||
deallocate(work_,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_z_apply2v
|
||||
|
||||
subroutine psb_z_apply1v(prec,x,desc_data,info,trans)
|
||||
use psb_base_mod
|
||||
use psb_z_prec_type, psb_protect_name => psb_z_apply1v
|
||||
implicit none
|
||||
type(psb_desc_type),intent(in) :: desc_data
|
||||
class(psb_zprec_type), intent(in) :: prec
|
||||
complex(psb_dpk_),intent(inout) :: x(:)
|
||||
integer, intent(out) :: info
|
||||
character(len=1), optional :: trans
|
||||
|
||||
character :: trans_
|
||||
integer :: ictxt,np,me, err_act
|
||||
complex(psb_dpk_), pointer :: WW(:), w1(:)
|
||||
character(len=20) :: name
|
||||
name='psb_z_apply1v'
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
|
||||
ictxt=desc_data%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
if (present(trans)) then
|
||||
trans_=psb_toupper(trans)
|
||||
else
|
||||
trans_='N'
|
||||
end if
|
||||
|
||||
if (.not.allocated(prec%prec)) then
|
||||
info = 1124
|
||||
call psb_errpush(info,name,a_err="preconditioner")
|
||||
goto 9999
|
||||
end if
|
||||
allocate(ww(size(x)),w1(size(x)),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='Allocate')
|
||||
goto 9999
|
||||
end if
|
||||
call prec%prec%apply(zone,x,zzero,ww,desc_data,info,&
|
||||
& trans_,work=w1)
|
||||
if(info /= psb_success_) goto 9999
|
||||
x(:) = ww(:)
|
||||
deallocate(ww,W1,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info = psb_err_from_subroutine_
|
||||
call psb_errpush(info,name,a_err='DeAllocate')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_errpush(info,name)
|
||||
call psb_erractionrestore(err_act)
|
||||
if (err_act == psb_act_abort_) then
|
||||
call psb_error()
|
||||
return
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine psb_z_apply1v
|
||||
|
Loading…
Reference in New Issue