Fix trim never to reallocate to sizes <=0

master
Salvatore Filippone 2 years ago
parent c2c80ae6e7
commit 7028cb656a

@ -572,7 +572,7 @@ subroutine psb_c_coo_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
if (a%is_dev()) call a%sync() if (a%is_dev()) call a%sync()
nz = a%get_nzeros() nz = max(1_psb_ipk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)
@ -6012,7 +6012,7 @@ subroutine psb_lc_coo_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
if (a%is_dev()) call a%sync() if (a%is_dev()) call a%sync()
nz = a%get_nzeros() nz = max(1_psb_lpk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)

@ -2621,8 +2621,8 @@ subroutine psb_c_csc_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
n = a%get_ncols() n = max(1_psb_ipk_,a%get_ncols())
nz = a%get_nzeros() nz = max(1_psb_ipk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(n+1,a%icp,info) if (info == psb_success_) call psb_realloc(n+1,a%icp,info)
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)
@ -4461,8 +4461,8 @@ subroutine psb_lc_csc_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
n = a%get_ncols() n = max(1_psb_lpk_,a%get_ncols())
nz = a%get_nzeros() nz = max(1_psb_lpk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(n+1,a%icp,info) if (info == psb_success_) call psb_realloc(n+1,a%icp,info)
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)

@ -2754,8 +2754,8 @@ subroutine psb_c_csr_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
m = a%get_nrows() m = max(1_psb_ipk_,a%get_nrows())
nz = a%get_nzeros() nz = max(1_psb_ipk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(m+1,a%irp,info) if (info == psb_success_) call psb_realloc(m+1,a%irp,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)
@ -5029,8 +5029,8 @@ subroutine psb_lc_csr_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
m = a%get_nrows() m = max(1_psb_lpk_,a%get_nrows())
nz = a%get_nzeros() nz = max(1_psb_lpk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(m+1,a%irp,info) if (info == psb_success_) call psb_realloc(m+1,a%irp,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)

@ -572,7 +572,7 @@ subroutine psb_d_coo_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
if (a%is_dev()) call a%sync() if (a%is_dev()) call a%sync()
nz = a%get_nzeros() nz = max(1_psb_ipk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)
@ -6012,7 +6012,7 @@ subroutine psb_ld_coo_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
if (a%is_dev()) call a%sync() if (a%is_dev()) call a%sync()
nz = a%get_nzeros() nz = max(1_psb_lpk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)

@ -2621,8 +2621,8 @@ subroutine psb_d_csc_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
n = a%get_ncols() n = max(1_psb_ipk_,a%get_ncols())
nz = a%get_nzeros() nz = max(1_psb_ipk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(n+1,a%icp,info) if (info == psb_success_) call psb_realloc(n+1,a%icp,info)
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)
@ -4461,8 +4461,8 @@ subroutine psb_ld_csc_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
n = a%get_ncols() n = max(1_psb_lpk_,a%get_ncols())
nz = a%get_nzeros() nz = max(1_psb_lpk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(n+1,a%icp,info) if (info == psb_success_) call psb_realloc(n+1,a%icp,info)
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)

@ -2754,8 +2754,8 @@ subroutine psb_d_csr_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
m = a%get_nrows() m = max(1_psb_ipk_,a%get_nrows())
nz = a%get_nzeros() nz = max(1_psb_ipk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(m+1,a%irp,info) if (info == psb_success_) call psb_realloc(m+1,a%irp,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)
@ -5029,8 +5029,8 @@ subroutine psb_ld_csr_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
m = a%get_nrows() m = max(1_psb_lpk_,a%get_nrows())
nz = a%get_nzeros() nz = max(1_psb_lpk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(m+1,a%irp,info) if (info == psb_success_) call psb_realloc(m+1,a%irp,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)

@ -572,7 +572,7 @@ subroutine psb_s_coo_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
if (a%is_dev()) call a%sync() if (a%is_dev()) call a%sync()
nz = a%get_nzeros() nz = max(1_psb_ipk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)
@ -6012,7 +6012,7 @@ subroutine psb_ls_coo_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
if (a%is_dev()) call a%sync() if (a%is_dev()) call a%sync()
nz = a%get_nzeros() nz = max(1_psb_lpk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)

@ -2621,8 +2621,8 @@ subroutine psb_s_csc_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
n = a%get_ncols() n = max(1_psb_ipk_,a%get_ncols())
nz = a%get_nzeros() nz = max(1_psb_ipk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(n+1,a%icp,info) if (info == psb_success_) call psb_realloc(n+1,a%icp,info)
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)
@ -4461,8 +4461,8 @@ subroutine psb_ls_csc_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
n = a%get_ncols() n = max(1_psb_lpk_,a%get_ncols())
nz = a%get_nzeros() nz = max(1_psb_lpk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(n+1,a%icp,info) if (info == psb_success_) call psb_realloc(n+1,a%icp,info)
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)

@ -2754,8 +2754,8 @@ subroutine psb_s_csr_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
m = a%get_nrows() m = max(1_psb_ipk_,a%get_nrows())
nz = a%get_nzeros() nz = max(1_psb_ipk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(m+1,a%irp,info) if (info == psb_success_) call psb_realloc(m+1,a%irp,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)
@ -5029,8 +5029,8 @@ subroutine psb_ls_csr_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
m = a%get_nrows() m = max(1_psb_lpk_,a%get_nrows())
nz = a%get_nzeros() nz = max(1_psb_lpk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(m+1,a%irp,info) if (info == psb_success_) call psb_realloc(m+1,a%irp,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)

@ -572,7 +572,7 @@ subroutine psb_z_coo_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
if (a%is_dev()) call a%sync() if (a%is_dev()) call a%sync()
nz = a%get_nzeros() nz = max(1_psb_ipk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)
@ -6012,7 +6012,7 @@ subroutine psb_lz_coo_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
if (a%is_dev()) call a%sync() if (a%is_dev()) call a%sync()
nz = a%get_nzeros() nz = max(1_psb_lpk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)

@ -2621,8 +2621,8 @@ subroutine psb_z_csc_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
n = a%get_ncols() n = max(1_psb_ipk_,a%get_ncols())
nz = a%get_nzeros() nz = max(1_psb_ipk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(n+1,a%icp,info) if (info == psb_success_) call psb_realloc(n+1,a%icp,info)
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)
@ -4461,8 +4461,8 @@ subroutine psb_lz_csc_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
n = a%get_ncols() n = max(1_psb_lpk_,a%get_ncols())
nz = a%get_nzeros() nz = max(1_psb_lpk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(n+1,a%icp,info) if (info == psb_success_) call psb_realloc(n+1,a%icp,info)
if (info == psb_success_) call psb_realloc(nz,a%ia,info) if (info == psb_success_) call psb_realloc(nz,a%ia,info)
if (info == psb_success_) call psb_realloc(nz,a%val,info) if (info == psb_success_) call psb_realloc(nz,a%val,info)

@ -2754,8 +2754,8 @@ subroutine psb_z_csr_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
m = a%get_nrows() m = max(1_psb_ipk_,a%get_nrows())
nz = a%get_nzeros() nz = max(1_psb_ipk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(m+1,a%irp,info) if (info == psb_success_) call psb_realloc(m+1,a%irp,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)
@ -5029,8 +5029,8 @@ subroutine psb_lz_csr_trim(a)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
m = a%get_nrows() m = max(1_psb_lpk_,a%get_nrows())
nz = a%get_nzeros() nz = max(1_psb_lpk_,a%get_nzeros())
if (info == psb_success_) call psb_realloc(m+1,a%irp,info) if (info == psb_success_) call psb_realloc(m+1,a%irp,info)
if (info == psb_success_) call psb_realloc(nz,a%ja,info) if (info == psb_success_) call psb_realloc(nz,a%ja,info)

Loading…
Cancel
Save