Cache ICTXT, IAM and NP

psblas-caf-csr
Salvatore Filippone 8 years ago
parent ee0aa157f3
commit 4f7d99154d

@ -515,18 +515,29 @@ contains
integer(psb_mpik_), intent(in) :: ictxt
integer(psb_mpik_), intent(out) :: iam, np
integer(psb_mpik_) :: info
! Cache the values for the most recent CTXT to speed
! up subsequent queries
integer(psb_mpik_), save :: lctxt=-1, lam, lnp
#if defined(SERIAL_MPI)
iam = 0
np = 1
#else
iam = -1
np = -1
if (ictxt /= mpi_comm_null) then
call mpi_comm_size(ictxt,np,info)
if (info /= mpi_success) np = -1
call mpi_comm_rank(ictxt,iam,info)
if (info /= mpi_success) iam = -1
if (ictxt == lctxt) then
iam = lam
np = lnp
else
if (ictxt /= mpi_comm_null) then
call mpi_comm_size(ictxt,np,info)
if (info /= mpi_success) np = -1
call mpi_comm_rank(ictxt,iam,info)
if (info /= mpi_success) iam = -1
end if
lctxt = ictxt
lam = iam
lnp = np
end if
#endif

@ -15,25 +15,25 @@ FINCLUDES=$(FMFLAG)$(INCDIR) $(FMFLAG).
EXEDIR=./runs
all: psb_s_pde2d psb_s_pde2d psb_d_pde2d psb_d_pde3d
all: psb_s_pde2d psb_s_pde3d psb_d_pde2d psb_d_pde3d
psb_d_pde3d: psb_d_pde3d.o
$(F90LINK) psb_d_pde3d.o -o psb_d_pde3d $(PSBLAS_LIB) $(LDLIBS)
$(FLINK) psb_d_pde3d.o -o psb_d_pde3d $(PSBLAS_LIB) $(LDLIBS)
/bin/mv psb_d_pde3d $(EXEDIR)
psb_s_pde3d: psb_s_pde3d.o
$(F90LINK) psb_s_pde3d.o -o psb_s_pde3d $(PSBLAS_LIB) $(LDLIBS)
$(FLINK) psb_s_pde3d.o -o psb_s_pde3d $(PSBLAS_LIB) $(LDLIBS)
/bin/mv psb_s_pde3d $(EXEDIR)
psb_d_pde2d: psb_d_pde2d.o
$(F90LINK) psb_d_pde2d.o -o psb_d_pde2d $(PSBLAS_LIB) $(LDLIBS)
$(FLINK) psb_d_pde2d.o -o psb_d_pde2d $(PSBLAS_LIB) $(LDLIBS)
/bin/mv psb_d_pde2d $(EXEDIR)
psb_s_pde2d: psb_s_pde2d.o
$(F90LINK) psb_s_pde2d.o -o psb_s_pde2d $(PSBLAS_LIB) $(LDLIBS)
$(FLINK) psb_s_pde2d.o -o psb_s_pde2d $(PSBLAS_LIB) $(LDLIBS)
/bin/mv psb_s_pde2d $(EXEDIR)

Loading…
Cancel
Save