From 3801148fde84206788fdb38060ea896a031ab743 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Mon, 28 May 2007 08:23:59 +0000 Subject: [PATCH] Fixed makefile and sample programs for precinit and friends. --- Makefile | 4 ++-- prec/Makefile | 4 ++-- test/fileread/zf_sample.f90 | 24 +++++++++++++++++------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 66079666..6390ae09 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ include Make.inc -PREC=../mld2p4 -#PREC=prec +#PREC=../mld2p4 +PREC=prec library: diff --git a/prec/Makefile b/prec/Makefile index 562dd467..38125ff7 100644 --- a/prec/Makefile +++ b/prec/Makefile @@ -4,12 +4,12 @@ LIBDIR=../lib HERE=. MODOBJS= psb_prec_type.o psb_prec_mod.o F90OBJS= psb_dbjac_bld.o psb_dilu_fct.o\ - psb_dprecbld.o psb_dprecset.o \ + psb_dprecbld.o psb_dprecset.o psb_dprecinit.o \ psb_ddiagsc_bld.o \ psb_dprc_aply.o \ psb_dgprec_aply.o psb_dbjac_aply.o\ psb_zbjac_bld.o psb_zilu_fct.o\ - psb_zprecbld.o psb_zprecset.o \ + psb_zprecbld.o psb_zprecset.o psb_zprecinit.o \ psb_zdiagsc_bld.o \ psb_zprc_aply.o psb_zgprec_aply.o psb_zbjac_aply.o diff --git a/test/fileread/zf_sample.f90 b/test/fileread/zf_sample.f90 index 8f197bd6..f68a69e0 100644 --- a/test/fileread/zf_sample.f90 +++ b/test/fileread/zf_sample.f90 @@ -62,7 +62,7 @@ program zf_sample ! solver paramters integer :: iter, itmax, ierr, itrace, ircode, ipart,& - & methd, istopc, iprec, ml + & methd, istopc, iprec, ml,amatsize,precsize,descsize real(kind(1.d0)) :: err, eps character(len=5) :: afmt @@ -99,7 +99,7 @@ program zf_sample ! get parameters ! call get_parms(ictxt,mtrx_file,rhs_file,cmethd,& - & ipart,afmt,istopc,itmax,itrace,novr,iprec,eps) + & ipart,afmt,istopc,itmax,itrace,ml,iprec,eps) call psb_barrier(ictxt) t1 = psb_wtime() @@ -203,13 +203,13 @@ program zf_sample igsmth=-1 select case(iprec) case(noprec_) - call psb_precset(pre,'noprec',info) + call psb_precinit(pre,'noprec',info) case(diag_) - call psb_precset(pre,'diag',info) + call psb_precinit(pre,'diag',info) case(bjac_) - call psb_precset(pre,'bjac',info) + call psb_precinit(pre,'bjac',info) case default - call psb_precset(pre,'bjac',info) + call psb_precinit(pre,'bjac',info) end select ! building the preconditioner @@ -242,6 +242,12 @@ program zf_sample call psb_genrm2s(resmx,r_col,desc_a,info) call psb_geamaxs(resmxp,r_col,desc_a,info) + amatsize = psb_sizeof(a) + descsize = psb_sizeof(desc_a) + precsize = psb_sizeof(pre) + call psb_sum(ictxt,amatsize) + call psb_sum(ictxt,descsize) + call psb_sum(ictxt,precsize) if (amroot) then call psb_prec_descr(6,pre) write(*,'("Matrix: ",a)')mtrx_file @@ -254,6 +260,9 @@ program zf_sample write(*,'("Total time : ",es10.4)')t2+tprec write(*,'("Residual norm 2 = ",es10.4)')resmx write(*,'("Residual norm inf = ",es10.4)')resmxp + write(*,'("Total memory occupation for A: ",i10)')amatsize + write(*,'("Total memory occupation for DESC_A: ",i10)')descsize + write(*,'("Total memory occupation for PRE: ",i10)')precsize end if allocate(x_col_glob(m_problem),r_col_glob(m_problem),stat=ierr) @@ -271,8 +280,9 @@ program zf_sample write(20,*) 'error indicator (infinity norm) on exit:', & & ' ||r||/(||a||||x||+||b||) = ',err write(20,*) 'max residual = ',resmx, resmxp + write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)' do i=1,m_problem - write(20,998) i,x_col_glob(i),r_col_glob(i)!,b_col_glob(i) + write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i) enddo end if end if