tests/fileread/cf_sample.f90
 tests/fileread/df_sample.f90
 tests/fileread/sf_sample.f90
 tests/fileread/zf_sample.f90
 tests/pdegen/ppde.f90
 tests/pdegen/spde.f90

Sample programs: formatting, comments, ownership function in matrix generation.
stopcriterion
Salvatore Filippone 18 years ago
parent 0a436e66d8
commit 8782eb20df

@ -356,7 +356,6 @@ contains
return return
end subroutine get_parms end subroutine get_parms
! !
! print an error message ! print an error message
! !
@ -421,7 +420,6 @@ contains
integer :: x,y,z,ia,indx_owner integer :: x,y,z,ia,indx_owner
integer :: np, iam integer :: np, iam
integer :: element integer :: element
integer :: nv, inv
integer, allocatable :: irow(:),icol(:) integer, allocatable :: irow(:),icol(:)
real(psb_dpk_), allocatable :: val(:) real(psb_dpk_), allocatable :: val(:)
integer, allocatable :: prv(:) integer, allocatable :: prv(:)
@ -454,10 +452,10 @@ contains
if(iam == psb_root_) write(0,'("Generating Matrix (size=",i0x,")...")')n if(iam == psb_root_) write(0,'("Generating Matrix (size=",i0x,")...")')n
call psb_cdall(ictxt,desc_a,info,mg=n,parts=parts) call psb_cdall(ictxt,desc_a,info,mg=n,parts=parts)
call psb_spall(a,desc_a,info,nnz=nnz) if (info == 0) call psb_spall(a,desc_a,info,nnz=nnz)
! define rhs from boundary conditions; also build initial guess ! define rhs from boundary conditions; also build initial guess
call psb_geall(b,desc_a,info) if (info == 0) call psb_geall(b,desc_a,info)
call psb_geall(xv,desc_a,info) if (info == 0) call psb_geall(xv,desc_a,info)
if (info /= 0) then if (info /= 0) then
info=4010 info=4010
ch_err='allocation rout.' ch_err='allocation rout.'
@ -470,7 +468,7 @@ contains
! a bunch of rows per call. ! a bunch of rows per call.
! !
allocate(val(20*nbmax),irow(20*nbmax),& allocate(val(20*nbmax),irow(20*nbmax),&
&icol(20*nbmax),prv(np),stat=info) &icol(20*nbmax),stat=info)
if (info /= 0 ) then if (info /= 0 ) then
info=4000 info=4000
call psb_errpush(info,name) call psb_errpush(info,name)
@ -486,10 +484,8 @@ contains
! icol(1)=1 ! icol(1)=1
do glob_row = 1, n do glob_row = 1, n
call parts(glob_row,n,np,prv,nv) ! Figure out which rows are local to the current process:
do inv = 1, nv if (psb_is_owned(glob_row,desc_a)) then
indx_owner = prv(inv)
if (indx_owner == iam) then
! local matrix pointer ! local matrix pointer
element=1 element=1
! compute gridpoint coordinates ! compute gridpoint coordinates
@ -618,7 +614,6 @@ contains
if(info /= 0) exit if(info /= 0) exit
end if end if
end do end do
end do
call psb_barrier(ictxt) call psb_barrier(ictxt)
t2 = psb_wtime()-t1 t2 = psb_wtime()-t1
@ -649,7 +644,7 @@ contains
call psb_amx(ictxt,tasb) call psb_amx(ictxt,tasb)
if(iam == psb_root_) then if(iam == psb_root_) then
write(*,'("The matrix has been generated and assembeld in ",a3," format.")')& write(*,'("The matrix has been generated and assembled in ",a3," format.")')&
& a%fida(1:3) & a%fida(1:3)
write(*,'("-pspins time : ",es10.4)')tins write(*,'("-pspins time : ",es10.4)')tins
write(*,'("-insert time : ",es10.4)')t2 write(*,'("-insert time : ",es10.4)')t2

@ -356,7 +356,6 @@ contains
return return
end subroutine get_parms end subroutine get_parms
! !
! print an error message ! print an error message
! !
@ -421,7 +420,6 @@ contains
integer :: x,y,z,ia,indx_owner integer :: x,y,z,ia,indx_owner
integer :: np, iam integer :: np, iam
integer :: element integer :: element
integer :: nv, inv
integer, allocatable :: irow(:),icol(:) integer, allocatable :: irow(:),icol(:)
real(psb_spk_), allocatable :: val(:) real(psb_spk_), allocatable :: val(:)
integer, allocatable :: prv(:) integer, allocatable :: prv(:)
@ -454,10 +452,10 @@ contains
if(iam == psb_root_) write(0,'("Generating Matrix (size=",i0x,")...")')n if(iam == psb_root_) write(0,'("Generating Matrix (size=",i0x,")...")')n
call psb_cdall(ictxt,desc_a,info,mg=n,parts=parts) call psb_cdall(ictxt,desc_a,info,mg=n,parts=parts)
call psb_spall(a,desc_a,info,nnz=nnz) if (info == 0) call psb_spall(a,desc_a,info,nnz=nnz)
! define rhs from boundary conditions; also build initial guess ! define rhs from boundary conditions; also build initial guess
call psb_geall(b,desc_a,info) if (info == 0) call psb_geall(b,desc_a,info)
call psb_geall(xv,desc_a,info) if (info == 0) call psb_geall(xv,desc_a,info)
if (info /= 0) then if (info /= 0) then
info=4010 info=4010
ch_err='allocation rout.' ch_err='allocation rout.'
@ -470,7 +468,7 @@ contains
! a bunch of rows per call. ! a bunch of rows per call.
! !
allocate(val(20*nbmax),irow(20*nbmax),& allocate(val(20*nbmax),irow(20*nbmax),&
&icol(20*nbmax),prv(np),stat=info) &icol(20*nbmax),stat=info)
if (info /= 0 ) then if (info /= 0 ) then
info=4000 info=4000
call psb_errpush(info,name) call psb_errpush(info,name)
@ -486,10 +484,8 @@ contains
! icol(1)=1 ! icol(1)=1
do glob_row = 1, n do glob_row = 1, n
call parts(glob_row,n,np,prv,nv) ! Figure out which rows are local to the current process:
do inv = 1, nv if (psb_is_owned(glob_row,desc_a)) then
indx_owner = prv(inv)
if (indx_owner == iam) then
! local matrix pointer ! local matrix pointer
element=1 element=1
! compute gridpoint coordinates ! compute gridpoint coordinates
@ -618,7 +614,6 @@ contains
if(info /= 0) exit if(info /= 0) exit
end if end if
end do end do
end do
call psb_barrier(ictxt) call psb_barrier(ictxt)
t2 = psb_wtime()-t1 t2 = psb_wtime()-t1
@ -649,7 +644,7 @@ contains
call psb_amx(ictxt,tasb) call psb_amx(ictxt,tasb)
if(iam == psb_root_) then if(iam == psb_root_) then
write(*,'("The matrix has been generated and assembeld in ",a3," format.")')& write(*,'("The matrix has been generated and assembled in ",a3," format.")')&
& a%fida(1:3) & a%fida(1:3)
write(*,'("-pspins time : ",es10.4)')tins write(*,'("-pspins time : ",es10.4)')tins
write(*,'("-insert time : ",es10.4)')t2 write(*,'("-insert time : ",es10.4)')t2

Loading…
Cancel
Save