Fix tests in X_PDE3D

master
Salvatore Filippone 2 years ago
parent d1def4ea17
commit f09767baca

@ -569,112 +569,112 @@ contains
call psb_cdasb(desc_a,info,mold=imold) call psb_cdasb(desc_a,info,mold=imold)
tcdasb = psb_wtime()-t1 tcdasb = psb_wtime()-t1
! if (.false.) then
! Add extra rows !
! ! Add extra rows to test remote build.
block !
integer(psb_ipk_) :: ks, i block
ks = desc_a%get_local_cols()-desc_a%get_local_rows() integer(psb_ipk_) :: ks, i
if (ks > 0) ks = max(1,ks / 10) ks = desc_a%get_local_cols()-desc_a%get_local_rows()
mysz = nlr+ks if (ks > 0) ks = max(1,ks / 10)
call psb_realloc(mysz,myidx,info) mysz = nlr+ks
do i=nlr+1, mysz call psb_realloc(mysz,myidx,info)
myidx(i) = i do i=nlr+1, mysz
end do myidx(i) = i
call desc_a%l2gv1(myidx(nlr+1:mysz),info) end do
!write(0,*) iam,' Check on extra nodes ',nlr,mysz,':',myidx(nlr+1:mysz) call desc_a%l2gv1(myidx(nlr+1:mysz),info)
do ii= nlr+1, mysz, nb !write(0,*) iam,' Check on extra nodes ',nlr,mysz,':',myidx(nlr+1:mysz)
ib = min(nb,mysz-ii+1) do ii= nlr+1, mysz, nb
icoeff = 1 ib = min(nb,mysz-ii+1)
do k=1,ib icoeff = 1
i=ii+k-1 do k=1,ib
! local matrix pointer i=ii+k-1
glob_row=myidx(i) ! local matrix pointer
! compute gridpoint coordinates glob_row=myidx(i)
call idx2ijk(ix,iy,iz,glob_row,idim,idim,idim) ! compute gridpoint coordinates
! x, y, z coordinates call idx2ijk(ix,iy,iz,glob_row,idim,idim,idim)
x = (ix-1)*deltah ! x, y, z coordinates
y = (iy-1)*deltah x = (ix-1)*deltah
z = (iz-1)*deltah y = (iy-1)*deltah
zt(k) = f_(x,y,z) z = (iz-1)*deltah
! internal point: build discretization zt(k) = f_(x,y,z)
! ! internal point: build discretization
! term depending on (x-1,y,z) !
! ! term depending on (x-1,y,z)
val(icoeff) = -a1(x,y,z)/sqdeltah-b1(x,y,z)/deltah2 !
if (ix == 1) then val(icoeff) = -a1(x,y,z)/sqdeltah-b1(x,y,z)/deltah2
zt(k) = g(dzero,y,z)*(-val(icoeff)) + zt(k) if (ix == 1) then
else zt(k) = g(dzero,y,z)*(-val(icoeff)) + zt(k)
call ijk2idx(icol(icoeff),ix-1,iy,iz,idim,idim,idim) else
irow(icoeff) = glob_row call ijk2idx(icol(icoeff),ix-1,iy,iz,idim,idim,idim)
icoeff = icoeff+1 irow(icoeff) = glob_row
endif icoeff = icoeff+1
! term depending on (x,y-1,z) endif
val(icoeff) = -a2(x,y,z)/sqdeltah-b2(x,y,z)/deltah2 ! term depending on (x,y-1,z)
if (iy == 1) then val(icoeff) = -a2(x,y,z)/sqdeltah-b2(x,y,z)/deltah2
zt(k) = g(x,dzero,z)*(-val(icoeff)) + zt(k) if (iy == 1) then
else zt(k) = g(x,dzero,z)*(-val(icoeff)) + zt(k)
call ijk2idx(icol(icoeff),ix,iy-1,iz,idim,idim,idim) else
irow(icoeff) = glob_row call ijk2idx(icol(icoeff),ix,iy-1,iz,idim,idim,idim)
icoeff = icoeff+1 irow(icoeff) = glob_row
endif icoeff = icoeff+1
! term depending on (x,y,z-1) endif
val(icoeff)=-a3(x,y,z)/sqdeltah-b3(x,y,z)/deltah2 ! term depending on (x,y,z-1)
if (iz == 1) then val(icoeff)=-a3(x,y,z)/sqdeltah-b3(x,y,z)/deltah2
zt(k) = g(x,y,dzero)*(-val(icoeff)) + zt(k) if (iz == 1) then
else zt(k) = g(x,y,dzero)*(-val(icoeff)) + zt(k)
call ijk2idx(icol(icoeff),ix,iy,iz-1,idim,idim,idim) else
irow(icoeff) = glob_row call ijk2idx(icol(icoeff),ix,iy,iz-1,idim,idim,idim)
icoeff = icoeff+1 irow(icoeff) = glob_row
endif icoeff = icoeff+1
endif
! term depending on (x,y,z)
val(icoeff)=(2*done)*(a1(x,y,z)+a2(x,y,z)+a3(x,y,z))/sqdeltah & ! term depending on (x,y,z)
& + c(x,y,z) val(icoeff)=(2*done)*(a1(x,y,z)+a2(x,y,z)+a3(x,y,z))/sqdeltah &
call ijk2idx(icol(icoeff),ix,iy,iz,idim,idim,idim) & + c(x,y,z)
irow(icoeff) = glob_row call ijk2idx(icol(icoeff),ix,iy,iz,idim,idim,idim)
icoeff = icoeff+1
! term depending on (x,y,z+1)
val(icoeff)=-a3(x,y,z)/sqdeltah+b3(x,y,z)/deltah2
if (iz == idim) then
zt(k) = g(x,y,done)*(-val(icoeff)) + zt(k)
else
call ijk2idx(icol(icoeff),ix,iy,iz+1,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
! term depending on (x,y+1,z)
val(icoeff)=-a2(x,y,z)/sqdeltah+b2(x,y,z)/deltah2
if (iy == idim) then
zt(k) = g(x,done,z)*(-val(icoeff)) + zt(k)
else
call ijk2idx(icol(icoeff),ix,iy+1,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
! term depending on (x+1,y,z)
val(icoeff)=-a1(x,y,z)/sqdeltah+b1(x,y,z)/deltah2
if (ix==idim) then
zt(k) = g(done,y,z)*(-val(icoeff)) + zt(k)
else
call ijk2idx(icol(icoeff),ix+1,iy,iz,idim,idim,idim)
irow(icoeff) = glob_row irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif ! term depending on (x,y,z+1)
val(icoeff)=-a3(x,y,z)/sqdeltah+b3(x,y,z)/deltah2
if (iz == idim) then
zt(k) = g(x,y,done)*(-val(icoeff)) + zt(k)
else
call ijk2idx(icol(icoeff),ix,iy,iz+1,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
! term depending on (x,y+1,z)
val(icoeff)=-a2(x,y,z)/sqdeltah+b2(x,y,z)/deltah2
if (iy == idim) then
zt(k) = g(x,done,z)*(-val(icoeff)) + zt(k)
else
call ijk2idx(icol(icoeff),ix,iy+1,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
! term depending on (x+1,y,z)
val(icoeff)=-a1(x,y,z)/sqdeltah+b1(x,y,z)/deltah2
if (ix==idim) then
zt(k) = g(done,y,z)*(-val(icoeff)) + zt(k)
else
call ijk2idx(icol(icoeff),ix+1,iy,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
end do
call psb_spins(icoeff-1,irow,icol,val,a,desc_a,info)
if(info /= psb_success_) exit
call psb_geins(ib,myidx(ii:ii+ib-1),zt(1:ib),bv,desc_a,info)
if(info /= psb_success_) exit
zt(:)=dzero
call psb_geins(ib,myidx(ii:ii+ib-1),zt(1:ib),xv,desc_a,info)
if(info /= psb_success_) exit
end do end do
call psb_spins(icoeff-1,irow,icol,val,a,desc_a,info)
if(info /= psb_success_) exit
call psb_geins(ib,myidx(ii:ii+ib-1),zt(1:ib),bv,desc_a,info)
if(info /= psb_success_) exit
zt(:)=dzero
call psb_geins(ib,myidx(ii:ii+ib-1),zt(1:ib),xv,desc_a,info)
if(info /= psb_success_) exit
end do
end block
end block
end if
call psb_barrier(ctxt) call psb_barrier(ctxt)
t1 = psb_wtime() t1 = psb_wtime()

@ -569,112 +569,112 @@ contains
call psb_cdasb(desc_a,info,mold=imold) call psb_cdasb(desc_a,info,mold=imold)
tcdasb = psb_wtime()-t1 tcdasb = psb_wtime()-t1
! if (.false.) then
! Add extra rows !
! ! Add extra rows to test remote build.
block !
integer(psb_ipk_) :: ks, i block
ks = desc_a%get_local_cols()-desc_a%get_local_rows() integer(psb_ipk_) :: ks, i
if (ks > 0) ks = max(1,ks / 10) ks = desc_a%get_local_cols()-desc_a%get_local_rows()
mysz = nlr+ks if (ks > 0) ks = max(1,ks / 10)
call psb_realloc(mysz,myidx,info) mysz = nlr+ks
do i=nlr+1, mysz call psb_realloc(mysz,myidx,info)
myidx(i) = i do i=nlr+1, mysz
end do myidx(i) = i
call desc_a%l2gv1(myidx(nlr+1:mysz),info) end do
!write(0,*) iam,' Check on extra nodes ',nlr,mysz,':',myidx(nlr+1:mysz) call desc_a%l2gv1(myidx(nlr+1:mysz),info)
do ii= nlr+1, mysz, nb !write(0,*) iam,' Check on extra nodes ',nlr,mysz,':',myidx(nlr+1:mysz)
ib = min(nb,mysz-ii+1) do ii= nlr+1, mysz, nb
icoeff = 1 ib = min(nb,mysz-ii+1)
do k=1,ib icoeff = 1
i=ii+k-1 do k=1,ib
! local matrix pointer i=ii+k-1
glob_row=myidx(i) ! local matrix pointer
! compute gridpoint coordinates glob_row=myidx(i)
call idx2ijk(ix,iy,iz,glob_row,idim,idim,idim) ! compute gridpoint coordinates
! x, y, z coordinates call idx2ijk(ix,iy,iz,glob_row,idim,idim,idim)
x = (ix-1)*deltah ! x, y, z coordinates
y = (iy-1)*deltah x = (ix-1)*deltah
z = (iz-1)*deltah y = (iy-1)*deltah
zt(k) = f_(x,y,z) z = (iz-1)*deltah
! internal point: build discretization zt(k) = f_(x,y,z)
! ! internal point: build discretization
! term depending on (x-1,y,z) !
! ! term depending on (x-1,y,z)
val(icoeff) = -a1(x,y,z)/sqdeltah-b1(x,y,z)/deltah2 !
if (ix == 1) then val(icoeff) = -a1(x,y,z)/sqdeltah-b1(x,y,z)/deltah2
zt(k) = g(szero,y,z)*(-val(icoeff)) + zt(k) if (ix == 1) then
else zt(k) = g(szero,y,z)*(-val(icoeff)) + zt(k)
call ijk2idx(icol(icoeff),ix-1,iy,iz,idim,idim,idim) else
irow(icoeff) = glob_row call ijk2idx(icol(icoeff),ix-1,iy,iz,idim,idim,idim)
icoeff = icoeff+1 irow(icoeff) = glob_row
endif icoeff = icoeff+1
! term depending on (x,y-1,z) endif
val(icoeff) = -a2(x,y,z)/sqdeltah-b2(x,y,z)/deltah2 ! term depending on (x,y-1,z)
if (iy == 1) then val(icoeff) = -a2(x,y,z)/sqdeltah-b2(x,y,z)/deltah2
zt(k) = g(x,szero,z)*(-val(icoeff)) + zt(k) if (iy == 1) then
else zt(k) = g(x,szero,z)*(-val(icoeff)) + zt(k)
call ijk2idx(icol(icoeff),ix,iy-1,iz,idim,idim,idim) else
irow(icoeff) = glob_row call ijk2idx(icol(icoeff),ix,iy-1,iz,idim,idim,idim)
icoeff = icoeff+1 irow(icoeff) = glob_row
endif icoeff = icoeff+1
! term depending on (x,y,z-1) endif
val(icoeff)=-a3(x,y,z)/sqdeltah-b3(x,y,z)/deltah2 ! term depending on (x,y,z-1)
if (iz == 1) then val(icoeff)=-a3(x,y,z)/sqdeltah-b3(x,y,z)/deltah2
zt(k) = g(x,y,szero)*(-val(icoeff)) + zt(k) if (iz == 1) then
else zt(k) = g(x,y,szero)*(-val(icoeff)) + zt(k)
call ijk2idx(icol(icoeff),ix,iy,iz-1,idim,idim,idim) else
irow(icoeff) = glob_row call ijk2idx(icol(icoeff),ix,iy,iz-1,idim,idim,idim)
icoeff = icoeff+1 irow(icoeff) = glob_row
endif icoeff = icoeff+1
endif
! term depending on (x,y,z)
val(icoeff)=(2*sone)*(a1(x,y,z)+a2(x,y,z)+a3(x,y,z))/sqdeltah & ! term depending on (x,y,z)
& + c(x,y,z) val(icoeff)=(2*sone)*(a1(x,y,z)+a2(x,y,z)+a3(x,y,z))/sqdeltah &
call ijk2idx(icol(icoeff),ix,iy,iz,idim,idim,idim) & + c(x,y,z)
irow(icoeff) = glob_row call ijk2idx(icol(icoeff),ix,iy,iz,idim,idim,idim)
icoeff = icoeff+1
! term depending on (x,y,z+1)
val(icoeff)=-a3(x,y,z)/sqdeltah+b3(x,y,z)/deltah2
if (iz == idim) then
zt(k) = g(x,y,sone)*(-val(icoeff)) + zt(k)
else
call ijk2idx(icol(icoeff),ix,iy,iz+1,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
! term depending on (x,y+1,z)
val(icoeff)=-a2(x,y,z)/sqdeltah+b2(x,y,z)/deltah2
if (iy == idim) then
zt(k) = g(x,sone,z)*(-val(icoeff)) + zt(k)
else
call ijk2idx(icol(icoeff),ix,iy+1,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
! term depending on (x+1,y,z)
val(icoeff)=-a1(x,y,z)/sqdeltah+b1(x,y,z)/deltah2
if (ix==idim) then
zt(k) = g(sone,y,z)*(-val(icoeff)) + zt(k)
else
call ijk2idx(icol(icoeff),ix+1,iy,iz,idim,idim,idim)
irow(icoeff) = glob_row irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif ! term depending on (x,y,z+1)
val(icoeff)=-a3(x,y,z)/sqdeltah+b3(x,y,z)/deltah2
if (iz == idim) then
zt(k) = g(x,y,sone)*(-val(icoeff)) + zt(k)
else
call ijk2idx(icol(icoeff),ix,iy,iz+1,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
! term depending on (x,y+1,z)
val(icoeff)=-a2(x,y,z)/sqdeltah+b2(x,y,z)/deltah2
if (iy == idim) then
zt(k) = g(x,sone,z)*(-val(icoeff)) + zt(k)
else
call ijk2idx(icol(icoeff),ix,iy+1,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
! term depending on (x+1,y,z)
val(icoeff)=-a1(x,y,z)/sqdeltah+b1(x,y,z)/deltah2
if (ix==idim) then
zt(k) = g(sone,y,z)*(-val(icoeff)) + zt(k)
else
call ijk2idx(icol(icoeff),ix+1,iy,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
end do
call psb_spins(icoeff-1,irow,icol,val,a,desc_a,info)
if(info /= psb_success_) exit
call psb_geins(ib,myidx(ii:ii+ib-1),zt(1:ib),bv,desc_a,info)
if(info /= psb_success_) exit
zt(:)=szero
call psb_geins(ib,myidx(ii:ii+ib-1),zt(1:ib),xv,desc_a,info)
if(info /= psb_success_) exit
end do end do
call psb_spins(icoeff-1,irow,icol,val,a,desc_a,info)
if(info /= psb_success_) exit
call psb_geins(ib,myidx(ii:ii+ib-1),zt(1:ib),bv,desc_a,info)
if(info /= psb_success_) exit
zt(:)=szero
call psb_geins(ib,myidx(ii:ii+ib-1),zt(1:ib),xv,desc_a,info)
if(info /= psb_success_) exit
end do
end block
end block
end if
call psb_barrier(ctxt) call psb_barrier(ctxt)
t1 = psb_wtime() t1 = psb_wtime()

Loading…
Cancel
Save