Test programs can take input file on command line.

stopcriterion
Salvatore Filippone 7 years ago
parent 2f30fe8e1e
commit 0f5ce22c8f

@ -85,7 +85,7 @@ program mld_cexample_1lev
integer :: ierr, ircode integer :: ierr, ircode
real(psb_spk_) :: resmx, resmxp real(psb_spk_) :: resmx, resmxp
real(psb_dpk_) :: t1, t2, tprec real(psb_dpk_) :: t1, t2, tprec
character(len=20) :: name character(len=20) :: name, kmethod
integer, parameter :: iunit=12 integer, parameter :: iunit=12
! initialize the parallel environment ! initialize the parallel environment
@ -189,7 +189,7 @@ program mld_cexample_1lev
end if end if
! START SETTING PARAMETER ! START SETTING PARAMETER
! set RAS ! set RAS
@ -219,12 +219,13 @@ program mld_cexample_1lev
call x%zero() call x%zero()
call psb_geasb(x,desc_A,info) call psb_geasb(x,desc_A,info)
! solve Ax=b with preconditioned BiCGSTAB ! solve Ax=b with preconditioned Krylov method: BiCGSTAB
kmethod = 'BiCGSTAB'
call psb_barrier(ictxt) call psb_barrier(ictxt)
t1 = psb_wtime() t1 = psb_wtime()
call psb_krylov('BiCGSTAB',A,P,b,x,tol,desc_A,info,itmax,iter,err,istop=2) call psb_krylov(kmethod,A,P,b,x,tol,desc_A,info,itmax,iter,err,istop=2)
t2 = psb_wtime() - t1 t2 = psb_wtime() - t1
call psb_amx(ictxt,t2) call psb_amx(ictxt,t2)
@ -247,6 +248,7 @@ program mld_cexample_1lev
write(*,'(" ")') write(*,'(" ")')
write(*,'("Matrix: ",A)')mtrx_file write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Krylov method : ",a)') kmethod
write(*,'("Iterations to convergence : ",i6)')iter write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es12.5)')err write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec write(*,'("Time to build prec. : ",es12.5)')tprec
@ -306,17 +308,35 @@ contains
integer :: ictxt, itmax integer :: ictxt, itmax
real(psb_spk_) :: tol real(psb_spk_) :: tol
character(len=*) :: mtrx, rhs,filefmt character(len=*) :: mtrx, rhs,filefmt
integer :: iam, np integer :: iam, np, inp_unit
character(len=1024) :: filename
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(ictxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input parameters ! read input parameters
call read_data(mtrx,5) call read_data(mtrx,inp_unit)
call read_data(rhs,5) call read_data(rhs,inp_unit)
call read_data(filefmt,5) call read_data(filefmt,inp_unit)
call read_data(itmax,5) call read_data(itmax,inp_unit)
call read_data(tol,5) call read_data(tol,inp_unit)
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(ictxt,mtrx) call psb_bcast(ictxt,mtrx)

@ -292,6 +292,7 @@ program mld_cexample_ml
write(*,'(" ")') write(*,'(" ")')
write(*,'("Matrix: ",A)')mtrx_file write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Krylov method : ",a)') kmethod
write(*,'("Iterations to convergence : ",i6)')iter write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es12.5)')err write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec write(*,'("Time to build prec. : ",es12.5)')tprec
@ -351,18 +352,36 @@ contains
integer :: ictxt, choice, itmax integer :: ictxt, choice, itmax
real(psb_spk_) :: tol real(psb_spk_) :: tol
character(len=*) :: mtrx, rhs,filefmt character(len=*) :: mtrx, rhs,filefmt
integer :: iam, np integer :: iam, np, inp_unit
character(len=1024) :: filename
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(ictxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input parameters ! read input parameters
call read_data(mtrx,5) call read_data(mtrx,inp_unit)
call read_data(rhs,5) call read_data(rhs,inp_unit)
call read_data(filefmt,5) call read_data(filefmt,inp_unit)
call read_data(choice,5) call read_data(choice,inp_unit)
call read_data(itmax,5) call read_data(itmax,inp_unit)
call read_data(tol,5) call read_data(tol,inp_unit)
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(ictxt,mtrx) call psb_bcast(ictxt,mtrx)

@ -85,7 +85,7 @@ program mld_dexample_1lev
integer :: ierr, ircode integer :: ierr, ircode
real(psb_dpk_) :: resmx, resmxp real(psb_dpk_) :: resmx, resmxp
real(psb_dpk_) :: t1, t2, tprec real(psb_dpk_) :: t1, t2, tprec
character(len=20) :: name character(len=20) :: name, kmethod
integer, parameter :: iunit=12 integer, parameter :: iunit=12
! initialize the parallel environment ! initialize the parallel environment
@ -189,18 +189,15 @@ program mld_dexample_1lev
end if end if
! START SETTING PARAMETER ! START SETTING PARAMETER
! set RAS ! set RAS
!!$ call P%init('AS',info) call P%init('AS',info)
!!$
!!$ ! set number of overlaps ! set number of overlaps
!!$
!!$ call P%set('SUB_OVR',2,info) call P%set('SUB_OVR',2,info)
!!$
call P%init('FBGS',info)
!call prec%set('smoother_sweeps', p_choice%outer_sweeps, info)
! build the preconditioner ! build the preconditioner
@ -222,12 +219,13 @@ program mld_dexample_1lev
call x%zero() call x%zero()
call psb_geasb(x,desc_A,info) call psb_geasb(x,desc_A,info)
! solve Ax=b with preconditioned BiCGSTAB ! solve Ax=b with preconditioned Krylov method: BiCGSTAB
kmethod = 'BiCGSTAB'
call psb_barrier(ictxt) call psb_barrier(ictxt)
t1 = psb_wtime() t1 = psb_wtime()
call psb_krylov('BiCGSTAB',A,P,b,x,tol,desc_A,info,itmax,iter,err,istop=2) call psb_krylov(kmethod,A,P,b,x,tol,desc_A,info,itmax,iter,err,istop=2)
t2 = psb_wtime() - t1 t2 = psb_wtime() - t1
call psb_amx(ictxt,t2) call psb_amx(ictxt,t2)
@ -250,6 +248,7 @@ program mld_dexample_1lev
write(*,'(" ")') write(*,'(" ")')
write(*,'("Matrix: ",A)')mtrx_file write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Krylov method : ",a)') kmethod
write(*,'("Iterations to convergence : ",i6)')iter write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es12.5)')err write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec write(*,'("Time to build prec. : ",es12.5)')tprec
@ -309,17 +308,35 @@ contains
integer :: ictxt, itmax integer :: ictxt, itmax
real(psb_dpk_) :: tol real(psb_dpk_) :: tol
character(len=*) :: mtrx, rhs,filefmt character(len=*) :: mtrx, rhs,filefmt
integer :: iam, np integer :: iam, np, inp_unit
character(len=1024) :: filename
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(ictxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input parameters ! read input parameters
call read_data(mtrx,5) call read_data(mtrx,inp_unit)
call read_data(rhs,5) call read_data(rhs,inp_unit)
call read_data(filefmt,5) call read_data(filefmt,inp_unit)
call read_data(itmax,5) call read_data(itmax,inp_unit)
call read_data(tol,5) call read_data(tol,inp_unit)
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(ictxt,mtrx) call psb_bcast(ictxt,mtrx)

@ -292,6 +292,7 @@ program mld_dexample_ml
write(*,'(" ")') write(*,'(" ")')
write(*,'("Matrix: ",A)')mtrx_file write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Krylov method : ",a)') kmethod
write(*,'("Iterations to convergence : ",i6)')iter write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es12.5)')err write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec write(*,'("Time to build prec. : ",es12.5)')tprec
@ -351,18 +352,36 @@ contains
integer :: ictxt, choice, itmax integer :: ictxt, choice, itmax
real(psb_dpk_) :: tol real(psb_dpk_) :: tol
character(len=*) :: mtrx, rhs,filefmt character(len=*) :: mtrx, rhs,filefmt
integer :: iam, np integer :: iam, np, inp_unit
character(len=1024) :: filename
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(ictxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input parameters ! read input parameters
call read_data(mtrx,5) call read_data(mtrx,inp_unit)
call read_data(rhs,5) call read_data(rhs,inp_unit)
call read_data(filefmt,5) call read_data(filefmt,inp_unit)
call read_data(choice,5) call read_data(choice,inp_unit)
call read_data(itmax,5) call read_data(itmax,inp_unit)
call read_data(tol,5) call read_data(tol,inp_unit)
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(ictxt,mtrx) call psb_bcast(ictxt,mtrx)

@ -85,7 +85,7 @@ program mld_sexample_1lev
integer :: ierr, ircode integer :: ierr, ircode
real(psb_spk_) :: resmx, resmxp real(psb_spk_) :: resmx, resmxp
real(psb_dpk_) :: t1, t2, tprec real(psb_dpk_) :: t1, t2, tprec
character(len=20) :: name character(len=20) :: name, kmethod
integer, parameter :: iunit=12 integer, parameter :: iunit=12
! initialize the parallel environment ! initialize the parallel environment
@ -189,7 +189,7 @@ program mld_sexample_1lev
end if end if
! START SETTING PARAMETER ! START SETTING PARAMETER
! set RAS ! set RAS
@ -219,12 +219,13 @@ program mld_sexample_1lev
call x%zero() call x%zero()
call psb_geasb(x,desc_A,info) call psb_geasb(x,desc_A,info)
! solve Ax=b with preconditioned BiCGSTAB ! solve Ax=b with preconditioned Krylov method: BiCGSTAB
kmethod = 'BiCGSTAB'
call psb_barrier(ictxt) call psb_barrier(ictxt)
t1 = psb_wtime() t1 = psb_wtime()
call psb_krylov('BiCGSTAB',A,P,b,x,tol,desc_A,info,itmax,iter,err,istop=2) call psb_krylov(kmethod,A,P,b,x,tol,desc_A,info,itmax,iter,err,istop=2)
t2 = psb_wtime() - t1 t2 = psb_wtime() - t1
call psb_amx(ictxt,t2) call psb_amx(ictxt,t2)
@ -247,6 +248,7 @@ program mld_sexample_1lev
write(*,'(" ")') write(*,'(" ")')
write(*,'("Matrix: ",A)')mtrx_file write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Krylov method : ",a)') kmethod
write(*,'("Iterations to convergence : ",i6)')iter write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es12.5)')err write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec write(*,'("Time to build prec. : ",es12.5)')tprec
@ -306,17 +308,35 @@ contains
integer :: ictxt, itmax integer :: ictxt, itmax
real(psb_spk_) :: tol real(psb_spk_) :: tol
character(len=*) :: mtrx, rhs,filefmt character(len=*) :: mtrx, rhs,filefmt
integer :: iam, np integer :: iam, np, inp_unit
character(len=1024) :: filename
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(ictxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input parameters ! read input parameters
call read_data(mtrx,5) call read_data(mtrx,inp_unit)
call read_data(rhs,5) call read_data(rhs,inp_unit)
call read_data(filefmt,5) call read_data(filefmt,inp_unit)
call read_data(itmax,5) call read_data(itmax,inp_unit)
call read_data(tol,5) call read_data(tol,inp_unit)
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(ictxt,mtrx) call psb_bcast(ictxt,mtrx)

@ -292,6 +292,7 @@ program mld_sexample_ml
write(*,'(" ")') write(*,'(" ")')
write(*,'("Matrix: ",A)')mtrx_file write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Krylov method : ",a)') kmethod
write(*,'("Iterations to convergence : ",i6)')iter write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es12.5)')err write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec write(*,'("Time to build prec. : ",es12.5)')tprec
@ -351,18 +352,36 @@ contains
integer :: ictxt, choice, itmax integer :: ictxt, choice, itmax
real(psb_spk_) :: tol real(psb_spk_) :: tol
character(len=*) :: mtrx, rhs,filefmt character(len=*) :: mtrx, rhs,filefmt
integer :: iam, np integer :: iam, np, inp_unit
character(len=1024) :: filename
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(ictxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input parameters ! read input parameters
call read_data(mtrx,5) call read_data(mtrx,inp_unit)
call read_data(rhs,5) call read_data(rhs,inp_unit)
call read_data(filefmt,5) call read_data(filefmt,inp_unit)
call read_data(choice,5) call read_data(choice,inp_unit)
call read_data(itmax,5) call read_data(itmax,inp_unit)
call read_data(tol,5) call read_data(tol,inp_unit)
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(ictxt,mtrx) call psb_bcast(ictxt,mtrx)

@ -85,7 +85,7 @@ program mld_zexample_1lev
integer :: ierr, ircode integer :: ierr, ircode
real(psb_dpk_) :: resmx, resmxp real(psb_dpk_) :: resmx, resmxp
real(psb_dpk_) :: t1, t2, tprec real(psb_dpk_) :: t1, t2, tprec
character(len=20) :: name character(len=20) :: name, kmethod
integer, parameter :: iunit=12 integer, parameter :: iunit=12
! initialize the parallel environment ! initialize the parallel environment
@ -189,7 +189,7 @@ program mld_zexample_1lev
end if end if
! START SETTING PARAMETER ! START SETTING PARAMETER
! set RAS ! set RAS
@ -219,12 +219,13 @@ program mld_zexample_1lev
call x%zero() call x%zero()
call psb_geasb(x,desc_A,info) call psb_geasb(x,desc_A,info)
! solve Ax=b with preconditioned BiCGSTAB ! solve Ax=b with preconditioned Krylov method: BiCGSTAB
kmethod = 'BiCGSTAB'
call psb_barrier(ictxt) call psb_barrier(ictxt)
t1 = psb_wtime() t1 = psb_wtime()
call psb_krylov('BiCGSTAB',A,P,b,x,tol,desc_A,info,itmax,iter,err,istop=2) call psb_krylov(kmethod,A,P,b,x,tol,desc_A,info,itmax,iter,err,istop=2)
t2 = psb_wtime() - t1 t2 = psb_wtime() - t1
call psb_amx(ictxt,t2) call psb_amx(ictxt,t2)
@ -247,6 +248,7 @@ program mld_zexample_1lev
write(*,'(" ")') write(*,'(" ")')
write(*,'("Matrix: ",A)')mtrx_file write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Krylov method : ",a)') kmethod
write(*,'("Iterations to convergence : ",i6)')iter write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es12.5)')err write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec write(*,'("Time to build prec. : ",es12.5)')tprec
@ -306,17 +308,35 @@ contains
integer :: ictxt, itmax integer :: ictxt, itmax
real(psb_dpk_) :: tol real(psb_dpk_) :: tol
character(len=*) :: mtrx, rhs,filefmt character(len=*) :: mtrx, rhs,filefmt
integer :: iam, np integer :: iam, np, inp_unit
character(len=1024) :: filename
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(ictxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input parameters ! read input parameters
call read_data(mtrx,5) call read_data(mtrx,inp_unit)
call read_data(rhs,5) call read_data(rhs,inp_unit)
call read_data(filefmt,5) call read_data(filefmt,inp_unit)
call read_data(itmax,5) call read_data(itmax,inp_unit)
call read_data(tol,5) call read_data(tol,inp_unit)
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(ictxt,mtrx) call psb_bcast(ictxt,mtrx)

@ -292,6 +292,7 @@ program mld_zexample_ml
write(*,'(" ")') write(*,'(" ")')
write(*,'("Matrix: ",A)')mtrx_file write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Krylov method : ",a)') kmethod
write(*,'("Iterations to convergence : ",i6)')iter write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es12.5)')err write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec write(*,'("Time to build prec. : ",es12.5)')tprec
@ -351,18 +352,36 @@ contains
integer :: ictxt, choice, itmax integer :: ictxt, choice, itmax
real(psb_dpk_) :: tol real(psb_dpk_) :: tol
character(len=*) :: mtrx, rhs,filefmt character(len=*) :: mtrx, rhs,filefmt
integer :: iam, np integer :: iam, np, inp_unit
character(len=1024) :: filename
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(ictxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input parameters ! read input parameters
call read_data(mtrx,5) call read_data(mtrx,inp_unit)
call read_data(rhs,5) call read_data(rhs,inp_unit)
call read_data(filefmt,5) call read_data(filefmt,inp_unit)
call read_data(choice,5) call read_data(choice,inp_unit)
call read_data(itmax,5) call read_data(itmax,inp_unit)
call read_data(tol,5) call read_data(tol,inp_unit)
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(ictxt,mtrx) call psb_bcast(ictxt,mtrx)

@ -234,15 +234,34 @@ contains
integer :: idim, ictxt, itmax integer :: idim, ictxt, itmax
real(psb_dpk_) :: tol real(psb_dpk_) :: tol
integer :: iam, np integer :: iam, np, inp_unit
character(len=1024) :: filename
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(ictxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input parameters ! read input parameters
call read_data(idim,5) call read_data(idim,inp_unit)
call read_data(itmax,5) call read_data(itmax,inp_unit)
call read_data(tol,5) call read_data(tol,inp_unit)
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(ictxt,idim) call psb_bcast(ictxt,idim)

@ -286,16 +286,34 @@ contains
integer :: choice, idim, ictxt, itmax integer :: choice, idim, ictxt, itmax
real(psb_dpk_) :: tol real(psb_dpk_) :: tol
integer :: iam, np integer :: iam, np, inp_unit
character(len=1024) :: filename
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(ictxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input parameters ! read input parameters
call read_data(choice,5) call read_data(choice,inp_unit)
call read_data(idim,5) call read_data(idim,inp_unit)
call read_data(itmax,5) call read_data(itmax,inp_unit)
call read_data(tol,5) call read_data(tol,inp_unit)
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(ictxt,choice) call psb_bcast(ictxt,choice)

@ -234,15 +234,34 @@ contains
integer :: idim, ictxt, itmax integer :: idim, ictxt, itmax
real(psb_spk_) :: tol real(psb_spk_) :: tol
integer :: iam, np integer :: iam, np, inp_unit
character(len=1024) :: filename
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(ictxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input parameters ! read input parameters
call read_data(idim,5) call read_data(idim,inp_unit)
call read_data(itmax,5) call read_data(itmax,inp_unit)
call read_data(tol,5) call read_data(tol,inp_unit)
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(ictxt,idim) call psb_bcast(ictxt,idim)

@ -286,16 +286,34 @@ contains
integer :: choice, idim, ictxt, itmax integer :: choice, idim, ictxt, itmax
real(psb_spk_) :: tol real(psb_spk_) :: tol
integer :: iam, np integer :: iam, np, inp_unit
character(len=1024) :: filename
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(ictxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input parameters ! read input parameters
call read_data(choice,5) call read_data(choice,inp_unit)
call read_data(idim,5) call read_data(idim,inp_unit)
call read_data(itmax,5) call read_data(itmax,inp_unit)
call read_data(tol,5) call read_data(tol,inp_unit)
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(ictxt,choice) call psb_bcast(ictxt,choice)

@ -603,75 +603,93 @@ contains
character(len=*) :: mtrx, rhs, guess, sol, filefmt, afmt, part character(len=*) :: mtrx, rhs, guess, sol, filefmt, afmt, part
type(solverdata) :: solve type(solverdata) :: solve
type(precdata) :: prec type(precdata) :: prec
integer(psb_ipk_) :: iam, nm, np integer(psb_ipk_) :: iam, nm, np, inp_unit
character(len=1024) :: filename
call psb_info(icontxt,iam,np) call psb_info(icontxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
! read input data ! read input data
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(icontxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! !
! input files ! input files
call read_data(mtrx,psb_inp_unit) ! matrix file call read_data(mtrx,inp_unit) ! matrix file
call read_data(rhs,psb_inp_unit) ! rhs file call read_data(rhs,inp_unit) ! rhs file
call read_data(guess,psb_inp_unit) ! starting guess file call read_data(guess,inp_unit) ! starting guess file
call read_data(sol,psb_inp_unit) ! solution file (for comparison) call read_data(sol,inp_unit) ! solution file (for comparison)
call read_data(filefmt,psb_inp_unit) ! format of files call read_data(filefmt,inp_unit) ! format of files
call read_data(afmt,psb_inp_unit) ! matrix storage format call read_data(afmt,inp_unit) ! matrix storage format
call read_data(part,psb_inp_unit) ! partition type call read_data(part,inp_unit) ! partition type
! Krylov solver data ! Krylov solver data
call read_data(solve%kmethd,psb_inp_unit) ! Krylov solver call read_data(solve%kmethd,inp_unit) ! Krylov solver
call read_data(solve%istopc,psb_inp_unit) ! stopping criterion call read_data(solve%istopc,inp_unit) ! stopping criterion
call read_data(solve%itmax,psb_inp_unit) ! max num iterations call read_data(solve%itmax,inp_unit) ! max num iterations
call read_data(solve%itrace,psb_inp_unit) ! tracing call read_data(solve%itrace,inp_unit) ! tracing
call read_data(solve%irst,psb_inp_unit) ! restart call read_data(solve%irst,inp_unit) ! restart
call read_data(solve%eps,psb_inp_unit) ! tolerance call read_data(solve%eps,inp_unit) ! tolerance
! preconditioner type ! preconditioner type
call read_data(prec%descr,psb_inp_unit) ! verbose description of the prec call read_data(prec%descr,inp_unit) ! verbose description of the prec
call read_data(prec%ptype,psb_inp_unit) ! preconditioner type call read_data(prec%ptype,inp_unit) ! preconditioner type
! First smoother / 1-lev preconditioner ! First smoother / 1-lev preconditioner
call read_data(prec%smther,psb_inp_unit) ! smoother type call read_data(prec%smther,inp_unit) ! smoother type
call read_data(prec%jsweeps,psb_inp_unit) ! (pre-)smoother / 1-lev prec sweeps call read_data(prec%jsweeps,inp_unit) ! (pre-)smoother / 1-lev prec sweeps
call read_data(prec%novr,psb_inp_unit) ! number of overlap layers call read_data(prec%novr,inp_unit) ! number of overlap layers
call read_data(prec%restr,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr,inp_unit) ! restriction over application of AS
call read_data(prec%prol,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol,inp_unit) ! prolongation over application of AS
call read_data(prec%solve,psb_inp_unit) ! local subsolver call read_data(prec%solve,inp_unit) ! local subsolver
call read_data(prec%fill,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr,inp_unit) ! threshold for ILUT
! Second smoother/ AMG post-smoother (if NONE ignored in main) ! Second smoother/ AMG post-smoother (if NONE ignored in main)
call read_data(prec%smther2,psb_inp_unit) ! smoother type call read_data(prec%smther2,inp_unit) ! smoother type
call read_data(prec%jsweeps2,psb_inp_unit) ! (post-)smoother sweeps call read_data(prec%jsweeps2,inp_unit) ! (post-)smoother sweeps
call read_data(prec%novr2,psb_inp_unit) ! number of overlap layers call read_data(prec%novr2,inp_unit) ! number of overlap layers
call read_data(prec%restr2,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr2,inp_unit) ! restriction over application of AS
call read_data(prec%prol2,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol2,inp_unit) ! prolongation over application of AS
call read_data(prec%solve2,psb_inp_unit) ! local subsolver call read_data(prec%solve2,inp_unit) ! local subsolver
call read_data(prec%fill2,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr2,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr2,inp_unit) ! threshold for ILUT
! general AMG data ! general AMG data
call read_data(prec%mlcycle,psb_inp_unit) ! AMG cycle type call read_data(prec%mlcycle,inp_unit) ! AMG cycle type
call read_data(prec%outer_sweeps,psb_inp_unit) ! number of 1lev/outer sweeps call read_data(prec%outer_sweeps,inp_unit) ! number of 1lev/outer sweeps
call read_data(prec%maxlevs,psb_inp_unit) ! max number of levels in AMG prec call read_data(prec%maxlevs,inp_unit) ! max number of levels in AMG prec
call read_data(prec%csize,psb_inp_unit) ! min size coarsest mat call read_data(prec%csize,inp_unit) ! min size coarsest mat
! aggregation ! aggregation
call read_data(prec%aggr_prol,psb_inp_unit) ! aggregation type call read_data(prec%aggr_prol,inp_unit) ! aggregation type
call read_data(prec%par_aggr_alg,psb_inp_unit) ! parallel aggregation alg call read_data(prec%par_aggr_alg,inp_unit) ! parallel aggregation alg
call read_data(prec%aggr_ord,psb_inp_unit) ! ordering for aggregation call read_data(prec%aggr_ord,inp_unit) ! ordering for aggregation
call read_data(prec%aggr_filter,psb_inp_unit) ! filtering call read_data(prec%aggr_filter,inp_unit) ! filtering
call read_data(prec%mncrratio,psb_inp_unit) ! minimum aggregation ratio call read_data(prec%mncrratio,inp_unit) ! minimum aggregation ratio
call read_data(prec%thrvsz,psb_inp_unit) ! size of aggr thresh vector call read_data(prec%thrvsz,inp_unit) ! size of aggr thresh vector
if (prec%thrvsz > 0) then if (prec%thrvsz > 0) then
call psb_realloc(prec%thrvsz,prec%athresv,info) call psb_realloc(prec%thrvsz,prec%athresv,info)
call read_data(prec%athresv,psb_inp_unit) ! aggr thresh vector call read_data(prec%athresv,inp_unit) ! aggr thresh vector
else else
read(psb_inp_unit,*) ! dummy read to skip a record read(inp_unit,*) ! dummy read to skip a record
end if end if
call read_data(prec%athres,psb_inp_unit) ! smoothed aggr thresh call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
! coasest-level solver ! coasest-level solver
call read_data(prec%csolve,psb_inp_unit) ! coarsest-lev solver call read_data(prec%csolve,inp_unit) ! coarsest-lev solver
call read_data(prec%csbsolve,psb_inp_unit) ! coarsest-lev subsolver call read_data(prec%csbsolve,inp_unit) ! coarsest-lev subsolver
call read_data(prec%cmat,psb_inp_unit) ! coarsest mat layout call read_data(prec%cmat,inp_unit) ! coarsest mat layout
call read_data(prec%cfill,psb_inp_unit) ! fill-in for incompl LU call read_data(prec%cfill,inp_unit) ! fill-in for incompl LU
call read_data(prec%cthres,psb_inp_unit) ! Threshold for ILUT call read_data(prec%cthres,inp_unit) ! Threshold for ILUT
call read_data(prec%cjswp,psb_inp_unit) ! sweeps for GS/JAC subsolver call read_data(prec%cjswp,inp_unit) ! sweeps for GS/JAC subsolver
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(icontxt,mtrx) call psb_bcast(icontxt,mtrx)

@ -603,75 +603,93 @@ contains
character(len=*) :: mtrx, rhs, guess, sol, filefmt, afmt, part character(len=*) :: mtrx, rhs, guess, sol, filefmt, afmt, part
type(solverdata) :: solve type(solverdata) :: solve
type(precdata) :: prec type(precdata) :: prec
integer(psb_ipk_) :: iam, nm, np integer(psb_ipk_) :: iam, nm, np, inp_unit
character(len=1024) :: filename
call psb_info(icontxt,iam,np) call psb_info(icontxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
! read input data ! read input data
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(icontxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! !
! input files ! input files
call read_data(mtrx,psb_inp_unit) ! matrix file call read_data(mtrx,inp_unit) ! matrix file
call read_data(rhs,psb_inp_unit) ! rhs file call read_data(rhs,inp_unit) ! rhs file
call read_data(guess,psb_inp_unit) ! starting guess file call read_data(guess,inp_unit) ! starting guess file
call read_data(sol,psb_inp_unit) ! solution file (for comparison) call read_data(sol,inp_unit) ! solution file (for comparison)
call read_data(filefmt,psb_inp_unit) ! format of files call read_data(filefmt,inp_unit) ! format of files
call read_data(afmt,psb_inp_unit) ! matrix storage format call read_data(afmt,inp_unit) ! matrix storage format
call read_data(part,psb_inp_unit) ! partition type call read_data(part,inp_unit) ! partition type
! Krylov solver data ! Krylov solver data
call read_data(solve%kmethd,psb_inp_unit) ! Krylov solver call read_data(solve%kmethd,inp_unit) ! Krylov solver
call read_data(solve%istopc,psb_inp_unit) ! stopping criterion call read_data(solve%istopc,inp_unit) ! stopping criterion
call read_data(solve%itmax,psb_inp_unit) ! max num iterations call read_data(solve%itmax,inp_unit) ! max num iterations
call read_data(solve%itrace,psb_inp_unit) ! tracing call read_data(solve%itrace,inp_unit) ! tracing
call read_data(solve%irst,psb_inp_unit) ! restart call read_data(solve%irst,inp_unit) ! restart
call read_data(solve%eps,psb_inp_unit) ! tolerance call read_data(solve%eps,inp_unit) ! tolerance
! preconditioner type ! preconditioner type
call read_data(prec%descr,psb_inp_unit) ! verbose description of the prec call read_data(prec%descr,inp_unit) ! verbose description of the prec
call read_data(prec%ptype,psb_inp_unit) ! preconditioner type call read_data(prec%ptype,inp_unit) ! preconditioner type
! First smoother / 1-lev preconditioner ! First smoother / 1-lev preconditioner
call read_data(prec%smther,psb_inp_unit) ! smoother type call read_data(prec%smther,inp_unit) ! smoother type
call read_data(prec%jsweeps,psb_inp_unit) ! (pre-)smoother / 1-lev prec sweeps call read_data(prec%jsweeps,inp_unit) ! (pre-)smoother / 1-lev prec sweeps
call read_data(prec%novr,psb_inp_unit) ! number of overlap layers call read_data(prec%novr,inp_unit) ! number of overlap layers
call read_data(prec%restr,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr,inp_unit) ! restriction over application of AS
call read_data(prec%prol,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol,inp_unit) ! prolongation over application of AS
call read_data(prec%solve,psb_inp_unit) ! local subsolver call read_data(prec%solve,inp_unit) ! local subsolver
call read_data(prec%fill,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr,inp_unit) ! threshold for ILUT
! Second smoother/ AMG post-smoother (if NONE ignored in main) ! Second smoother/ AMG post-smoother (if NONE ignored in main)
call read_data(prec%smther2,psb_inp_unit) ! smoother type call read_data(prec%smther2,inp_unit) ! smoother type
call read_data(prec%jsweeps2,psb_inp_unit) ! (post-)smoother sweeps call read_data(prec%jsweeps2,inp_unit) ! (post-)smoother sweeps
call read_data(prec%novr2,psb_inp_unit) ! number of overlap layers call read_data(prec%novr2,inp_unit) ! number of overlap layers
call read_data(prec%restr2,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr2,inp_unit) ! restriction over application of AS
call read_data(prec%prol2,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol2,inp_unit) ! prolongation over application of AS
call read_data(prec%solve2,psb_inp_unit) ! local subsolver call read_data(prec%solve2,inp_unit) ! local subsolver
call read_data(prec%fill2,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr2,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr2,inp_unit) ! threshold for ILUT
! general AMG data ! general AMG data
call read_data(prec%mlcycle,psb_inp_unit) ! AMG cycle type call read_data(prec%mlcycle,inp_unit) ! AMG cycle type
call read_data(prec%outer_sweeps,psb_inp_unit) ! number of 1lev/outer sweeps call read_data(prec%outer_sweeps,inp_unit) ! number of 1lev/outer sweeps
call read_data(prec%maxlevs,psb_inp_unit) ! max number of levels in AMG prec call read_data(prec%maxlevs,inp_unit) ! max number of levels in AMG prec
call read_data(prec%csize,psb_inp_unit) ! min size coarsest mat call read_data(prec%csize,inp_unit) ! min size coarsest mat
! aggregation ! aggregation
call read_data(prec%aggr_prol,psb_inp_unit) ! aggregation type call read_data(prec%aggr_prol,inp_unit) ! aggregation type
call read_data(prec%par_aggr_alg,psb_inp_unit) ! parallel aggregation alg call read_data(prec%par_aggr_alg,inp_unit) ! parallel aggregation alg
call read_data(prec%aggr_ord,psb_inp_unit) ! ordering for aggregation call read_data(prec%aggr_ord,inp_unit) ! ordering for aggregation
call read_data(prec%aggr_filter,psb_inp_unit) ! filtering call read_data(prec%aggr_filter,inp_unit) ! filtering
call read_data(prec%mncrratio,psb_inp_unit) ! minimum aggregation ratio call read_data(prec%mncrratio,inp_unit) ! minimum aggregation ratio
call read_data(prec%thrvsz,psb_inp_unit) ! size of aggr thresh vector call read_data(prec%thrvsz,inp_unit) ! size of aggr thresh vector
if (prec%thrvsz > 0) then if (prec%thrvsz > 0) then
call psb_realloc(prec%thrvsz,prec%athresv,info) call psb_realloc(prec%thrvsz,prec%athresv,info)
call read_data(prec%athresv,psb_inp_unit) ! aggr thresh vector call read_data(prec%athresv,inp_unit) ! aggr thresh vector
else else
read(psb_inp_unit,*) ! dummy read to skip a record read(inp_unit,*) ! dummy read to skip a record
end if end if
call read_data(prec%athres,psb_inp_unit) ! smoothed aggr thresh call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
! coasest-level solver ! coasest-level solver
call read_data(prec%csolve,psb_inp_unit) ! coarsest-lev solver call read_data(prec%csolve,inp_unit) ! coarsest-lev solver
call read_data(prec%csbsolve,psb_inp_unit) ! coarsest-lev subsolver call read_data(prec%csbsolve,inp_unit) ! coarsest-lev subsolver
call read_data(prec%cmat,psb_inp_unit) ! coarsest mat layout call read_data(prec%cmat,inp_unit) ! coarsest mat layout
call read_data(prec%cfill,psb_inp_unit) ! fill-in for incompl LU call read_data(prec%cfill,inp_unit) ! fill-in for incompl LU
call read_data(prec%cthres,psb_inp_unit) ! Threshold for ILUT call read_data(prec%cthres,inp_unit) ! Threshold for ILUT
call read_data(prec%cjswp,psb_inp_unit) ! sweeps for GS/JAC subsolver call read_data(prec%cjswp,inp_unit) ! sweeps for GS/JAC subsolver
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(icontxt,mtrx) call psb_bcast(icontxt,mtrx)

@ -603,75 +603,93 @@ contains
character(len=*) :: mtrx, rhs, guess, sol, filefmt, afmt, part character(len=*) :: mtrx, rhs, guess, sol, filefmt, afmt, part
type(solverdata) :: solve type(solverdata) :: solve
type(precdata) :: prec type(precdata) :: prec
integer(psb_ipk_) :: iam, nm, np integer(psb_ipk_) :: iam, nm, np, inp_unit
character(len=1024) :: filename
call psb_info(icontxt,iam,np) call psb_info(icontxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
! read input data ! read input data
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(icontxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! !
! input files ! input files
call read_data(mtrx,psb_inp_unit) ! matrix file call read_data(mtrx,inp_unit) ! matrix file
call read_data(rhs,psb_inp_unit) ! rhs file call read_data(rhs,inp_unit) ! rhs file
call read_data(guess,psb_inp_unit) ! starting guess file call read_data(guess,inp_unit) ! starting guess file
call read_data(sol,psb_inp_unit) ! solution file (for comparison) call read_data(sol,inp_unit) ! solution file (for comparison)
call read_data(filefmt,psb_inp_unit) ! format of files call read_data(filefmt,inp_unit) ! format of files
call read_data(afmt,psb_inp_unit) ! matrix storage format call read_data(afmt,inp_unit) ! matrix storage format
call read_data(part,psb_inp_unit) ! partition type call read_data(part,inp_unit) ! partition type
! Krylov solver data ! Krylov solver data
call read_data(solve%kmethd,psb_inp_unit) ! Krylov solver call read_data(solve%kmethd,inp_unit) ! Krylov solver
call read_data(solve%istopc,psb_inp_unit) ! stopping criterion call read_data(solve%istopc,inp_unit) ! stopping criterion
call read_data(solve%itmax,psb_inp_unit) ! max num iterations call read_data(solve%itmax,inp_unit) ! max num iterations
call read_data(solve%itrace,psb_inp_unit) ! tracing call read_data(solve%itrace,inp_unit) ! tracing
call read_data(solve%irst,psb_inp_unit) ! restart call read_data(solve%irst,inp_unit) ! restart
call read_data(solve%eps,psb_inp_unit) ! tolerance call read_data(solve%eps,inp_unit) ! tolerance
! preconditioner type ! preconditioner type
call read_data(prec%descr,psb_inp_unit) ! verbose description of the prec call read_data(prec%descr,inp_unit) ! verbose description of the prec
call read_data(prec%ptype,psb_inp_unit) ! preconditioner type call read_data(prec%ptype,inp_unit) ! preconditioner type
! First smoother / 1-lev preconditioner ! First smoother / 1-lev preconditioner
call read_data(prec%smther,psb_inp_unit) ! smoother type call read_data(prec%smther,inp_unit) ! smoother type
call read_data(prec%jsweeps,psb_inp_unit) ! (pre-)smoother / 1-lev prec sweeps call read_data(prec%jsweeps,inp_unit) ! (pre-)smoother / 1-lev prec sweeps
call read_data(prec%novr,psb_inp_unit) ! number of overlap layers call read_data(prec%novr,inp_unit) ! number of overlap layers
call read_data(prec%restr,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr,inp_unit) ! restriction over application of AS
call read_data(prec%prol,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol,inp_unit) ! prolongation over application of AS
call read_data(prec%solve,psb_inp_unit) ! local subsolver call read_data(prec%solve,inp_unit) ! local subsolver
call read_data(prec%fill,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr,inp_unit) ! threshold for ILUT
! Second smoother/ AMG post-smoother (if NONE ignored in main) ! Second smoother/ AMG post-smoother (if NONE ignored in main)
call read_data(prec%smther2,psb_inp_unit) ! smoother type call read_data(prec%smther2,inp_unit) ! smoother type
call read_data(prec%jsweeps2,psb_inp_unit) ! (post-)smoother sweeps call read_data(prec%jsweeps2,inp_unit) ! (post-)smoother sweeps
call read_data(prec%novr2,psb_inp_unit) ! number of overlap layers call read_data(prec%novr2,inp_unit) ! number of overlap layers
call read_data(prec%restr2,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr2,inp_unit) ! restriction over application of AS
call read_data(prec%prol2,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol2,inp_unit) ! prolongation over application of AS
call read_data(prec%solve2,psb_inp_unit) ! local subsolver call read_data(prec%solve2,inp_unit) ! local subsolver
call read_data(prec%fill2,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr2,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr2,inp_unit) ! threshold for ILUT
! general AMG data ! general AMG data
call read_data(prec%mlcycle,psb_inp_unit) ! AMG cycle type call read_data(prec%mlcycle,inp_unit) ! AMG cycle type
call read_data(prec%outer_sweeps,psb_inp_unit) ! number of 1lev/outer sweeps call read_data(prec%outer_sweeps,inp_unit) ! number of 1lev/outer sweeps
call read_data(prec%maxlevs,psb_inp_unit) ! max number of levels in AMG prec call read_data(prec%maxlevs,inp_unit) ! max number of levels in AMG prec
call read_data(prec%csize,psb_inp_unit) ! min size coarsest mat call read_data(prec%csize,inp_unit) ! min size coarsest mat
! aggregation ! aggregation
call read_data(prec%aggr_prol,psb_inp_unit) ! aggregation type call read_data(prec%aggr_prol,inp_unit) ! aggregation type
call read_data(prec%par_aggr_alg,psb_inp_unit) ! parallel aggregation alg call read_data(prec%par_aggr_alg,inp_unit) ! parallel aggregation alg
call read_data(prec%aggr_ord,psb_inp_unit) ! ordering for aggregation call read_data(prec%aggr_ord,inp_unit) ! ordering for aggregation
call read_data(prec%aggr_filter,psb_inp_unit) ! filtering call read_data(prec%aggr_filter,inp_unit) ! filtering
call read_data(prec%mncrratio,psb_inp_unit) ! minimum aggregation ratio call read_data(prec%mncrratio,inp_unit) ! minimum aggregation ratio
call read_data(prec%thrvsz,psb_inp_unit) ! size of aggr thresh vector call read_data(prec%thrvsz,inp_unit) ! size of aggr thresh vector
if (prec%thrvsz > 0) then if (prec%thrvsz > 0) then
call psb_realloc(prec%thrvsz,prec%athresv,info) call psb_realloc(prec%thrvsz,prec%athresv,info)
call read_data(prec%athresv,psb_inp_unit) ! aggr thresh vector call read_data(prec%athresv,inp_unit) ! aggr thresh vector
else else
read(psb_inp_unit,*) ! dummy read to skip a record read(inp_unit,*) ! dummy read to skip a record
end if end if
call read_data(prec%athres,psb_inp_unit) ! smoothed aggr thresh call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
! coasest-level solver ! coasest-level solver
call read_data(prec%csolve,psb_inp_unit) ! coarsest-lev solver call read_data(prec%csolve,inp_unit) ! coarsest-lev solver
call read_data(prec%csbsolve,psb_inp_unit) ! coarsest-lev subsolver call read_data(prec%csbsolve,inp_unit) ! coarsest-lev subsolver
call read_data(prec%cmat,psb_inp_unit) ! coarsest mat layout call read_data(prec%cmat,inp_unit) ! coarsest mat layout
call read_data(prec%cfill,psb_inp_unit) ! fill-in for incompl LU call read_data(prec%cfill,inp_unit) ! fill-in for incompl LU
call read_data(prec%cthres,psb_inp_unit) ! Threshold for ILUT call read_data(prec%cthres,inp_unit) ! Threshold for ILUT
call read_data(prec%cjswp,psb_inp_unit) ! sweeps for GS/JAC subsolver call read_data(prec%cjswp,inp_unit) ! sweeps for GS/JAC subsolver
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(icontxt,mtrx) call psb_bcast(icontxt,mtrx)

@ -603,75 +603,93 @@ contains
character(len=*) :: mtrx, rhs, guess, sol, filefmt, afmt, part character(len=*) :: mtrx, rhs, guess, sol, filefmt, afmt, part
type(solverdata) :: solve type(solverdata) :: solve
type(precdata) :: prec type(precdata) :: prec
integer(psb_ipk_) :: iam, nm, np integer(psb_ipk_) :: iam, nm, np, inp_unit
character(len=1024) :: filename
call psb_info(icontxt,iam,np) call psb_info(icontxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
! read input data ! read input data
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(icontxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! !
! input files ! input files
call read_data(mtrx,psb_inp_unit) ! matrix file call read_data(mtrx,inp_unit) ! matrix file
call read_data(rhs,psb_inp_unit) ! rhs file call read_data(rhs,inp_unit) ! rhs file
call read_data(guess,psb_inp_unit) ! starting guess file call read_data(guess,inp_unit) ! starting guess file
call read_data(sol,psb_inp_unit) ! solution file (for comparison) call read_data(sol,inp_unit) ! solution file (for comparison)
call read_data(filefmt,psb_inp_unit) ! format of files call read_data(filefmt,inp_unit) ! format of files
call read_data(afmt,psb_inp_unit) ! matrix storage format call read_data(afmt,inp_unit) ! matrix storage format
call read_data(part,psb_inp_unit) ! partition type call read_data(part,inp_unit) ! partition type
! Krylov solver data ! Krylov solver data
call read_data(solve%kmethd,psb_inp_unit) ! Krylov solver call read_data(solve%kmethd,inp_unit) ! Krylov solver
call read_data(solve%istopc,psb_inp_unit) ! stopping criterion call read_data(solve%istopc,inp_unit) ! stopping criterion
call read_data(solve%itmax,psb_inp_unit) ! max num iterations call read_data(solve%itmax,inp_unit) ! max num iterations
call read_data(solve%itrace,psb_inp_unit) ! tracing call read_data(solve%itrace,inp_unit) ! tracing
call read_data(solve%irst,psb_inp_unit) ! restart call read_data(solve%irst,inp_unit) ! restart
call read_data(solve%eps,psb_inp_unit) ! tolerance call read_data(solve%eps,inp_unit) ! tolerance
! preconditioner type ! preconditioner type
call read_data(prec%descr,psb_inp_unit) ! verbose description of the prec call read_data(prec%descr,inp_unit) ! verbose description of the prec
call read_data(prec%ptype,psb_inp_unit) ! preconditioner type call read_data(prec%ptype,inp_unit) ! preconditioner type
! First smoother / 1-lev preconditioner ! First smoother / 1-lev preconditioner
call read_data(prec%smther,psb_inp_unit) ! smoother type call read_data(prec%smther,inp_unit) ! smoother type
call read_data(prec%jsweeps,psb_inp_unit) ! (pre-)smoother / 1-lev prec sweeps call read_data(prec%jsweeps,inp_unit) ! (pre-)smoother / 1-lev prec sweeps
call read_data(prec%novr,psb_inp_unit) ! number of overlap layers call read_data(prec%novr,inp_unit) ! number of overlap layers
call read_data(prec%restr,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr,inp_unit) ! restriction over application of AS
call read_data(prec%prol,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol,inp_unit) ! prolongation over application of AS
call read_data(prec%solve,psb_inp_unit) ! local subsolver call read_data(prec%solve,inp_unit) ! local subsolver
call read_data(prec%fill,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr,inp_unit) ! threshold for ILUT
! Second smoother/ AMG post-smoother (if NONE ignored in main) ! Second smoother/ AMG post-smoother (if NONE ignored in main)
call read_data(prec%smther2,psb_inp_unit) ! smoother type call read_data(prec%smther2,inp_unit) ! smoother type
call read_data(prec%jsweeps2,psb_inp_unit) ! (post-)smoother sweeps call read_data(prec%jsweeps2,inp_unit) ! (post-)smoother sweeps
call read_data(prec%novr2,psb_inp_unit) ! number of overlap layers call read_data(prec%novr2,inp_unit) ! number of overlap layers
call read_data(prec%restr2,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr2,inp_unit) ! restriction over application of AS
call read_data(prec%prol2,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol2,inp_unit) ! prolongation over application of AS
call read_data(prec%solve2,psb_inp_unit) ! local subsolver call read_data(prec%solve2,inp_unit) ! local subsolver
call read_data(prec%fill2,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr2,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr2,inp_unit) ! threshold for ILUT
! general AMG data ! general AMG data
call read_data(prec%mlcycle,psb_inp_unit) ! AMG cycle type call read_data(prec%mlcycle,inp_unit) ! AMG cycle type
call read_data(prec%outer_sweeps,psb_inp_unit) ! number of 1lev/outer sweeps call read_data(prec%outer_sweeps,inp_unit) ! number of 1lev/outer sweeps
call read_data(prec%maxlevs,psb_inp_unit) ! max number of levels in AMG prec call read_data(prec%maxlevs,inp_unit) ! max number of levels in AMG prec
call read_data(prec%csize,psb_inp_unit) ! min size coarsest mat call read_data(prec%csize,inp_unit) ! min size coarsest mat
! aggregation ! aggregation
call read_data(prec%aggr_prol,psb_inp_unit) ! aggregation type call read_data(prec%aggr_prol,inp_unit) ! aggregation type
call read_data(prec%par_aggr_alg,psb_inp_unit) ! parallel aggregation alg call read_data(prec%par_aggr_alg,inp_unit) ! parallel aggregation alg
call read_data(prec%aggr_ord,psb_inp_unit) ! ordering for aggregation call read_data(prec%aggr_ord,inp_unit) ! ordering for aggregation
call read_data(prec%aggr_filter,psb_inp_unit) ! filtering call read_data(prec%aggr_filter,inp_unit) ! filtering
call read_data(prec%mncrratio,psb_inp_unit) ! minimum aggregation ratio call read_data(prec%mncrratio,inp_unit) ! minimum aggregation ratio
call read_data(prec%thrvsz,psb_inp_unit) ! size of aggr thresh vector call read_data(prec%thrvsz,inp_unit) ! size of aggr thresh vector
if (prec%thrvsz > 0) then if (prec%thrvsz > 0) then
call psb_realloc(prec%thrvsz,prec%athresv,info) call psb_realloc(prec%thrvsz,prec%athresv,info)
call read_data(prec%athresv,psb_inp_unit) ! aggr thresh vector call read_data(prec%athresv,inp_unit) ! aggr thresh vector
else else
read(psb_inp_unit,*) ! dummy read to skip a record read(inp_unit,*) ! dummy read to skip a record
end if end if
call read_data(prec%athres,psb_inp_unit) ! smoothed aggr thresh call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
! coasest-level solver ! coasest-level solver
call read_data(prec%csolve,psb_inp_unit) ! coarsest-lev solver call read_data(prec%csolve,inp_unit) ! coarsest-lev solver
call read_data(prec%csbsolve,psb_inp_unit) ! coarsest-lev subsolver call read_data(prec%csbsolve,inp_unit) ! coarsest-lev subsolver
call read_data(prec%cmat,psb_inp_unit) ! coarsest mat layout call read_data(prec%cmat,inp_unit) ! coarsest mat layout
call read_data(prec%cfill,psb_inp_unit) ! fill-in for incompl LU call read_data(prec%cfill,inp_unit) ! fill-in for incompl LU
call read_data(prec%cthres,psb_inp_unit) ! Threshold for ILUT call read_data(prec%cthres,inp_unit) ! Threshold for ILUT
call read_data(prec%cjswp,psb_inp_unit) ! sweeps for GS/JAC subsolver call read_data(prec%cjswp,inp_unit) ! sweeps for GS/JAC subsolver
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(icontxt,mtrx) call psb_bcast(icontxt,mtrx)

@ -790,69 +790,87 @@ contains
character(len=*) :: afmt character(len=*) :: afmt
type(solverdata) :: solve type(solverdata) :: solve
type(precdata) :: prec type(precdata) :: prec
integer(psb_ipk_) :: iam, nm, np integer(psb_ipk_) :: iam, nm, np, inp_unit
character(len=1024) :: filename
call psb_info(icontxt,iam,np) call psb_info(icontxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(icontxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input data ! read input data
! !
call read_data(afmt,psb_inp_unit) ! matrix storage format call read_data(afmt,inp_unit) ! matrix storage format
call read_data(idim,psb_inp_unit) ! Discretization grid size call read_data(idim,inp_unit) ! Discretization grid size
! Krylov solver data ! Krylov solver data
call read_data(solve%kmethd,psb_inp_unit) ! Krylov solver call read_data(solve%kmethd,inp_unit) ! Krylov solver
call read_data(solve%istopc,psb_inp_unit) ! stopping criterion call read_data(solve%istopc,inp_unit) ! stopping criterion
call read_data(solve%itmax,psb_inp_unit) ! max num iterations call read_data(solve%itmax,inp_unit) ! max num iterations
call read_data(solve%itrace,psb_inp_unit) ! tracing call read_data(solve%itrace,inp_unit) ! tracing
call read_data(solve%irst,psb_inp_unit) ! restart call read_data(solve%irst,inp_unit) ! restart
call read_data(solve%eps,psb_inp_unit) ! tolerance call read_data(solve%eps,inp_unit) ! tolerance
! preconditioner type ! preconditioner type
call read_data(prec%descr,psb_inp_unit) ! verbose description of the prec call read_data(prec%descr,inp_unit) ! verbose description of the prec
call read_data(prec%ptype,psb_inp_unit) ! preconditioner type call read_data(prec%ptype,inp_unit) ! preconditioner type
! First smoother / 1-lev preconditioner ! First smoother / 1-lev preconditioner
call read_data(prec%smther,psb_inp_unit) ! smoother type call read_data(prec%smther,inp_unit) ! smoother type
call read_data(prec%jsweeps,psb_inp_unit) ! (pre-)smoother / 1-lev prec sweeps call read_data(prec%jsweeps,inp_unit) ! (pre-)smoother / 1-lev prec sweeps
call read_data(prec%novr,psb_inp_unit) ! number of overlap layers call read_data(prec%novr,inp_unit) ! number of overlap layers
call read_data(prec%restr,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr,inp_unit) ! restriction over application of AS
call read_data(prec%prol,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol,inp_unit) ! prolongation over application of AS
call read_data(prec%solve,psb_inp_unit) ! local subsolver call read_data(prec%solve,inp_unit) ! local subsolver
call read_data(prec%fill,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr,inp_unit) ! threshold for ILUT
! Second smoother/ AMG post-smoother (if NONE ignored in main) ! Second smoother/ AMG post-smoother (if NONE ignored in main)
call read_data(prec%smther2,psb_inp_unit) ! smoother type call read_data(prec%smther2,inp_unit) ! smoother type
call read_data(prec%jsweeps2,psb_inp_unit) ! (post-)smoother sweeps call read_data(prec%jsweeps2,inp_unit) ! (post-)smoother sweeps
call read_data(prec%novr2,psb_inp_unit) ! number of overlap layers call read_data(prec%novr2,inp_unit) ! number of overlap layers
call read_data(prec%restr2,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr2,inp_unit) ! restriction over application of AS
call read_data(prec%prol2,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol2,inp_unit) ! prolongation over application of AS
call read_data(prec%solve2,psb_inp_unit) ! local subsolver call read_data(prec%solve2,inp_unit) ! local subsolver
call read_data(prec%fill2,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr2,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr2,inp_unit) ! threshold for ILUT
! general AMG data ! general AMG data
call read_data(prec%mlcycle,psb_inp_unit) ! AMG cycle type call read_data(prec%mlcycle,inp_unit) ! AMG cycle type
call read_data(prec%outer_sweeps,psb_inp_unit) ! number of 1lev/outer sweeps call read_data(prec%outer_sweeps,inp_unit) ! number of 1lev/outer sweeps
call read_data(prec%maxlevs,psb_inp_unit) ! max number of levels in AMG prec call read_data(prec%maxlevs,inp_unit) ! max number of levels in AMG prec
call read_data(prec%csize,psb_inp_unit) ! min size coarsest mat call read_data(prec%csize,inp_unit) ! min size coarsest mat
! aggregation ! aggregation
call read_data(prec%aggr_prol,psb_inp_unit) ! aggregation type call read_data(prec%aggr_prol,inp_unit) ! aggregation type
call read_data(prec%par_aggr_alg,psb_inp_unit) ! parallel aggregation alg call read_data(prec%par_aggr_alg,inp_unit) ! parallel aggregation alg
call read_data(prec%aggr_ord,psb_inp_unit) ! ordering for aggregation call read_data(prec%aggr_ord,inp_unit) ! ordering for aggregation
call read_data(prec%aggr_filter,psb_inp_unit) ! filtering call read_data(prec%aggr_filter,inp_unit) ! filtering
call read_data(prec%mncrratio,psb_inp_unit) ! minimum aggregation ratio call read_data(prec%mncrratio,inp_unit) ! minimum aggregation ratio
call read_data(prec%thrvsz,psb_inp_unit) ! size of aggr thresh vector call read_data(prec%thrvsz,inp_unit) ! size of aggr thresh vector
if (prec%thrvsz > 0) then if (prec%thrvsz > 0) then
call psb_realloc(prec%thrvsz,prec%athresv,info) call psb_realloc(prec%thrvsz,prec%athresv,info)
call read_data(prec%athresv,psb_inp_unit) ! aggr thresh vector call read_data(prec%athresv,inp_unit) ! aggr thresh vector
else else
read(psb_inp_unit,*) ! dummy read to skip a record read(inp_unit,*) ! dummy read to skip a record
end if end if
call read_data(prec%athres,psb_inp_unit) ! smoothed aggr thresh call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
! coasest-level solver ! coasest-level solver
call read_data(prec%csolve,psb_inp_unit) ! coarsest-lev solver call read_data(prec%csolve,inp_unit) ! coarsest-lev solver
call read_data(prec%csbsolve,psb_inp_unit) ! coarsest-lev subsolver call read_data(prec%csbsolve,inp_unit) ! coarsest-lev subsolver
call read_data(prec%cmat,psb_inp_unit) ! coarsest mat layout call read_data(prec%cmat,inp_unit) ! coarsest mat layout
call read_data(prec%cfill,psb_inp_unit) ! fill-in for incompl LU call read_data(prec%cfill,inp_unit) ! fill-in for incompl LU
call read_data(prec%cthres,psb_inp_unit) ! Threshold for ILUT call read_data(prec%cthres,inp_unit) ! Threshold for ILUT
call read_data(prec%cjswp,psb_inp_unit) ! sweeps for GS/JAC subsolver call read_data(prec%cjswp,inp_unit) ! sweeps for GS/JAC subsolver
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(icontxt,afmt) call psb_bcast(icontxt,afmt)

@ -844,69 +844,87 @@ contains
character(len=*) :: afmt character(len=*) :: afmt
type(solverdata) :: solve type(solverdata) :: solve
type(precdata) :: prec type(precdata) :: prec
integer(psb_ipk_) :: iam, nm, np integer(psb_ipk_) :: iam, nm, np, inp_unit
character(len=1024) :: filename
call psb_info(icontxt,iam,np) call psb_info(icontxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(icontxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input data ! read input data
! !
call read_data(afmt,psb_inp_unit) ! matrix storage format call read_data(afmt,inp_unit) ! matrix storage format
call read_data(idim,psb_inp_unit) ! Discretization grid size call read_data(idim,inp_unit) ! Discretization grid size
! Krylov solver data ! Krylov solver data
call read_data(solve%kmethd,psb_inp_unit) ! Krylov solver call read_data(solve%kmethd,inp_unit) ! Krylov solver
call read_data(solve%istopc,psb_inp_unit) ! stopping criterion call read_data(solve%istopc,inp_unit) ! stopping criterion
call read_data(solve%itmax,psb_inp_unit) ! max num iterations call read_data(solve%itmax,inp_unit) ! max num iterations
call read_data(solve%itrace,psb_inp_unit) ! tracing call read_data(solve%itrace,inp_unit) ! tracing
call read_data(solve%irst,psb_inp_unit) ! restart call read_data(solve%irst,inp_unit) ! restart
call read_data(solve%eps,psb_inp_unit) ! tolerance call read_data(solve%eps,inp_unit) ! tolerance
! preconditioner type ! preconditioner type
call read_data(prec%descr,psb_inp_unit) ! verbose description of the prec call read_data(prec%descr,inp_unit) ! verbose description of the prec
call read_data(prec%ptype,psb_inp_unit) ! preconditioner type call read_data(prec%ptype,inp_unit) ! preconditioner type
! First smoother / 1-lev preconditioner ! First smoother / 1-lev preconditioner
call read_data(prec%smther,psb_inp_unit) ! smoother type call read_data(prec%smther,inp_unit) ! smoother type
call read_data(prec%jsweeps,psb_inp_unit) ! (pre-)smoother / 1-lev prec sweeps call read_data(prec%jsweeps,inp_unit) ! (pre-)smoother / 1-lev prec sweeps
call read_data(prec%novr,psb_inp_unit) ! number of overlap layers call read_data(prec%novr,inp_unit) ! number of overlap layers
call read_data(prec%restr,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr,inp_unit) ! restriction over application of AS
call read_data(prec%prol,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol,inp_unit) ! prolongation over application of AS
call read_data(prec%solve,psb_inp_unit) ! local subsolver call read_data(prec%solve,inp_unit) ! local subsolver
call read_data(prec%fill,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr,inp_unit) ! threshold for ILUT
! Second smoother/ AMG post-smoother (if NONE ignored in main) ! Second smoother/ AMG post-smoother (if NONE ignored in main)
call read_data(prec%smther2,psb_inp_unit) ! smoother type call read_data(prec%smther2,inp_unit) ! smoother type
call read_data(prec%jsweeps2,psb_inp_unit) ! (post-)smoother sweeps call read_data(prec%jsweeps2,inp_unit) ! (post-)smoother sweeps
call read_data(prec%novr2,psb_inp_unit) ! number of overlap layers call read_data(prec%novr2,inp_unit) ! number of overlap layers
call read_data(prec%restr2,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr2,inp_unit) ! restriction over application of AS
call read_data(prec%prol2,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol2,inp_unit) ! prolongation over application of AS
call read_data(prec%solve2,psb_inp_unit) ! local subsolver call read_data(prec%solve2,inp_unit) ! local subsolver
call read_data(prec%fill2,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr2,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr2,inp_unit) ! threshold for ILUT
! general AMG data ! general AMG data
call read_data(prec%mlcycle,psb_inp_unit) ! AMG cycle type call read_data(prec%mlcycle,inp_unit) ! AMG cycle type
call read_data(prec%outer_sweeps,psb_inp_unit) ! number of 1lev/outer sweeps call read_data(prec%outer_sweeps,inp_unit) ! number of 1lev/outer sweeps
call read_data(prec%maxlevs,psb_inp_unit) ! max number of levels in AMG prec call read_data(prec%maxlevs,inp_unit) ! max number of levels in AMG prec
call read_data(prec%csize,psb_inp_unit) ! min size coarsest mat call read_data(prec%csize,inp_unit) ! min size coarsest mat
! aggregation ! aggregation
call read_data(prec%aggr_prol,psb_inp_unit) ! aggregation type call read_data(prec%aggr_prol,inp_unit) ! aggregation type
call read_data(prec%par_aggr_alg,psb_inp_unit) ! parallel aggregation alg call read_data(prec%par_aggr_alg,inp_unit) ! parallel aggregation alg
call read_data(prec%aggr_ord,psb_inp_unit) ! ordering for aggregation call read_data(prec%aggr_ord,inp_unit) ! ordering for aggregation
call read_data(prec%aggr_filter,psb_inp_unit) ! filtering call read_data(prec%aggr_filter,inp_unit) ! filtering
call read_data(prec%mncrratio,psb_inp_unit) ! minimum aggregation ratio call read_data(prec%mncrratio,inp_unit) ! minimum aggregation ratio
call read_data(prec%thrvsz,psb_inp_unit) ! size of aggr thresh vector call read_data(prec%thrvsz,inp_unit) ! size of aggr thresh vector
if (prec%thrvsz > 0) then if (prec%thrvsz > 0) then
call psb_realloc(prec%thrvsz,prec%athresv,info) call psb_realloc(prec%thrvsz,prec%athresv,info)
call read_data(prec%athresv,psb_inp_unit) ! aggr thresh vector call read_data(prec%athresv,inp_unit) ! aggr thresh vector
else else
read(psb_inp_unit,*) ! dummy read to skip a record read(inp_unit,*) ! dummy read to skip a record
end if end if
call read_data(prec%athres,psb_inp_unit) ! smoothed aggr thresh call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
! coasest-level solver ! coasest-level solver
call read_data(prec%csolve,psb_inp_unit) ! coarsest-lev solver call read_data(prec%csolve,inp_unit) ! coarsest-lev solver
call read_data(prec%csbsolve,psb_inp_unit) ! coarsest-lev subsolver call read_data(prec%csbsolve,inp_unit) ! coarsest-lev subsolver
call read_data(prec%cmat,psb_inp_unit) ! coarsest mat layout call read_data(prec%cmat,inp_unit) ! coarsest mat layout
call read_data(prec%cfill,psb_inp_unit) ! fill-in for incompl LU call read_data(prec%cfill,inp_unit) ! fill-in for incompl LU
call read_data(prec%cthres,psb_inp_unit) ! Threshold for ILUT call read_data(prec%cthres,inp_unit) ! Threshold for ILUT
call read_data(prec%cjswp,psb_inp_unit) ! sweeps for GS/JAC subsolver call read_data(prec%cjswp,inp_unit) ! sweeps for GS/JAC subsolver
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(icontxt,afmt) call psb_bcast(icontxt,afmt)

@ -790,69 +790,87 @@ contains
character(len=*) :: afmt character(len=*) :: afmt
type(solverdata) :: solve type(solverdata) :: solve
type(precdata) :: prec type(precdata) :: prec
integer(psb_ipk_) :: iam, nm, np integer(psb_ipk_) :: iam, nm, np, inp_unit
character(len=1024) :: filename
call psb_info(icontxt,iam,np) call psb_info(icontxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(icontxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input data ! read input data
! !
call read_data(afmt,psb_inp_unit) ! matrix storage format call read_data(afmt,inp_unit) ! matrix storage format
call read_data(idim,psb_inp_unit) ! Discretization grid size call read_data(idim,inp_unit) ! Discretization grid size
! Krylov solver data ! Krylov solver data
call read_data(solve%kmethd,psb_inp_unit) ! Krylov solver call read_data(solve%kmethd,inp_unit) ! Krylov solver
call read_data(solve%istopc,psb_inp_unit) ! stopping criterion call read_data(solve%istopc,inp_unit) ! stopping criterion
call read_data(solve%itmax,psb_inp_unit) ! max num iterations call read_data(solve%itmax,inp_unit) ! max num iterations
call read_data(solve%itrace,psb_inp_unit) ! tracing call read_data(solve%itrace,inp_unit) ! tracing
call read_data(solve%irst,psb_inp_unit) ! restart call read_data(solve%irst,inp_unit) ! restart
call read_data(solve%eps,psb_inp_unit) ! tolerance call read_data(solve%eps,inp_unit) ! tolerance
! preconditioner type ! preconditioner type
call read_data(prec%descr,psb_inp_unit) ! verbose description of the prec call read_data(prec%descr,inp_unit) ! verbose description of the prec
call read_data(prec%ptype,psb_inp_unit) ! preconditioner type call read_data(prec%ptype,inp_unit) ! preconditioner type
! First smoother / 1-lev preconditioner ! First smoother / 1-lev preconditioner
call read_data(prec%smther,psb_inp_unit) ! smoother type call read_data(prec%smther,inp_unit) ! smoother type
call read_data(prec%jsweeps,psb_inp_unit) ! (pre-)smoother / 1-lev prec sweeps call read_data(prec%jsweeps,inp_unit) ! (pre-)smoother / 1-lev prec sweeps
call read_data(prec%novr,psb_inp_unit) ! number of overlap layers call read_data(prec%novr,inp_unit) ! number of overlap layers
call read_data(prec%restr,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr,inp_unit) ! restriction over application of AS
call read_data(prec%prol,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol,inp_unit) ! prolongation over application of AS
call read_data(prec%solve,psb_inp_unit) ! local subsolver call read_data(prec%solve,inp_unit) ! local subsolver
call read_data(prec%fill,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr,inp_unit) ! threshold for ILUT
! Second smoother/ AMG post-smoother (if NONE ignored in main) ! Second smoother/ AMG post-smoother (if NONE ignored in main)
call read_data(prec%smther2,psb_inp_unit) ! smoother type call read_data(prec%smther2,inp_unit) ! smoother type
call read_data(prec%jsweeps2,psb_inp_unit) ! (post-)smoother sweeps call read_data(prec%jsweeps2,inp_unit) ! (post-)smoother sweeps
call read_data(prec%novr2,psb_inp_unit) ! number of overlap layers call read_data(prec%novr2,inp_unit) ! number of overlap layers
call read_data(prec%restr2,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr2,inp_unit) ! restriction over application of AS
call read_data(prec%prol2,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol2,inp_unit) ! prolongation over application of AS
call read_data(prec%solve2,psb_inp_unit) ! local subsolver call read_data(prec%solve2,inp_unit) ! local subsolver
call read_data(prec%fill2,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr2,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr2,inp_unit) ! threshold for ILUT
! general AMG data ! general AMG data
call read_data(prec%mlcycle,psb_inp_unit) ! AMG cycle type call read_data(prec%mlcycle,inp_unit) ! AMG cycle type
call read_data(prec%outer_sweeps,psb_inp_unit) ! number of 1lev/outer sweeps call read_data(prec%outer_sweeps,inp_unit) ! number of 1lev/outer sweeps
call read_data(prec%maxlevs,psb_inp_unit) ! max number of levels in AMG prec call read_data(prec%maxlevs,inp_unit) ! max number of levels in AMG prec
call read_data(prec%csize,psb_inp_unit) ! min size coarsest mat call read_data(prec%csize,inp_unit) ! min size coarsest mat
! aggregation ! aggregation
call read_data(prec%aggr_prol,psb_inp_unit) ! aggregation type call read_data(prec%aggr_prol,inp_unit) ! aggregation type
call read_data(prec%par_aggr_alg,psb_inp_unit) ! parallel aggregation alg call read_data(prec%par_aggr_alg,inp_unit) ! parallel aggregation alg
call read_data(prec%aggr_ord,psb_inp_unit) ! ordering for aggregation call read_data(prec%aggr_ord,inp_unit) ! ordering for aggregation
call read_data(prec%aggr_filter,psb_inp_unit) ! filtering call read_data(prec%aggr_filter,inp_unit) ! filtering
call read_data(prec%mncrratio,psb_inp_unit) ! minimum aggregation ratio call read_data(prec%mncrratio,inp_unit) ! minimum aggregation ratio
call read_data(prec%thrvsz,psb_inp_unit) ! size of aggr thresh vector call read_data(prec%thrvsz,inp_unit) ! size of aggr thresh vector
if (prec%thrvsz > 0) then if (prec%thrvsz > 0) then
call psb_realloc(prec%thrvsz,prec%athresv,info) call psb_realloc(prec%thrvsz,prec%athresv,info)
call read_data(prec%athresv,psb_inp_unit) ! aggr thresh vector call read_data(prec%athresv,inp_unit) ! aggr thresh vector
else else
read(psb_inp_unit,*) ! dummy read to skip a record read(inp_unit,*) ! dummy read to skip a record
end if end if
call read_data(prec%athres,psb_inp_unit) ! smoothed aggr thresh call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
! coasest-level solver ! coasest-level solver
call read_data(prec%csolve,psb_inp_unit) ! coarsest-lev solver call read_data(prec%csolve,inp_unit) ! coarsest-lev solver
call read_data(prec%csbsolve,psb_inp_unit) ! coarsest-lev subsolver call read_data(prec%csbsolve,inp_unit) ! coarsest-lev subsolver
call read_data(prec%cmat,psb_inp_unit) ! coarsest mat layout call read_data(prec%cmat,inp_unit) ! coarsest mat layout
call read_data(prec%cfill,psb_inp_unit) ! fill-in for incompl LU call read_data(prec%cfill,inp_unit) ! fill-in for incompl LU
call read_data(prec%cthres,psb_inp_unit) ! Threshold for ILUT call read_data(prec%cthres,inp_unit) ! Threshold for ILUT
call read_data(prec%cjswp,psb_inp_unit) ! sweeps for GS/JAC subsolver call read_data(prec%cjswp,inp_unit) ! sweeps for GS/JAC subsolver
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(icontxt,afmt) call psb_bcast(icontxt,afmt)

@ -844,69 +844,87 @@ contains
character(len=*) :: afmt character(len=*) :: afmt
type(solverdata) :: solve type(solverdata) :: solve
type(precdata) :: prec type(precdata) :: prec
integer(psb_ipk_) :: iam, nm, np integer(psb_ipk_) :: iam, nm, np, inp_unit
character(len=1024) :: filename
call psb_info(icontxt,iam,np) call psb_info(icontxt,iam,np)
if (iam == psb_root_) then if (iam == psb_root_) then
if (command_argument_count()>0) then
call get_command_argument(1,filename)
inp_unit = 30
open(inp_unit,file=filename,action='read',iostat=info)
if (info /= 0) then
write(psb_err_unit,*) 'Could not open file ',filename,' for input'
call psb_abort(icontxt)
stop
else
write(psb_err_unit,*) 'Opened file ',trim(filename),' for input'
end if
else
inp_unit=psb_inp_unit
end if
! read input data ! read input data
! !
call read_data(afmt,psb_inp_unit) ! matrix storage format call read_data(afmt,inp_unit) ! matrix storage format
call read_data(idim,psb_inp_unit) ! Discretization grid size call read_data(idim,inp_unit) ! Discretization grid size
! Krylov solver data ! Krylov solver data
call read_data(solve%kmethd,psb_inp_unit) ! Krylov solver call read_data(solve%kmethd,inp_unit) ! Krylov solver
call read_data(solve%istopc,psb_inp_unit) ! stopping criterion call read_data(solve%istopc,inp_unit) ! stopping criterion
call read_data(solve%itmax,psb_inp_unit) ! max num iterations call read_data(solve%itmax,inp_unit) ! max num iterations
call read_data(solve%itrace,psb_inp_unit) ! tracing call read_data(solve%itrace,inp_unit) ! tracing
call read_data(solve%irst,psb_inp_unit) ! restart call read_data(solve%irst,inp_unit) ! restart
call read_data(solve%eps,psb_inp_unit) ! tolerance call read_data(solve%eps,inp_unit) ! tolerance
! preconditioner type ! preconditioner type
call read_data(prec%descr,psb_inp_unit) ! verbose description of the prec call read_data(prec%descr,inp_unit) ! verbose description of the prec
call read_data(prec%ptype,psb_inp_unit) ! preconditioner type call read_data(prec%ptype,inp_unit) ! preconditioner type
! First smoother / 1-lev preconditioner ! First smoother / 1-lev preconditioner
call read_data(prec%smther,psb_inp_unit) ! smoother type call read_data(prec%smther,inp_unit) ! smoother type
call read_data(prec%jsweeps,psb_inp_unit) ! (pre-)smoother / 1-lev prec sweeps call read_data(prec%jsweeps,inp_unit) ! (pre-)smoother / 1-lev prec sweeps
call read_data(prec%novr,psb_inp_unit) ! number of overlap layers call read_data(prec%novr,inp_unit) ! number of overlap layers
call read_data(prec%restr,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr,inp_unit) ! restriction over application of AS
call read_data(prec%prol,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol,inp_unit) ! prolongation over application of AS
call read_data(prec%solve,psb_inp_unit) ! local subsolver call read_data(prec%solve,inp_unit) ! local subsolver
call read_data(prec%fill,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr,inp_unit) ! threshold for ILUT
! Second smoother/ AMG post-smoother (if NONE ignored in main) ! Second smoother/ AMG post-smoother (if NONE ignored in main)
call read_data(prec%smther2,psb_inp_unit) ! smoother type call read_data(prec%smther2,inp_unit) ! smoother type
call read_data(prec%jsweeps2,psb_inp_unit) ! (post-)smoother sweeps call read_data(prec%jsweeps2,inp_unit) ! (post-)smoother sweeps
call read_data(prec%novr2,psb_inp_unit) ! number of overlap layers call read_data(prec%novr2,inp_unit) ! number of overlap layers
call read_data(prec%restr2,psb_inp_unit) ! restriction over application of AS call read_data(prec%restr2,inp_unit) ! restriction over application of AS
call read_data(prec%prol2,psb_inp_unit) ! prolongation over application of AS call read_data(prec%prol2,inp_unit) ! prolongation over application of AS
call read_data(prec%solve2,psb_inp_unit) ! local subsolver call read_data(prec%solve2,inp_unit) ! local subsolver
call read_data(prec%fill2,psb_inp_unit) ! fill-in for incomplete LU call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU
call read_data(prec%thr2,psb_inp_unit) ! threshold for ILUT call read_data(prec%thr2,inp_unit) ! threshold for ILUT
! general AMG data ! general AMG data
call read_data(prec%mlcycle,psb_inp_unit) ! AMG cycle type call read_data(prec%mlcycle,inp_unit) ! AMG cycle type
call read_data(prec%outer_sweeps,psb_inp_unit) ! number of 1lev/outer sweeps call read_data(prec%outer_sweeps,inp_unit) ! number of 1lev/outer sweeps
call read_data(prec%maxlevs,psb_inp_unit) ! max number of levels in AMG prec call read_data(prec%maxlevs,inp_unit) ! max number of levels in AMG prec
call read_data(prec%csize,psb_inp_unit) ! min size coarsest mat call read_data(prec%csize,inp_unit) ! min size coarsest mat
! aggregation ! aggregation
call read_data(prec%aggr_prol,psb_inp_unit) ! aggregation type call read_data(prec%aggr_prol,inp_unit) ! aggregation type
call read_data(prec%par_aggr_alg,psb_inp_unit) ! parallel aggregation alg call read_data(prec%par_aggr_alg,inp_unit) ! parallel aggregation alg
call read_data(prec%aggr_ord,psb_inp_unit) ! ordering for aggregation call read_data(prec%aggr_ord,inp_unit) ! ordering for aggregation
call read_data(prec%aggr_filter,psb_inp_unit) ! filtering call read_data(prec%aggr_filter,inp_unit) ! filtering
call read_data(prec%mncrratio,psb_inp_unit) ! minimum aggregation ratio call read_data(prec%mncrratio,inp_unit) ! minimum aggregation ratio
call read_data(prec%thrvsz,psb_inp_unit) ! size of aggr thresh vector call read_data(prec%thrvsz,inp_unit) ! size of aggr thresh vector
if (prec%thrvsz > 0) then if (prec%thrvsz > 0) then
call psb_realloc(prec%thrvsz,prec%athresv,info) call psb_realloc(prec%thrvsz,prec%athresv,info)
call read_data(prec%athresv,psb_inp_unit) ! aggr thresh vector call read_data(prec%athresv,inp_unit) ! aggr thresh vector
else else
read(psb_inp_unit,*) ! dummy read to skip a record read(inp_unit,*) ! dummy read to skip a record
end if end if
call read_data(prec%athres,psb_inp_unit) ! smoothed aggr thresh call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
! coasest-level solver ! coasest-level solver
call read_data(prec%csolve,psb_inp_unit) ! coarsest-lev solver call read_data(prec%csolve,inp_unit) ! coarsest-lev solver
call read_data(prec%csbsolve,psb_inp_unit) ! coarsest-lev subsolver call read_data(prec%csbsolve,inp_unit) ! coarsest-lev subsolver
call read_data(prec%cmat,psb_inp_unit) ! coarsest mat layout call read_data(prec%cmat,inp_unit) ! coarsest mat layout
call read_data(prec%cfill,psb_inp_unit) ! fill-in for incompl LU call read_data(prec%cfill,inp_unit) ! fill-in for incompl LU
call read_data(prec%cthres,psb_inp_unit) ! Threshold for ILUT call read_data(prec%cthres,inp_unit) ! Threshold for ILUT
call read_data(prec%cjswp,psb_inp_unit) ! sweeps for GS/JAC subsolver call read_data(prec%cjswp,inp_unit) ! sweeps for GS/JAC subsolver
if (inp_unit /= psb_inp_unit) then
close(inp_unit)
end if
end if end if
call psb_bcast(icontxt,afmt) call psb_bcast(icontxt,afmt)

Loading…
Cancel
Save