test/fileread/cf_sample.f90
 test/fileread/df_sample.f90
 test/fileread/sf_sample.f90
 test/fileread/zf_sample.f90

Fixed usage of gather.
psblas-3.0-maint
Salvatore Filippone 13 years ago
parent 53a7db871a
commit 6b12d0b3d8

@ -286,27 +286,23 @@ program cf_sample
& desc_a%indxmap%get_fmt() & desc_a%indxmap%get_fmt()
end if end if
allocate(x_col_glob(m_problem),r_col_glob(m_problem),stat=ierr) call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_)
if (ierr /= 0) then if (info == psb_success_) &
write(psb_err_unit,*) 'allocation error: no data collection' & call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_)
else if (iam == psb_root_) then
call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_) write(psb_err_unit,'(" ")')
call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_) write(psb_err_unit,'("Saving x on file")')
if (iam == psb_root_) then write(20,*) 'matrix: ',mtrx_file
write(psb_err_unit,'(" ")') write(20,*) 'computed solution on ',np,' processors.'
write(psb_err_unit,'("Saving x on file")') write(20,*) 'iterations to convergence: ',iter
write(20,*) 'matrix: ',mtrx_file write(20,*) 'error estimate (infinity norm) on exit:', &
write(20,*) 'computed solution on ',np,' processors.' & ' ||r||/(||a||||x||+||b||) = ',err
write(20,*) 'iterations to convergence: ',iter write(20,'("Residual norm 2 : ",es12.5)')resmx
write(20,*) 'error estimate (infinity norm) on exit:', & write(20,'("Residual norm inf : ",es12.5)')resmxp
& ' ||r||/(||a||||x||+||b||) = ',err write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)'
write(20,'("Residual norm 2 : ",es12.5)')resmx do i=1,m_problem
write(20,'("Residual norm inf : ",es12.5)')resmxp write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i)
write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' enddo
do i=1,m_problem
write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i)
enddo
end if
end if end if
998 format(i8,6(1x,g11.5)) 998 format(i8,6(1x,g11.5))
993 format(i6,4(1x,e12.6)) 993 format(i6,4(1x,e12.6))

@ -293,27 +293,23 @@ program df_sample
end if end if
!!$ call psb_precdump(prec,info,prefix=trim(mtrx_file)//'_') !!$ call psb_precdump(prec,info,prefix=trim(mtrx_file)//'_')
allocate(x_col_glob(m_problem),r_col_glob(m_problem),stat=ierr) call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_)
if (ierr /= 0) then if (info == psb_success_) &
write(psb_err_unit,*) 'allocation error: no data collection' & call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_)
else if (iam == psb_root_) then
call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_) write(psb_err_unit,'(" ")')
call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_) write(psb_err_unit,'("Saving x on file")')
if (iam == psb_root_) then write(20,*) 'matrix: ',mtrx_file
write(psb_err_unit,'(" ")') write(20,*) 'computed solution on ',np,' processors.'
write(psb_err_unit,'("Saving x on file")') write(20,*) 'iterations to convergence: ',iter
write(20,*) 'matrix: ',mtrx_file write(20,*) 'error estimate (infinity norm) on exit:', &
write(20,*) 'computed solution on ',np,' processors.' & ' ||r||/(||a||||x||+||b||) = ',err
write(20,*) 'iterations to convergence: ',iter write(20,'("Residual norm 2 : ",es12.5)')resmx
write(20,*) 'error estimate (infinity norm) on exit:', & write(20,'("Residual norm inf : ",es12.5)')resmxp
& ' ||r||/(||a||||x||+||b||) = ',err write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)'
write(20,'("Residual norm 2 : ",es12.5)')resmx do i=1,m_problem
write(20,'("Residual norm inf : ",es12.5)')resmxp write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i)
write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' enddo
do i=1,m_problem
write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i)
enddo
end if
end if end if
998 format(i8,4(2x,g20.14)) 998 format(i8,4(2x,g20.14))
993 format(i6,4(1x,e12.6)) 993 format(i6,4(1x,e12.6))

@ -290,27 +290,23 @@ program sf_sample
end if end if
!!$ call psb_precdump(prec,info,prefix=trim(mtrx_file)//'_') !!$ call psb_precdump(prec,info,prefix=trim(mtrx_file)//'_')
allocate(x_col_glob(m_problem),r_col_glob(m_problem),stat=ierr) call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_)
if (ierr /= 0) then if (info == psb_success_) &
write(psb_err_unit,*) 'allocation error: no data collection' & call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_)
else if (iam == psb_root_) then
call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_) write(psb_err_unit,'(" ")')
call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_) write(psb_err_unit,'("Saving x on file")')
if (iam == psb_root_) then write(20,*) 'matrix: ',mtrx_file
write(psb_err_unit,'(" ")') write(20,*) 'computed solution on ',np,' processors.'
write(psb_err_unit,'("Saving x on file")') write(20,*) 'iterations to convergence: ',iter
write(20,*) 'matrix: ',mtrx_file write(20,*) 'error estimate (infinity norm) on exit:', &
write(20,*) 'computed solution on ',np,' processors.' & ' ||r||/(||a||||x||+||b||) = ',err
write(20,*) 'iterations to convergence: ',iter write(20,'("Residual norm 2 : ",es12.5)')resmx
write(20,*) 'error estimate (infinity norm) on exit:', & write(20,'("Residual norm inf : ",es12.5)')resmxp
& ' ||r||/(||a||||x||+||b||) = ',err write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)'
write(20,'("Residual norm 2 : ",es12.5)')resmx do i=1,m_problem
write(20,'("Residual norm inf : ",es12.5)')resmxp write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i)
write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' enddo
do i=1,m_problem
write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i)
enddo
end if
end if end if
998 format(i8,4(2x,g20.14)) 998 format(i8,4(2x,g20.14))
993 format(i6,4(1x,e12.6)) 993 format(i6,4(1x,e12.6))

@ -286,27 +286,23 @@ program zf_sample
& desc_a%indxmap%get_fmt() & desc_a%indxmap%get_fmt()
end if end if
allocate(x_col_glob(m_problem),r_col_glob(m_problem),stat=ierr) call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_)
if (ierr /= 0) then if (info == psb_success_) &
write(psb_err_unit,*) 'allocation error: no data collection' & call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_)
else if (iam == psb_root_) then
call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_) write(psb_err_unit,'(" ")')
call psb_gather(r_col_glob,r_col,desc_a,info,root=psb_root_) write(psb_err_unit,'("Saving x on file")')
if (iam == psb_root_) then write(20,*) 'matrix: ',mtrx_file
write(psb_err_unit,'(" ")') write(20,*) 'computed solution on ',np,' processors.'
write(psb_err_unit,'("Saving x on file")') write(20,*) 'iterations to convergence: ',iter
write(20,*) 'matrix: ',mtrx_file write(20,*) 'error estimate (infinity norm) on exit:', &
write(20,*) 'computed solution on ',np,' processors.' & ' ||r||/(||a||||x||+||b||) = ',err
write(20,*) 'iterations to convergence: ',iter write(20,'("Residual norm 2 : ",es12.5)')resmx
write(20,*) 'error estimate (infinity norm) on exit:', & write(20,'("Residual norm inf : ",es12.5)')resmxp
& ' ||r||/(||a||||x||+||b||) = ',err write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)'
write(20,'("Residual norm 2 : ",es12.5)')resmx do i=1,m_problem
write(20,'("Residual norm inf : ",es12.5)')resmxp write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i)
write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' enddo
do i=1,m_problem
write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i)
enddo
end if
end if end if
998 format(i8,6(1x,g11.5)) 998 format(i8,6(1x,g11.5))
993 format(i6,4(1x,e12.6)) 993 format(i6,4(1x,e12.6))

Loading…
Cancel
Save