Make errcom not blocking. Cache in info_mpik. Fix makefile.

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

@ -5,7 +5,7 @@ subroutine psb_errcomm(ictxt, err)
integer(psb_mpik_), intent(in) :: ictxt integer(psb_mpik_), intent(in) :: ictxt
integer(psb_ipk_), intent(inout):: err integer(psb_ipk_), intent(inout):: err
call psb_amx(ictxt, err) if (psb_get_global_checks()) call psb_amx(ictxt, err)
end subroutine psb_errcomm end subroutine psb_errcomm

@ -63,8 +63,8 @@ module psb_error_mod
& psb_clean_errstack, psb_error_handler, & & psb_clean_errstack, psb_error_handler, &
& psb_ser_error_handler, psb_par_error_handler, & & psb_ser_error_handler, psb_par_error_handler, &
& psb_ser_error_print_stack, psb_par_error_print_stack,& & psb_ser_error_print_stack, psb_par_error_print_stack,&
& psb_error_print_stack, psb_errmsg, psb_ach_errmsg & psb_error_print_stack, psb_errmsg, psb_ach_errmsg, &
& psb_set_global_checks, psb_clear_global_checks, psb_get_global_checks
interface psb_error_handler interface psb_error_handler
subroutine psb_ser_error_handler(err_act) subroutine psb_ser_error_handler(err_act)
@ -161,9 +161,31 @@ module psb_error_mod
integer(psb_ipk_), save :: verbosity_level = 1 integer(psb_ipk_), save :: verbosity_level = 1
integer(psb_ipk_), save :: err_action = psb_act_abort_ integer(psb_ipk_), save :: err_action = psb_act_abort_
integer(psb_ipk_), save :: debug_level = 0, debug_unit, serial_debug_level=0 integer(psb_ipk_), save :: debug_level = 0, debug_unit, serial_debug_level=0
logical, save :: comm_global_checks = .false.
contains contains
subroutine psb_set_global_checks(val)
logical, intent(in), optional :: val
if (present(val)) then
comm_global_checks = val
else
comm_global_checks = .true.
end if
end subroutine psb_set_global_checks
subroutine psb_clear_global_checks()
comm_global_checks = .false.
end subroutine psb_clear_global_checks
function psb_get_global_checks() result(val)
logical :: val
val = comm_global_checks
end function psb_get_global_checks
#if defined(LONG_INTEGERS) #if defined(LONG_INTEGERS)
subroutine psb_errcomm_ipk(ictxt, err) subroutine psb_errcomm_ipk(ictxt, err)
integer(psb_ipk_), intent(in) :: ictxt integer(psb_ipk_), intent(in) :: ictxt

@ -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
@ -515,8 +521,10 @@ contains
integer(psb_mpik_), intent(in) :: ictxt integer(psb_mpik_), intent(in) :: ictxt
integer(psb_mpik_), intent(out) :: iam, np integer(psb_mpik_), intent(out) :: iam, np
integer(psb_mpik_) :: info integer(psb_mpik_) :: info
! Cache the values for the most recent CTXT to speed !
! up subsequent queries ! Simple caching scheme, keep track
! of the last CTXT encountered.
!
integer(psb_mpik_), save :: lctxt=-1, lam, lnp integer(psb_mpik_), save :: lctxt=-1, lam, lnp
#if defined(SERIAL_MPI) #if defined(SERIAL_MPI)
@ -527,7 +535,7 @@ contains
np = -1 np = -1
if (ictxt == lctxt) then if (ictxt == lctxt) then
iam = lam iam = lam
np = lnp np = lnp
else else
if (ictxt /= mpi_comm_null) then if (ictxt /= mpi_comm_null) then
call mpi_comm_size(ictxt,np,info) call mpi_comm_size(ictxt,np,info)
@ -537,7 +545,7 @@ contains
end if end if
lctxt = ictxt lctxt = ictxt
lam = iam lam = iam
lnp = np lnp = np
end if end if
#endif #endif

@ -5,7 +5,7 @@ include $(INCDIR)/Make.inc.psblas
# Libraries used # Libraries used
# #
LIBDIR=$(INSTALLDIR)/lib/ LIBDIR=$(INSTALLDIR)/lib/
PSBLAS_LIB= -L$(LIBDIR) -L/opencoarray-1.7.4 -lcaf_mpi -lpsb_util -lpsb_krylov -lpsb_prec -lpsb_base PSBLAS_LIB= -L$(LIBDIR) -lpsb_util -lpsb_krylov -lpsb_prec -lpsb_base
LDLIBS=$(PSBLDLIBS) LDLIBS=$(PSBLDLIBS)
FINCLUDES=$(FMFLAG)$(INCDIR) $(FMFLAG). FINCLUDES=$(FMFLAG)$(INCDIR) $(FMFLAG).
@ -35,7 +35,7 @@ psb_zf_sample: $(ZFOBJS)
/bin/mv psb_zf_sample $(EXEDIR) /bin/mv psb_zf_sample $(EXEDIR)
.f90.o: .f90.o:
$(MPF90) $(F90COPT) $(FINCLUDES) $(FDEFINES) -c $< $(MPFC) $(FCOPT) $(FINCLUDES) $(FDEFINES) -c $<
clean: clean:
/bin/rm -f $(DFOBJS) $(ZFOBJS) $(SFOBJS) $(CFOBJS)\ /bin/rm -f $(DFOBJS) $(ZFOBJS) $(SFOBJS) $(CFOBJS)\

Loading…
Cancel
Save