Simple caching scheme for psb_info

pull/1/head
Salvatore Filippone 8 years ago
parent 592e9bacba
commit 9c989c24e9

@ -253,11 +253,17 @@ contains
integer(psb_ipk_), intent(in) :: ictxt integer(psb_ipk_), intent(in) :: ictxt
integer(psb_ipk_), intent(out) :: iam, np integer(psb_ipk_), intent(out) :: iam, np
integer(psb_mpik_) :: iictxt, iiam, inp !
iictxt = ictxt ! Simple caching scheme, keep track
call psb_info(iictxt,iiam,inp) ! of the last CTXT encountered.
iam = iiam !
np = inp integer(psb_mpik_), save :: lctxt=-1, lam, lnp
if (ictxt /= lctxt) then
lctxt = ictxt
call psb_info(lctxt,lam,lnp)
end if
iam = lam
np = lnp
end subroutine psb_info_ipk end subroutine psb_info_ipk

Loading…
Cancel
Save