From 8059d3b131fe0ddd65302cd66068a1ccadaec26b Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sat, 26 Nov 2011 21:57:01 +0000 Subject: [PATCH] mld2p4-2: Makefile mlprec/mld_c_prec_type.f90 mlprec/mld_cmlprec_bld.f90 mlprec/mld_d_prec_type.f90 mlprec/mld_daggrmat_minnrg_asb.F90 mlprec/mld_dmlprec_bld.f90 mlprec/mld_s_prec_type.f90 mlprec/mld_smlprec_bld.f90 mlprec/mld_z_prec_type.f90 mlprec/mld_zmlprec_bld.f90 Fixes for free of linmap. Preprocessed sources from testpre. --- Makefile | 2 +- mlprec/mld_c_prec_type.f90 | 12 ++++-------- mlprec/mld_cmlprec_bld.f90 | 11 +++++++++++ mlprec/mld_d_prec_type.f90 | 12 ++++-------- mlprec/mld_daggrmat_minnrg_asb.F90 | 14 +++++++------- mlprec/mld_dmlprec_bld.f90 | 11 +++++++++++ mlprec/mld_s_prec_type.f90 | 12 ++++-------- mlprec/mld_smlprec_bld.f90 | 11 +++++++++++ mlprec/mld_z_prec_type.f90 | 12 ++++-------- mlprec/mld_zmlprec_bld.f90 | 11 +++++++++++ 10 files changed, 68 insertions(+), 40 deletions(-) diff --git a/Makefile b/Makefile index 80e4e87b..a17481c2 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ libdir: mlp: cd mlprec && $(MAKE) lib -install: +install: all (./mkdir.sh $(INSTALL_DIR) &&\ $(INSTALL_DATA) Make.inc $(INSTALL_DIR)/Make.inc.MLD2P4) (./mkdir.sh $(INSTALL_LIBDIR) &&\ diff --git a/mlprec/mld_c_prec_type.f90 b/mlprec/mld_c_prec_type.f90 index 89f08c0b..bd7b4a07 100644 --- a/mlprec/mld_c_prec_type.f90 +++ b/mlprec/mld_c_prec_type.f90 @@ -664,26 +664,22 @@ contains info = psb_success_ - ! Actually we might just deallocate the top level array, except - ! for the inner UMFPACK or SLU stuff. + ! We might just deallocate the top level array, except + ! that there are inner objects containing C pointers, + ! e.g. UMFPACK, SLU or CUDA stuff. ! We really need FINALs. call lv%sm%free(info) call lv%ac%free() if (psb_is_ok_desc(lv%desc_ac)) & & call psb_cdfree(lv%desc_ac,info) + call lv%map%free(info) ! This is a pointer to something else, must not free it here. nullify(lv%base_a) ! This is a pointer to something else, must not free it here. nullify(lv%base_desc) - ! - ! free explicitly map??? - ! For now thanks to allocatable semantics - ! works anyway. - ! - call lv%nullify() end subroutine c_base_onelev_free diff --git a/mlprec/mld_cmlprec_bld.f90 b/mlprec/mld_cmlprec_bld.f90 index 15f65673..6164ee9b 100644 --- a/mlprec/mld_cmlprec_bld.f90 +++ b/mlprec/mld_cmlprec_bld.f90 @@ -62,6 +62,17 @@ ! of the preconditioner to be built. ! info - integer, output. ! Error code. +! +! amold - class(psb_c_base_sparse_mat), input, optional +! Mold for the inner format of matrices contained in the +! preconditioner +! +! +! vmold - class(psb_c_base_vect_type), input, optional +! Mold for the inner format of vectors contained in the +! preconditioner +! +! ! subroutine mld_cmlprec_bld(a,desc_a,p,info,amold,vmold) diff --git a/mlprec/mld_d_prec_type.f90 b/mlprec/mld_d_prec_type.f90 index f2b3ba86..0556aa5a 100644 --- a/mlprec/mld_d_prec_type.f90 +++ b/mlprec/mld_d_prec_type.f90 @@ -664,26 +664,22 @@ contains info = psb_success_ - ! Actually we might just deallocate the top level array, except - ! for the inner UMFPACK or SLU stuff. + ! We might just deallocate the top level array, except + ! that there are inner objects containing C pointers, + ! e.g. UMFPACK, SLU or CUDA stuff. ! We really need FINALs. call lv%sm%free(info) call lv%ac%free() if (psb_is_ok_desc(lv%desc_ac)) & & call psb_cdfree(lv%desc_ac,info) + call lv%map%free(info) ! This is a pointer to something else, must not free it here. nullify(lv%base_a) ! This is a pointer to something else, must not free it here. nullify(lv%base_desc) - ! - ! free explicitly map??? - ! For now thanks to allocatable semantics - ! works anyway. - ! - call lv%nullify() end subroutine d_base_onelev_free diff --git a/mlprec/mld_daggrmat_minnrg_asb.F90 b/mlprec/mld_daggrmat_minnrg_asb.F90 index 0421996f..4951948a 100644 --- a/mlprec/mld_daggrmat_minnrg_asb.F90 +++ b/mlprec/mld_daggrmat_minnrg_asb.F90 @@ -124,11 +124,11 @@ subroutine mld_daggrmat_minnrg_asb(a,desc_a,ilaggr,nlaggr,p,info) & naggr, nzl,naggrm1,naggrp1, i, j, k, jd, icolF, nrt integer :: ictxt,np,me, err_act, icomm character(len=20) :: name - type(psb_dspmat_type) :: am1,am2, af, ptilde, rtilde, atran, atp, atdatp - type(psb_dspmat_type) :: am3,am4, ap, adap,atmp,rada, ra, atmp2, dap, dadap, da + type(psb_dspmat_type) :: am1, am2, af, ptilde, rtilde, atran, atp, atdatp + type(psb_dspmat_type) :: am3, am4, ap, adap, atmp, rada, ra, atmp2, dap, dadap, da type(psb_dspmat_type) :: dat, datp, datdatp, atmp3 type(psb_d_coo_sparse_mat) :: acoo, acoof, bcoo, tmpcoo - type(psb_d_csr_sparse_mat) :: acsr1, acsr2, acsr3, bcsr, acsr, acsrf + type(psb_d_csr_sparse_mat) :: acsr1, acsr2, acsr3, acsrf type(psb_d_csc_sparse_mat) :: csc_dap, csc_dadap, csc_datp, csc_datdatp, acsc real(psb_dpk_), allocatable :: adiag(:), omf(:),omp(:),omi(:),& & oden(:), adinv(:) @@ -625,14 +625,14 @@ subroutine mld_daggrmat_minnrg_asb(a,desc_a,ilaggr,nlaggr,p,info) call p%ac%cscnv(info,type='csr') if (np>1) then - call am1%mv_to(acsr) - nzl = acsr%get_nzeros() - call psb_glob_to_loc(acsr%ja(1:nzl),p%desc_ac,info,'I') + call am1%mv_to(acsr1) + nzl = acsr1%get_nzeros() + call psb_glob_to_loc(acsr1%ja(1:nzl),p%desc_ac,info,'I') if (info /= psb_success_) then call psb_errpush(psb_err_from_subroutine_,name,a_err='psb_glob_to_loc') goto 9999 end if - call am1%mv_from(acsr) + call am1%mv_from(acsr1) endif call am1%set_ncols(p%desc_ac%get_local_cols()) diff --git a/mlprec/mld_dmlprec_bld.f90 b/mlprec/mld_dmlprec_bld.f90 index fce9ee2b..c3169a89 100644 --- a/mlprec/mld_dmlprec_bld.f90 +++ b/mlprec/mld_dmlprec_bld.f90 @@ -62,6 +62,17 @@ ! of the preconditioner to be built. ! info - integer, output. ! Error code. +! +! amold - class(psb_d_base_sparse_mat), input, optional +! Mold for the inner format of matrices contained in the +! preconditioner +! +! +! vmold - class(psb_d_base_vect_type), input, optional +! Mold for the inner format of vectors contained in the +! preconditioner +! +! ! subroutine mld_dmlprec_bld(a,desc_a,p,info,amold,vmold) diff --git a/mlprec/mld_s_prec_type.f90 b/mlprec/mld_s_prec_type.f90 index c834254e..5ebf1925 100644 --- a/mlprec/mld_s_prec_type.f90 +++ b/mlprec/mld_s_prec_type.f90 @@ -664,26 +664,22 @@ contains info = psb_success_ - ! Actually we might just deallocate the top level array, except - ! for the inner UMFPACK or SLU stuff. + ! We might just deallocate the top level array, except + ! that there are inner objects containing C pointers, + ! e.g. UMFPACK, SLU or CUDA stuff. ! We really need FINALs. call lv%sm%free(info) call lv%ac%free() if (psb_is_ok_desc(lv%desc_ac)) & & call psb_cdfree(lv%desc_ac,info) + call lv%map%free(info) ! This is a pointer to something else, must not free it here. nullify(lv%base_a) ! This is a pointer to something else, must not free it here. nullify(lv%base_desc) - ! - ! free explicitly map??? - ! For now thanks to allocatable semantics - ! works anyway. - ! - call lv%nullify() end subroutine s_base_onelev_free diff --git a/mlprec/mld_smlprec_bld.f90 b/mlprec/mld_smlprec_bld.f90 index e60c3154..9429ed50 100644 --- a/mlprec/mld_smlprec_bld.f90 +++ b/mlprec/mld_smlprec_bld.f90 @@ -62,6 +62,17 @@ ! of the preconditioner to be built. ! info - integer, output. ! Error code. +! +! amold - class(psb_s_base_sparse_mat), input, optional +! Mold for the inner format of matrices contained in the +! preconditioner +! +! +! vmold - class(psb_s_base_vect_type), input, optional +! Mold for the inner format of vectors contained in the +! preconditioner +! +! ! subroutine mld_smlprec_bld(a,desc_a,p,info,amold,vmold) diff --git a/mlprec/mld_z_prec_type.f90 b/mlprec/mld_z_prec_type.f90 index c3cf31e3..79719a6e 100644 --- a/mlprec/mld_z_prec_type.f90 +++ b/mlprec/mld_z_prec_type.f90 @@ -664,26 +664,22 @@ contains info = psb_success_ - ! Actually we might just deallocate the top level array, except - ! for the inner UMFPACK or SLU stuff. + ! We might just deallocate the top level array, except + ! that there are inner objects containing C pointers, + ! e.g. UMFPACK, SLU or CUDA stuff. ! We really need FINALs. call lv%sm%free(info) call lv%ac%free() if (psb_is_ok_desc(lv%desc_ac)) & & call psb_cdfree(lv%desc_ac,info) + call lv%map%free(info) ! This is a pointer to something else, must not free it here. nullify(lv%base_a) ! This is a pointer to something else, must not free it here. nullify(lv%base_desc) - ! - ! free explicitly map??? - ! For now thanks to allocatable semantics - ! works anyway. - ! - call lv%nullify() end subroutine z_base_onelev_free diff --git a/mlprec/mld_zmlprec_bld.f90 b/mlprec/mld_zmlprec_bld.f90 index 39916cf1..fa84047e 100644 --- a/mlprec/mld_zmlprec_bld.f90 +++ b/mlprec/mld_zmlprec_bld.f90 @@ -62,6 +62,17 @@ ! of the preconditioner to be built. ! info - integer, output. ! Error code. +! +! amold - class(psb_z_base_sparse_mat), input, optional +! Mold for the inner format of matrices contained in the +! preconditioner +! +! +! vmold - class(psb_z_base_vect_type), input, optional +! Mold for the inner format of vectors contained in the +! preconditioner +! +! ! subroutine mld_zmlprec_bld(a,desc_a,p,info,amold,vmold)