Folded in new precinit/precset.

psblas3-type-indexed
Salvatore Filippone 18 years ago
parent e3b29920ed
commit b350f41c87

@ -1,6 +1,8 @@
Changelog. A lot less detailed than usual, at least for past
history.
2007/05/22: Defined psb_precinit.
2007/05/15: Defined psb_sizeof.
2007/05/15: Merged in various fixes coming from tests on SP5 and

@ -10,9 +10,9 @@ F90=/usr/local/gcc42/bin/gfortran
FC=/usr/local/gcc42/bin/gfortran
F77=$(FC)
CC=/usr/local/gcc42/bin/gcc
F90COPT=-O3 -ggdb -pg
FCOPT=-O3 -ggdb -pg
CCOPT=-O3 -ggdb -pg
F90COPT=-O3
FCOPT=-O3
CCOPT=-O3
#
# Which flag does your compiler use for module inclusion?
# Most compilers use -I but Sun uses -M
@ -26,7 +26,7 @@ FIFLAG=-I
# MPI_FINC=-DMPI_H or MPI_FINC=-DMPI_MOD #
# If necessary add an include dir #
##########################################################
F90LINK=/usr/local/mpich-gcc42/bin/mpif90
F90LINK=/usr/local/mpich-gcc42/bin/mpif90 -pg
FLINK=/usr/local/mpich-gcc42/bin/mpif77
MPF90=/usr/local/mpich-gcc42/bin/mpif90
MPF77=/usr/local/mpich-gcc42/bin/mpif77

@ -1,6 +1,6 @@
include Make.inc
#PREC=../mld2p4
PREC=prec
PREC=../mld2p4
#PREC=prec
library:

@ -54,7 +54,7 @@ module psb_error_mod
integer,dimension(5) :: i_err_data=0 ! array of integer data to complete the error msg
! real(kind(1.d0))(dim=10) :: r_err_data=0.d0 ! array of real data to complete the error msg
! complex(dim=10) :: c_err_data=0.c0 ! array of complex data to complete the error msg
character(len=20) :: a_err_data='' ! array of character data to complete the error msg
character(len=40) :: a_err_data='' ! array of character data to complete the error msg
type(psb_errstack_node), pointer :: next ! pointer to the next element in the stack
end type psb_errstack_node
@ -175,7 +175,8 @@ contains
subroutine psb_errpop(err_c, r_name, i_e_d, a_e_d)
integer, intent(out) :: err_c
character(len=20), intent(out) :: r_name, a_e_d
character(len=20), intent(out) :: r_name
character(len=40), intent(out) :: a_e_d
integer, intent(out) :: i_e_d(5)
type(psb_errstack_node), pointer :: old_node
@ -201,7 +202,8 @@ contains
integer, intent(in) :: ictxt
integer :: err_c
character(len=20) :: r_name, a_e_d
character(len=20) :: r_name
character(len=40) :: a_e_d
integer :: i_e_d(5)
integer :: nprow, npcol, me, mypcol
integer, parameter :: ione=1, izero=0
@ -252,7 +254,8 @@ contains
subroutine psb_serror()
integer :: err_c
character(len=20) :: r_name, a_e_d
character(len=20) :: r_name
character(len=40) :: a_e_d
integer :: i_e_d(5)
integer, parameter :: ione=1, izero=0
@ -283,7 +286,8 @@ contains
subroutine psb_errmsg(err_c, r_name, i_e_d, a_e_d,me)
integer, intent(in) :: err_c
character(len=20), intent(in) :: r_name, a_e_d
character(len=20), intent(in) :: r_name
character(len=40), intent(in) :: a_e_d
integer, intent(in) :: i_e_d(5)
integer, optional :: me

@ -24,9 +24,9 @@ module \verb|psb_prec_mod|.
\subroutine{psb\_precset}{Sets the preconditioner type}
\subroutine{psb\_precinit}{Initialize a preconditioner}
\syntax{call psb\_precset}{prec, ptype, info}
\syntax{call psb\_precinit}{prec, ptype, info}
\begin{description}
\item[\bf On Entry]

File diff suppressed because it is too large Load Diff

@ -0,0 +1,70 @@
!!$
!!$ Parallel Sparse BLAS v2.0
!!$ (C) Copyright 2006 Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ 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_dprecinit(p,ptype,info)
use psb_base_mod
use psb_prec_mod, psb_protect_name => psb_dprecinit
implicit none
type(psb_dprec_type), intent(inout) :: p
character(len=*), intent(in) :: ptype
integer, intent(out) :: info
info = 0
call psb_realloc(ifpsz,p%iprcparm,info)
if (info == 0) call psb_realloc(dfpsz,p%dprcparm,info)
if (info /= 0) return
p%iprcparm(:) = 0
select case(toupper(ptype(1:len_trim(ptype))))
case ('NONE','NOPREC')
p%iprcparm(:) = 0
p%iprcparm(p_type_) = noprec_
p%iprcparm(f_type_) = f_none_
case ('DIAG')
p%iprcparm(:) = 0
p%iprcparm(p_type_) = diag_
p%iprcparm(f_type_) = f_none_
case ('BJAC')
p%iprcparm(:) = 0
p%iprcparm(p_type_) = bjac_
p%iprcparm(f_type_) = f_ilu_n_
p%iprcparm(ilu_fill_in_) = 0
case default
write(0,*) 'Unknown preconditioner type request "',ptype,'"'
info = 2
end select
end subroutine psb_dprecinit

@ -28,52 +28,78 @@
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
subroutine psb_dprecset(p,ptype,info,iv,rs,rv)
subroutine psb_dprecseti(p,what,val,info)
use psb_base_mod
use psb_prec_mod, psb_protect_name => psb_dprecset
use psb_prec_mod, psb_protect_name => psb_dprecseti
implicit none
type(psb_dprec_type), intent(inout) :: p
character(len=*), intent(in) :: ptype
integer :: what, val
integer, intent(out) :: info
integer, optional, intent(in) :: iv(:)
real(kind(1.d0)), optional, intent(in) :: rs
real(kind(1.d0)), optional, intent(in) :: rv(:)
character(len=len(ptype)) :: typeup
integer :: isz, err, nlev_, ilev_, i
info = 0
select case(what)
case (f_type_)
if (p%iprcparm(p_type_) /= bjac_) then
write(0,*) 'WHAT is invalid for current preconditioner ',p%iprcparm(p_type_),&
& 'ignoring user specification'
return
endif
p%iprcparm(f_type_) = val
case (ilu_fill_in_)
if ((p%iprcparm(p_type_) /= bjac_).or.(p%iprcparm(f_type_) /= f_ilu_n_)) then
write(0,*) 'WHAT is invalid for current preconditioner ',p%iprcparm(p_type_),&
& 'ignoring user specification'
return
endif
p%iprcparm(ilu_fill_in_) = val
call psb_realloc(ifpsz,p%iprcparm,info)
if (info == 0) call psb_realloc(dfpsz,p%dprcparm,info)
if (info /= 0) return
p%iprcparm(:) = 0
case default
write(0,*) 'WHAT is invalid, ignoring user specification'
select case(toupper(ptype(1:len_trim(ptype))))
case ('NONE','NOPREC')
p%iprcparm(:) = 0
p%iprcparm(p_type_) = noprec_
p%iprcparm(f_type_) = f_none_
end select
return
case ('DIAG')
p%iprcparm(:) = 0
p%iprcparm(p_type_) = diag_
p%iprcparm(f_type_) = f_none_
end subroutine psb_dprecseti
case ('BJAC')
p%iprcparm(:) = 0
p%iprcparm(p_type_) = bjac_
p%iprcparm(f_type_) = f_ilu_n_
p%iprcparm(ilu_fill_in_) = 0
subroutine psb_dprecsetd(p,what,val,info)
use psb_base_mod
use psb_prec_mod, psb_protect_name => psb_dprecsetd
implicit none
type(psb_dprec_type), intent(inout) :: p
integer :: what
real(kind(1.d0)) :: val
integer, intent(out) :: info
!
! This will have to be changed if/when we put together an ILU(eps)
! factorization.
!
select case(what)
!!$ case (f_type_)
!!$ if (p%iprcparm(p_type_) /= bjac_) then
!!$ write(0,*) 'WHAT is invalid for current preconditioner ',p%iprcparm(p_type_),&
!!$ & 'ignoring user specification'
!!$ return
!!$ endif
!!$ p%iprcparm(f_type_) = val
!!$
!!$ case (ilu_fill_in_)
!!$ if ((p%iprcparm(p_type_) /= bjac_).or.(p%iprcparm(f_type_) /= f_ilu_n_)) then
!!$ write(0,*) 'WHAT is invalid for current preconditioner ',p%iprcparm(p_type_),&
!!$ & 'ignoring user specification'
!!$ return
!!$ endif
!!$ p%iprcparm(ilu_fill_in_) = val
case default
write(0,*) 'Unknown preconditioner type request "',ptype,'"'
err = 2
write(0,*) 'WHAT is invalid, ignoring user specification'
end select
return
info = err
end subroutine psb_dprecset
end subroutine psb_dprecsetd

@ -55,29 +55,60 @@ module psb_prec_mod
end subroutine psb_zprecbld
end interface
interface psb_precset
subroutine psb_dprecset(prec,ptype,info,iv,rs,rv)
interface psb_precinit
subroutine psb_dprecinit(prec,ptype,info)
use psb_base_mod
use psb_prec_type
implicit none
type(psb_dprec_type), intent(inout) :: prec
character(len=*), intent(in) :: ptype
integer, intent(out) :: info
integer, optional, intent(in) :: iv(:)
real(kind(1.d0)), optional, intent(in) :: rs
real(kind(1.d0)), optional, intent(in) :: rv(:)
end subroutine psb_dprecset
subroutine psb_zprecset(prec,ptype,info,iv,rs,rv)
end subroutine psb_dprecinit
subroutine psb_zprecinit(prec,ptype,info)
use psb_base_mod
use psb_prec_type
implicit none
type(psb_zprec_type), intent(inout) :: prec
character(len=*), intent(in) :: ptype
integer, intent(out) :: info
integer, optional, intent(in) :: iv(:)
real(kind(1.d0)), optional, intent(in) :: rs
real(kind(1.d0)), optional, intent(in) :: rv(:)
end subroutine psb_zprecset
end subroutine psb_zprecinit
end interface
interface psb_precset
subroutine psb_dprecseti(prec,what,val,info)
use psb_base_mod
use psb_prec_type
implicit none
type(psb_dprec_type), intent(inout) :: prec
integer :: what, val
integer, intent(out) :: info
end subroutine psb_dprecseti
subroutine psb_dprecsetd(prec,what,val,info)
use psb_base_mod
use psb_prec_type
implicit none
type(psb_dprec_type), intent(inout) :: prec
integer :: what
real(kind(1.d0)) :: val
integer, intent(out) :: info
end subroutine psb_dprecsetd
subroutine psb_zprecseti(prec,what,val,info)
use psb_base_mod
use psb_prec_type
implicit none
type(psb_zprec_type), intent(inout) :: prec
integer :: what, val
integer, intent(out) :: info
end subroutine psb_zprecseti
subroutine psb_zprecsetd(prec,what,val,info)
use psb_base_mod
use psb_prec_type
implicit none
type(psb_zprec_type), intent(inout) :: prec
integer :: what
real(kind(1.d0)) :: val
integer, intent(out) :: info
end subroutine psb_zprecsetd
end interface

@ -0,0 +1,73 @@
!!$
!!$ Parallel Sparse BLAS v2.0
!!$ (C) Copyright 2006 Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ 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_zprecinit(p,ptype,info)
use psb_base_mod
use psb_prec_mod, psb_protect_name => psb_zprecinit
implicit none
type(psb_zprec_type), intent(inout) :: p
character(len=*), intent(in) :: ptype
integer, intent(out) :: info
info = 0
call psb_realloc(ifpsz,p%iprcparm,info)
if (info == 0) call psb_realloc(dfpsz,p%dprcparm,info)
if (info /= 0) return
p%iprcparm(:) = 0
select case(toupper(ptype(1:len_trim(ptype))))
case ('NONE','NOPREC')
p%iprcparm(:) = 0
p%iprcparm(p_type_) = noprec_
p%iprcparm(f_type_) = f_none_
case ('DIAG')
p%iprcparm(:) = 0
p%iprcparm(p_type_) = diag_
p%iprcparm(f_type_) = f_none_
case ('BJAC')
p%iprcparm(:) = 0
p%iprcparm(p_type_) = bjac_
p%iprcparm(f_type_) = f_ilu_n_
p%iprcparm(ilu_fill_in_) = 0
case default
write(0,*) 'Unknown preconditioner type request "',ptype,'"'
info = 2
end select
end subroutine psb_zprecinit

@ -28,53 +28,78 @@
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
subroutine psb_zprecset(p,ptype,info,iv,rs,rv)
subroutine psb_zprecseti(p,what,val,info)
use psb_base_mod
use psb_prec_mod, psb_protect_name => psb_zprecset
use psb_prec_mod, psb_protect_name => psb_zprecseti
implicit none
type(psb_zprec_type), intent(inout) :: p
character(len=*), intent(in) :: ptype
integer :: what, val
integer, intent(out) :: info
integer, optional, intent(in) :: iv(:)
real(kind(1.d0)), optional, intent(in) :: rs
real(kind(1.d0)), optional, intent(in) :: rv(:)
character(len=len(ptype)) :: typeup
integer :: isz, err, nlev_, ilev_, i
info = 0
select case(what)
case (f_type_)
if (p%iprcparm(p_type_) /= bjac_) then
write(0,*) 'WHAT is invalid for current preconditioner ',p%iprcparm(p_type_),&
& 'ignoring user specification'
return
endif
p%iprcparm(f_type_) = val
case (ilu_fill_in_)
if ((p%iprcparm(p_type_) /= bjac_).or.(p%iprcparm(f_type_) /= f_ilu_n_)) then
write(0,*) 'WHAT is invalid for current preconditioner ',p%iprcparm(p_type_),&
& 'ignoring user specification'
return
endif
p%iprcparm(ilu_fill_in_) = val
case default
write(0,*) 'WHAT is invalid, ignoring user specification'
end select
return
end subroutine psb_zprecseti
call psb_realloc(ifpsz,p%iprcparm,info)
if (info == 0) call psb_realloc(dfpsz,p%dprcparm,info)
if (info /= 0) return
p%iprcparm(:) = 0
select case(toupper(ptype(1:len_trim(ptype))))
case ('NONE','NOPREC')
p%iprcparm(:) = 0
p%iprcparm(p_type_) = noprec_
p%iprcparm(f_type_) = f_none_
subroutine psb_zprecsetd(p,what,val,info)
case ('DIAG')
p%iprcparm(:) = 0
p%iprcparm(p_type_) = diag_
p%iprcparm(f_type_) = f_none_
use psb_base_mod
use psb_prec_mod, psb_protect_name => psb_zprecsetd
implicit none
type(psb_zprec_type), intent(inout) :: p
integer :: what
real(kind(1.d0)) :: val
integer, intent(out) :: info
case ('BJAC')
p%iprcparm(:) = 0
p%iprcparm(p_type_) = bjac_
p%iprcparm(f_type_) = f_ilu_n_
p%iprcparm(ilu_fill_in_) = 0
!
! This will have to be changed if/when we put together an ILU(eps)
! factorization.
!
select case(what)
!!$ case (f_type_)
!!$ if (p%iprcparm(p_type_) /= bjac_) then
!!$ write(0,*) 'WHAT is invalid for current preconditioner ',p%iprcparm(p_type_),&
!!$ & 'ignoring user specification'
!!$ return
!!$ endif
!!$ p%iprcparm(f_type_) = val
!!$
!!$ case (ilu_fill_in_)
!!$ if ((p%iprcparm(p_type_) /= bjac_).or.(p%iprcparm(f_type_) /= f_ilu_n_)) then
!!$ write(0,*) 'WHAT is invalid for current preconditioner ',p%iprcparm(p_type_),&
!!$ & 'ignoring user specification'
!!$ return
!!$ endif
!!$ p%iprcparm(ilu_fill_in_) = val
case default
write(0,*) 'Unknown preconditioner type request "',ptype,'"'
err = 2
write(0,*) 'WHAT is invalid, ignoring user specification'
end select
return
info = err
end subroutine psb_zprecset
end subroutine psb_zprecsetd

@ -203,13 +203,13 @@ program df_sample
igsmth=-1
select case(iprec)
case(noprec_)
call psb_precset(pre,'noprec',info)
call psb_precinit(pre,'noprec',info)
case(diag_)
call psb_precset(pre,'diag',info)
call psb_precinit(pre,'diag',info)
case(bjac_)
call psb_precset(pre,'bjac',info)
call psb_precinit(pre,'bjac',info)
case default
call psb_precset(pre,'bjac',info)
call psb_precinit(pre,'bjac',info)
end select
! building the preconditioner

@ -154,13 +154,13 @@ program pde90
if(iam == psb_root_) write(0,'("Setting preconditioner to : ",a)')pr_to_str(iprec)
select case(iprec)
case(noprec_)
call psb_precset(pre,'noprec',info)
call psb_precinit(pre,'noprec',info)
case(diag_)
call psb_precset(pre,'diag',info)
call psb_precinit(pre,'diag',info)
case(bjac_)
call psb_precset(pre,'bjac',info)
call psb_precinit(pre,'bjac',info)
case default
call psb_precset(pre,'bjac',info)
call psb_precinit(pre,'bjac',info)
end select
call psb_barrier(ictxt)

Loading…
Cancel
Save