From 7f3f0cb2e5a9b27048572e311d6bc56d0950bd71 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 20 Feb 2020 12:28:20 +0000 Subject: [PATCH] Fix build of replicated coarse matrix for unsmoothed aggregation. --- mlprec/impl/aggregator/mld_c_dec_aggregator_mat_asb.f90 | 7 +++++++ mlprec/impl/aggregator/mld_caggrmat_nosmth_bld.f90 | 4 ++++ mlprec/impl/aggregator/mld_d_dec_aggregator_mat_asb.f90 | 7 +++++++ mlprec/impl/aggregator/mld_daggrmat_nosmth_bld.f90 | 4 ++++ mlprec/impl/aggregator/mld_s_dec_aggregator_mat_asb.f90 | 7 +++++++ mlprec/impl/aggregator/mld_saggrmat_nosmth_bld.f90 | 4 ++++ mlprec/impl/aggregator/mld_z_dec_aggregator_mat_asb.f90 | 7 +++++++ mlprec/impl/aggregator/mld_zaggrmat_nosmth_bld.f90 | 4 ++++ 8 files changed, 44 insertions(+) diff --git a/mlprec/impl/aggregator/mld_c_dec_aggregator_mat_asb.f90 b/mlprec/impl/aggregator/mld_c_dec_aggregator_mat_asb.f90 index c231ef02..e0c20250 100644 --- a/mlprec/impl/aggregator/mld_c_dec_aggregator_mat_asb.f90 +++ b/mlprec/impl/aggregator/mld_c_dec_aggregator_mat_asb.f90 @@ -191,7 +191,14 @@ subroutine mld_c_dec_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,& ! ! If we are here, it means we assume that an IPK version of the ! coarse matrix can hold all indices. User beware! + ! + + ! + ! op_prol/op_restr come from par_spmm_bld with local sizes + ! suitable for DIST option, fix relevant sizes ! + call op_prol%set_ncols(ntaggr) + call op_restr%set_nrows(ntaggr) call psb_cdall(ictxt,desc_ac,info,mg=ntaggr,repl=.true.) if (info == psb_success_) call psb_cdasb(desc_ac,info) if (info == psb_success_) call ac%mv_to(acoo) diff --git a/mlprec/impl/aggregator/mld_caggrmat_nosmth_bld.f90 b/mlprec/impl/aggregator/mld_caggrmat_nosmth_bld.f90 index e88d0e19..a31d5eda 100644 --- a/mlprec/impl/aggregator/mld_caggrmat_nosmth_bld.f90 +++ b/mlprec/impl/aggregator/mld_caggrmat_nosmth_bld.f90 @@ -146,6 +146,9 @@ subroutine mld_caggrmat_nosmth_bld(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_re naggrp1 = sum(nlaggr(1:me+1)) if (.false.) then + ! + ! If we ever want to switch to explicit product when building this.. + ! call a%cp_to(acsr) call op_prol%mv_to(coo_prol) inaggr = naggr @@ -161,6 +164,7 @@ subroutine mld_caggrmat_nosmth_bld(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_re else + call a%cp_to(ac_coo) nzt = ac_coo%get_nzeros() k = 0 diff --git a/mlprec/impl/aggregator/mld_d_dec_aggregator_mat_asb.f90 b/mlprec/impl/aggregator/mld_d_dec_aggregator_mat_asb.f90 index 6cfda26b..90a12d83 100644 --- a/mlprec/impl/aggregator/mld_d_dec_aggregator_mat_asb.f90 +++ b/mlprec/impl/aggregator/mld_d_dec_aggregator_mat_asb.f90 @@ -191,7 +191,14 @@ subroutine mld_d_dec_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,& ! ! If we are here, it means we assume that an IPK version of the ! coarse matrix can hold all indices. User beware! + ! + + ! + ! op_prol/op_restr come from par_spmm_bld with local sizes + ! suitable for DIST option, fix relevant sizes ! + call op_prol%set_ncols(ntaggr) + call op_restr%set_nrows(ntaggr) call psb_cdall(ictxt,desc_ac,info,mg=ntaggr,repl=.true.) if (info == psb_success_) call psb_cdasb(desc_ac,info) if (info == psb_success_) call ac%mv_to(acoo) diff --git a/mlprec/impl/aggregator/mld_daggrmat_nosmth_bld.f90 b/mlprec/impl/aggregator/mld_daggrmat_nosmth_bld.f90 index 3688aefc..ddef24a3 100644 --- a/mlprec/impl/aggregator/mld_daggrmat_nosmth_bld.f90 +++ b/mlprec/impl/aggregator/mld_daggrmat_nosmth_bld.f90 @@ -146,6 +146,9 @@ subroutine mld_daggrmat_nosmth_bld(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_re naggrp1 = sum(nlaggr(1:me+1)) if (.false.) then + ! + ! If we ever want to switch to explicit product when building this.. + ! call a%cp_to(acsr) call op_prol%mv_to(coo_prol) inaggr = naggr @@ -161,6 +164,7 @@ subroutine mld_daggrmat_nosmth_bld(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_re else + call a%cp_to(ac_coo) nzt = ac_coo%get_nzeros() k = 0 diff --git a/mlprec/impl/aggregator/mld_s_dec_aggregator_mat_asb.f90 b/mlprec/impl/aggregator/mld_s_dec_aggregator_mat_asb.f90 index 22097744..15f2d347 100644 --- a/mlprec/impl/aggregator/mld_s_dec_aggregator_mat_asb.f90 +++ b/mlprec/impl/aggregator/mld_s_dec_aggregator_mat_asb.f90 @@ -191,7 +191,14 @@ subroutine mld_s_dec_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,& ! ! If we are here, it means we assume that an IPK version of the ! coarse matrix can hold all indices. User beware! + ! + + ! + ! op_prol/op_restr come from par_spmm_bld with local sizes + ! suitable for DIST option, fix relevant sizes ! + call op_prol%set_ncols(ntaggr) + call op_restr%set_nrows(ntaggr) call psb_cdall(ictxt,desc_ac,info,mg=ntaggr,repl=.true.) if (info == psb_success_) call psb_cdasb(desc_ac,info) if (info == psb_success_) call ac%mv_to(acoo) diff --git a/mlprec/impl/aggregator/mld_saggrmat_nosmth_bld.f90 b/mlprec/impl/aggregator/mld_saggrmat_nosmth_bld.f90 index 66d7e79f..1805bd25 100644 --- a/mlprec/impl/aggregator/mld_saggrmat_nosmth_bld.f90 +++ b/mlprec/impl/aggregator/mld_saggrmat_nosmth_bld.f90 @@ -146,6 +146,9 @@ subroutine mld_saggrmat_nosmth_bld(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_re naggrp1 = sum(nlaggr(1:me+1)) if (.false.) then + ! + ! If we ever want to switch to explicit product when building this.. + ! call a%cp_to(acsr) call op_prol%mv_to(coo_prol) inaggr = naggr @@ -161,6 +164,7 @@ subroutine mld_saggrmat_nosmth_bld(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_re else + call a%cp_to(ac_coo) nzt = ac_coo%get_nzeros() k = 0 diff --git a/mlprec/impl/aggregator/mld_z_dec_aggregator_mat_asb.f90 b/mlprec/impl/aggregator/mld_z_dec_aggregator_mat_asb.f90 index 04916cee..a71473a7 100644 --- a/mlprec/impl/aggregator/mld_z_dec_aggregator_mat_asb.f90 +++ b/mlprec/impl/aggregator/mld_z_dec_aggregator_mat_asb.f90 @@ -191,7 +191,14 @@ subroutine mld_z_dec_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,& ! ! If we are here, it means we assume that an IPK version of the ! coarse matrix can hold all indices. User beware! + ! + + ! + ! op_prol/op_restr come from par_spmm_bld with local sizes + ! suitable for DIST option, fix relevant sizes ! + call op_prol%set_ncols(ntaggr) + call op_restr%set_nrows(ntaggr) call psb_cdall(ictxt,desc_ac,info,mg=ntaggr,repl=.true.) if (info == psb_success_) call psb_cdasb(desc_ac,info) if (info == psb_success_) call ac%mv_to(acoo) diff --git a/mlprec/impl/aggregator/mld_zaggrmat_nosmth_bld.f90 b/mlprec/impl/aggregator/mld_zaggrmat_nosmth_bld.f90 index 08e2c4f9..514399df 100644 --- a/mlprec/impl/aggregator/mld_zaggrmat_nosmth_bld.f90 +++ b/mlprec/impl/aggregator/mld_zaggrmat_nosmth_bld.f90 @@ -146,6 +146,9 @@ subroutine mld_zaggrmat_nosmth_bld(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_re naggrp1 = sum(nlaggr(1:me+1)) if (.false.) then + ! + ! If we ever want to switch to explicit product when building this.. + ! call a%cp_to(acsr) call op_prol%mv_to(coo_prol) inaggr = naggr @@ -161,6 +164,7 @@ subroutine mld_zaggrmat_nosmth_bld(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_re else + call a%cp_to(ac_coo) nzt = ac_coo%get_nzeros() k = 0