Merge branch 'unify_aggr_bld' into development
commit
1493be1de6
@ -0,0 +1,215 @@
|
|||||||
|
!
|
||||||
|
! Parallel Sparse BLAS version 3.5
|
||||||
|
! (C) Copyright 2006-2018
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Alfredo Buttari
|
||||||
|
!
|
||||||
|
! Redistribution and use in source and binary forms, with or without
|
||||||
|
! modification, are permitted provided that the following conditions
|
||||||
|
! are met:
|
||||||
|
! 1. Redistributions of source code must retain the above copyright
|
||||||
|
! notice, this list of conditions and the following disclaimer.
|
||||||
|
! 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
! notice, this list of conditions, and the following disclaimer in the
|
||||||
|
! documentation and/or other materials provided with the distribution.
|
||||||
|
! 3. The name of the PSBLAS group or the names of its contributors may
|
||||||
|
! not be used to endorse or promote products derived from this
|
||||||
|
! software without specific written permission.
|
||||||
|
!
|
||||||
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||||
|
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
! POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
!
|
||||||
|
!
|
||||||
|
subroutine psi_i_bld_glb_dep_list(ictxt,loc_dl,length_dl,dep_list,dl_lda,info)
|
||||||
|
use psi_mod, psb_protect_name => psi_i_bld_glb_dep_list
|
||||||
|
#ifdef MPI_MOD
|
||||||
|
use mpi
|
||||||
|
#endif
|
||||||
|
use psb_penv_mod
|
||||||
|
use psb_const_mod
|
||||||
|
use psb_error_mod
|
||||||
|
use psb_desc_mod
|
||||||
|
use psb_sort_mod
|
||||||
|
implicit none
|
||||||
|
#ifdef MPI_H
|
||||||
|
include 'mpif.h'
|
||||||
|
#endif
|
||||||
|
! ....scalar parameters...
|
||||||
|
integer(psb_ipk_), intent(in) :: ictxt
|
||||||
|
integer(psb_ipk_), intent(out) :: dl_lda
|
||||||
|
integer(psb_ipk_), intent(in) :: loc_dl(:), length_dl(0:)
|
||||||
|
integer(psb_ipk_), allocatable, intent(out) :: dep_list(:,:)
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
|
|
||||||
|
! .....local arrays....
|
||||||
|
integer(psb_ipk_) :: int_err(5)
|
||||||
|
|
||||||
|
! .....local scalars...
|
||||||
|
integer(psb_ipk_) :: i, proc,j,err_act
|
||||||
|
integer(psb_ipk_) :: err
|
||||||
|
integer(psb_ipk_) :: debug_level, debug_unit
|
||||||
|
integer(psb_mpk_) :: iictxt, icomm, me, np, minfo
|
||||||
|
logical, parameter :: dist_symm_list=.false., print_dl=.false.
|
||||||
|
character name*20
|
||||||
|
name='psi_bld_glb_dep_list'
|
||||||
|
|
||||||
|
call psb_erractionsave(err_act)
|
||||||
|
debug_unit = psb_get_debug_unit()
|
||||||
|
debug_level = psb_get_debug_level()
|
||||||
|
|
||||||
|
iictxt = ictxt
|
||||||
|
info = psb_success_
|
||||||
|
|
||||||
|
call psb_info(iictxt,me,np)
|
||||||
|
|
||||||
|
|
||||||
|
dl_lda = length_dl(me)
|
||||||
|
call psb_max(iictxt, dl_lda)
|
||||||
|
|
||||||
|
if (debug_level >= psb_debug_inner_) &
|
||||||
|
& write(debug_unit,*) me,' ',trim(name),': Dep_list length ',length_dl(me),dl_lda
|
||||||
|
dl_lda = max(dl_lda,1)
|
||||||
|
allocate(dep_list(dl_lda,0:np),stat=info)
|
||||||
|
if (info /= psb_success_) then
|
||||||
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='Allocate')
|
||||||
|
goto 9999
|
||||||
|
end if
|
||||||
|
icomm = psb_get_mpi_comm(iictxt)
|
||||||
|
call mpi_allgather(loc_dl,dl_lda,psb_mpi_ipk_,&
|
||||||
|
& dep_list,dl_lda,psb_mpi_ipk_,icomm,minfo)
|
||||||
|
|
||||||
|
info = minfo
|
||||||
|
if (info /= psb_success_) then
|
||||||
|
info=psb_err_internal_error_
|
||||||
|
goto 9999
|
||||||
|
endif
|
||||||
|
if (print_dl) then
|
||||||
|
if (me == 0) then
|
||||||
|
write(0,*) ' Dep_list '
|
||||||
|
do i=0,np-1
|
||||||
|
j = length_dl(i)
|
||||||
|
write(0,*) 'Proc ',i,':',dep_list(1:j,i)
|
||||||
|
end do
|
||||||
|
flush(0)
|
||||||
|
end if
|
||||||
|
call psb_barrier(ictxt)
|
||||||
|
end if
|
||||||
|
|
||||||
|
call psb_erractionrestore(err_act)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
9999 continue
|
||||||
|
|
||||||
|
call psb_errpush(info,name,i_err=int_err)
|
||||||
|
call psb_error_handler(err_act)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
end subroutine psi_i_bld_glb_dep_list
|
||||||
|
|
||||||
|
subroutine psi_i_bld_glb_csr_dep_list(ictxt,loc_dl,length_dl,c_dep_list,dl_ptr,info)
|
||||||
|
use psi_mod, psb_protect_name => psi_i_bld_glb_csr_dep_list
|
||||||
|
#ifdef MPI_MOD
|
||||||
|
use mpi
|
||||||
|
#endif
|
||||||
|
use psb_penv_mod
|
||||||
|
use psb_const_mod
|
||||||
|
use psb_error_mod
|
||||||
|
use psb_desc_mod
|
||||||
|
use psb_sort_mod
|
||||||
|
implicit none
|
||||||
|
#ifdef MPI_H
|
||||||
|
include 'mpif.h'
|
||||||
|
#endif
|
||||||
|
! ....scalar parameters...
|
||||||
|
integer(psb_ipk_), intent(in) :: ictxt
|
||||||
|
integer(psb_ipk_), intent(in) :: loc_dl(:), length_dl(0:)
|
||||||
|
integer(psb_ipk_), allocatable, intent(out) :: c_dep_list(:), dl_ptr(:)
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
|
||||||
|
|
||||||
|
! .....local arrays....
|
||||||
|
integer(psb_ipk_) :: int_err(5)
|
||||||
|
|
||||||
|
! .....local scalars...
|
||||||
|
integer(psb_ipk_) :: i, proc,j,err_act, length, myld
|
||||||
|
integer(psb_ipk_) :: err
|
||||||
|
integer(psb_ipk_) :: debug_level, debug_unit
|
||||||
|
integer(psb_mpk_) :: iictxt, icomm, me, np, minfo
|
||||||
|
logical, parameter :: dist_symm_list=.false., print_dl=.false.
|
||||||
|
character name*20
|
||||||
|
name='psi_bld_glb_csr_dep_list'
|
||||||
|
|
||||||
|
call psb_erractionsave(err_act)
|
||||||
|
debug_unit = psb_get_debug_unit()
|
||||||
|
debug_level = psb_get_debug_level()
|
||||||
|
|
||||||
|
iictxt = ictxt
|
||||||
|
info = psb_success_
|
||||||
|
|
||||||
|
call psb_info(iictxt,me,np)
|
||||||
|
|
||||||
|
myld = length_dl(me)
|
||||||
|
length = sum(length_dl(0:np-1))
|
||||||
|
allocate(dl_ptr(0:np),stat=info)
|
||||||
|
dl_ptr(0) = 0
|
||||||
|
do i=1, np
|
||||||
|
dl_ptr(i) = dl_ptr(i-1) + length_dl(i-1)
|
||||||
|
end do
|
||||||
|
|
||||||
|
if (length /= dl_ptr(np)) then
|
||||||
|
write(0,*) me,trim(name),' Inconsistency: ',length,dl_ptr(np)
|
||||||
|
end if
|
||||||
|
if (debug_level >= psb_debug_inner_) &
|
||||||
|
& write(debug_unit,*) me,' ',trim(name),': Dep_list length ',length_dl(me)
|
||||||
|
|
||||||
|
allocate(c_dep_list(length),stat=info)
|
||||||
|
|
||||||
|
if (info /= psb_success_) then
|
||||||
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='Allocate')
|
||||||
|
goto 9999
|
||||||
|
end if
|
||||||
|
icomm = psb_get_mpi_comm(iictxt)
|
||||||
|
call mpi_allgatherv(loc_dl,myld,psb_mpi_ipk_,&
|
||||||
|
& c_dep_list,length_dl,dl_ptr,psb_mpi_ipk_,icomm,minfo)
|
||||||
|
|
||||||
|
info = minfo
|
||||||
|
if (info /= psb_success_) then
|
||||||
|
info=psb_err_internal_error_
|
||||||
|
goto 9999
|
||||||
|
endif
|
||||||
|
dl_ptr = dl_ptr + 1
|
||||||
|
if (print_dl) then
|
||||||
|
if (me == 0) then
|
||||||
|
write(0,*) ' Dep_list '
|
||||||
|
do i=0,np-1
|
||||||
|
write(0,*) 'Proc ',i,':',c_dep_list(dl_ptr(i):dl_ptr(i+1)-1)
|
||||||
|
end do
|
||||||
|
flush(0)
|
||||||
|
end if
|
||||||
|
call psb_barrier(ictxt)
|
||||||
|
end if
|
||||||
|
|
||||||
|
call psb_erractionrestore(err_act)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
9999 continue
|
||||||
|
|
||||||
|
call psb_errpush(info,name,i_err=int_err)
|
||||||
|
call psb_error_handler(err_act)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
end subroutine psi_i_bld_glb_csr_dep_list
|
@ -1,95 +0,0 @@
|
|||||||
!
|
|
||||||
! Parallel Sparse BLAS version 3.5
|
|
||||||
! (C) Copyright 2006-2018
|
|
||||||
! Salvatore Filippone
|
|
||||||
! Alfredo Buttari
|
|
||||||
!
|
|
||||||
! Redistribution and use in source and binary forms, with or without
|
|
||||||
! modification, are permitted provided that the following conditions
|
|
||||||
! are met:
|
|
||||||
! 1. Redistributions of source code must retain the above copyright
|
|
||||||
! notice, this list of conditions and the following disclaimer.
|
|
||||||
! 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
! notice, this list of conditions, and the following disclaimer in the
|
|
||||||
! documentation and/or other materials provided with the distribution.
|
|
||||||
! 3. The name of the PSBLAS group or the names of its contributors may
|
|
||||||
! not be used to endorse or promote products derived from this
|
|
||||||
! software without specific written permission.
|
|
||||||
!
|
|
||||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
|
||||||
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
! POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
!
|
|
||||||
!
|
|
||||||
!
|
|
||||||
! File: psi_dl_check.f90
|
|
||||||
!
|
|
||||||
! Subroutine: psi_dl_check
|
|
||||||
! Make sure a dependency list is symmetric, i.e. if process i depends on j
|
|
||||||
! then process j should depend on i (even if the data to be sent in one of the
|
|
||||||
! directions happens to be empty)
|
|
||||||
!
|
|
||||||
! Arguments:
|
|
||||||
! dep_list(:,:) - integer Initial dependency lists
|
|
||||||
! dl_lda - integer Allocated size of dep_list
|
|
||||||
! np - integer Total number of processes.
|
|
||||||
! length_dl(:) - integer Items in dependency lists; updated on
|
|
||||||
! exit
|
|
||||||
!
|
|
||||||
subroutine psi_i_dl_check(dep_list,dl_lda,np,length_dl)
|
|
||||||
|
|
||||||
use psi_mod, psb_protect_name => psi_i_dl_check
|
|
||||||
use psb_const_mod
|
|
||||||
use psb_desc_mod
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
integer(psb_ipk_) :: np,dl_lda,length_dl(0:np)
|
|
||||||
integer(psb_ipk_) :: dep_list(dl_lda,0:np)
|
|
||||||
! locals
|
|
||||||
integer(psb_ipk_) :: proc, proc2, i, j
|
|
||||||
|
|
||||||
|
|
||||||
! ...if j is in dep_list of process i
|
|
||||||
! and i is not in dep_list of process j
|
|
||||||
! fix it.
|
|
||||||
|
|
||||||
do proc=0,np-1
|
|
||||||
i=1
|
|
||||||
outer: do
|
|
||||||
if (i >length_dl(proc)) exit outer
|
|
||||||
proc2=dep_list(i,proc)
|
|
||||||
if ((proc2 /= -1).and.(proc2 /= proc)) then
|
|
||||||
! ...search proc in proc2's dep_list....
|
|
||||||
j=1
|
|
||||||
p2loop:do
|
|
||||||
if (j > length_dl(proc2)) exit p2loop
|
|
||||||
if (dep_list(j,proc2) == proc) exit p2loop
|
|
||||||
j=j+1
|
|
||||||
enddo p2loop
|
|
||||||
|
|
||||||
if (j > length_dl(proc2)) then
|
|
||||||
! ...add proc to proc2 s dep_list.....',proc,proc2
|
|
||||||
length_dl(proc2) = length_dl(proc2)+1
|
|
||||||
if (length_dl(proc2) > size(dep_list,1)) then
|
|
||||||
write(psb_err_unit,*)'error in dl_check', proc2,proc,&
|
|
||||||
& length_dl(proc2),'>',size(dep_list,1)
|
|
||||||
endif
|
|
||||||
dep_list(length_dl(proc2),proc2) = proc
|
|
||||||
else if (dep_list(j,proc2) /= proc) then
|
|
||||||
write(psb_err_unit,*) 'PSI_DL_CHECK This should not happen!!! ',&
|
|
||||||
& j,proc2,dep_list(j,proc2),proc
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
i=i+1
|
|
||||||
enddo outer
|
|
||||||
enddo
|
|
||||||
|
|
||||||
end subroutine psi_i_dl_check
|
|
@ -1,58 +0,0 @@
|
|||||||
!
|
|
||||||
! Parallel Sparse BLAS version 3.5
|
|
||||||
! (C) Copyright 2006, 2010, 2015, 2017
|
|
||||||
! Salvatore Filippone
|
|
||||||
! Alfredo Buttari CNRS-IRIT, Toulouse
|
|
||||||
!
|
|
||||||
! Redistribution and use in source and binary forms, with or without
|
|
||||||
! modification, are permitted provided that the following conditions
|
|
||||||
! are met:
|
|
||||||
! 1. Redistributions of source code must retain the above copyright
|
|
||||||
! notice, this list of conditions and the following disclaimer.
|
|
||||||
! 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
! notice, this list of conditions, and the following disclaimer in the
|
|
||||||
! documentation and/or other materials provided with the distribution.
|
|
||||||
! 3. The name of the PSBLAS group or the names of its contributors may
|
|
||||||
! not be used to endorse or promote products derived from this
|
|
||||||
! software without specific written permission.
|
|
||||||
!
|
|
||||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
|
||||||
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
! POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
!
|
|
||||||
!
|
|
||||||
integer function psi_list_search(list,lenght_list,elem)
|
|
||||||
use psb_const_mod
|
|
||||||
implicit none
|
|
||||||
!returns position of elem in a array list
|
|
||||||
!of lenght lenght_list, if this element does not exist
|
|
||||||
!returns -1
|
|
||||||
integer(psb_ipk_) :: list(*)
|
|
||||||
integer(psb_ipk_) :: lenght_list
|
|
||||||
integer(psb_ipk_) :: elem
|
|
||||||
|
|
||||||
integer(psb_ipk_) :: i
|
|
||||||
|
|
||||||
i=1
|
|
||||||
do while ((i.le.lenght_list).and.(list(i).ne.elem))
|
|
||||||
i=i+1
|
|
||||||
enddo
|
|
||||||
if (i.le.lenght_list) then
|
|
||||||
if (list(i).eq.elem) then
|
|
||||||
psi_list_search=i
|
|
||||||
else
|
|
||||||
psi_list_search=-1
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
psi_list_search=-1
|
|
||||||
endif
|
|
||||||
end function psi_list_search
|
|
||||||
|
|
@ -0,0 +1,230 @@
|
|||||||
|
!
|
||||||
|
! Parallel Sparse BLAS version 3.5
|
||||||
|
! (C) Copyright 2006-2018
|
||||||
|
! Salvatore Filippone
|
||||||
|
! Alfredo Buttari
|
||||||
|
!
|
||||||
|
! Redistribution and use in source and binary forms, with or without
|
||||||
|
! modification, are permitted provided that the following conditions
|
||||||
|
! are met:
|
||||||
|
! 1. Redistributions of source code must retain the above copyright
|
||||||
|
! notice, this list of conditions and the following disclaimer.
|
||||||
|
! 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
! notice, this list of conditions, and the following disclaimer in the
|
||||||
|
! documentation and/or other materials provided with the distribution.
|
||||||
|
! 3. The name of the PSBLAS group or the names of its contributors may
|
||||||
|
! not be used to endorse or promote products derived from this
|
||||||
|
! software without specific written permission.
|
||||||
|
!
|
||||||
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||||
|
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
! POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
!
|
||||||
|
!
|
||||||
|
subroutine psi_i_xtr_loc_dl(ictxt,is_bld,is_upd,desc_str,loc_dl,length_dl,info)
|
||||||
|
|
||||||
|
! internal routine
|
||||||
|
! == = =============
|
||||||
|
!
|
||||||
|
! _____called by psi_crea_halo and psi_crea_ovrlap ______
|
||||||
|
!
|
||||||
|
! purpose
|
||||||
|
! == = ====
|
||||||
|
! process root (pid=0) extracts for each process "k" the ordered list of process
|
||||||
|
! to which "k" must communicate. this list with its order is extracted from
|
||||||
|
! desc_str list
|
||||||
|
!
|
||||||
|
!
|
||||||
|
! input
|
||||||
|
! == = ====
|
||||||
|
! desc_data :integer array
|
||||||
|
! explanation:
|
||||||
|
! name explanation
|
||||||
|
! ------------------ -------------------------------------------------------
|
||||||
|
! desc_data array of integer that contains some local and global
|
||||||
|
! information of matrix.
|
||||||
|
!
|
||||||
|
!
|
||||||
|
! now we explain each of the above vectors.
|
||||||
|
!
|
||||||
|
! let a be a generic sparse matrix. we denote with matdata_a the matrix_data
|
||||||
|
! array for matrix a.
|
||||||
|
! data stored in matrix_data array are:
|
||||||
|
!
|
||||||
|
! notation stored in explanation
|
||||||
|
! --------------- ---------------------- -------------------------------------
|
||||||
|
! dec_type matdata_a[psb_dec_type_] decomposition type
|
||||||
|
! m matdata_a[m_] total number of equations
|
||||||
|
! n matdata_a[n_] total number of variables
|
||||||
|
! n_row matdata_a[psb_n_row_] number of local equations
|
||||||
|
! n_col matdata_a[psb_n_col_] number of local variables
|
||||||
|
! psb_ctxt_a matdata_a[ctxt_] the blacs context handle, indicating
|
||||||
|
! the global context of the operation
|
||||||
|
! on the matrix.
|
||||||
|
! the context itself is global.
|
||||||
|
! desc_str integer array
|
||||||
|
! explanation:
|
||||||
|
! let desc_str_p be the array desc_str for local process.
|
||||||
|
!! this is composed of variable dimension blocks for each process to
|
||||||
|
! communicate to.
|
||||||
|
! each block contain indexes of local halo elements to exchange with other
|
||||||
|
! process.
|
||||||
|
! let p be the pointer to the first element of a block in desc_str_p.
|
||||||
|
! this block is stored in desc_str_p as :
|
||||||
|
!
|
||||||
|
! notation stored in explanation
|
||||||
|
! --------------- --------------------------- -----------------------------------
|
||||||
|
! process_id desc_str_p[p+psb_proc_id_] identifier of process which exchange
|
||||||
|
! data with.
|
||||||
|
! n_elements_recv desc_str_p[p+n_elem_recv_] number of elements to receive.
|
||||||
|
! elements_recv desc_str_p[p+elem_recv_+i] indexes of local elements to
|
||||||
|
! receive. these are stored in the
|
||||||
|
! array from location p+elem_recv_ to
|
||||||
|
! location p+elem_recv_+
|
||||||
|
! desc_str_p[p+n_elem_recv_]-1.
|
||||||
|
! if desc_data(psb_dec_type_) == 0
|
||||||
|
! then also will be:
|
||||||
|
! n_elements_send desc_str_p[p+n_elem_send_] number of elements to send.
|
||||||
|
! elements_send desc_str_p[p+elem_send_+i] indexes of local elements to
|
||||||
|
! send. these are stored in the
|
||||||
|
! array from location p+elem_send_ to
|
||||||
|
! location p+elem_send_+
|
||||||
|
! desc_str_p[p+n_elem_send_]-1.
|
||||||
|
! list is ended by -1 value
|
||||||
|
!
|
||||||
|
! np integer (global input)
|
||||||
|
! number of grid process.
|
||||||
|
!
|
||||||
|
! output
|
||||||
|
! == = ==
|
||||||
|
! loc_dl integer array(:)
|
||||||
|
! dependence list of current process
|
||||||
|
!
|
||||||
|
use psi_mod, psb_protect_name => psi_i_xtr_loc_dl
|
||||||
|
#ifdef MPI_MOD
|
||||||
|
use mpi
|
||||||
|
#endif
|
||||||
|
use psb_penv_mod
|
||||||
|
use psb_const_mod
|
||||||
|
use psb_error_mod
|
||||||
|
use psb_desc_mod
|
||||||
|
use psb_sort_mod
|
||||||
|
implicit none
|
||||||
|
#ifdef MPI_H
|
||||||
|
include 'mpif.h'
|
||||||
|
#endif
|
||||||
|
! ....scalar parameters...
|
||||||
|
logical, intent(in) :: is_bld, is_upd
|
||||||
|
integer(psb_ipk_), intent(in) :: ictxt
|
||||||
|
integer(psb_ipk_), intent(in) :: desc_str(:)
|
||||||
|
integer(psb_ipk_), allocatable, intent(out) :: loc_dl(:), length_dl(:)
|
||||||
|
integer(psb_ipk_), intent(out) :: info
|
||||||
|
! .....local arrays....
|
||||||
|
integer(psb_ipk_) :: int_err(5)
|
||||||
|
|
||||||
|
! .....local scalars...
|
||||||
|
integer(psb_ipk_) :: i,pdl,proc,j,err_act, ldu
|
||||||
|
integer(psb_ipk_) :: err
|
||||||
|
integer(psb_ipk_) :: debug_level, debug_unit
|
||||||
|
integer(psb_mpk_) :: iictxt, icomm, me, np, minfo
|
||||||
|
logical, parameter :: dist_symm_list=.true., print_dl=.false., profile=.true.
|
||||||
|
character name*20
|
||||||
|
name='psi_extrct_dl'
|
||||||
|
|
||||||
|
call psb_erractionsave(err_act)
|
||||||
|
debug_unit = psb_get_debug_unit()
|
||||||
|
debug_level = psb_get_debug_level()
|
||||||
|
iictxt = ictxt
|
||||||
|
info = psb_success_
|
||||||
|
|
||||||
|
call psb_info(iictxt,me,np)
|
||||||
|
pdl = size(desc_str)
|
||||||
|
allocate(loc_dl(pdl+1),length_dl(0:np),stat=info)
|
||||||
|
if (info /= psb_success_) then
|
||||||
|
info=psb_err_alloc_dealloc_
|
||||||
|
goto 9999
|
||||||
|
end if
|
||||||
|
|
||||||
|
if (debug_level >= psb_debug_inner_)&
|
||||||
|
& write(debug_unit,*) me,' ',trim(name),': start ',info
|
||||||
|
|
||||||
|
loc_dl = -1
|
||||||
|
i = 1
|
||||||
|
pdl = 0
|
||||||
|
if (is_bld) then
|
||||||
|
do while (desc_str(i) /= -1)
|
||||||
|
if (debug_level >= psb_debug_inner_)&
|
||||||
|
& write(debug_unit,*) me,' ',trim(name),' : looping ',i,&
|
||||||
|
& desc_str(i),desc_str(i+1),desc_str(i+2)
|
||||||
|
|
||||||
|
! ...with different decomposition type we have different
|
||||||
|
! structure of indices lists............................
|
||||||
|
if ((desc_str(i+1) /= 0).or.(desc_str(i+2) /= 0)) then
|
||||||
|
! ..if number of element to be exchanged !=0
|
||||||
|
proc=desc_str(i)
|
||||||
|
if ((proc < 0).or.(proc >= np)) then
|
||||||
|
if (debug_level >= psb_debug_inner_)&
|
||||||
|
& write(debug_unit,*) me,' ',trim(name),': error ',i,desc_str(i)
|
||||||
|
info = 9999
|
||||||
|
int_err(1) = i
|
||||||
|
int_err(2) = desc_str(i)
|
||||||
|
goto 9999
|
||||||
|
endif
|
||||||
|
! if((me == 1).and.(proc == 3))write(psb_err_unit,*)'found 3'
|
||||||
|
pdl=pdl+1
|
||||||
|
loc_dl(pdl)=proc
|
||||||
|
endif
|
||||||
|
i=i+desc_str(i+1)+2
|
||||||
|
enddo
|
||||||
|
|
||||||
|
else if (is_upd) then
|
||||||
|
|
||||||
|
do while (desc_str(i) /= -1)
|
||||||
|
if (debug_level >= psb_debug_inner_) &
|
||||||
|
& write(debug_unit,*) me,' ',trim(name),': looping ',i,desc_str(i)
|
||||||
|
|
||||||
|
! ...with different decomposition type we have different
|
||||||
|
! structure of indices lists............................
|
||||||
|
if (desc_str(i+1) /= 0) then
|
||||||
|
|
||||||
|
proc=desc_str(i)
|
||||||
|
! ..if number of element to be exchanged !=0
|
||||||
|
pdl=pdl+1
|
||||||
|
loc_dl(pdl)=proc
|
||||||
|
endif
|
||||||
|
i=i+desc_str(i+1)+2
|
||||||
|
enddo
|
||||||
|
|
||||||
|
else
|
||||||
|
info = 2020
|
||||||
|
goto 9999
|
||||||
|
endif
|
||||||
|
call psb_msort_unique(loc_dl(1:pdl),ldu)
|
||||||
|
pdl = ldu
|
||||||
|
call psb_realloc(pdl,loc_dl,info)
|
||||||
|
call psi_symm_dep_list(loc_dl,ictxt,info)
|
||||||
|
pdl = size(loc_dl)
|
||||||
|
length_dl = 0
|
||||||
|
length_dl(me) = pdl
|
||||||
|
call psb_sum(ictxt,length_dl)
|
||||||
|
|
||||||
|
call psb_erractionrestore(err_act)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
9999 continue
|
||||||
|
|
||||||
|
call psb_errpush(info,name,i_err=int_err)
|
||||||
|
call psb_error_handler(err_act)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
end subroutine psi_i_xtr_loc_dl
|
Loading…
Reference in New Issue