mld2p4-dev:

Merged _sizeof changes in preparation for 1.0.1 release.
This commit is contained in:
Salvatore Filippone
2008-09-19 11:38:37 +00:00
parent f16eaa8e14
commit 4cab60bd4c
19 changed files with 309 additions and 285 deletions
+13 -12
View File
@@ -82,7 +82,8 @@ program mld_cexample_ml
integer :: ictxt, iam, np
! other variables
integer :: i,info,j,m_problem,amatsize,descsize,precsize
integer :: i,info,j,m_problem
integer(psb_long_int_k_) :: amatsize, precsize, descsize
integer :: ierr, ircode
real(psb_dpk_) :: t1, t2, tprec
real(psb_spk_) :: resmx, resmxp
@@ -186,7 +187,7 @@ program mld_cexample_ml
if (iam==psb_root_) then
write(*,'(" ")')
write(*,'("Time to read and partition matrix : ",es10.4)')t2
write(*,'("Time to read and partition matrix : ",es12.5)')t2
write(*,'(" ")')
end if
@@ -247,16 +248,16 @@ program mld_cexample_ml
write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es10.4)')err
write(*,'("Time to build prec. : ",es10.4)')tprec
write(*,'("Time to solve system : ",es10.4)')t2
write(*,'("Time per iteration : ",es10.4)')t2/(iter)
write(*,'("Total time : ",es10.4)')t2+tprec
write(*,'("Residual 2-norm : ",es10.4)')resmx
write(*,'("Residual inf-norm : ",es10.4)')resmxp
write(*,'("Total memory occupation for A : ",i10)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i10)')descsize
write(*,'("Total memory occupation for PREC : ",i10)')precsize
write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec
write(*,'("Time to solve system : ",es12.5)')t2
write(*,'("Time per iteration : ",es12.5)')t2/(iter)
write(*,'("Total time : ",es12.5)')t2+tprec
write(*,'("Residual 2-norm : ",es12.5)')resmx
write(*,'("Residual inf-norm : ",es12.5)')resmxp
write(*,'("Total memory occupation for A : ",i12)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i12)')descsize
write(*,'("Total memory occupation for PREC : ",i12)')precsize
end if
allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr)
+13 -12
View File
@@ -86,8 +86,9 @@ program mld_cexample_ml
! other variables
integer :: choice
integer :: i,info,j,m_problem,amatsize,descsize,precsize
integer :: i,info,j,m_problem
integer :: ierr, ircode
integer(psb_long_int_k_) :: amatsize, precsize, descsize
real(psb_dpk_) :: t1, t2, tprec
real(psb_spk_) :: resmx, resmxp
character(len=20) :: name
@@ -190,7 +191,7 @@ program mld_cexample_ml
if (iam==psb_root_) then
write(*,'(" ")')
write(*,'("Time to read and partition matrix : ",es10.4)')t2
write(*,'("Time to read and partition matrix : ",es12.5)')t2
write(*,'(" ")')
end if
@@ -284,16 +285,16 @@ program mld_cexample_ml
write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es10.4)')err
write(*,'("Time to build prec. : ",es10.4)')tprec
write(*,'("Time to solve system : ",es10.4)')t2
write(*,'("Time per iteration : ",es10.4)')t2/(iter)
write(*,'("Total time : ",es10.4)')t2+tprec
write(*,'("Residual 2-norm : ",es10.4)')resmx
write(*,'("Residual inf-norm : ",es10.4)')resmxp
write(*,'("Total memory occupation for A : ",i10)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i10)')descsize
write(*,'("Total memory occupation for PREC : ",i10)')precsize
write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec
write(*,'("Time to solve system : ",es12.5)')t2
write(*,'("Time per iteration : ",es12.5)')t2/(iter)
write(*,'("Total time : ",es12.5)')t2+tprec
write(*,'("Residual 2-norm : ",es12.5)')resmx
write(*,'("Residual inf-norm : ",es12.5)')resmxp
write(*,'("Total memory occupation for A : ",i12)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i12)')descsize
write(*,'("Total memory occupation for PREC : ",i12)')precsize
end if
allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr)
+13 -12
View File
@@ -82,7 +82,8 @@ program mld_dexample_ml
integer :: ictxt, iam, np
! other variables
integer :: i,info,j,m_problem,amatsize,descsize,precsize
integer :: i,info,j,m_problem
integer(psb_long_int_k_) :: amatsize, precsize, descsize
integer :: ierr, ircode
real(psb_dpk_) :: t1, t2, tprec, resmx, resmxp
character(len=20) :: name
@@ -185,7 +186,7 @@ program mld_dexample_ml
if (iam==psb_root_) then
write(*,'(" ")')
write(*,'("Time to read and partition matrix : ",es10.4)')t2
write(*,'("Time to read and partition matrix : ",es12.5)')t2
write(*,'(" ")')
end if
@@ -246,16 +247,16 @@ program mld_dexample_ml
write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es10.4)')err
write(*,'("Time to build prec. : ",es10.4)')tprec
write(*,'("Time to solve system : ",es10.4)')t2
write(*,'("Time per iteration : ",es10.4)')t2/(iter)
write(*,'("Total time : ",es10.4)')t2+tprec
write(*,'("Residual 2-norm : ",es10.4)')resmx
write(*,'("Residual inf-norm : ",es10.4)')resmxp
write(*,'("Total memory occupation for A : ",i10)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i10)')descsize
write(*,'("Total memory occupation for PREC : ",i10)')precsize
write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec
write(*,'("Time to solve system : ",es12.5)')t2
write(*,'("Time per iteration : ",es12.5)')t2/(iter)
write(*,'("Total time : ",es12.5)')t2+tprec
write(*,'("Residual 2-norm : ",es12.5)')resmx
write(*,'("Residual inf-norm : ",es12.5)')resmxp
write(*,'("Total memory occupation for A : ",i12)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i12)')descsize
write(*,'("Total memory occupation for PREC : ",i12)')precsize
end if
allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr)
+13 -12
View File
@@ -86,7 +86,8 @@ program mld_dexample_ml
! other variables
integer :: choice
integer :: i,info,j,m_problem,amatsize,descsize,precsize
integer :: i,info,j,m_problem
integer(psb_long_int_k_) :: amatsize, precsize, descsize
integer :: ierr, ircode
real(psb_dpk_) :: t1, t2, tprec, resmx, resmxp
character(len=20) :: name
@@ -189,7 +190,7 @@ program mld_dexample_ml
if (iam==psb_root_) then
write(*,'(" ")')
write(*,'("Time to read and partition matrix : ",es10.4)')t2
write(*,'("Time to read and partition matrix : ",es12.5)')t2
write(*,'(" ")')
end if
@@ -283,16 +284,16 @@ program mld_dexample_ml
write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es10.4)')err
write(*,'("Time to build prec. : ",es10.4)')tprec
write(*,'("Time to solve system : ",es10.4)')t2
write(*,'("Time per iteration : ",es10.4)')t2/(iter)
write(*,'("Total time : ",es10.4)')t2+tprec
write(*,'("Residual 2-norm : ",es10.4)')resmx
write(*,'("Residual inf-norm : ",es10.4)')resmxp
write(*,'("Total memory occupation for A : ",i10)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i10)')descsize
write(*,'("Total memory occupation for PREC : ",i10)')precsize
write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec
write(*,'("Time to solve system : ",es12.5)')t2
write(*,'("Time per iteration : ",es12.5)')t2/(iter)
write(*,'("Total time : ",es12.5)')t2+tprec
write(*,'("Residual 2-norm : ",es12.5)')resmx
write(*,'("Residual inf-norm : ",es12.5)')resmxp
write(*,'("Total memory occupation for A : ",i12)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i12)')descsize
write(*,'("Total memory occupation for PREC : ",i12)')precsize
end if
allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr)
+13 -12
View File
@@ -82,7 +82,8 @@ program mld_sexample_ml
integer :: ictxt, iam, np
! other variables
integer :: i,info,j,m_problem,amatsize,descsize,precsize
integer :: i,info,j,m_problem
integer(psb_long_int_k_) :: amatsize, precsize, descsize
integer :: ierr, ircode
real(psb_dpk_) :: t1, t2, tprec
real(psb_spk_) :: resmx, resmxp
@@ -186,7 +187,7 @@ program mld_sexample_ml
if (iam==psb_root_) then
write(*,'(" ")')
write(*,'("Time to read and partition matrix : ",es10.4)')t2
write(*,'("Time to read and partition matrix : ",es12.5)')t2
write(*,'(" ")')
end if
@@ -247,16 +248,16 @@ program mld_sexample_ml
write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es10.4)')err
write(*,'("Time to build prec. : ",es10.4)')tprec
write(*,'("Time to solve system : ",es10.4)')t2
write(*,'("Time per iteration : ",es10.4)')t2/(iter)
write(*,'("Total time : ",es10.4)')t2+tprec
write(*,'("Residual 2-norm : ",es10.4)')resmx
write(*,'("Residual inf-norm : ",es10.4)')resmxp
write(*,'("Total memory occupation for A : ",i10)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i10)')descsize
write(*,'("Total memory occupation for PREC : ",i10)')precsize
write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec
write(*,'("Time to solve system : ",es12.5)')t2
write(*,'("Time per iteration : ",es12.5)')t2/(iter)
write(*,'("Total time : ",es12.5)')t2+tprec
write(*,'("Residual 2-norm : ",es12.5)')resmx
write(*,'("Residual inf-norm : ",es12.5)')resmxp
write(*,'("Total memory occupation for A : ",i12)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i12)')descsize
write(*,'("Total memory occupation for PREC : ",i12)')precsize
end if
allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr)
+13 -12
View File
@@ -86,7 +86,8 @@ program mld_sexample_ml
! other variables
integer :: choice
integer :: i,info,j,m_problem,amatsize,descsize,precsize
integer :: i,info,j,m_problem
integer(psb_long_int_k_) :: amatsize, precsize, descsize
integer :: ierr, ircode
real(psb_dpk_) :: t1, t2, tprec
real(psb_spk_) :: resmx, resmxp
@@ -190,7 +191,7 @@ program mld_sexample_ml
if (iam==psb_root_) then
write(*,'(" ")')
write(*,'("Time to read and partition matrix : ",es10.4)')t2
write(*,'("Time to read and partition matrix : ",es12.5)')t2
write(*,'(" ")')
end if
@@ -284,16 +285,16 @@ program mld_sexample_ml
write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es10.4)')err
write(*,'("Time to build prec. : ",es10.4)')tprec
write(*,'("Time to solve system : ",es10.4)')t2
write(*,'("Time per iteration : ",es10.4)')t2/(iter)
write(*,'("Total time : ",es10.4)')t2+tprec
write(*,'("Residual 2-norm : ",es10.4)')resmx
write(*,'("Residual inf-norm : ",es10.4)')resmxp
write(*,'("Total memory occupation for A : ",i10)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i10)')descsize
write(*,'("Total memory occupation for PREC : ",i10)')precsize
write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec
write(*,'("Time to solve system : ",es12.5)')t2
write(*,'("Time per iteration : ",es12.5)')t2/(iter)
write(*,'("Total time : ",es12.5)')t2+tprec
write(*,'("Residual 2-norm : ",es12.5)')resmx
write(*,'("Residual inf-norm : ",es12.5)')resmxp
write(*,'("Total memory occupation for A : ",i12)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i12)')descsize
write(*,'("Total memory occupation for PREC : ",i12)')precsize
end if
allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr)
+13 -12
View File
@@ -82,7 +82,8 @@ program mld_zexample_ml
integer :: ictxt, iam, np
! other variables
integer :: i,info,j,m_problem,amatsize,descsize,precsize
integer :: i,info,j,m_problem
integer(psb_long_int_k_) :: amatsize, precsize, descsize
integer :: ierr, ircode
real(psb_dpk_) :: t1, t2, tprec, resmx, resmxp
character(len=20) :: name
@@ -185,7 +186,7 @@ program mld_zexample_ml
if (iam==psb_root_) then
write(*,'(" ")')
write(*,'("Time to read and partition matrix : ",es10.4)')t2
write(*,'("Time to read and partition matrix : ",es12.5)')t2
write(*,'(" ")')
end if
@@ -246,16 +247,16 @@ program mld_zexample_ml
write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es10.4)')err
write(*,'("Time to build prec. : ",es10.4)')tprec
write(*,'("Time to solve system : ",es10.4)')t2
write(*,'("Time per iteration : ",es10.4)')t2/(iter)
write(*,'("Total time : ",es10.4)')t2+tprec
write(*,'("Residual 2-norm : ",es10.4)')resmx
write(*,'("Residual inf-norm : ",es10.4)')resmxp
write(*,'("Total memory occupation for A : ",i10)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i10)')descsize
write(*,'("Total memory occupation for PREC : ",i10)')precsize
write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec
write(*,'("Time to solve system : ",es12.5)')t2
write(*,'("Time per iteration : ",es12.5)')t2/(iter)
write(*,'("Total time : ",es12.5)')t2+tprec
write(*,'("Residual 2-norm : ",es12.5)')resmx
write(*,'("Residual inf-norm : ",es12.5)')resmxp
write(*,'("Total memory occupation for A : ",i12)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i12)')descsize
write(*,'("Total memory occupation for PREC : ",i12)')precsize
end if
allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr)
+13 -12
View File
@@ -86,7 +86,8 @@ program mld_zexample_ml
! other variables
integer :: choice
integer :: i,info,j,m_problem,amatsize,descsize,precsize
integer :: i,info,j,m_problem
integer(psb_long_int_k_) :: amatsize, precsize, descsize
integer :: ierr, ircode
real(psb_dpk_) :: t1, t2, tprec, resmx, resmxp
character(len=20) :: name
@@ -189,7 +190,7 @@ program mld_zexample_ml
if (iam==psb_root_) then
write(*,'(" ")')
write(*,'("Time to read and partition matrix : ",es10.4)')t2
write(*,'("Time to read and partition matrix : ",es12.5)')t2
write(*,'(" ")')
end if
@@ -283,16 +284,16 @@ program mld_zexample_ml
write(*,'("Matrix: ",A)')mtrx_file
write(*,'("Computed solution on ",i8," processors")')np
write(*,'("Iterations to convergence : ",i6)')iter
write(*,'("Error estimate on exit : ",es10.4)')err
write(*,'("Time to build prec. : ",es10.4)')tprec
write(*,'("Time to solve system : ",es10.4)')t2
write(*,'("Time per iteration : ",es10.4)')t2/(iter)
write(*,'("Total time : ",es10.4)')t2+tprec
write(*,'("Residual 2-norm : ",es10.4)')resmx
write(*,'("Residual inf-norm : ",es10.4)')resmxp
write(*,'("Total memory occupation for A : ",i10)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i10)')descsize
write(*,'("Total memory occupation for PREC : ",i10)')precsize
write(*,'("Error estimate on exit : ",es12.5)')err
write(*,'("Time to build prec. : ",es12.5)')tprec
write(*,'("Time to solve system : ",es12.5)')t2
write(*,'("Time per iteration : ",es12.5)')t2/(iter)
write(*,'("Total time : ",es12.5)')t2+tprec
write(*,'("Residual 2-norm : ",es12.5)')resmx
write(*,'("Residual inf-norm : ",es12.5)')resmxp
write(*,'("Total memory occupation for A : ",i12)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i12)')descsize
write(*,'("Total memory occupation for PREC : ",i12)')precsize
end if
allocate(x_glob(m_problem),r_glob(m_problem),stat=ierr)
+19 -18
View File
@@ -101,7 +101,8 @@ program mld_dexample_1lev
integer :: ictxt, iam, np
! other variables
integer :: i,info,j,amatsize,descsize,precsize
integer :: i,info,j
integer(psb_long_int_k_) :: amatsize, precsize, descsize
integer :: idim, nlev, ierr, ircode
real(psb_dpk_) :: t1, t2, tprec, resmx, resmxp
character(len=20) :: name
@@ -129,7 +130,7 @@ program mld_dexample_1lev
call psb_barrier(ictxt)
t1 = psb_wtime()
call create_matrix(idim,a,b,x,desc_a,part_block,ictxt,info)
call create_matrix(idim,a,b,x,desc_a,ictxt,info)
call psb_barrier(ictxt)
t2 = psb_wtime() - t1
if(info /= 0) then
@@ -206,9 +207,9 @@ program mld_dexample_1lev
write(*,'("Total time : ",es12.5)')t2+tprec
write(*,'("Residual 2-norm : ",es12.5)')resmx
write(*,'("Residual inf-norm : ",es12.5)')resmxp
write(*,'("Total memory occupation for A : ",i10)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i10)')descsize
write(*,'("Total memory occupation for PREC : ",i10)')precsize
write(*,'("Total memory occupation for A : ",i12)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i12)')descsize
write(*,'("Total memory occupation for PREC : ",i12)')precsize
end if
call psb_gefree(b, desc_A,info)
@@ -256,7 +257,7 @@ contains
! subroutine to allocate and fill in the coefficient matrix and
! the rhs
!
subroutine create_matrix(idim,a,b,xv,desc_a,parts,ictxt,info)
subroutine create_matrix(idim,a,b,xv,desc_a,ictxt,info)
!
! Discretize the partial diferential equation
!
@@ -280,21 +281,12 @@ contains
real(psb_dpk_), allocatable :: b(:),xv(:)
type(psb_desc_type) :: desc_a
integer :: ictxt, info
interface
! .....user passed subroutine.....
subroutine parts(global_indx,n,np,pv,nv)
implicit none
integer, intent(in) :: global_indx, n, np
integer, intent(out) :: nv
integer, intent(out) :: pv(*)
end subroutine parts
end interface
! local variables
type(psb_dspmat_type) :: a
real(psb_dpk_) :: zt(nb),glob_x,glob_y,glob_z
integer :: m,n,nnz,glob_row,nlr,i,ii,ib,k,ipoints
integer :: x,y,z,ia,indx_owner
integer :: np, iam
integer :: np, iam, nr, nt
integer :: element
integer, allocatable :: irow(:),icol(:),myidx(:)
real(psb_dpk_), allocatable :: val(:)
@@ -326,9 +318,18 @@ contains
nnz = ((n*9)/(np))
if(iam == psb_root_) write(0,'("Generating Matrix (size=",i0x,")...")')n
!
! Using a simple BLOCK distribution.
!
nt = (m+np-1)/np
nr = min(nt,m-(iam*nt))
nt = nr
call psb_sum(ictxt,nt)
if (nt /= m) write(0,*) iam, 'Initialization error ',nr,nt,m
call psb_barrier(ictxt)
t0 = psb_wtime()
call psb_cdall(ictxt,desc_a,info,mg=n,parts=parts)
call psb_cdall(ictxt,desc_a,info,nl=nr)
if (info == 0) call psb_spall(a,desc_a,info,nnz=nnz)
! define rhs from boundary conditions; also build initial guess
if (info == 0) call psb_geall(b,desc_a,info)
@@ -564,7 +565,7 @@ contains
end if
return
end subroutine create_matrix
end program
end program mld_dexample_1lev
!
! functions parametrizing the differential equation
!
+18 -17
View File
@@ -104,7 +104,8 @@ program mld_dexample_ml
! other variables
integer :: choice
integer :: i,info,j,amatsize,descsize,precsize
integer :: i,info,j
integer(psb_long_int_k_) :: amatsize, precsize, descsize
integer :: idim, ierr, ircode
real(psb_dpk_) :: t1, t2, tprec, resmx, resmxp
character(len=20) :: name
@@ -133,7 +134,7 @@ program mld_dexample_ml
call psb_barrier(ictxt)
t1 = psb_wtime()
call create_matrix(idim,A,b,x,desc_A,part_block,ictxt,info)
call create_matrix(idim,a,b,x,desc_a,ictxt,info)
call psb_barrier(ictxt)
t2 = psb_wtime() - t1
if(info /= 0) then
@@ -242,9 +243,9 @@ program mld_dexample_ml
write(*,'("Total time : ",es12.5)')t2+tprec
write(*,'("Residual 2-norm : ",es12.5)')resmx
write(*,'("Residual inf-norm : ",es12.5)')resmxp
write(*,'("Total memory occupation for A : ",i10)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i10)')descsize
write(*,'("Total memory occupation for PREC : ",i10)')precsize
write(*,'("Total memory occupation for A : ",i12)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i12)')descsize
write(*,'("Total memory occupation for PREC : ",i12)')precsize
end if
call psb_gefree(b, desc_A,info)
@@ -294,7 +295,7 @@ contains
! subroutine to allocate and fill in the coefficient matrix and
! the rhs
!
subroutine create_matrix(idim,a,b,xv,desc_a,parts,ictxt,info)
subroutine create_matrix(idim,a,b,xv,desc_a,ictxt,info)
!
! Discretize the partial diferential equation
!
@@ -318,21 +319,12 @@ contains
real(psb_dpk_), allocatable :: b(:),xv(:)
type(psb_desc_type) :: desc_a
integer :: ictxt, info
interface
! .....user passed subroutine.....
subroutine parts(global_indx,n,np,pv,nv)
implicit none
integer, intent(in) :: global_indx, n, np
integer, intent(out) :: nv
integer, intent(out) :: pv(*)
end subroutine parts
end interface
! local variables
type(psb_dspmat_type) :: a
real(psb_dpk_) :: zt(nb),glob_x,glob_y,glob_z
integer :: m,n,nnz,glob_row,nlr,i,ii,ib,k,ipoints
integer :: x,y,z,ia,indx_owner
integer :: np, iam
integer :: np, iam, nr, nt
integer :: element
integer, allocatable :: irow(:),icol(:),myidx(:)
real(psb_dpk_), allocatable :: val(:)
@@ -364,9 +356,18 @@ contains
nnz = ((n*9)/(np))
if(iam == psb_root_) write(0,'("Generating Matrix (size=",i0x,")...")')n
!
! Using a simple BLOCK distribution.
!
nt = (m+np-1)/np
nr = min(nt,m-(iam*nt))
nt = nr
call psb_sum(ictxt,nt)
if (nt /= m) write(0,*) iam, 'Initialization error ',nr,nt,m
call psb_barrier(ictxt)
t0 = psb_wtime()
call psb_cdall(ictxt,desc_a,info,mg=n,parts=parts)
call psb_cdall(ictxt,desc_a,info,nl=nr)
if (info == 0) call psb_spall(a,desc_a,info,nnz=nnz)
! define rhs from boundary conditions; also build initial guess
if (info == 0) call psb_geall(b,desc_a,info)
+18 -17
View File
@@ -101,7 +101,8 @@ program mld_sexample_1lev
integer :: ictxt, iam, np
! other variables
integer :: i,info,j,amatsize,descsize,precsize
integer :: i,info,j
integer(psb_long_int_k_) :: amatsize, precsize, descsize
integer :: idim, nlev, ierr, ircode
real(psb_dpk_) :: t1, t2, tprec
real(psb_spk_) :: resmx, resmxp
@@ -130,7 +131,7 @@ program mld_sexample_1lev
call psb_barrier(ictxt)
t1 = psb_wtime()
call create_matrix(idim,a,b,x,desc_a,part_block,ictxt,info)
call create_matrix(idim,a,b,x,desc_a,ictxt,info)
call psb_barrier(ictxt)
t2 = psb_wtime() - t1
if(info /= 0) then
@@ -207,9 +208,9 @@ program mld_sexample_1lev
write(*,'("Total time : ",es12.5)')t2+tprec
write(*,'("Residual 2-norm : ",es12.5)')resmx
write(*,'("Residual inf-norm : ",es12.5)')resmxp
write(*,'("Total memory occupation for A : ",i10)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i10)')descsize
write(*,'("Total memory occupation for PREC : ",i10)')precsize
write(*,'("Total memory occupation for A : ",i12)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i12)')descsize
write(*,'("Total memory occupation for PREC : ",i12)')precsize
end if
call psb_gefree(b, desc_A,info)
@@ -257,7 +258,7 @@ contains
! subroutine to allocate and fill in the coefficient matrix and
! the rhs
!
subroutine create_matrix(idim,a,b,xv,desc_a,parts,ictxt,info)
subroutine create_matrix(idim,a,b,xv,desc_a,ictxt,info)
!
! Discretize the partial diferential equation
!
@@ -281,21 +282,12 @@ contains
real(psb_spk_), allocatable :: b(:),xv(:)
type(psb_desc_type) :: desc_a
integer :: ictxt, info
interface
! .....user passed subroutine.....
subroutine parts(global_indx,n,np,pv,nv)
implicit none
integer, intent(in) :: global_indx, n, np
integer, intent(out) :: nv
integer, intent(out) :: pv(*)
end subroutine parts
end interface
! local variables
type(psb_sspmat_type) :: a
real(psb_spk_) :: zt(nb),glob_x,glob_y,glob_z
integer :: m,n,nnz,glob_row,nlr,i,ii,ib,k,ipoints
integer :: x,y,z,ia,indx_owner
integer :: np, iam
integer :: np, iam, nr, nt
integer :: element
integer, allocatable :: irow(:),icol(:),myidx(:)
real(psb_spk_), allocatable :: val(:)
@@ -327,9 +319,18 @@ contains
nnz = ((n*9)/(np))
if(iam == psb_root_) write(0,'("Generating Matrix (size=",i0x,")...")')n
!
! Using a simple BLOCK distribution.
!
nt = (m+np-1)/np
nr = min(nt,m-(iam*nt))
nt = nr
call psb_sum(ictxt,nt)
if (nt /= m) write(0,*) iam, 'Initialization error ',nr,nt,m
call psb_barrier(ictxt)
t0 = psb_wtime()
call psb_cdall(ictxt,desc_a,info,mg=n,parts=parts)
call psb_cdall(ictxt,desc_a,info,nl=nr)
if (info == 0) call psb_spall(a,desc_a,info,nnz=nnz)
! define rhs from boundary conditions; also build initial guess
if (info == 0) call psb_geall(b,desc_a,info)
+18 -17
View File
@@ -104,7 +104,8 @@ program mld_sexample_ml
! other variables
integer :: choice
integer :: i,info,j,amatsize,descsize,precsize
integer :: i,info,j
integer(psb_long_int_k_) :: amatsize, precsize, descsize
integer :: idim, ierr, ircode
real(psb_dpk_) :: t1, t2, tprec
real(psb_spk_) :: resmx, resmxp
@@ -134,7 +135,7 @@ program mld_sexample_ml
call psb_barrier(ictxt)
t1 = psb_wtime()
call create_matrix(idim,a,b,x,desc_a,part_block,ictxt,info)
call create_matrix(idim,a,b,x,desc_a,ictxt,info)
call psb_barrier(ictxt)
t2 = psb_wtime() - t1
if(info /= 0) then
@@ -243,9 +244,9 @@ program mld_sexample_ml
write(*,'("Total time : ",es12.5)')t2+tprec
write(*,'("Residual 2-norm : ",es12.5)')resmx
write(*,'("Residual inf-norm : ",es12.5)')resmxp
write(*,'("Total memory occupation for A : ",i10)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i10)')descsize
write(*,'("Total memory occupation for PREC : ",i10)')precsize
write(*,'("Total memory occupation for A : ",i12)')amatsize
write(*,'("Total memory occupation for DESC_A : ",i12)')descsize
write(*,'("Total memory occupation for PREC : ",i12)')precsize
end if
call psb_gefree(b, desc_A,info)
@@ -295,7 +296,7 @@ contains
! subroutine to allocate and fill in the coefficient matrix and
! the rhs
!
subroutine create_matrix(idim,a,b,xv,desc_a,parts,ictxt,info)
subroutine create_matrix(idim,a,b,xv,desc_a,ictxt,info)
!
! Discretize the partial diferential equation
!
@@ -319,21 +320,12 @@ contains
real(psb_spk_), allocatable :: b(:),xv(:)
type(psb_desc_type) :: desc_a
integer :: ictxt, info
interface
! .....user passed subroutine.....
subroutine parts(global_indx,n,np,pv,nv)
implicit none
integer, intent(in) :: global_indx, n, np
integer, intent(out) :: nv
integer, intent(out) :: pv(*)
end subroutine parts
end interface
! local variables
type(psb_sspmat_type) :: a
real(psb_spk_) :: zt(nb),glob_x,glob_y,glob_z
integer :: m,n,nnz,glob_row,nlr,i,ii,ib,k,ipoints
integer :: x,y,z,ia,indx_owner
integer :: np, iam
integer :: np, iam, nr, nt
integer :: element
integer, allocatable :: irow(:),icol(:),myidx(:)
real(psb_spk_), allocatable :: val(:)
@@ -365,9 +357,18 @@ contains
nnz = ((n*9)/(np))
if(iam == psb_root_) write(0,'("Generating Matrix (size=",i0x,")...")')n
!
! Using a simple BLOCK distribution.
!
nt = (m+np-1)/np
nr = min(nt,m-(iam*nt))
nt = nr
call psb_sum(ictxt,nt)
if (nt /= m) write(0,*) iam, 'Initialization error ',nr,nt,m
call psb_barrier(ictxt)
t0 = psb_wtime()
call psb_cdall(ictxt,desc_a,info,mg=n,parts=parts)
call psb_cdall(ictxt,desc_a,info,nl=nr)
if (info == 0) call psb_spall(a,desc_a,info,nnz=nnz)
! define rhs from boundary conditions; also build initial guess
if (info == 0) call psb_geall(b,desc_a,info)