From 93c1bd2787e8684ca92d9292bb35ed0ce14b4331 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 17 May 2007 10:17:49 +0000 Subject: [PATCH] Fixed usage of psb_cd_get_XXX. --- psb_dbaseprc_aply.f90 | 17 +++++++++-------- psb_dprc_aply.f90 | 9 +++++---- psb_zbaseprc_aply.f90 | 17 +++++++++-------- psb_zprc_aply.f90 | 9 +++++---- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/psb_dbaseprc_aply.f90 b/psb_dbaseprc_aply.f90 index d2c06809..ad5bd1fd 100644 --- a/psb_dbaseprc_aply.f90 +++ b/psb_dbaseprc_aply.f90 @@ -54,7 +54,7 @@ subroutine psb_dbaseprc_aply(alpha,prec,x,beta,y,desc_data,trans,work,info) integer, intent(out) :: info ! Local variables - integer :: n_row,n_col, int_err(5) + integer :: n_row,n_col, int_err(5), nrow_d real(kind(1.d0)), pointer :: ww(:), aux(:), tx(:),ty(:) character ::diagl, diagu integer :: ictxt,np,me,i, isz, nrg, err_act @@ -66,7 +66,8 @@ subroutine psb_dbaseprc_aply(alpha,prec,x,beta,y,desc_data,trans,work,info) info = 0 call psb_erractionsave(err_act) - ictxt=desc_data%matrix_data(psb_ctxt_) + ictxt = psb_cd_get_context(desc_data) + call psb_info(ictxt, me, np) diagl='U' @@ -100,7 +101,7 @@ subroutine psb_dbaseprc_aply(alpha,prec,x,beta,y,desc_data,trans,work,info) end if end if - n_row=desc_data%matrix_data(psb_n_row_) + n_row = psb_cd_get_local_rows(desc_data) ww(1:n_row) = x(1:n_row)*prec%d(1:n_row) call psb_geaxpby(alpha,ww,beta,y,desc_data,info) @@ -134,9 +135,9 @@ subroutine psb_dbaseprc_aply(alpha,prec,x,beta,y,desc_data,trans,work,info) else ! Note: currently trans is unused. - n_row=prec%desc_data%matrix_data(psb_n_row_) - n_col=prec%desc_data%matrix_data(psb_n_col_) - + n_row = psb_cd_get_local_rows(prec%desc_data) + n_col = psb_cd_get_local_cols(prec%desc_data) + nrow_d = psb_cd_get_local_rows(desc_data) isz=max(n_row,N_COL) if ((6*isz) <= size(work)) then ww => work(1:isz) @@ -173,8 +174,8 @@ subroutine psb_dbaseprc_aply(alpha,prec,x,beta,y,desc_data,trans,work,info) if (debugprt) write(0,*)' vdiag: ',prec%d(:) if (debug) write(0,*) 'Bi-CGSTAB with Additive Schwarz prec' - tx(1:desc_data%matrix_data(psb_n_row_)) = x(1:desc_data%matrix_data(psb_n_row_)) - tx(desc_data%matrix_data(psb_n_row_)+1:isz) = dzero + tx(1:nrow_d) = x(1:nrow_d) + tx(nrow_d+1:isz) = dzero if (prec%iprcparm(restr_)==psb_halo_) then call psb_halo(tx,prec%desc_data,info,work=aux,data=psb_comm_ext_) diff --git a/psb_dprc_aply.f90 b/psb_dprc_aply.f90 index 76cefd0b..254793b5 100644 --- a/psb_dprc_aply.f90 +++ b/psb_dprc_aply.f90 @@ -51,7 +51,7 @@ subroutine psb_dprc_aply(prec,x,y,desc_data,info,trans, work) ! Local variables character :: trans_ real(kind(1.d0)), pointer :: work_(:) - integer :: ictxt,np,me,err_act + integer :: ictxt,np,me,err_act,iwsz logical,parameter :: debug=.false., debugprt=.false. character(len=20) :: name @@ -59,7 +59,7 @@ subroutine psb_dprc_aply(prec,x,y,desc_data,info,trans, work) info = 0 call psb_erractionsave(err_act) - ictxt=desc_data%matrix_data(psb_ctxt_) + ictxt = psb_cd_get_context(desc_data) call psb_info(ictxt, me, np) if (present(trans)) then @@ -71,7 +71,8 @@ subroutine psb_dprc_aply(prec,x,y,desc_data,info,trans, work) if (present(work)) then work_ => work else - allocate(work_(4*desc_data%matrix_data(psb_n_col_)),stat=info) + iwsz = max(1,4*psb_cd_get_local_cols(desc_data)) + allocate(work_(iwsz)),stat=info) if (info /= 0) then call psb_errpush(4010,name,a_err='Allocate') goto 9999 @@ -176,7 +177,7 @@ subroutine psb_dprc_aply1(prec,x,desc_data,info,trans) call psb_erractionsave(err_act) - ictxt=desc_data%matrix_data(psb_ctxt_) + ictxt = psb_cd_get_context(desc_data) call psb_info(ictxt, me, np) if (present(trans)) then trans_=trans diff --git a/psb_zbaseprc_aply.f90 b/psb_zbaseprc_aply.f90 index 2032f797..4f5101b1 100644 --- a/psb_zbaseprc_aply.f90 +++ b/psb_zbaseprc_aply.f90 @@ -53,7 +53,7 @@ subroutine psb_zbaseprc_aply(alpha,prec,x,beta,y,desc_data,trans,work,info) integer, intent(out) :: info ! Local variables - integer :: n_row,n_col, int_err(5) + integer :: n_row,n_col, int_err(5), nrow_d complex(kind(1.d0)), pointer :: ww(:), aux(:), tx(:),ty(:) character ::diagl, diagu integer :: ictxt,np,me,i, isz, nrg, err_act @@ -65,7 +65,8 @@ subroutine psb_zbaseprc_aply(alpha,prec,x,beta,y,desc_data,trans,work,info) info = 0 call psb_erractionsave(err_act) - ictxt=desc_data%matrix_data(psb_ctxt_) + ictxt = psb_cd_get_context(desc_data) + call psb_info(ictxt, me, np) diagl='U' @@ -99,7 +100,7 @@ subroutine psb_zbaseprc_aply(alpha,prec,x,beta,y,desc_data,trans,work,info) end if end if - n_row=desc_data%matrix_data(psb_n_row_) + n_row = psb_cd_get_local_rows(desc_data) ww(1:n_row) = x(1:n_row)*prec%d(1:n_row) call psb_geaxpby(alpha,ww,beta,y,desc_data,info) @@ -133,9 +134,9 @@ subroutine psb_zbaseprc_aply(alpha,prec,x,beta,y,desc_data,trans,work,info) else ! Note: currently trans is unused. - n_row=prec%desc_data%matrix_data(psb_n_row_) - n_col=prec%desc_data%matrix_data(psb_n_col_) - + n_row = psb_cd_get_local_rows(prec%desc_data) + n_col = psb_cd_get_local_cols(prec%desc_data) + nrow_d = psb_cd_get_local_rows(desc_data) isz=max(n_row,N_COL) if ((6*isz) <= size(work)) then ww => work(1:isz) @@ -172,8 +173,8 @@ subroutine psb_zbaseprc_aply(alpha,prec,x,beta,y,desc_data,trans,work,info) if (debugprt) write(0,*)' vdiag: ',prec%d(:) if (debug) write(0,*) 'Bi-CGSTAB with Additive Schwarz prec' - tx(1:desc_data%matrix_data(psb_n_row_)) = x(1:desc_data%matrix_data(psb_n_row_)) - tx(desc_data%matrix_data(psb_n_row_)+1:isz) = zzero + tx(1:nrow_d) = x(1:nrow_d) + tx(nrow_d+1:isz) = zzero if (prec%iprcparm(restr_)==psb_halo_) then call psb_halo(tx,prec%desc_data,info,work=aux,data=psb_comm_ext_) diff --git a/psb_zprc_aply.f90 b/psb_zprc_aply.f90 index c12d2c96..9af3e17b 100644 --- a/psb_zprc_aply.f90 +++ b/psb_zprc_aply.f90 @@ -51,7 +51,7 @@ subroutine psb_zprc_aply(prec,x,y,desc_data,info,trans, work) ! Local variables character :: trans_ complex(kind(1.d0)), pointer :: work_(:) - integer :: ictxt,np,me,err_act + integer :: ictxt,np,me,err_act,iwsz logical,parameter :: debug=.false., debugprt=.false. character(len=20) :: name @@ -59,7 +59,7 @@ subroutine psb_zprc_aply(prec,x,y,desc_data,info,trans, work) info = 0 call psb_erractionsave(err_act) - ictxt=desc_data%matrix_data(psb_ctxt_) + ictxt = psb_cd_get_context(desc_data) call psb_info(ictxt, me, np) if (present(trans)) then @@ -71,7 +71,8 @@ subroutine psb_zprc_aply(prec,x,y,desc_data,info,trans, work) if (present(work)) then work_ => work else - allocate(work_(4*desc_data%matrix_data(psb_n_col_)),stat=info) + iwsz = max(1,4*psb_cd_get_local_cols(desc_data)) + allocate(work_(iwsz)),stat=info) if (info /= 0) then call psb_errpush(4010,name,a_err='Allocate') goto 9999 @@ -174,7 +175,7 @@ subroutine psb_zprc_aply1(prec,x,desc_data,info,trans) call psb_erractionsave(err_act) - ictxt=desc_data%matrix_data(psb_ctxt_) + ictxt = psb_cd_get_context(desc_data) call psb_info(ictxt, me, np) if (present(trans)) then trans_=trans