You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
psblas3/base/comm/psb_dspgather.F90

115 lines
3.0 KiB
Fortran

subroutine psb_dsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
use psb_descriptor_type
use psb_error_mod
use psb_mat_mod
use psb_penv_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
type(psb_d_sparse_mat), intent(inout) :: loca
type(psb_d_sparse_mat), intent(inout) :: globa
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
integer, intent(in), optional :: root, dupl
logical, intent(in), optional :: keepnum,keeploc
type(psb_d_coo_sparse_mat) :: loc_coo, glob_coo
integer :: ictxt,np,me, err_act, icomm, dupl_, nrg, ncg, nzg
integer :: ip, ndx,naggrm1,naggrp1, i, j, k
logical :: keepnum_, keeploc_
integer, allocatable :: nzbr(:), idisp(:)
character(len=20) :: name
integer :: debug_level, debug_unit
name='psb_gather'
if (psb_get_errstatus().ne.0) return
info=psb_success_
call psb_erractionsave(err_act)
ictxt = psb_cd_get_context(desc_a)
icomm = psb_cd_get_mpic(desc_a)
call psb_info(ictxt, me, np)
if (present(keepnum)) then
keepnum_ = keepnum
else
keepnum_ = .true.
end if
if (present(keeploc)) then
keeploc_ = keeploc
else
keeploc_ = .true.
end if
call globa%free()
if (keepnum_) then
nrg = psb_cd_get_global_rows(desc_a)
ncg = psb_cd_get_global_rows(desc_a)
allocate(nzbr(np), idisp(np),stat=info)
if (info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/2*np,0,0,0,0/),&
& a_err='integer')
goto 9999
end if
call loca%mv_to(loc_coo)
nzbr(:) = 0
nzbr(me+1) = loc_coo%get_nzeros()
call psb_sum(ictxt,nzbr(1:np))
nzg = sum(nzbr)
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
if (info /= psb_success_) goto 9999
do ip=1,np
idisp(ip) = sum(nzbr(1:ip-1))
enddo
ndx = nzbr(me+1)
call mpi_allgatherv(loc_coo%val,ndx,mpi_double_precision,&
& glob_coo%val,nzbr,idisp,&
& mpi_double_precision,icomm,info)
if (info == psb_success_) call mpi_allgatherv(loc_coo%ia,ndx,mpi_integer,&
& glob_coo%ia,nzbr,idisp,&
& mpi_integer,icomm,info)
if (info == psb_success_) call mpi_allgatherv(loc_coo%ja,ndx,mpi_integer,&
& glob_coo%ja,nzbr,idisp,&
& mpi_integer,icomm,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_internal_error_,name,a_err=' from mpi_allgatherv')
goto 9999
end if
if (keeploc_) then
call loca%mv_from(loc_coo)
else
call loc_coo%free()
end if
call glob_coo%set_nzeros(nzg)
if (present(dupl)) call glob_coo%set_dupl(dupl)
call globa%mv_from(glob_coo)
else
psblas3: base/comm/psb_dhalo.f90 base/comm/psb_dspgather.F90 base/comm/psb_shalo.f90 base/internals/psi_bld_g2lmap.f90 base/internals/psi_bld_tmphalo.f90 base/internals/psi_cswapdata.F90 base/internals/psi_cswaptran.F90 base/internals/psi_desc_index.F90 base/internals/psi_dl_check.f90 base/internals/psi_dswapdata.F90 base/internals/psi_dswaptran.F90 base/internals/psi_extrct_dl.F90 base/internals/psi_fnd_owner.F90 base/internals/psi_iswapdata.F90 base/internals/psi_iswaptran.F90 base/internals/psi_sswapdata.F90 base/internals/psi_sswaptran.F90 base/internals/psi_zswapdata.F90 base/internals/psi_zswaptran.F90 base/internals/srtlist.f base/modules/psb_base_mat_mod.f03 base/modules/psb_c_tools_mod.f90 base/modules/psb_const_mod.F90 base/modules/psb_d_tools_mod.f90 base/modules/psb_desc_type.f90 base/modules/psb_error_impl.F90 base/modules/psb_error_mod.F90 base/modules/psb_gps_mod.f90 base/modules/psb_hash_mod.f90 base/modules/psb_realloc_mod.F90 base/modules/psb_s_tools_mod.f90 base/modules/psb_z_tools_mod.f90 base/modules/psi_comm_buffers_mod.F90 base/modules/psi_p2p_mod.F90 base/modules/psi_penv_mod.F90 base/psblas/psb_sxdot.f90 base/serial/aux/dasrx.f90 base/serial/aux/dmsr.f90 base/serial/aux/dmsrx.f90 base/serial/aux/zamsr.f90 base/serial/f03/psb_c_coo_impl.f03 base/serial/f03/psb_c_mat_impl.f03 base/serial/f03/psb_d_coo_impl.f03 base/serial/f03/psb_d_mat_impl.f03 base/serial/f03/psb_s_coo_impl.f03 base/serial/f03/psb_s_mat_impl.f03 base/serial/f03/psb_z_coo_impl.f03 base/serial/f03/psb_z_mat_impl.f03 base/serial/f77/smmp.f base/serial/psb_cnumbmm.f90 base/serial/psb_crwextd.f90 base/serial/psb_csymbmm.f90 base/serial/psb_dnumbmm.f90 base/serial/psb_drwextd.f90 base/serial/psb_dsymbmm.f90 base/serial/psb_snumbmm.f90 base/serial/psb_sort_impl.f90 base/serial/psb_srwextd.f90 base/serial/psb_ssymbmm.f90 base/serial/psb_znumbmm.f90 base/serial/psb_zrwextd.f90 base/serial/psb_zsymbmm.f90 base/serial/psi_impl.f90 base/tools/psb_ccdbldext.F90 base/tools/psb_cd_inloc.f90 base/tools/psb_cd_set_bld.f90 base/tools/psb_cdins.f90 base/tools/psb_cspins.f90 base/tools/psb_dcdbldext.F90 base/tools/psb_dspins.f90 base/tools/psb_glob_to_loc.f90 base/tools/psb_linmap.f90 base/tools/psb_loc_to_glob.f90 base/tools/psb_map.f90 base/tools/psb_scdbldext.F90 base/tools/psb_sspins.f90 base/tools/psb_zcdbldext.F90 base/tools/psb_zspins.f90 config/pac.m4 configure.ac configure krylov/psb_base_inner_krylov_mod.f90 krylov/psb_ckrylov.f90 krylov/psb_dkrylov.f90 krylov/psb_skrylov.f90 krylov/psb_zkrylov.f90 prec/psb_c_bjacprec.f03 prec/psb_cilu_fct.f90 prec/psb_cprecinit.f90 prec/psb_d_bjacprec.f03 prec/psb_dilu_fct.f90 prec/psb_dprecinit.f90 prec/psb_prec_const_mod.f03 prec/psb_s_bjacprec.f03 prec/psb_silu_fct.f90 prec/psb_sprecinit.f90 prec/psb_z_bjacprec.f03 prec/psb_zilu_fct.f90 prec/psb_zprecinit.f90 test/fileread/cf_sample.f90 test/fileread/df_sample.f90 test/fileread/getp.f90 test/fileread/sf_sample.f90 test/fileread/zf_sample.f90 test/pargen/ppde.f90 test/pargen/spde.f90 test/serial/d_coo_matgen.f03 test/serial/d_matgen.f03 test/torture/psbtf.f90 util/psb_hbio_impl.f90 util/psb_mat_dist_impl.f90 util/psb_metispart_mod.F90 util/psb_mmio_impl.f90 I/O changes with ISO_FORTRAN_ENV psb_XXX_unit & friends.
15 years ago
write(psb_err_unit,*) 'SP_ALLGATHER: Not implemented yet with keepnum ',keepnum_
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_errpush(info,name)
call psb_erractionrestore(err_act)
if (err_act.eq.psb_act_abort_) then
call psb_error()
return
end if
return
end subroutine psb_dsp_allgather