From 160b987ed1f455adeeab05a59aa3bb6fd5a987de Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 25 Jun 2019 15:09:19 +0100 Subject: [PATCH] Reduce memory footprint in csrspspmm. --- base/serial/impl/psb_c_csr_impl.f90 | 2 +- base/serial/impl/psb_d_csr_impl.f90 | 2 +- base/serial/impl/psb_s_csr_impl.f90 | 2 +- base/serial/impl/psb_z_csr_impl.f90 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base/serial/impl/psb_c_csr_impl.f90 b/base/serial/impl/psb_c_csr_impl.f90 index 138d2963..1490718d 100644 --- a/base/serial/impl/psb_c_csr_impl.f90 +++ b/base/serial/impl/psb_c_csr_impl.f90 @@ -3384,7 +3384,7 @@ subroutine psb_ccsrspspmm(a,b,c,info) ! Estimate number of nonzeros on output. nza = a%get_nzeros() nzb = b%get_nzeros() - nzc = 2*(nza+nzb) + nzc = int(1.25*(nza+nzb)) call c%allocate(ma,nb,nzc) call csr_spspmm(a,b,c,info) diff --git a/base/serial/impl/psb_d_csr_impl.f90 b/base/serial/impl/psb_d_csr_impl.f90 index 6631cc42..523c1501 100644 --- a/base/serial/impl/psb_d_csr_impl.f90 +++ b/base/serial/impl/psb_d_csr_impl.f90 @@ -3384,7 +3384,7 @@ subroutine psb_dcsrspspmm(a,b,c,info) ! Estimate number of nonzeros on output. nza = a%get_nzeros() nzb = b%get_nzeros() - nzc = 2*(nza+nzb) + nzc = int(1.25*(nza+nzb)) call c%allocate(ma,nb,nzc) call csr_spspmm(a,b,c,info) diff --git a/base/serial/impl/psb_s_csr_impl.f90 b/base/serial/impl/psb_s_csr_impl.f90 index c4fb5e1a..75a6c0cc 100644 --- a/base/serial/impl/psb_s_csr_impl.f90 +++ b/base/serial/impl/psb_s_csr_impl.f90 @@ -3384,7 +3384,7 @@ subroutine psb_scsrspspmm(a,b,c,info) ! Estimate number of nonzeros on output. nza = a%get_nzeros() nzb = b%get_nzeros() - nzc = 2*(nza+nzb) + nzc = int(1.25*(nza+nzb)) call c%allocate(ma,nb,nzc) call csr_spspmm(a,b,c,info) diff --git a/base/serial/impl/psb_z_csr_impl.f90 b/base/serial/impl/psb_z_csr_impl.f90 index 3a2768d6..6a691d4f 100644 --- a/base/serial/impl/psb_z_csr_impl.f90 +++ b/base/serial/impl/psb_z_csr_impl.f90 @@ -3384,7 +3384,7 @@ subroutine psb_zcsrspspmm(a,b,c,info) ! Estimate number of nonzeros on output. nza = a%get_nzeros() nzb = b%get_nzeros() - nzc = 2*(nza+nzb) + nzc = int(1.25*(nza+nzb)) call c%allocate(ma,nb,nzc) call csr_spspmm(a,b,c,info)