psb_c_mmio_impl.f90
 psb_d_mmio_impl.f90
 psb_s_mmio_impl.f90
 psb_z_mmio_impl.f90

Added proper error condition on read.
psblas-3.2.0
Salvatore Filippone 11 years ago
parent 8c8480ea3d
commit 51c0935493

@ -285,7 +285,7 @@ subroutine cmm_mat_read(a, info, iunit, filename)
! we de-symmetrize what we are about to read ! we de-symmetrize what we are about to read
call acoo%allocate(nrow,ncol,2*nnzero) call acoo%allocate(nrow,ncol,2*nnzero)
do i=1,nnzero do i=1,nnzero
read(infile,fmt=*,end=902) acoo%ia(i),acoo%ja(i),are,aim read(infile,fmt=*,end=902,err=905) acoo%ia(i),acoo%ja(i),are,aim
acoo%val(i) = cmplx(are,aim,kind=psb_spk_) acoo%val(i) = cmplx(are,aim,kind=psb_spk_)
end do end do
nzr = nnzero nzr = nnzero
@ -308,7 +308,7 @@ subroutine cmm_mat_read(a, info, iunit, filename)
! we de-symmetrize what we are about to read ! we de-symmetrize what we are about to read
call acoo%allocate(nrow,ncol,2*nnzero) call acoo%allocate(nrow,ncol,2*nnzero)
do i=1,nnzero do i=1,nnzero
read(infile,fmt=*,end=902) acoo%ia(i),acoo%ja(i),are,aim read(infile,fmt=*,end=902,err=905) acoo%ia(i),acoo%ja(i),are,aim
acoo%val(i) = cmplx(are,aim,kind=psb_spk_) acoo%val(i) = cmplx(are,aim,kind=psb_spk_)
end do end do
nzr = nnzero nzr = nnzero
@ -340,6 +340,9 @@ subroutine cmm_mat_read(a, info, iunit, filename)
902 info=902 902 info=902
write(psb_err_unit,*) 'READ_MATRIX: Unexpected end of file ' write(psb_err_unit,*) 'READ_MATRIX: Unexpected end of file '
return return
905 info=905
write(psb_err_unit,*) 'READ_MATRIX: Error at line',i
return
993 info=993 993 info=993
write(psb_err_unit,*) 'READ_MATRIX: Memory allocation failure' write(psb_err_unit,*) 'READ_MATRIX: Memory allocation failure'
return return

@ -276,7 +276,7 @@ subroutine dmm_mat_read(a, info, iunit, filename)
! we de-symmetrize what we are about to read ! we de-symmetrize what we are about to read
call acoo%allocate(nrow,ncol,2*nnzero) call acoo%allocate(nrow,ncol,2*nnzero)
do i=1,nnzero do i=1,nnzero
read(infile,fmt=*,end=902) acoo%ia(i),acoo%ja(i),acoo%val(i) read(infile,fmt=*,end=902,err=905) acoo%ia(i),acoo%ja(i),acoo%val(i)
end do end do
nzr = nnzero nzr = nnzero
do i=1,nnzero do i=1,nnzero

@ -266,7 +266,7 @@ subroutine smm_mat_read(a, info, iunit, filename)
if ((psb_tolower(type) == 'real').and.(psb_tolower(sym) == 'general')) then if ((psb_tolower(type) == 'real').and.(psb_tolower(sym) == 'general')) then
call acoo%allocate(nrow,ncol,nnzero) call acoo%allocate(nrow,ncol,nnzero)
do i=1,nnzero do i=1,nnzero
read(infile,fmt=*,end=902) acoo%ia(i),acoo%ja(i),acoo%val(i) read(infile,fmt=*,end=902,err=905) acoo%ia(i),acoo%ja(i),acoo%val(i)
end do end do
call acoo%set_nzeros(nnzero) call acoo%set_nzeros(nnzero)
call acoo%fix(info) call acoo%fix(info)
@ -279,7 +279,7 @@ subroutine smm_mat_read(a, info, iunit, filename)
! we de-symmetrize what we are about to read ! we de-symmetrize what we are about to read
call acoo%allocate(nrow,ncol,2*nnzero) call acoo%allocate(nrow,ncol,2*nnzero)
do i=1,nnzero do i=1,nnzero
read(infile,fmt=*,end=902) acoo%ia(i),acoo%ja(i),acoo%val(i) read(infile,fmt=*,end=902,err=905) acoo%ia(i),acoo%ja(i),acoo%val(i)
end do end do
nzr = nnzero nzr = nnzero
do i=1,nnzero do i=1,nnzero
@ -312,6 +312,9 @@ subroutine smm_mat_read(a, info, iunit, filename)
902 info=902 902 info=902
write(psb_err_unit,*) 'READ_MATRIX: Unexpected end of file ' write(psb_err_unit,*) 'READ_MATRIX: Unexpected end of file '
return return
905 info=905
write(psb_err_unit,*) 'READ_MATRIX: Error at line',i
return
993 info=993 993 info=993
write(psb_err_unit,*) 'READ_MATRIX: Memory allocation failure' write(psb_err_unit,*) 'READ_MATRIX: Memory allocation failure'
return return

@ -270,7 +270,7 @@ subroutine zmm_mat_read(a, info, iunit, filename)
if ((psb_tolower(type) == 'complex').and.(psb_tolower(sym) == 'general')) then if ((psb_tolower(type) == 'complex').and.(psb_tolower(sym) == 'general')) then
call acoo%allocate(nrow,ncol,nnzero) call acoo%allocate(nrow,ncol,nnzero)
do i=1,nnzero do i=1,nnzero
read(infile,fmt=*,end=902) acoo%ia(i),acoo%ja(i),are,aim read(infile,fmt=*,end=902,err=905) acoo%ia(i),acoo%ja(i),are,aim
acoo%val(i) = cmplx(are,aim,kind=psb_dpk_) acoo%val(i) = cmplx(are,aim,kind=psb_dpk_)
end do end do
call acoo%set_nzeros(nnzero) call acoo%set_nzeros(nnzero)
@ -284,7 +284,7 @@ subroutine zmm_mat_read(a, info, iunit, filename)
! we de-symmetrize what we are about to read ! we de-symmetrize what we are about to read
call acoo%allocate(nrow,ncol,2*nnzero) call acoo%allocate(nrow,ncol,2*nnzero)
do i=1,nnzero do i=1,nnzero
read(infile,fmt=*,end=902) acoo%ia(i),acoo%ja(i),are,aim read(infile,fmt=*,end=902,err=905) acoo%ia(i),acoo%ja(i),are,aim
acoo%val(i) = cmplx(are,aim,kind=psb_dpk_) acoo%val(i) = cmplx(are,aim,kind=psb_dpk_)
end do end do
nzr = nnzero nzr = nnzero
@ -339,6 +339,9 @@ subroutine zmm_mat_read(a, info, iunit, filename)
902 info=902 902 info=902
write(psb_err_unit,*) 'READ_MATRIX: Unexpected end of file ' write(psb_err_unit,*) 'READ_MATRIX: Unexpected end of file '
return return
905 info=905
write(psb_err_unit,*) 'READ_MATRIX: Error at line',i
return
993 info=993 993 info=993
write(psb_err_unit,*) 'READ_MATRIX: Memory allocation failure' write(psb_err_unit,*) 'READ_MATRIX: Memory allocation failure'
return return

Loading…
Cancel
Save