From c3ddbf76fb815748b1b21a2932aed9e71235dee7 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 12 Mar 2019 15:13:21 +0000 Subject: [PATCH 1/6] Fix bookkeeping in Xsphalo. Fix cd_renum_block init. --- base/tools/psb_cd_renum_block.F90 | 19 +++++++++++++++++-- base/tools/psb_csphalo.F90 | 2 +- base/tools/psb_dsphalo.F90 | 2 +- base/tools/psb_ssphalo.F90 | 2 +- base/tools/psb_zsphalo.F90 | 2 +- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/base/tools/psb_cd_renum_block.F90 b/base/tools/psb_cd_renum_block.F90 index 5fe559be..6f273369 100644 --- a/base/tools/psb_cd_renum_block.F90 +++ b/base/tools/psb_cd_renum_block.F90 @@ -31,7 +31,8 @@ ! ! ! Subroutine: psb_cd_renum_block -! Produces a clone of a descriptor. +! Produces a renumbered version of the input descriptor, with +! global indices in a BLOCK distribution. ! ! Arguments: ! desc_in - type(psb_desc_type). The communication descriptor to be cloned. @@ -120,9 +121,23 @@ subroutine psb_cd_renum_block(desc_in, desc_out, info) reflidx(1:n_col) = [(i,i=1,n_col)] gidx(1:n_row) = reflidx(1:n_row) + vnl(me) call psb_halo(gidx,desc_in,info) - if (info == 0) call blck_map%gen_block_map_init(ictxt,vnl(me),info) + if (debug_level >= psb_debug_ext_) & + & write(debug_unit,*) me,' ',trim(name),': Done halo on gidx ',info + + if (info == 0) call blck_map%gen_block_map_init(ictxt,n_row,info) + if (debug_level >= psb_debug_ext_) & + & write(debug_unit,*) me,' ',trim(name),': Done gen_block_map_init ',info,& + & blck_map%get_lr(),blck_map%get_lc(),vnl(me) + if (info == 0) call blck_map%g2l_ins(gidx,lidx,info,lidx=reflidx) + if (debug_level >= psb_debug_ext_) then + write(debug_unit,*) me,' ',trim(name),': Done g2l_ins ',info,size(gidx),size(lidx),size(reflidx) + write(debug_unit,*) me,' ',trim(name),': Done g2l_ins ',gidx(:),':',lidx(:),' :',reflidx(:) + end if + if (info == 0) call blck_map%asb(info) + if (debug_level >= psb_debug_ext_) & + & write(debug_unit,*) me,' ',trim(name),': Done asb ',info if (info /= psb_success_) then info = psb_err_from_subroutine_ diff --git a/base/tools/psb_csphalo.F90 b/base/tools/psb_csphalo.F90 index 28cfe2e5..b88d82af 100644 --- a/base/tools/psb_csphalo.F90 +++ b/base/tools/psb_csphalo.F90 @@ -280,7 +280,7 @@ Subroutine psb_csphalo(a,desc_a,blk,info,rowcnv,colcnv,& call psb_errpush(info,name,a_err='psb_sp_getrow') goto 9999 end if - tot_elem=tot_elem+n_elem + tot_elem=tot_elem+ngtz Enddo ipx = ipx + 1 counter = counter+n_el_send+3 diff --git a/base/tools/psb_dsphalo.F90 b/base/tools/psb_dsphalo.F90 index b35acd42..e4bc8b52 100644 --- a/base/tools/psb_dsphalo.F90 +++ b/base/tools/psb_dsphalo.F90 @@ -280,7 +280,7 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rowcnv,colcnv,& call psb_errpush(info,name,a_err='psb_sp_getrow') goto 9999 end if - tot_elem=tot_elem+n_elem + tot_elem=tot_elem+ngtz Enddo ipx = ipx + 1 counter = counter+n_el_send+3 diff --git a/base/tools/psb_ssphalo.F90 b/base/tools/psb_ssphalo.F90 index 3714bdcb..2d0cbeb5 100644 --- a/base/tools/psb_ssphalo.F90 +++ b/base/tools/psb_ssphalo.F90 @@ -280,7 +280,7 @@ Subroutine psb_ssphalo(a,desc_a,blk,info,rowcnv,colcnv,& call psb_errpush(info,name,a_err='psb_sp_getrow') goto 9999 end if - tot_elem=tot_elem+n_elem + tot_elem=tot_elem+ngtz Enddo ipx = ipx + 1 counter = counter+n_el_send+3 diff --git a/base/tools/psb_zsphalo.F90 b/base/tools/psb_zsphalo.F90 index b70d25a5..f9e72cd6 100644 --- a/base/tools/psb_zsphalo.F90 +++ b/base/tools/psb_zsphalo.F90 @@ -280,7 +280,7 @@ Subroutine psb_zsphalo(a,desc_a,blk,info,rowcnv,colcnv,& call psb_errpush(info,name,a_err='psb_sp_getrow') goto 9999 end if - tot_elem=tot_elem+n_elem + tot_elem=tot_elem+ngtz Enddo ipx = ipx + 1 counter = counter+n_el_send+3 From 4b3ef0910bd17354b3b07bcc4b47c4d2db85a6d2 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 19 Mar 2019 11:40:41 +0000 Subject: [PATCH 2/6] Fix new nodes for html docs. --- docs/html/node134.html | 180 +++++++++++++++++++++++++++++++++++++++++ docs/html/node135.html | 67 +++++++++++++++ 2 files changed, 247 insertions(+) create mode 100644 docs/html/node134.html create mode 100644 docs/html/node135.html diff --git a/docs/html/node134.html b/docs/html/node134.html new file mode 100644 index 00000000..fa6197a5 --- /dev/null +++ b/docs/html/node134.html @@ -0,0 +1,180 @@ + + + + + +Bibliography + + + + + + + + + + + + + + + + + + + + + +

+Bibliography +

1 +
+ D. Barbieri, V. Cardellini, S. Filippone and D. Rouson +Design Patterns for Scientific Computations on Sparse Matrices, + HPSS 2011, Algorithms and Programming Tools for Next-Generation High-Performance Scientific Software, Bordeaux, Sep. 2011 + +

+

2 +
+G. Bella, S. Filippone, A. De Maio and M. Testa, +A Simulation Model for Forest Fires, +in J. Dongarra, K. Madsen, J. Wasniewski, editors, +Proceedings of PARA 04 Workshop on State of the Art +in Scientific Computing, pp. 546-553, Lecture Notes in Computer Science, +Springer, 2005. +

3 +
A. Buttari, D. di Serafino, P. D'Ambra, S. Filippone,
+2LEV-D2P4: a package of high-performance preconditioners,
+Applicable Algebra in Engineering, Communications and Computing, +Volume 18, Number 3, May, 2007, pp. 223-239 +

4 +
P. D'Ambra, S. Filippone, D. Di Serafino
+On the Development of PSBLAS-based Parallel Two-level Schwarz Preconditioners +
+Applied Numerical Mathematics, Elsevier Science, +Volume 57, Issues 11-12, November-December 2007, Pages 1181-1196. + +

+

5 +
+ Dongarra, J. J., DuCroz, J., Hammarling, S. and Hanson, R., +An Extended Set of Fortran Basic Linear Algebra Subprograms, +ACM Trans. Math. Softw. vol. 14, 1-17, 1988. +

6 +
+ Dongarra, J., DuCroz, J., Hammarling, S. and Duff, I., +A Set of level 3 Basic Linear Algebra Subprograms, +ACM Trans. Math. Softw. vol. 16, 1-17, 1990. +

7 +
+J. J. Dongarra and R. C. Whaley, +A User's Guide to the BLACS v. 1.1, +Lapack Working Note 94, Tech. Rep. UT-CS-95-281, University of +Tennessee, March 1995 (updated May 1997). +

8 +
+I. Duff, M. Marrone, G. Radicati and C. Vittoli, +Level 3 Basic Linear Algebra Subprograms for Sparse Matrices: +a User Level Interface, +ACM Transactions on Mathematical Software, 23(3), pp. 379-401, 1997. +

9 +
+I. Duff, M. Heroux and R. Pozo, +An Overview of the Sparse Basic Linear +Algebra Subprograms: the New Standard from the BLAS Technical Forum, +ACM Transactions on Mathematical Software, 28(2), pp. 239-267, 2002. +

10 +
+S. Filippone and M. Colajanni, +PSBLAS: A Library for Parallel Linear Algebra +Computation on Sparse Matrices, +
+ACM Transactions on Mathematical Software, 26(4), pp. 527-550, 2000. +

11 +
+S. Filippone and A. Buttari, +Object-Oriented Techniques for Sparse Matrix Computations in Fortran 2003, +
+ACM Transactions on Mathematical Software, 38(4), 2012. +

12 +
+S. Filippone, P. D'Ambra, M. Colajanni, +Using a Parallel Library of Sparse Linear Algebra in a Fluid Dynamics +Applications Code on Linux Clusters, +in G. Joubert, A. Murli, F. Peters, M. Vanneschi, editors, +Parallel Computing - Advances & Current Issues, +pp. 441-448, Imperial College Press, 2002. +

13 +
+ Gamma, E., Helm, R., Johnson, R., and Vlissides, + J. 1995. + Design Patterns: Elements of Reusable Object-Oriented Software. + Addison-Wesley. + +

+

14 +
+Karypis, G. and Kumar, V., +METIS: Unstructured Graph Partitioning and Sparse Matrix + Ordering System. +Minneapolis, MN 55455: University of Minnesota, Department of + Computer Science, 1995. +Internet Address: http://www.cs.umn.edu/~karypis. +

15 +
+Lawson, C., Hanson, R., Kincaid, D. and Krogh, F., + Basic Linear Algebra Subprograms for Fortran usage, +ACM Trans. Math. Softw. vol. 5, 38-329, 1979. + +

+

16 +
+Machiels, L. and Deville, M. +Fortran 90: An entry to object-oriented programming for the solution + of partial differential equations. +ACM Trans. Math. Softw. vol. 23, 32-49. +

17 +
+Metcalf, M., Reid, J. and Cohen, M. +Fortran 95/2003 explained. +Oxford University Press, 2004. +

18 +
+Rouson, D.W.I., Xia, J., Xu, X.: Scientific Software Design: The + Object-Oriented Way. Cambridge University Press (2011) + +

+

19 +
+M. Snir, S. Otto, S. Huss-Lederman, D. Walker and J. Dongarra, +MPI: The Complete Reference. Volume 1 - The MPI Core, second edition, +MIT Press, 1998. +
+ +

+


+ + + diff --git a/docs/html/node135.html b/docs/html/node135.html new file mode 100644 index 00000000..3094bb25 --- /dev/null +++ b/docs/html/node135.html @@ -0,0 +1,67 @@ + + + + + +About this document ... + + + + + + + + + + + + + + + + + + + +

+About this document ... +

+

+This document was generated using the +LaTeX2HTML translator Version 2018 (Released Feb 1, 2018) +

+Copyright © 1993, 1994, 1995, 1996, +Nikos Drakos, +Computer Based Learning Unit, University of Leeds. +
+Copyright © 1997, 1998, 1999, +Ross Moore, +Mathematics Department, Macquarie University, Sydney. +

+The command line arguments were:
+ latex2html -local_icons -noaddress -dir ../../html userhtml.tex +

+The translation was initiated on 2019-01-07 +


+ + + From 73695712a637cba71263bbb3041b168527bfb019 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Fri, 22 Mar 2019 09:13:16 +0000 Subject: [PATCH 3/6] Fix stray #elif --- base/tools/psb_csphalo.F90 | 2 +- base/tools/psb_dsphalo.F90 | 2 +- base/tools/psb_ssphalo.F90 | 2 +- base/tools/psb_zsphalo.F90 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base/tools/psb_csphalo.F90 b/base/tools/psb_csphalo.F90 index b88d82af..394c8a52 100644 --- a/base/tools/psb_csphalo.F90 +++ b/base/tools/psb_csphalo.F90 @@ -317,7 +317,7 @@ Subroutine psb_csphalo(a,desc_a,blk,info,rowcnv,colcnv,& #elif defined(SP_A2AV_MAT) call c_coo_my_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & acoo%val,acoo%ia,acoo%ja,rvsz,brvindx,ipdxv,ictxt,icomm,info) -#elif +#else choke on me @! #endif if (info /= psb_success_) then diff --git a/base/tools/psb_dsphalo.F90 b/base/tools/psb_dsphalo.F90 index e4bc8b52..8ef8e3f5 100644 --- a/base/tools/psb_dsphalo.F90 +++ b/base/tools/psb_dsphalo.F90 @@ -317,7 +317,7 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rowcnv,colcnv,& #elif defined(SP_A2AV_MAT) call d_coo_my_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & acoo%val,acoo%ia,acoo%ja,rvsz,brvindx,ipdxv,ictxt,icomm,info) -#elif +#else choke on me @! #endif if (info /= psb_success_) then diff --git a/base/tools/psb_ssphalo.F90 b/base/tools/psb_ssphalo.F90 index 2d0cbeb5..c8945d41 100644 --- a/base/tools/psb_ssphalo.F90 +++ b/base/tools/psb_ssphalo.F90 @@ -317,7 +317,7 @@ Subroutine psb_ssphalo(a,desc_a,blk,info,rowcnv,colcnv,& #elif defined(SP_A2AV_MAT) call s_coo_my_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & acoo%val,acoo%ia,acoo%ja,rvsz,brvindx,ipdxv,ictxt,icomm,info) -#elif +#else choke on me @! #endif if (info /= psb_success_) then diff --git a/base/tools/psb_zsphalo.F90 b/base/tools/psb_zsphalo.F90 index f9e72cd6..4f88ca5e 100644 --- a/base/tools/psb_zsphalo.F90 +++ b/base/tools/psb_zsphalo.F90 @@ -317,7 +317,7 @@ Subroutine psb_zsphalo(a,desc_a,blk,info,rowcnv,colcnv,& #elif defined(SP_A2AV_MAT) call z_coo_my_a2av(valsnd,iasnd,jasnd,sdsz,bsdindx,& & acoo%val,acoo%ia,acoo%ja,rvsz,brvindx,ipdxv,ictxt,icomm,info) -#elif +#else choke on me @! #endif if (info /= psb_success_) then From 3344bbe089b3201a8d7ba5a5ac3bd53d71d7403e Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Fri, 22 Mar 2019 09:15:15 +0000 Subject: [PATCH 4/6] Fix stray #elif --- util/metis_int.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/metis_int.c b/util/metis_int.c index a293e085..f9385306 100644 --- a/util/metis_int.c +++ b/util/metis_int.c @@ -50,7 +50,7 @@ int metis_PartGraphKway_C(int *n, int *ixadj, int *iadj, int *ivwg, &ecut,(idxtype *)graphpart); return(0); -#elif +#else choke on me! #endif } From ba6ac770cb893186102f76617f437ad3f080af21 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Wed, 27 Mar 2019 17:57:54 +0000 Subject: [PATCH 5/6] Implement clean_zeros in CSR and CSC --- base/modules/serial/psb_c_csc_mat_mod.f90 | 14 +++++++++++ base/modules/serial/psb_c_csr_mat_mod.f90 | 14 +++++++++++ base/modules/serial/psb_d_csc_mat_mod.f90 | 14 +++++++++++ base/modules/serial/psb_d_csr_mat_mod.f90 | 14 +++++++++++ base/modules/serial/psb_s_csc_mat_mod.f90 | 14 +++++++++++ base/modules/serial/psb_s_csr_mat_mod.f90 | 14 +++++++++++ base/modules/serial/psb_z_csc_mat_mod.f90 | 14 +++++++++++ base/modules/serial/psb_z_csr_mat_mod.f90 | 14 +++++++++++ base/serial/impl/psb_c_csc_impl.f90 | 29 +++++++++++++++++++++++ base/serial/impl/psb_c_csr_impl.f90 | 28 ++++++++++++++++++++++ base/serial/impl/psb_d_csc_impl.f90 | 29 +++++++++++++++++++++++ base/serial/impl/psb_d_csr_impl.f90 | 28 ++++++++++++++++++++++ base/serial/impl/psb_s_csc_impl.f90 | 29 +++++++++++++++++++++++ base/serial/impl/psb_s_csr_impl.f90 | 28 ++++++++++++++++++++++ base/serial/impl/psb_z_csc_impl.f90 | 29 +++++++++++++++++++++++ base/serial/impl/psb_z_csr_impl.f90 | 28 ++++++++++++++++++++++ 16 files changed, 340 insertions(+) diff --git a/base/modules/serial/psb_c_csc_mat_mod.f90 b/base/modules/serial/psb_c_csc_mat_mod.f90 index 2bb7982c..871cb3b5 100644 --- a/base/modules/serial/psb_c_csc_mat_mod.f90 +++ b/base/modules/serial/psb_c_csc_mat_mod.f90 @@ -87,6 +87,7 @@ module psb_c_csc_mat_mod procedure, pass(a) :: mv_from_coo => psb_c_mv_csc_from_coo procedure, pass(a) :: mv_to_fmt => psb_c_mv_csc_to_fmt procedure, pass(a) :: mv_from_fmt => psb_c_mv_csc_from_fmt + procedure, pass(a) :: clean_zeros => psb_c_csc_clean_zeros procedure, pass(a) :: csput_a => psb_c_csc_csput_a procedure, pass(a) :: get_diag => psb_c_csc_get_diag procedure, pass(a) :: csgetptn => psb_c_csc_csgetptn @@ -256,6 +257,19 @@ module psb_c_csc_mat_mod end subroutine psb_c_mv_csc_from_fmt end interface + ! + !> + !! \memberof psb_c_csc_sparse_mat + !! \see psb_c_base_mat_mod::psb_c_base_clean_zeros + ! + interface + subroutine psb_c_csc_clean_zeros(a, info) + import :: psb_ipk_, psb_c_csc_sparse_mat + class(psb_c_csc_sparse_mat), intent(inout) :: a + integer(psb_ipk_), intent(out) :: info + end subroutine psb_c_csc_clean_zeros + end interface + !> \memberof psb_c_csc_sparse_mat !! \see psb_c_base_mat_mod::psb_c_base_cp_from interface diff --git a/base/modules/serial/psb_c_csr_mat_mod.f90 b/base/modules/serial/psb_c_csr_mat_mod.f90 index af4f3165..7452d5aa 100644 --- a/base/modules/serial/psb_c_csr_mat_mod.f90 +++ b/base/modules/serial/psb_c_csr_mat_mod.f90 @@ -90,6 +90,7 @@ module psb_c_csr_mat_mod procedure, pass(a) :: mv_from_coo => psb_c_mv_csr_from_coo procedure, pass(a) :: mv_to_fmt => psb_c_mv_csr_to_fmt procedure, pass(a) :: mv_from_fmt => psb_c_mv_csr_from_fmt + procedure, pass(a) :: clean_zeros => psb_c_csr_clean_zeros procedure, pass(a) :: csput_a => psb_c_csr_csput_a procedure, pass(a) :: get_diag => psb_c_csr_get_diag procedure, pass(a) :: csgetptn => psb_c_csr_csgetptn @@ -259,6 +260,19 @@ module psb_c_csr_mat_mod end subroutine psb_c_csr_triu end interface + ! + !> + !! \memberof psb_c_csr_sparse_mat + !! \see psb_c_base_mat_mod::psb_c_base_clean_zeros + ! + interface + subroutine psb_c_csr_clean_zeros(a, info) + import :: psb_ipk_, psb_c_csr_sparse_mat + class(psb_c_csr_sparse_mat), intent(inout) :: a + integer(psb_ipk_), intent(out) :: info + end subroutine psb_c_csr_clean_zeros + end interface + !> \memberof psb_c_csr_sparse_mat !! \see psb_c_base_mat_mod::psb_c_base_cp_to_coo diff --git a/base/modules/serial/psb_d_csc_mat_mod.f90 b/base/modules/serial/psb_d_csc_mat_mod.f90 index 7e4d555c..cc917ef9 100644 --- a/base/modules/serial/psb_d_csc_mat_mod.f90 +++ b/base/modules/serial/psb_d_csc_mat_mod.f90 @@ -87,6 +87,7 @@ module psb_d_csc_mat_mod procedure, pass(a) :: mv_from_coo => psb_d_mv_csc_from_coo procedure, pass(a) :: mv_to_fmt => psb_d_mv_csc_to_fmt procedure, pass(a) :: mv_from_fmt => psb_d_mv_csc_from_fmt + procedure, pass(a) :: clean_zeros => psb_d_csc_clean_zeros procedure, pass(a) :: csput_a => psb_d_csc_csput_a procedure, pass(a) :: get_diag => psb_d_csc_get_diag procedure, pass(a) :: csgetptn => psb_d_csc_csgetptn @@ -256,6 +257,19 @@ module psb_d_csc_mat_mod end subroutine psb_d_mv_csc_from_fmt end interface + ! + !> + !! \memberof psb_d_csc_sparse_mat + !! \see psb_d_base_mat_mod::psb_d_base_clean_zeros + ! + interface + subroutine psb_d_csc_clean_zeros(a, info) + import :: psb_ipk_, psb_d_csc_sparse_mat + class(psb_d_csc_sparse_mat), intent(inout) :: a + integer(psb_ipk_), intent(out) :: info + end subroutine psb_d_csc_clean_zeros + end interface + !> \memberof psb_d_csc_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_cp_from interface diff --git a/base/modules/serial/psb_d_csr_mat_mod.f90 b/base/modules/serial/psb_d_csr_mat_mod.f90 index 8ba73b15..ae5ddfd3 100644 --- a/base/modules/serial/psb_d_csr_mat_mod.f90 +++ b/base/modules/serial/psb_d_csr_mat_mod.f90 @@ -90,6 +90,7 @@ module psb_d_csr_mat_mod procedure, pass(a) :: mv_from_coo => psb_d_mv_csr_from_coo procedure, pass(a) :: mv_to_fmt => psb_d_mv_csr_to_fmt procedure, pass(a) :: mv_from_fmt => psb_d_mv_csr_from_fmt + procedure, pass(a) :: clean_zeros => psb_d_csr_clean_zeros procedure, pass(a) :: csput_a => psb_d_csr_csput_a procedure, pass(a) :: get_diag => psb_d_csr_get_diag procedure, pass(a) :: csgetptn => psb_d_csr_csgetptn @@ -259,6 +260,19 @@ module psb_d_csr_mat_mod end subroutine psb_d_csr_triu end interface + ! + !> + !! \memberof psb_d_csr_sparse_mat + !! \see psb_d_base_mat_mod::psb_d_base_clean_zeros + ! + interface + subroutine psb_d_csr_clean_zeros(a, info) + import :: psb_ipk_, psb_d_csr_sparse_mat + class(psb_d_csr_sparse_mat), intent(inout) :: a + integer(psb_ipk_), intent(out) :: info + end subroutine psb_d_csr_clean_zeros + end interface + !> \memberof psb_d_csr_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_cp_to_coo diff --git a/base/modules/serial/psb_s_csc_mat_mod.f90 b/base/modules/serial/psb_s_csc_mat_mod.f90 index 9e936153..7a636f58 100644 --- a/base/modules/serial/psb_s_csc_mat_mod.f90 +++ b/base/modules/serial/psb_s_csc_mat_mod.f90 @@ -87,6 +87,7 @@ module psb_s_csc_mat_mod procedure, pass(a) :: mv_from_coo => psb_s_mv_csc_from_coo procedure, pass(a) :: mv_to_fmt => psb_s_mv_csc_to_fmt procedure, pass(a) :: mv_from_fmt => psb_s_mv_csc_from_fmt + procedure, pass(a) :: clean_zeros => psb_s_csc_clean_zeros procedure, pass(a) :: csput_a => psb_s_csc_csput_a procedure, pass(a) :: get_diag => psb_s_csc_get_diag procedure, pass(a) :: csgetptn => psb_s_csc_csgetptn @@ -256,6 +257,19 @@ module psb_s_csc_mat_mod end subroutine psb_s_mv_csc_from_fmt end interface + ! + !> + !! \memberof psb_s_csc_sparse_mat + !! \see psb_s_base_mat_mod::psb_s_base_clean_zeros + ! + interface + subroutine psb_s_csc_clean_zeros(a, info) + import :: psb_ipk_, psb_s_csc_sparse_mat + class(psb_s_csc_sparse_mat), intent(inout) :: a + integer(psb_ipk_), intent(out) :: info + end subroutine psb_s_csc_clean_zeros + end interface + !> \memberof psb_s_csc_sparse_mat !! \see psb_s_base_mat_mod::psb_s_base_cp_from interface diff --git a/base/modules/serial/psb_s_csr_mat_mod.f90 b/base/modules/serial/psb_s_csr_mat_mod.f90 index 2266ff50..e48fb7c1 100644 --- a/base/modules/serial/psb_s_csr_mat_mod.f90 +++ b/base/modules/serial/psb_s_csr_mat_mod.f90 @@ -90,6 +90,7 @@ module psb_s_csr_mat_mod procedure, pass(a) :: mv_from_coo => psb_s_mv_csr_from_coo procedure, pass(a) :: mv_to_fmt => psb_s_mv_csr_to_fmt procedure, pass(a) :: mv_from_fmt => psb_s_mv_csr_from_fmt + procedure, pass(a) :: clean_zeros => psb_s_csr_clean_zeros procedure, pass(a) :: csput_a => psb_s_csr_csput_a procedure, pass(a) :: get_diag => psb_s_csr_get_diag procedure, pass(a) :: csgetptn => psb_s_csr_csgetptn @@ -259,6 +260,19 @@ module psb_s_csr_mat_mod end subroutine psb_s_csr_triu end interface + ! + !> + !! \memberof psb_s_csr_sparse_mat + !! \see psb_s_base_mat_mod::psb_s_base_clean_zeros + ! + interface + subroutine psb_s_csr_clean_zeros(a, info) + import :: psb_ipk_, psb_s_csr_sparse_mat + class(psb_s_csr_sparse_mat), intent(inout) :: a + integer(psb_ipk_), intent(out) :: info + end subroutine psb_s_csr_clean_zeros + end interface + !> \memberof psb_s_csr_sparse_mat !! \see psb_s_base_mat_mod::psb_s_base_cp_to_coo diff --git a/base/modules/serial/psb_z_csc_mat_mod.f90 b/base/modules/serial/psb_z_csc_mat_mod.f90 index 4c7e050d..bbc3c456 100644 --- a/base/modules/serial/psb_z_csc_mat_mod.f90 +++ b/base/modules/serial/psb_z_csc_mat_mod.f90 @@ -87,6 +87,7 @@ module psb_z_csc_mat_mod procedure, pass(a) :: mv_from_coo => psb_z_mv_csc_from_coo procedure, pass(a) :: mv_to_fmt => psb_z_mv_csc_to_fmt procedure, pass(a) :: mv_from_fmt => psb_z_mv_csc_from_fmt + procedure, pass(a) :: clean_zeros => psb_z_csc_clean_zeros procedure, pass(a) :: csput_a => psb_z_csc_csput_a procedure, pass(a) :: get_diag => psb_z_csc_get_diag procedure, pass(a) :: csgetptn => psb_z_csc_csgetptn @@ -256,6 +257,19 @@ module psb_z_csc_mat_mod end subroutine psb_z_mv_csc_from_fmt end interface + ! + !> + !! \memberof psb_z_csc_sparse_mat + !! \see psb_z_base_mat_mod::psb_z_base_clean_zeros + ! + interface + subroutine psb_z_csc_clean_zeros(a, info) + import :: psb_ipk_, psb_z_csc_sparse_mat + class(psb_z_csc_sparse_mat), intent(inout) :: a + integer(psb_ipk_), intent(out) :: info + end subroutine psb_z_csc_clean_zeros + end interface + !> \memberof psb_z_csc_sparse_mat !! \see psb_z_base_mat_mod::psb_z_base_cp_from interface diff --git a/base/modules/serial/psb_z_csr_mat_mod.f90 b/base/modules/serial/psb_z_csr_mat_mod.f90 index 7dc58c04..8312d960 100644 --- a/base/modules/serial/psb_z_csr_mat_mod.f90 +++ b/base/modules/serial/psb_z_csr_mat_mod.f90 @@ -90,6 +90,7 @@ module psb_z_csr_mat_mod procedure, pass(a) :: mv_from_coo => psb_z_mv_csr_from_coo procedure, pass(a) :: mv_to_fmt => psb_z_mv_csr_to_fmt procedure, pass(a) :: mv_from_fmt => psb_z_mv_csr_from_fmt + procedure, pass(a) :: clean_zeros => psb_z_csr_clean_zeros procedure, pass(a) :: csput_a => psb_z_csr_csput_a procedure, pass(a) :: get_diag => psb_z_csr_get_diag procedure, pass(a) :: csgetptn => psb_z_csr_csgetptn @@ -259,6 +260,19 @@ module psb_z_csr_mat_mod end subroutine psb_z_csr_triu end interface + ! + !> + !! \memberof psb_z_csr_sparse_mat + !! \see psb_z_base_mat_mod::psb_z_base_clean_zeros + ! + interface + subroutine psb_z_csr_clean_zeros(a, info) + import :: psb_ipk_, psb_z_csr_sparse_mat + class(psb_z_csr_sparse_mat), intent(inout) :: a + integer(psb_ipk_), intent(out) :: info + end subroutine psb_z_csr_clean_zeros + end interface + !> \memberof psb_z_csr_sparse_mat !! \see psb_z_base_mat_mod::psb_z_base_cp_to_coo diff --git a/base/serial/impl/psb_c_csc_impl.f90 b/base/serial/impl/psb_c_csc_impl.f90 index 4e76fe2b..b74f36ae 100644 --- a/base/serial/impl/psb_c_csc_impl.f90 +++ b/base/serial/impl/psb_c_csc_impl.f90 @@ -2489,6 +2489,35 @@ subroutine psb_c_cp_csc_from_fmt(a,b,info) end subroutine psb_c_cp_csc_from_fmt +subroutine psb_c_csc_clean_zeros(a, info) + use psb_error_mod + use psb_c_csc_mat_mod, psb_protect_name => psb_c_csc_clean_zeros + implicit none + class(psb_c_csc_sparse_mat), intent(inout) :: a + integer(psb_ipk_) :: info + ! + integer(psb_ipk_) :: i, j, k, nc + integer(psb_ipk_), allocatable :: ilcp(:) + + info = 0 + nc = a%get_ncols() + ilcp = a%icp(:) + a%icp(1) = 1 + j = a%icp(1) + do i=1, nc + do k = ilcp(i), ilcp(i+1) -1 + if (a%val(k) /= czero) then + a%val(j) = a%val(k) + a%ia(j) = a%ia(k) + j = j + 1 + end if + end do + a%icp(i+1) = j + end do + call a%trim() +end subroutine psb_c_csc_clean_zeros + + subroutine psb_c_csc_mold(a,b,info) use psb_c_csc_mat_mod, psb_protect_name => psb_c_csc_mold use psb_error_mod diff --git a/base/serial/impl/psb_c_csr_impl.f90 b/base/serial/impl/psb_c_csr_impl.f90 index bb0d5309..dc126352 100644 --- a/base/serial/impl/psb_c_csr_impl.f90 +++ b/base/serial/impl/psb_c_csr_impl.f90 @@ -3321,6 +3321,34 @@ subroutine psb_c_cp_csr_from_fmt(a,b,info) end select end subroutine psb_c_cp_csr_from_fmt +subroutine psb_c_csr_clean_zeros(a, info) + use psb_error_mod + use psb_c_csr_mat_mod, psb_protect_name => psb_c_csr_clean_zeros + implicit none + class(psb_c_csr_sparse_mat), intent(inout) :: a + integer(psb_ipk_) :: info + ! + integer(psb_ipk_) :: i, j, k, nr + integer(psb_ipk_), allocatable :: ilrp(:) + + info = 0 + nr = a%get_nrows() + ilrp = a%irp(:) + a%irp(1) = 1 + j = a%irp(1) + do i=1, nr + do k = ilrp(i), ilrp(i+1) -1 + if (a%val(k) /= czero) then + a%val(j) = a%val(k) + a%ja(j) = a%ja(k) + j = j + 1 + end if + end do + a%irp(i+1) = j + end do + call a%trim() +end subroutine psb_c_csr_clean_zeros + subroutine psb_ccsrspspmm(a,b,c,info) use psb_c_mat_mod use psb_serial_mod, psb_protect_name => psb_ccsrspspmm diff --git a/base/serial/impl/psb_d_csc_impl.f90 b/base/serial/impl/psb_d_csc_impl.f90 index 4b46bc9a..d988d2d3 100644 --- a/base/serial/impl/psb_d_csc_impl.f90 +++ b/base/serial/impl/psb_d_csc_impl.f90 @@ -2489,6 +2489,35 @@ subroutine psb_d_cp_csc_from_fmt(a,b,info) end subroutine psb_d_cp_csc_from_fmt +subroutine psb_d_csc_clean_zeros(a, info) + use psb_error_mod + use psb_d_csc_mat_mod, psb_protect_name => psb_d_csc_clean_zeros + implicit none + class(psb_d_csc_sparse_mat), intent(inout) :: a + integer(psb_ipk_) :: info + ! + integer(psb_ipk_) :: i, j, k, nc + integer(psb_ipk_), allocatable :: ilcp(:) + + info = 0 + nc = a%get_ncols() + ilcp = a%icp(:) + a%icp(1) = 1 + j = a%icp(1) + do i=1, nc + do k = ilcp(i), ilcp(i+1) -1 + if (a%val(k) /= dzero) then + a%val(j) = a%val(k) + a%ia(j) = a%ia(k) + j = j + 1 + end if + end do + a%icp(i+1) = j + end do + call a%trim() +end subroutine psb_d_csc_clean_zeros + + subroutine psb_d_csc_mold(a,b,info) use psb_d_csc_mat_mod, psb_protect_name => psb_d_csc_mold use psb_error_mod diff --git a/base/serial/impl/psb_d_csr_impl.f90 b/base/serial/impl/psb_d_csr_impl.f90 index 868f0fe6..bc91e06a 100644 --- a/base/serial/impl/psb_d_csr_impl.f90 +++ b/base/serial/impl/psb_d_csr_impl.f90 @@ -3321,6 +3321,34 @@ subroutine psb_d_cp_csr_from_fmt(a,b,info) end select end subroutine psb_d_cp_csr_from_fmt +subroutine psb_d_csr_clean_zeros(a, info) + use psb_error_mod + use psb_d_csr_mat_mod, psb_protect_name => psb_d_csr_clean_zeros + implicit none + class(psb_d_csr_sparse_mat), intent(inout) :: a + integer(psb_ipk_) :: info + ! + integer(psb_ipk_) :: i, j, k, nr + integer(psb_ipk_), allocatable :: ilrp(:) + + info = 0 + nr = a%get_nrows() + ilrp = a%irp(:) + a%irp(1) = 1 + j = a%irp(1) + do i=1, nr + do k = ilrp(i), ilrp(i+1) -1 + if (a%val(k) /= dzero) then + a%val(j) = a%val(k) + a%ja(j) = a%ja(k) + j = j + 1 + end if + end do + a%irp(i+1) = j + end do + call a%trim() +end subroutine psb_d_csr_clean_zeros + subroutine psb_dcsrspspmm(a,b,c,info) use psb_d_mat_mod use psb_serial_mod, psb_protect_name => psb_dcsrspspmm diff --git a/base/serial/impl/psb_s_csc_impl.f90 b/base/serial/impl/psb_s_csc_impl.f90 index bf3fa900..2b976798 100644 --- a/base/serial/impl/psb_s_csc_impl.f90 +++ b/base/serial/impl/psb_s_csc_impl.f90 @@ -2489,6 +2489,35 @@ subroutine psb_s_cp_csc_from_fmt(a,b,info) end subroutine psb_s_cp_csc_from_fmt +subroutine psb_s_csc_clean_zeros(a, info) + use psb_error_mod + use psb_s_csc_mat_mod, psb_protect_name => psb_s_csc_clean_zeros + implicit none + class(psb_s_csc_sparse_mat), intent(inout) :: a + integer(psb_ipk_) :: info + ! + integer(psb_ipk_) :: i, j, k, nc + integer(psb_ipk_), allocatable :: ilcp(:) + + info = 0 + nc = a%get_ncols() + ilcp = a%icp(:) + a%icp(1) = 1 + j = a%icp(1) + do i=1, nc + do k = ilcp(i), ilcp(i+1) -1 + if (a%val(k) /= szero) then + a%val(j) = a%val(k) + a%ia(j) = a%ia(k) + j = j + 1 + end if + end do + a%icp(i+1) = j + end do + call a%trim() +end subroutine psb_s_csc_clean_zeros + + subroutine psb_s_csc_mold(a,b,info) use psb_s_csc_mat_mod, psb_protect_name => psb_s_csc_mold use psb_error_mod diff --git a/base/serial/impl/psb_s_csr_impl.f90 b/base/serial/impl/psb_s_csr_impl.f90 index 9a537360..b257bd64 100644 --- a/base/serial/impl/psb_s_csr_impl.f90 +++ b/base/serial/impl/psb_s_csr_impl.f90 @@ -3321,6 +3321,34 @@ subroutine psb_s_cp_csr_from_fmt(a,b,info) end select end subroutine psb_s_cp_csr_from_fmt +subroutine psb_s_csr_clean_zeros(a, info) + use psb_error_mod + use psb_s_csr_mat_mod, psb_protect_name => psb_s_csr_clean_zeros + implicit none + class(psb_s_csr_sparse_mat), intent(inout) :: a + integer(psb_ipk_) :: info + ! + integer(psb_ipk_) :: i, j, k, nr + integer(psb_ipk_), allocatable :: ilrp(:) + + info = 0 + nr = a%get_nrows() + ilrp = a%irp(:) + a%irp(1) = 1 + j = a%irp(1) + do i=1, nr + do k = ilrp(i), ilrp(i+1) -1 + if (a%val(k) /= szero) then + a%val(j) = a%val(k) + a%ja(j) = a%ja(k) + j = j + 1 + end if + end do + a%irp(i+1) = j + end do + call a%trim() +end subroutine psb_s_csr_clean_zeros + subroutine psb_scsrspspmm(a,b,c,info) use psb_s_mat_mod use psb_serial_mod, psb_protect_name => psb_scsrspspmm diff --git a/base/serial/impl/psb_z_csc_impl.f90 b/base/serial/impl/psb_z_csc_impl.f90 index 1abf68d3..b9c5898b 100644 --- a/base/serial/impl/psb_z_csc_impl.f90 +++ b/base/serial/impl/psb_z_csc_impl.f90 @@ -2489,6 +2489,35 @@ subroutine psb_z_cp_csc_from_fmt(a,b,info) end subroutine psb_z_cp_csc_from_fmt +subroutine psb_z_csc_clean_zeros(a, info) + use psb_error_mod + use psb_z_csc_mat_mod, psb_protect_name => psb_z_csc_clean_zeros + implicit none + class(psb_z_csc_sparse_mat), intent(inout) :: a + integer(psb_ipk_) :: info + ! + integer(psb_ipk_) :: i, j, k, nc + integer(psb_ipk_), allocatable :: ilcp(:) + + info = 0 + nc = a%get_ncols() + ilcp = a%icp(:) + a%icp(1) = 1 + j = a%icp(1) + do i=1, nc + do k = ilcp(i), ilcp(i+1) -1 + if (a%val(k) /= zzero) then + a%val(j) = a%val(k) + a%ia(j) = a%ia(k) + j = j + 1 + end if + end do + a%icp(i+1) = j + end do + call a%trim() +end subroutine psb_z_csc_clean_zeros + + subroutine psb_z_csc_mold(a,b,info) use psb_z_csc_mat_mod, psb_protect_name => psb_z_csc_mold use psb_error_mod diff --git a/base/serial/impl/psb_z_csr_impl.f90 b/base/serial/impl/psb_z_csr_impl.f90 index 502b7c5b..24cc1509 100644 --- a/base/serial/impl/psb_z_csr_impl.f90 +++ b/base/serial/impl/psb_z_csr_impl.f90 @@ -3321,6 +3321,34 @@ subroutine psb_z_cp_csr_from_fmt(a,b,info) end select end subroutine psb_z_cp_csr_from_fmt +subroutine psb_z_csr_clean_zeros(a, info) + use psb_error_mod + use psb_z_csr_mat_mod, psb_protect_name => psb_z_csr_clean_zeros + implicit none + class(psb_z_csr_sparse_mat), intent(inout) :: a + integer(psb_ipk_) :: info + ! + integer(psb_ipk_) :: i, j, k, nr + integer(psb_ipk_), allocatable :: ilrp(:) + + info = 0 + nr = a%get_nrows() + ilrp = a%irp(:) + a%irp(1) = 1 + j = a%irp(1) + do i=1, nr + do k = ilrp(i), ilrp(i+1) -1 + if (a%val(k) /= zzero) then + a%val(j) = a%val(k) + a%ja(j) = a%ja(k) + j = j + 1 + end if + end do + a%irp(i+1) = j + end do + call a%trim() +end subroutine psb_z_csr_clean_zeros + subroutine psb_zcsrspspmm(a,b,c,info) use psb_z_mat_mod use psb_serial_mod, psb_protect_name => psb_zcsrspspmm From 9e0d336d9d174d35bfb4c289e942c909d047e247 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sun, 31 Mar 2019 11:58:16 +0100 Subject: [PATCH 6/6] Mark matrix on host after clean_zeros --- base/serial/impl/psb_c_csc_impl.f90 | 4 +++- base/serial/impl/psb_c_csr_impl.f90 | 6 ++++-- base/serial/impl/psb_d_csc_impl.f90 | 4 +++- base/serial/impl/psb_d_csr_impl.f90 | 4 +++- base/serial/impl/psb_s_csc_impl.f90 | 4 +++- base/serial/impl/psb_s_csr_impl.f90 | 6 ++++-- base/serial/impl/psb_z_csc_impl.f90 | 4 +++- base/serial/impl/psb_z_csr_impl.f90 | 4 +++- 8 files changed, 26 insertions(+), 10 deletions(-) diff --git a/base/serial/impl/psb_c_csc_impl.f90 b/base/serial/impl/psb_c_csc_impl.f90 index b74f36ae..23e8f4a8 100644 --- a/base/serial/impl/psb_c_csc_impl.f90 +++ b/base/serial/impl/psb_c_csc_impl.f90 @@ -2499,7 +2499,8 @@ subroutine psb_c_csc_clean_zeros(a, info) integer(psb_ipk_) :: i, j, k, nc integer(psb_ipk_), allocatable :: ilcp(:) - info = 0 + info = 0 + call a%sync() nc = a%get_ncols() ilcp = a%icp(:) a%icp(1) = 1 @@ -2515,6 +2516,7 @@ subroutine psb_c_csc_clean_zeros(a, info) a%icp(i+1) = j end do call a%trim() + call a%set_host() end subroutine psb_c_csc_clean_zeros diff --git a/base/serial/impl/psb_c_csr_impl.f90 b/base/serial/impl/psb_c_csr_impl.f90 index dc126352..a4296c3e 100644 --- a/base/serial/impl/psb_c_csr_impl.f90 +++ b/base/serial/impl/psb_c_csr_impl.f90 @@ -1304,7 +1304,7 @@ function psb_c_csr_csnmi(a) result(res) if (a%is_dev()) call a%sync() do i = 1, a%get_nrows() - acc = dzero + acc = szero do j=a%irp(i),a%irp(i+1)-1 acc = acc + abs(a%val(j)) end do @@ -3331,7 +3331,8 @@ subroutine psb_c_csr_clean_zeros(a, info) integer(psb_ipk_) :: i, j, k, nr integer(psb_ipk_), allocatable :: ilrp(:) - info = 0 + info = 0 + call a%sync() nr = a%get_nrows() ilrp = a%irp(:) a%irp(1) = 1 @@ -3347,6 +3348,7 @@ subroutine psb_c_csr_clean_zeros(a, info) a%irp(i+1) = j end do call a%trim() + call a%set_host() end subroutine psb_c_csr_clean_zeros subroutine psb_ccsrspspmm(a,b,c,info) diff --git a/base/serial/impl/psb_d_csc_impl.f90 b/base/serial/impl/psb_d_csc_impl.f90 index d988d2d3..ef68164d 100644 --- a/base/serial/impl/psb_d_csc_impl.f90 +++ b/base/serial/impl/psb_d_csc_impl.f90 @@ -2499,7 +2499,8 @@ subroutine psb_d_csc_clean_zeros(a, info) integer(psb_ipk_) :: i, j, k, nc integer(psb_ipk_), allocatable :: ilcp(:) - info = 0 + info = 0 + call a%sync() nc = a%get_ncols() ilcp = a%icp(:) a%icp(1) = 1 @@ -2515,6 +2516,7 @@ subroutine psb_d_csc_clean_zeros(a, info) a%icp(i+1) = j end do call a%trim() + call a%set_host() end subroutine psb_d_csc_clean_zeros diff --git a/base/serial/impl/psb_d_csr_impl.f90 b/base/serial/impl/psb_d_csr_impl.f90 index bc91e06a..c0f7cfcb 100644 --- a/base/serial/impl/psb_d_csr_impl.f90 +++ b/base/serial/impl/psb_d_csr_impl.f90 @@ -3331,7 +3331,8 @@ subroutine psb_d_csr_clean_zeros(a, info) integer(psb_ipk_) :: i, j, k, nr integer(psb_ipk_), allocatable :: ilrp(:) - info = 0 + info = 0 + call a%sync() nr = a%get_nrows() ilrp = a%irp(:) a%irp(1) = 1 @@ -3347,6 +3348,7 @@ subroutine psb_d_csr_clean_zeros(a, info) a%irp(i+1) = j end do call a%trim() + call a%set_host() end subroutine psb_d_csr_clean_zeros subroutine psb_dcsrspspmm(a,b,c,info) diff --git a/base/serial/impl/psb_s_csc_impl.f90 b/base/serial/impl/psb_s_csc_impl.f90 index 2b976798..6318db9d 100644 --- a/base/serial/impl/psb_s_csc_impl.f90 +++ b/base/serial/impl/psb_s_csc_impl.f90 @@ -2499,7 +2499,8 @@ subroutine psb_s_csc_clean_zeros(a, info) integer(psb_ipk_) :: i, j, k, nc integer(psb_ipk_), allocatable :: ilcp(:) - info = 0 + info = 0 + call a%sync() nc = a%get_ncols() ilcp = a%icp(:) a%icp(1) = 1 @@ -2515,6 +2516,7 @@ subroutine psb_s_csc_clean_zeros(a, info) a%icp(i+1) = j end do call a%trim() + call a%set_host() end subroutine psb_s_csc_clean_zeros diff --git a/base/serial/impl/psb_s_csr_impl.f90 b/base/serial/impl/psb_s_csr_impl.f90 index b257bd64..ceb21bf3 100644 --- a/base/serial/impl/psb_s_csr_impl.f90 +++ b/base/serial/impl/psb_s_csr_impl.f90 @@ -1304,7 +1304,7 @@ function psb_s_csr_csnmi(a) result(res) if (a%is_dev()) call a%sync() do i = 1, a%get_nrows() - acc = dzero + acc = szero do j=a%irp(i),a%irp(i+1)-1 acc = acc + abs(a%val(j)) end do @@ -3331,7 +3331,8 @@ subroutine psb_s_csr_clean_zeros(a, info) integer(psb_ipk_) :: i, j, k, nr integer(psb_ipk_), allocatable :: ilrp(:) - info = 0 + info = 0 + call a%sync() nr = a%get_nrows() ilrp = a%irp(:) a%irp(1) = 1 @@ -3347,6 +3348,7 @@ subroutine psb_s_csr_clean_zeros(a, info) a%irp(i+1) = j end do call a%trim() + call a%set_host() end subroutine psb_s_csr_clean_zeros subroutine psb_scsrspspmm(a,b,c,info) diff --git a/base/serial/impl/psb_z_csc_impl.f90 b/base/serial/impl/psb_z_csc_impl.f90 index b9c5898b..bd14f8a3 100644 --- a/base/serial/impl/psb_z_csc_impl.f90 +++ b/base/serial/impl/psb_z_csc_impl.f90 @@ -2499,7 +2499,8 @@ subroutine psb_z_csc_clean_zeros(a, info) integer(psb_ipk_) :: i, j, k, nc integer(psb_ipk_), allocatable :: ilcp(:) - info = 0 + info = 0 + call a%sync() nc = a%get_ncols() ilcp = a%icp(:) a%icp(1) = 1 @@ -2515,6 +2516,7 @@ subroutine psb_z_csc_clean_zeros(a, info) a%icp(i+1) = j end do call a%trim() + call a%set_host() end subroutine psb_z_csc_clean_zeros diff --git a/base/serial/impl/psb_z_csr_impl.f90 b/base/serial/impl/psb_z_csr_impl.f90 index 24cc1509..f86b0872 100644 --- a/base/serial/impl/psb_z_csr_impl.f90 +++ b/base/serial/impl/psb_z_csr_impl.f90 @@ -3331,7 +3331,8 @@ subroutine psb_z_csr_clean_zeros(a, info) integer(psb_ipk_) :: i, j, k, nr integer(psb_ipk_), allocatable :: ilrp(:) - info = 0 + info = 0 + call a%sync() nr = a%get_nrows() ilrp = a%irp(:) a%irp(1) = 1 @@ -3347,6 +3348,7 @@ subroutine psb_z_csr_clean_zeros(a, info) a%irp(i+1) = j end do call a%trim() + call a%set_host() end subroutine psb_z_csr_clean_zeros subroutine psb_zcsrspspmm(a,b,c,info)