Added routine for logical all reduce and applied in psb_mask

merge-paraggr-newops
Cirdans-Home 5 years ago
parent 17e24bdcf0
commit 7f42d63275

@ -180,6 +180,31 @@ contains
end subroutine psb_lbcasts end subroutine psb_lbcasts
subroutine psb_lallreduceand(ictxt,dat,rec)
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
logical, intent(inout) :: dat
logical, intent(inout), optional :: rec
integer(psb_mpk_) :: iam, np, info
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(rec)) then
call mpi_allreduce(dat,rec,1,MPI_LOGICAL,MPI_LAND,ictxt,info)
else
call mpi_allreduce(MPI_IN_PLACE,dat,1,MPI_LOGICAL,MPI_LAND,ictxt,info)
endif
#endif
end subroutine psb_lallreduceand
subroutine psb_lbcastv(ictxt,dat,root) subroutine psb_lbcastv(ictxt,dat,root)
#ifdef MPI_MOD #ifdef MPI_MOD

@ -214,6 +214,8 @@ subroutine psb_dmask_vect(c,x,m,t,desc_a,info)
call m%mask(c,x,t,info) call m%mask(c,x,t,info)
end if end if
call psb_lallreduceand(ictxt,t)
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return

@ -214,6 +214,8 @@ subroutine psb_smask_vect(c,x,m,t,desc_a,info)
call m%mask(c,x,t,info) call m%mask(c,x,t,info)
end if end if
call psb_lallreduceand(ictxt,t)
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return

Loading…
Cancel
Save