From 00d130b933dfa350d36de27f36fef59cb1f11a2f Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Mon, 16 Jul 2007 13:50:36 +0000 Subject: [PATCH] Fixed huge run time due to usage of an unsorted COO temp storage. Removed the temp storage for the in matrix, using SP_CLIP with another (much smaller) temp buffer. --- mld_dbjac_bld.f90 | 25 ++++++++++--------------- mld_zbjac_bld.f90 | 31 +++++++++++++++++-------------- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/mld_dbjac_bld.f90 b/mld_dbjac_bld.f90 index 095e6085..8c70fdfb 100644 --- a/mld_dbjac_bld.f90 +++ b/mld_dbjac_bld.f90 @@ -272,28 +272,23 @@ subroutine mld_dbjac_bld(a,desc_a,p,upd,info) if (p%iprcparm(smooth_sweeps_) > 1) then - atmp%fida='COO' - call psb_csdp(a,atmp,info) - if (info /= 0) then - call psb_errpush(4010,name,a_err='psb_csdp') - goto 9999 - end if - n_row = psb_cd_get_local_rows(p%desc_data) n_col = psb_cd_get_local_cols(p%desc_data) - call psb_rwextd(n_row,atmp,info,b=blck,rowscale=.false.) - call psb_fixcoo(atmp,info) - !------------------------------------------------------------------ - ! Split AC=M+N N off-diagonal part - ! Output in COO format. - call psb_sp_clip(atmp,p%av(ap_nd_),info,& - & jmin=atmp%m+1,rscale=.false.,cscale=.false.) + nrow_a = a%m + ! The following is known to work + ! given that the output from CLIP is in COO. + call psb_sp_clip(a,p%av(ap_nd_),info,& + & jmin=nrow_a+1,rscale=.false.,cscale=.false.) + call psb_sp_clip(blck,atmp,info,& + & jmin=nrow_a+1,rscale=.false.,cscale=.false.) + call psb_rwextd(n_row,p%av(ap_nd_),info,b=atmp,rowscale=.false.) + call psb_ipcoo2csr(p%av(ap_nd_),info) if(info /= 0) then call psb_errpush(4010,name,a_err='psb_ipcoo2csr 4') goto 9999 end if - + k = psb_sp_get_nnzeros(p%av(ap_nd_)) call psb_sum(ictxt,k) diff --git a/mld_zbjac_bld.f90 b/mld_zbjac_bld.f90 index a271f120..bf12b59e 100644 --- a/mld_zbjac_bld.f90 +++ b/mld_zbjac_bld.f90 @@ -112,6 +112,15 @@ subroutine mld_zbjac_bld(a,desc_a,p,upd,info) call mld_asmat_bld(p%iprcparm(prec_type_),p%iprcparm(n_ovr_),a,& & blck,desc_a,upd,p%desc_data,info,outfmt=coofmt) + if (debugprt) then + open(60+me) + call psb_csprt(60+me,a,head='% A') + close(60+me) + open(70+me) + call psb_csprt(70+me,blck,head='% BLCK') + close(70+me) + endif + if(info/=0) then call psb_errpush(4010,name,a_err='mld_asmat_bld') goto 9999 @@ -264,22 +273,16 @@ subroutine mld_zbjac_bld(a,desc_a,p,upd,info) if (p%iprcparm(smooth_sweeps_) > 1) then - atmp%fida='COO' - call psb_csdp(a,atmp,info) - if (info /= 0) then - call psb_errpush(4010,name,a_err='psb_csdp') - goto 9999 - end if - n_row = psb_cd_get_local_rows(p%desc_data) n_col = psb_cd_get_local_cols(p%desc_data) - call psb_rwextd(n_row,atmp,info,b=blck,rowscale=.false.) - call psb_fixcoo(atmp,info) - !------------------------------------------------------------------ - ! Split AC=M+N N off-diagonal part - ! Output in COO format. - call psb_sp_clip(atmp,p%av(ap_nd_),info,& - & jmin=atmp%m+1,rscale=.false.,cscale=.false.) + nrow_a = a%m + ! The following is known to work + ! given that the output from CLIP is in COO. + call psb_sp_clip(a,p%av(ap_nd_),info,& + & jmin=nrow_a+1,rscale=.false.,cscale=.false.) + call psb_sp_clip(blck,atmp,info,& + & jmin=nrow_a+1,rscale=.false.,cscale=.false.) + call psb_rwextd(n_row,p%av(ap_nd_),info,b=atmp,rowscale=.false.) call psb_ipcoo2csr(p%av(ap_nd_),info) if(info /= 0) then