mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-16 19:02:09 +00:00
New files for 2-bytes integer support. To be compiled and tested.
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
!
|
||||
! 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.
|
||||
!
|
||||
!
|
||||
!
|
||||
! Sorting routines
|
||||
! References:
|
||||
! D. Knuth
|
||||
! The Art of Computer Programming, vol. 3
|
||||
! Addison-Wesley
|
||||
!
|
||||
! Aho, Hopcroft, Ullman
|
||||
! Data Structures and Algorithms
|
||||
! Addison-Wesley
|
||||
!
|
||||
module psb_i2_hsort_mod
|
||||
use psb_const_mod
|
||||
|
||||
interface psb_hsort
|
||||
subroutine psb_i2hsort(x,ix,dir,flag)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), optional, intent(in) :: dir, flag
|
||||
integer(psb_ipk_), optional, intent(inout) :: ix(:)
|
||||
end subroutine psb_i2hsort
|
||||
end interface psb_hsort
|
||||
|
||||
|
||||
interface psi_insert_heap
|
||||
subroutine psi_i2_insert_heap(key,last,heap,dir,info)
|
||||
import
|
||||
implicit none
|
||||
|
||||
!
|
||||
! Input:
|
||||
! key: the new value
|
||||
! last: pointer to the last occupied element in heap
|
||||
! heap: the heap
|
||||
! dir: sorting direction
|
||||
|
||||
integer(psb_i2pk_), intent(in) :: key
|
||||
integer(psb_i2pk_), intent(inout) :: heap(:)
|
||||
integer(psb_ipk_), intent(in) :: dir
|
||||
integer(psb_ipk_), intent(inout) :: last
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psi_i2_insert_heap
|
||||
end interface psi_insert_heap
|
||||
|
||||
interface psi_idx_insert_heap
|
||||
subroutine psi_i2_idx_insert_heap(key,index,last,heap,idxs,dir,info)
|
||||
import
|
||||
implicit none
|
||||
|
||||
!
|
||||
! Input:
|
||||
! key: the new value
|
||||
! last: pointer to the last occupied element in heap
|
||||
! heap: the heap
|
||||
! dir: sorting direction
|
||||
|
||||
integer(psb_i2pk_), intent(in) :: key
|
||||
integer(psb_i2pk_), intent(inout) :: heap(:)
|
||||
integer(psb_ipk_), intent(in) :: index
|
||||
integer(psb_ipk_), intent(in) :: dir
|
||||
integer(psb_ipk_), intent(inout) :: idxs(:)
|
||||
integer(psb_ipk_), intent(inout) :: last
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psi_i2_idx_insert_heap
|
||||
end interface psi_idx_insert_heap
|
||||
|
||||
|
||||
interface psi_heap_get_first
|
||||
subroutine psi_i2_heap_get_first(key,last,heap,dir,info)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_), intent(inout) :: key
|
||||
integer(psb_ipk_), intent(inout) :: last
|
||||
integer(psb_ipk_), intent(in) :: dir
|
||||
integer(psb_i2pk_), intent(inout) :: heap(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psi_i2_heap_get_first
|
||||
end interface psi_heap_get_first
|
||||
|
||||
interface psi_idx_heap_get_first
|
||||
subroutine psi_i2_idx_heap_get_first(key,index,last,heap,idxs,dir,info)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: key
|
||||
integer(psb_ipk_), intent(out) :: index
|
||||
integer(psb_i2pk_), intent(inout) :: heap(:)
|
||||
integer(psb_ipk_), intent(in) :: dir
|
||||
integer(psb_ipk_), intent(inout) :: last
|
||||
integer(psb_ipk_), intent(inout) :: idxs(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psi_i2_idx_heap_get_first
|
||||
end interface psi_idx_heap_get_first
|
||||
|
||||
|
||||
end module psb_i2_hsort_mod
|
||||
@@ -0,0 +1,320 @@
|
||||
!
|
||||
! 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.
|
||||
!
|
||||
!
|
||||
!
|
||||
! Reorder (an) input vector(s) based on a list sort output.
|
||||
! Based on: D. E. Knuth: The Art of Computer Programming
|
||||
! vol. 3: Sorting and Searching, Addison Wesley, 1973
|
||||
! ex. 5.2.12
|
||||
!
|
||||
!
|
||||
module psb_i2_ip_reord_mod
|
||||
use psb_const_mod
|
||||
|
||||
interface psb_ip_reord
|
||||
module procedure psb_ip_reord_i21m,&
|
||||
& psb_ip_reord_i21m1, psb_ip_reord_i21m2,&
|
||||
& psb_ip_reord_i21m3
|
||||
module procedure psb_ip_reord_i21e,&
|
||||
& psb_ip_reord_i21e1, psb_ip_reord_i21e2,&
|
||||
& psb_ip_reord_i21e3
|
||||
|
||||
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine psb_ip_reord_i21m(n,x,iaux)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
integer(psb_mpk_) :: iaux(0:*)
|
||||
integer(psb_i2pk_) :: x(*)
|
||||
integer(psb_mpk_) :: lswap, lp, k
|
||||
integer(psb_i2pk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp == 0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_i21m
|
||||
|
||||
subroutine psb_ip_reord_i21m1(n,x,indx,iaux)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
integer(psb_mpk_) :: iaux(0:*)
|
||||
integer(psb_i2pk_) :: x(*)
|
||||
integer(psb_mpk_) :: indx(*)
|
||||
integer(psb_mpk_) :: lswap, lp, k, ixswap
|
||||
integer(psb_i2pk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp == 0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
ixswap = indx(lp)
|
||||
indx(lp) = indx(k)
|
||||
indx(k) = ixswap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_i21m1
|
||||
|
||||
subroutine psb_ip_reord_i21m2(n,x,i1,i2,iaux)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
integer(psb_mpk_) :: iaux(0:*)
|
||||
integer(psb_i2pk_) :: x(*)
|
||||
integer(psb_mpk_) :: i1(*), i2(*)
|
||||
|
||||
|
||||
integer(psb_mpk_) :: lswap, lp, k, isw1, isw2
|
||||
integer(psb_i2pk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp == 0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
isw1 = i1(lp)
|
||||
i1(lp) = i1(k)
|
||||
i1(k) = isw1
|
||||
isw2 = i2(lp)
|
||||
i2(lp) = i2(k)
|
||||
i2(k) = isw2
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_i21m2
|
||||
|
||||
subroutine psb_ip_reord_i21m3(n,x,i1,i2,i3,iaux)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
integer(psb_mpk_) :: iaux(0:*)
|
||||
integer(psb_i2pk_) :: x(*)
|
||||
integer(psb_mpk_) :: i1(*), i2(*), i3(*)
|
||||
|
||||
integer(psb_mpk_) :: lswap, lp, k, isw1, isw2, isw3
|
||||
integer(psb_i2pk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp == 0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
isw1 = i1(lp)
|
||||
i1(lp) = i1(k)
|
||||
i1(k) = isw1
|
||||
isw2 = i2(lp)
|
||||
i2(lp) = i2(k)
|
||||
i2(k) = isw2
|
||||
isw3 = i3(lp)
|
||||
i3(lp) = i3(k)
|
||||
i3(k) = isw3
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_i21m3
|
||||
|
||||
|
||||
subroutine psb_ip_reord_i21e(n,x,iaux)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
integer(psb_epk_) :: iaux(0:*)
|
||||
integer(psb_i2pk_) :: x(*)
|
||||
integer(psb_epk_) :: lswap, lp, k
|
||||
integer(psb_i2pk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp == 0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_i21e
|
||||
|
||||
subroutine psb_ip_reord_i21e1(n,x,indx,iaux)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
integer(psb_epk_) :: iaux(0:*)
|
||||
integer(psb_i2pk_) :: x(*)
|
||||
integer(psb_epk_) :: indx(*)
|
||||
integer(psb_epk_) :: lswap, lp, k, ixswap
|
||||
integer(psb_i2pk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp == 0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
ixswap = indx(lp)
|
||||
indx(lp) = indx(k)
|
||||
indx(k) = ixswap
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_i21e1
|
||||
|
||||
subroutine psb_ip_reord_i21e2(n,x,i1,i2,iaux)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
integer(psb_epk_) :: iaux(0:*)
|
||||
integer(psb_i2pk_) :: x(*)
|
||||
integer(psb_epk_) :: i1(*), i2(*)
|
||||
|
||||
|
||||
integer(psb_epk_) :: lswap, lp, k, isw1, isw2
|
||||
integer(psb_i2pk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp == 0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
isw1 = i1(lp)
|
||||
i1(lp) = i1(k)
|
||||
i1(k) = isw1
|
||||
isw2 = i2(lp)
|
||||
i2(lp) = i2(k)
|
||||
i2(k) = isw2
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_i21e2
|
||||
|
||||
subroutine psb_ip_reord_i21e3(n,x,i1,i2,i3,iaux)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
integer(psb_epk_) :: iaux(0:*)
|
||||
integer(psb_i2pk_) :: x(*)
|
||||
integer(psb_epk_) :: i1(*), i2(*), i3(*)
|
||||
|
||||
integer(psb_epk_) :: lswap, lp, k, isw1, isw2, isw3
|
||||
integer(psb_i2pk_) :: swap
|
||||
|
||||
lp = iaux(0)
|
||||
k = 1
|
||||
do
|
||||
if ((lp == 0).or.(k>n)) exit
|
||||
do
|
||||
if (lp >= k) exit
|
||||
lp = iaux(lp)
|
||||
end do
|
||||
swap = x(lp)
|
||||
x(lp) = x(k)
|
||||
x(k) = swap
|
||||
isw1 = i1(lp)
|
||||
i1(lp) = i1(k)
|
||||
i1(k) = isw1
|
||||
isw2 = i2(lp)
|
||||
i2(lp) = i2(k)
|
||||
i2(k) = isw2
|
||||
isw3 = i3(lp)
|
||||
i3(lp) = i3(k)
|
||||
i3(k) = isw3
|
||||
lswap = iaux(lp)
|
||||
iaux(lp) = iaux(k)
|
||||
iaux(k) = lp
|
||||
lp = lswap
|
||||
k = k + 1
|
||||
enddo
|
||||
return
|
||||
end subroutine psb_ip_reord_i21e3
|
||||
|
||||
end module psb_i2_ip_reord_mod
|
||||
@@ -0,0 +1,105 @@
|
||||
!
|
||||
! 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.
|
||||
!
|
||||
!
|
||||
!
|
||||
! Sorting routines
|
||||
! References:
|
||||
! D. Knuth
|
||||
! The Art of Computer Programming, vol. 3
|
||||
! Addison-Wesley
|
||||
!
|
||||
! Aho, Hopcroft, Ullman
|
||||
! Data Structures and Algorithms
|
||||
! Addison-Wesley
|
||||
!
|
||||
module psb_i2_isort_mod
|
||||
use psb_const_mod
|
||||
|
||||
interface psb_isort
|
||||
subroutine psb_i2isort(x,ix,dir,flag)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), optional, intent(in) :: dir, flag
|
||||
integer(psb_ipk_), optional, intent(inout) :: ix(:)
|
||||
end subroutine psb_i2isort
|
||||
end interface psb_isort
|
||||
|
||||
|
||||
|
||||
interface
|
||||
subroutine psi_i2isrx_up(n,x,ix)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(inout) :: ix(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2isrx_up
|
||||
subroutine psi_i2isrx_dw(n,x,ix)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(inout) :: ix(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2isrx_dw
|
||||
subroutine psi_i2isr_up(n,x)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2isr_up
|
||||
subroutine psi_i2isr_dw(n,x)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2isr_dw
|
||||
subroutine psi_i2aisrx_up(n,x,ix)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(inout) :: ix(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2aisrx_up
|
||||
subroutine psi_i2aisrx_dw(n,x,ix)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(inout) :: ix(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2aisrx_dw
|
||||
subroutine psi_i2aisr_up(n,x)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2aisr_up
|
||||
subroutine psi_i2aisr_dw(n,x)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2aisr_dw
|
||||
end interface
|
||||
|
||||
|
||||
end module psb_i2_isort_mod
|
||||
@@ -0,0 +1,111 @@
|
||||
!
|
||||
! 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.
|
||||
!
|
||||
!
|
||||
!
|
||||
! Sorting routines
|
||||
! References:
|
||||
! D. Knuth
|
||||
! The Art of Computer Programming, vol. 3
|
||||
! Addison-Wesley
|
||||
!
|
||||
! Aho, Hopcroft, Ullman
|
||||
! Data Structures and Algorithms
|
||||
! Addison-Wesley
|
||||
!
|
||||
module psb_i2_msort_mod
|
||||
use psb_const_mod
|
||||
|
||||
interface psb_isaperm
|
||||
logical function psb_i2isaperm(n,eip)
|
||||
import
|
||||
integer(psb_i2pk_), intent(in) :: n
|
||||
integer(psb_i2pk_), intent(in) :: eip(n)
|
||||
end function psb_i2isaperm
|
||||
end interface psb_isaperm
|
||||
|
||||
interface psb_msort_unique
|
||||
subroutine psb_i2msort_u(x,nout,dir)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(out) :: nout
|
||||
integer(psb_ipk_), optional, intent(in) :: dir
|
||||
end subroutine psb_i2msort_u
|
||||
end interface psb_msort_unique
|
||||
|
||||
|
||||
interface psb_msort
|
||||
subroutine psb_i2msort(x,ix,dir,flag)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), optional, intent(in) :: dir, flag
|
||||
integer(psb_ipk_), optional, intent(inout) :: ix(:)
|
||||
end subroutine psb_i2msort
|
||||
end interface psb_msort
|
||||
|
||||
|
||||
interface psi_msort_up
|
||||
subroutine psi_i2_msort_up(n,k,l,iret)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_ipk_) :: n, iret
|
||||
integer(psb_i2pk_) :: k(n)
|
||||
integer(psb_ipk_) :: l(0:n+1)
|
||||
end subroutine psi_i2_msort_up
|
||||
end interface psi_msort_up
|
||||
interface psi_msort_dw
|
||||
subroutine psi_i2_msort_dw(n,k,l,iret)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_ipk_) :: n, iret
|
||||
integer(psb_i2pk_) :: k(n)
|
||||
integer(psb_ipk_) :: l(0:n+1)
|
||||
end subroutine psi_i2_msort_dw
|
||||
end interface psi_msort_dw
|
||||
interface psi_amsort_up
|
||||
subroutine psi_i2_amsort_up(n,k,l,iret)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_ipk_) :: n, iret
|
||||
integer(psb_i2pk_) :: k(n)
|
||||
integer(psb_ipk_) :: l(0:n+1)
|
||||
end subroutine psi_i2_amsort_up
|
||||
end interface psi_amsort_up
|
||||
interface psi_amsort_dw
|
||||
subroutine psi_i2_amsort_dw(n,k,l,iret)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_ipk_) :: n, iret
|
||||
integer(psb_i2pk_) :: k(n)
|
||||
integer(psb_ipk_) :: l(0:n+1)
|
||||
end subroutine psi_i2_amsort_dw
|
||||
end interface psi_amsort_dw
|
||||
|
||||
end module psb_i2_msort_mod
|
||||
@@ -0,0 +1,123 @@
|
||||
!
|
||||
! 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.
|
||||
!
|
||||
!
|
||||
!
|
||||
! Sorting routines
|
||||
! References:
|
||||
! D. Knuth
|
||||
! The Art of Computer Programming, vol. 3
|
||||
! Addison-Wesley
|
||||
!
|
||||
! Aho, Hopcroft, Ullman
|
||||
! Data Structures and Algorithms
|
||||
! Addison-Wesley
|
||||
!
|
||||
module psb_i2_qsort_mod
|
||||
use psb_const_mod
|
||||
|
||||
|
||||
|
||||
interface psb_bsrch
|
||||
function psb_i2bsrch(key,n,v) result(ipos)
|
||||
import
|
||||
integer(psb_ipk_) :: ipos, n
|
||||
integer(psb_i2pk_) :: key
|
||||
integer(psb_i2pk_) :: v(:)
|
||||
end function psb_i2bsrch
|
||||
end interface psb_bsrch
|
||||
|
||||
interface psb_ssrch
|
||||
function psb_i2ssrch(key,n,v) result(ipos)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_ipk_) :: ipos, n
|
||||
integer(psb_i2pk_) :: key
|
||||
integer(psb_i2pk_) :: v(:)
|
||||
end function psb_i2ssrch
|
||||
end interface psb_ssrch
|
||||
|
||||
interface psb_qsort
|
||||
subroutine psb_i2qsort(x,ix,dir,flag)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), optional, intent(in) :: dir, flag
|
||||
integer(psb_ipk_), optional, intent(inout) :: ix(:)
|
||||
end subroutine psb_i2qsort
|
||||
end interface psb_qsort
|
||||
|
||||
interface
|
||||
subroutine psi_i2qsrx_up(n,x,ix)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(inout) :: ix(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2qsrx_up
|
||||
subroutine psi_i2qsrx_dw(n,x,ix)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(inout) :: ix(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2qsrx_dw
|
||||
subroutine psi_i2qsr_up(n,x)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2qsr_up
|
||||
subroutine psi_i2qsr_dw(n,x)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2qsr_dw
|
||||
subroutine psi_i2aqsrx_up(n,x,ix)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(inout) :: ix(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2aqsrx_up
|
||||
subroutine psi_i2aqsrx_dw(n,x,ix)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(inout) :: ix(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2aqsrx_dw
|
||||
subroutine psi_i2aqsr_up(n,x)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2aqsr_up
|
||||
subroutine psi_i2aqsr_dw(n,x)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(in) :: n
|
||||
end subroutine psi_i2aqsr_dw
|
||||
end interface
|
||||
|
||||
end module psb_i2_qsort_mod
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,133 @@
|
||||
!
|
||||
! 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.
|
||||
!
|
||||
!
|
||||
module psi_i2_serial_mod
|
||||
use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_
|
||||
|
||||
interface psb_gelp
|
||||
! 2-D version
|
||||
subroutine psb_i2gelp(trans,iperm,x,info)
|
||||
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
|
||||
implicit none
|
||||
integer(psb_i2pk_), intent(inout) :: x(:,:)
|
||||
integer(psb_ipk_), intent(in) :: iperm(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in) :: trans
|
||||
end subroutine psb_i2gelp
|
||||
subroutine psb_i2gelpv(trans,iperm,x,info)
|
||||
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
|
||||
implicit none
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(in) :: iperm(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in) :: trans
|
||||
end subroutine psb_i2gelpv
|
||||
end interface psb_gelp
|
||||
|
||||
interface psb_geaxpby
|
||||
subroutine psi_i2axpby(m,n,alpha, x, beta, y, info)
|
||||
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
|
||||
implicit none
|
||||
integer(psb_ipk_), intent(in) :: m, n
|
||||
integer(psb_i2pk_), intent (in) :: x(:,:)
|
||||
integer(psb_i2pk_), intent (inout) :: y(:,:)
|
||||
integer(psb_i2pk_), intent (in) :: alpha, beta
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psi_i2axpby
|
||||
subroutine psi_i2axpbyv(m,alpha, x, beta, y, info)
|
||||
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
|
||||
implicit none
|
||||
integer(psb_ipk_), intent(in) :: m
|
||||
integer(psb_i2pk_), intent (in) :: x(:)
|
||||
integer(psb_i2pk_), intent (inout) :: y(:)
|
||||
integer(psb_i2pk_), intent (in) :: alpha, beta
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psi_i2axpbyv
|
||||
end interface psb_geaxpby
|
||||
|
||||
interface psi_gth
|
||||
subroutine psi_i2gthmv(n,k,idx,alpha,x,beta,y)
|
||||
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
|
||||
implicit none
|
||||
integer(psb_ipk_) :: n, k, idx(:)
|
||||
integer(psb_i2pk_) :: x(:,:), y(:),alpha,beta
|
||||
end subroutine psi_i2gthmv
|
||||
subroutine psi_i2gthv(n,idx,alpha,x,beta,y)
|
||||
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
|
||||
implicit none
|
||||
integer(psb_ipk_) :: n, idx(:)
|
||||
integer(psb_i2pk_) :: x(:), y(:),alpha,beta
|
||||
end subroutine psi_i2gthv
|
||||
subroutine psi_i2gthzmv(n,k,idx,x,y)
|
||||
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
|
||||
implicit none
|
||||
integer(psb_ipk_) :: n, k, idx(:)
|
||||
integer(psb_i2pk_) :: x(:,:), y(:)
|
||||
|
||||
end subroutine psi_i2gthzmv
|
||||
subroutine psi_i2gthzmm(n,k,idx,x,y)
|
||||
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
|
||||
implicit none
|
||||
integer(psb_ipk_) :: n, k, idx(:)
|
||||
integer(psb_i2pk_) :: x(:,:), y(:,:)
|
||||
|
||||
end subroutine psi_i2gthzmm
|
||||
subroutine psi_i2gthzv(n,idx,x,y)
|
||||
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
|
||||
implicit none
|
||||
integer(psb_ipk_) :: n, idx(:)
|
||||
integer(psb_i2pk_) :: x(:), y(:)
|
||||
end subroutine psi_i2gthzv
|
||||
end interface psi_gth
|
||||
|
||||
interface psi_sct
|
||||
subroutine psi_i2sctmm(n,k,idx,x,beta,y)
|
||||
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
|
||||
implicit none
|
||||
integer(psb_ipk_) :: n, k, idx(:)
|
||||
integer(psb_i2pk_) :: beta, x(:,:), y(:,:)
|
||||
end subroutine psi_i2sctmm
|
||||
subroutine psi_i2sctmv(n,k,idx,x,beta,y)
|
||||
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
|
||||
implicit none
|
||||
integer(psb_ipk_) :: n, k, idx(:)
|
||||
integer(psb_i2pk_) :: beta, x(:), y(:,:)
|
||||
end subroutine psi_i2sctmv
|
||||
subroutine psi_i2sctv(n,idx,x,beta,y)
|
||||
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
|
||||
implicit none
|
||||
|
||||
integer(psb_ipk_) :: n, idx(:)
|
||||
integer(psb_i2pk_) :: beta, x(:), y(:)
|
||||
end subroutine psi_i2sctv
|
||||
end interface psi_sct
|
||||
|
||||
end module psi_i2_serial_mod
|
||||
@@ -30,7 +30,8 @@
|
||||
!
|
||||
!
|
||||
module psb_e_comm_a_mod
|
||||
use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_lpk_, psb_epk_, psb_mpk_
|
||||
use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_lpk_, &
|
||||
& psb_epk_, psb_mpk_, psb_i2pk_
|
||||
|
||||
interface psb_ovrl
|
||||
subroutine psb_eovrlm(x,desc_a,info,jx,ik,work,update,mode)
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
!
|
||||
! 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.
|
||||
!
|
||||
!
|
||||
module psb_i2_comm_a_mod
|
||||
use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_lpk_, &
|
||||
& psb_epk_, psb_mpk_, psb_i2pk_
|
||||
|
||||
interface psb_ovrl
|
||||
subroutine psb_i2ovrlm(x,desc_a,info,jx,ik,work,update,mode)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_), intent(inout), target :: x(:,:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_i2pk_), intent(inout), optional, target :: work(:)
|
||||
integer(psb_ipk_), intent(in), optional :: update,jx,ik,mode
|
||||
end subroutine psb_i2ovrlm
|
||||
subroutine psb_i2ovrlv(x,desc_a,info,work,update,mode)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_), intent(inout), target :: x(:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_i2pk_), intent(inout), optional, target :: work(:)
|
||||
integer(psb_ipk_), intent(in), optional :: update,mode
|
||||
end subroutine psb_i2ovrlv
|
||||
end interface psb_ovrl
|
||||
|
||||
interface psb_halo
|
||||
subroutine psb_i2halom(x,desc_a,info,jx,ik,work,tran,mode,data)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_), intent(inout), target :: x(:,:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_i2pk_), target, optional, intent(inout) :: work(:)
|
||||
integer(psb_ipk_), intent(in), optional :: mode,jx,ik,data
|
||||
character, intent(in), optional :: tran
|
||||
end subroutine psb_i2halom
|
||||
subroutine psb_i2halov(x,desc_a,info,work,tran,mode,data)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_i2pk_), target, optional, intent(inout) :: work(:)
|
||||
integer(psb_ipk_), intent(in), optional :: mode,data
|
||||
character, intent(in), optional :: tran
|
||||
end subroutine psb_i2halov
|
||||
end interface psb_halo
|
||||
|
||||
|
||||
interface psb_scatter
|
||||
subroutine psb_i2scatterm(globx, locx, desc_a, info, root)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_), intent(out), allocatable :: locx(:,:)
|
||||
integer(psb_i2pk_), intent(in) :: globx(:,:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: root
|
||||
end subroutine psb_i2scatterm
|
||||
subroutine psb_i2scatterv(globx, locx, desc_a, info, root)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_), intent(out), allocatable :: locx(:)
|
||||
integer(psb_i2pk_), intent(in) :: globx(:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: root
|
||||
end subroutine psb_i2scatterv
|
||||
end interface psb_scatter
|
||||
|
||||
interface psb_gather
|
||||
subroutine psb_i2gatherm(globx, locx, desc_a, info, root)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_), intent(in) :: locx(:,:)
|
||||
integer(psb_i2pk_), intent(out), allocatable :: globx(:,:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: root
|
||||
end subroutine psb_i2gatherm
|
||||
subroutine psb_i2gatherv(globx, locx, desc_a, info, root)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_), intent(in) :: locx(:)
|
||||
integer(psb_i2pk_), intent(out), allocatable :: globx(:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: root
|
||||
end subroutine psb_i2gatherv
|
||||
end interface psb_gather
|
||||
|
||||
end module psb_i2_comm_a_mod
|
||||
@@ -30,7 +30,8 @@
|
||||
!
|
||||
!
|
||||
module psb_m_comm_a_mod
|
||||
use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_lpk_, psb_epk_, psb_mpk_
|
||||
use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_lpk_, &
|
||||
& psb_epk_, psb_mpk_, psb_i2pk_
|
||||
|
||||
interface psb_ovrl
|
||||
subroutine psb_movrlm(x,desc_a,info,jx,ik,work,update,mode)
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
!
|
||||
! 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.
|
||||
!
|
||||
!
|
||||
module psi_i2_comm_a_mod
|
||||
use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_mpk_, psb_epk_
|
||||
|
||||
interface psi_swapdata
|
||||
subroutine psi_i2swapdatam(flag,n,beta,y,desc_a,work,info,data)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: flag, n
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_i2pk_) :: y(:,:), beta
|
||||
integer(psb_i2pk_),target :: work(:)
|
||||
type(psb_desc_type), target :: desc_a
|
||||
integer(psb_ipk_), optional :: data
|
||||
end subroutine psi_i2swapdatam
|
||||
subroutine psi_i2swapdatav(flag,beta,y,desc_a,work,info,data)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: flag
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_i2pk_) :: y(:), beta
|
||||
integer(psb_i2pk_),target :: work(:)
|
||||
type(psb_desc_type), target :: desc_a
|
||||
integer(psb_ipk_), optional :: data
|
||||
end subroutine psi_i2swapdatav
|
||||
subroutine psi_i2swapidxm(ictxt,icomm,flag,n,beta,y,idx,&
|
||||
& totxch,totsnd,totrcv,work,info)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: ictxt,icomm,flag, n
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_i2pk_) :: y(:,:), beta
|
||||
integer(psb_i2pk_),target :: work(:)
|
||||
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd,totrcv
|
||||
end subroutine psi_i2swapidxm
|
||||
subroutine psi_i2swapidxv(ictxt,icomm,flag,beta,y,idx,&
|
||||
& totxch,totsnd,totrcv,work,info)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: ictxt,icomm,flag
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_i2pk_) :: y(:), beta
|
||||
integer(psb_i2pk_),target :: work(:)
|
||||
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd,totrcv
|
||||
end subroutine psi_i2swapidxv
|
||||
end interface psi_swapdata
|
||||
|
||||
|
||||
interface psi_swaptran
|
||||
subroutine psi_i2swaptranm(flag,n,beta,y,desc_a,work,info,data)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: flag, n
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_i2pk_) :: y(:,:), beta
|
||||
integer(psb_i2pk_),target :: work(:)
|
||||
type(psb_desc_type), target :: desc_a
|
||||
integer(psb_ipk_), optional :: data
|
||||
end subroutine psi_i2swaptranm
|
||||
subroutine psi_i2swaptranv(flag,beta,y,desc_a,work,info,data)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: flag
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_i2pk_) :: y(:), beta
|
||||
integer(psb_i2pk_),target :: work(:)
|
||||
type(psb_desc_type), target :: desc_a
|
||||
integer(psb_ipk_), optional :: data
|
||||
end subroutine psi_i2swaptranv
|
||||
subroutine psi_i2tranidxm(ictxt,icomm,flag,n,beta,y,idx,&
|
||||
& totxch,totsnd,totrcv,work,info)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: ictxt,icomm,flag, n
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_i2pk_) :: y(:,:), beta
|
||||
integer(psb_i2pk_),target :: work(:)
|
||||
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd,totrcv
|
||||
end subroutine psi_i2tranidxm
|
||||
subroutine psi_i2tranidxv(ictxt,icomm,flag,beta,y,idx,&
|
||||
& totxch,totsnd,totrcv,work,info)
|
||||
import
|
||||
integer(psb_ipk_), intent(in) :: ictxt,icomm,flag
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_i2pk_) :: y(:), beta
|
||||
integer(psb_i2pk_),target :: work(:)
|
||||
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd,totrcv
|
||||
end subroutine psi_i2tranidxv
|
||||
end interface psi_swaptran
|
||||
|
||||
interface psi_ovrl_upd
|
||||
subroutine psi_i2ovrl_updr1(x,desc_a,update,info)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout), target :: x(:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(in) :: update
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psi_i2ovrl_updr1
|
||||
subroutine psi_i2ovrl_updr2(x,desc_a,update,info)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout), target :: x(:,:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(in) :: update
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psi_i2ovrl_updr2
|
||||
end interface psi_ovrl_upd
|
||||
|
||||
interface psi_ovrl_save
|
||||
subroutine psi_i2ovrl_saver1(x,xs,desc_a,info)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_i2pk_), allocatable :: xs(:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psi_i2ovrl_saver1
|
||||
subroutine psi_i2ovrl_saver2(x,xs,desc_a,info)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:,:)
|
||||
integer(psb_i2pk_), allocatable :: xs(:,:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psi_i2ovrl_saver2
|
||||
end interface psi_ovrl_save
|
||||
|
||||
interface psi_ovrl_restore
|
||||
subroutine psi_i2ovrl_restrr1(x,xs,desc_a,info)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:)
|
||||
integer(psb_i2pk_) :: xs(:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psi_i2ovrl_restrr1
|
||||
subroutine psi_i2ovrl_restrr2(x,xs,desc_a,info)
|
||||
import
|
||||
integer(psb_i2pk_), intent(inout) :: x(:,:)
|
||||
integer(psb_i2pk_) :: xs(:,:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psi_i2ovrl_restrr2
|
||||
end interface psi_ovrl_restore
|
||||
|
||||
end module psi_i2_comm_a_mod
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
!
|
||||
!
|
||||
module psi_i_comm_v_mod
|
||||
use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_mpk_, psb_lpk_, psb_epk_
|
||||
use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_mpk_, &
|
||||
& psb_lpk_, psb_epk_, psb_i2pk_
|
||||
use psb_i_base_vect_mod, only : psb_i_base_vect_type
|
||||
use psb_i_base_multivect_mod, only : psb_i_base_multivect_type
|
||||
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
!
|
||||
!
|
||||
module psi_l_comm_v_mod
|
||||
use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_mpk_, psb_lpk_, psb_epk_
|
||||
use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_mpk_, &
|
||||
& psb_lpk_, psb_epk_, psb_i2pk_
|
||||
use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_mpk_, psb_lpk_, psb_epk_, psb_i_base_vect_type
|
||||
use psb_l_base_vect_mod, only : psb_l_base_vect_type
|
||||
use psb_l_base_multivect_mod, only : psb_l_base_multivect_type
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,307 @@
|
||||
!
|
||||
! 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.
|
||||
!
|
||||
!
|
||||
|
||||
module psi_i2_p2p_mod
|
||||
use psi_penv_mod
|
||||
use psi_comm_buffers_mod
|
||||
|
||||
interface psb_snd
|
||||
module procedure psb_i2snds, psb_i2sndv, psb_i2sndm, &
|
||||
& psb_i2snds_ec, psb_i2sndv_ec, psb_i2sndm_ec
|
||||
end interface
|
||||
|
||||
interface psb_rcv
|
||||
module procedure psb_i2rcvs, psb_i2rcvv, psb_i2rcvm, &
|
||||
& psb_i2rcvs_ec, psb_i2rcvv_ec, psb_i2rcvm_ec
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine psb_i2snds(ictxt,dat,dst)
|
||||
use psi_comm_buffers_mod
|
||||
#ifdef MPI_MOD
|
||||
use mpi
|
||||
#endif
|
||||
implicit none
|
||||
#ifdef MPI_H
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
integer(psb_mpk_), intent(in) :: ictxt
|
||||
integer(psb_i2pk_), intent(in) :: dat
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_i2pk_), allocatable :: dat_(:)
|
||||
integer(psb_mpk_) :: info
|
||||
#if defined(SERIAL_MPI)
|
||||
! do nothing
|
||||
#else
|
||||
allocate(dat_(1), stat=info)
|
||||
dat_(1) = dat
|
||||
call psi_snd(ictxt,psb_int2_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_i2snds
|
||||
|
||||
subroutine psb_i2sndv(ictxt,dat,dst)
|
||||
use psi_comm_buffers_mod
|
||||
|
||||
#ifdef MPI_MOD
|
||||
use mpi
|
||||
#endif
|
||||
implicit none
|
||||
#ifdef MPI_H
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
integer(psb_mpk_), intent(in) :: ictxt
|
||||
integer(psb_i2pk_), intent(in) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_i2pk_), allocatable :: dat_(:)
|
||||
integer(psb_mpk_) :: info
|
||||
|
||||
#if defined(SERIAL_MPI)
|
||||
#else
|
||||
allocate(dat_(size(dat)), stat=info)
|
||||
dat_(:) = dat(:)
|
||||
call psi_snd(ictxt,psb_int2_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_i2sndv
|
||||
|
||||
subroutine psb_i2sndm(ictxt,dat,dst,m)
|
||||
use psi_comm_buffers_mod
|
||||
|
||||
#ifdef MPI_MOD
|
||||
use mpi
|
||||
#endif
|
||||
implicit none
|
||||
#ifdef MPI_H
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
integer(psb_mpk_), intent(in) :: ictxt
|
||||
integer(psb_i2pk_), intent(in) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
integer(psb_i2pk_), allocatable :: dat_(:)
|
||||
integer(psb_ipk_) :: i,j,k,m_,n_
|
||||
integer(psb_mpk_) :: info
|
||||
|
||||
#if defined(SERIAL_MPI)
|
||||
#else
|
||||
if (present(m)) then
|
||||
m_ = m
|
||||
else
|
||||
m_ = size(dat,1)
|
||||
end if
|
||||
n_ = size(dat,2)
|
||||
allocate(dat_(m_*n_), stat=info)
|
||||
k=1
|
||||
do j=1,n_
|
||||
do i=1, m_
|
||||
dat_(k) = dat(i,j)
|
||||
k = k + 1
|
||||
end do
|
||||
end do
|
||||
call psi_snd(ictxt,psb_int2_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_i2sndm
|
||||
|
||||
subroutine psb_i2rcvs(ictxt,dat,src)
|
||||
use psi_comm_buffers_mod
|
||||
#ifdef MPI_MOD
|
||||
use mpi
|
||||
#endif
|
||||
implicit none
|
||||
#ifdef MPI_H
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
integer(psb_mpk_), intent(in) :: ictxt
|
||||
integer(psb_i2pk_), intent(out) :: dat
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
integer(psb_mpk_) :: info
|
||||
integer(psb_mpk_) :: status(mpi_status_size)
|
||||
#if defined(SERIAL_MPI)
|
||||
! do nothing
|
||||
#else
|
||||
call mpi_recv(dat,1,psb_mpi_i2pk_,src,psb_int2_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_i2rcvs
|
||||
|
||||
subroutine psb_i2rcvv(ictxt,dat,src)
|
||||
use psi_comm_buffers_mod
|
||||
|
||||
#ifdef MPI_MOD
|
||||
use mpi
|
||||
#endif
|
||||
implicit none
|
||||
#ifdef MPI_H
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
integer(psb_mpk_), intent(in) :: ictxt
|
||||
integer(psb_i2pk_), intent(out) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
integer(psb_i2pk_), allocatable :: dat_(:)
|
||||
integer(psb_mpk_) :: info
|
||||
integer(psb_mpk_) :: status(mpi_status_size)
|
||||
#if defined(SERIAL_MPI)
|
||||
#else
|
||||
call mpi_recv(dat,size(dat),psb_mpi_i2pk_,src,psb_int2_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_i2rcvv
|
||||
|
||||
subroutine psb_i2rcvm(ictxt,dat,src,m)
|
||||
use psi_comm_buffers_mod
|
||||
|
||||
#ifdef MPI_MOD
|
||||
use mpi
|
||||
#endif
|
||||
implicit none
|
||||
#ifdef MPI_H
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
integer(psb_mpk_), intent(in) :: ictxt
|
||||
integer(psb_i2pk_), intent(out) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
integer(psb_i2pk_), allocatable :: dat_(:)
|
||||
integer(psb_mpk_) :: info ,m_,n_, ld, mp_rcv_type
|
||||
integer(psb_mpk_) :: i,j,k
|
||||
integer(psb_mpk_) :: status(mpi_status_size)
|
||||
#if defined(SERIAL_MPI)
|
||||
! What should we do here??
|
||||
#else
|
||||
if (present(m)) then
|
||||
m_ = m
|
||||
ld = size(dat,1)
|
||||
n_ = size(dat,2)
|
||||
call mpi_type_vector(n_,m_,ld,psb_mpi_i2pk_,mp_rcv_type,info)
|
||||
if (info == mpi_success) call mpi_type_commit(mp_rcv_type,info)
|
||||
if (info == mpi_success) call mpi_recv(dat,1,mp_rcv_type,src,&
|
||||
& psb_int2_tag,ictxt,status,info)
|
||||
if (info == mpi_success) call mpi_type_free(mp_rcv_type,info)
|
||||
else
|
||||
call mpi_recv(dat,size(dat),psb_mpi_i2pk_,src,psb_int2_tag,ictxt,status,info)
|
||||
end if
|
||||
if (info /= mpi_success) then
|
||||
write(psb_err_unit,*) 'Error in psb_recv', info
|
||||
end if
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_i2rcvm
|
||||
|
||||
|
||||
subroutine psb_i2snds_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_i2pk_), intent(in) :: dat
|
||||
integer(psb_epk_), intent(in) :: dst
|
||||
|
||||
integer(psb_mpk_) :: iictxt, idst
|
||||
|
||||
iictxt = ictxt
|
||||
idst = dst
|
||||
call psb_snd(iictxt, dat, idst)
|
||||
|
||||
end subroutine psb_i2snds_ec
|
||||
|
||||
subroutine psb_i2sndv_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_i2pk_), intent(in) :: dat(:)
|
||||
integer(psb_epk_), intent(in) :: dst
|
||||
|
||||
integer(psb_mpk_) :: iictxt, idst
|
||||
|
||||
iictxt = ictxt
|
||||
idst = dst
|
||||
call psb_snd(iictxt, dat, idst)
|
||||
|
||||
end subroutine psb_i2sndv_ec
|
||||
|
||||
subroutine psb_i2sndm_ec(ictxt,dat,dst,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_i2pk_), intent(in) :: dat(:,:)
|
||||
integer(psb_epk_), intent(in) :: dst
|
||||
|
||||
integer(psb_mpk_) :: iictxt, idst
|
||||
|
||||
iictxt = ictxt
|
||||
idst = dst
|
||||
call psb_snd(iictxt, dat, idst)
|
||||
|
||||
end subroutine psb_i2sndm_ec
|
||||
|
||||
subroutine psb_i2rcvs_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_i2pk_), intent(out) :: dat
|
||||
integer(psb_epk_), intent(in) :: src
|
||||
|
||||
integer(psb_mpk_) :: iictxt, isrc
|
||||
|
||||
iictxt = ictxt
|
||||
isrc = src
|
||||
call psb_rcv(iictxt, dat, isrc)
|
||||
|
||||
end subroutine psb_i2rcvs_ec
|
||||
|
||||
subroutine psb_i2rcvv_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_i2pk_), intent(out) :: dat(:)
|
||||
integer(psb_epk_), intent(in) :: src
|
||||
|
||||
integer(psb_mpk_) :: iictxt, isrc
|
||||
|
||||
iictxt = ictxt
|
||||
isrc = src
|
||||
call psb_rcv(iictxt, dat, isrc)
|
||||
|
||||
end subroutine psb_i2rcvv_ec
|
||||
|
||||
subroutine psb_i2rcvm_ec(ictxt,dat,src,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_i2pk_), intent(out) :: dat(:,:)
|
||||
integer(psb_epk_), intent(in) :: src
|
||||
|
||||
integer(psb_mpk_) :: iictxt, isrc
|
||||
|
||||
iictxt = ictxt
|
||||
isrc = src
|
||||
call psb_rcv(iictxt, dat, isrc)
|
||||
|
||||
end subroutine psb_i2rcvm_ec
|
||||
|
||||
|
||||
end module psi_i2_p2p_mod
|
||||
@@ -0,0 +1,119 @@
|
||||
!
|
||||
! 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.
|
||||
!
|
||||
!
|
||||
Module psb_i2_tools_a_mod
|
||||
use psb_desc_mod, only : psb_desc_type, psb_i2pk_, psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_
|
||||
|
||||
interface psb_geall
|
||||
subroutine psb_i2alloc(x, desc_a, info, n, lb)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_), allocatable, intent(out) :: x(:,:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), optional, intent(in) :: n, lb
|
||||
end subroutine psb_i2alloc
|
||||
subroutine psb_i2allocv(x, desc_a,info,n)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_), allocatable, intent(out) :: x(:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), optional, intent(in) :: n
|
||||
end subroutine psb_i2allocv
|
||||
end interface
|
||||
|
||||
|
||||
interface psb_geasb
|
||||
subroutine psb_i2asb(x, desc_a, info, scratch)
|
||||
import
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_i2pk_), allocatable, intent(inout) :: x(:,:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
logical, intent(in), optional :: scratch
|
||||
end subroutine psb_i2asb
|
||||
subroutine psb_i2asbv(x, desc_a, info, scratch)
|
||||
import
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_i2pk_), allocatable, intent(inout) :: x(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
logical, intent(in), optional :: scratch
|
||||
end subroutine psb_i2asbv
|
||||
end interface
|
||||
|
||||
interface psb_gefree
|
||||
subroutine psb_i2free(x, desc_a, info)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_),allocatable, intent(inout) :: x(:,:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_i2free
|
||||
subroutine psb_i2freev(x, desc_a, info)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_i2pk_),allocatable, intent(inout) :: x(:)
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine psb_i2freev
|
||||
end interface
|
||||
|
||||
|
||||
interface psb_geins
|
||||
subroutine psb_i2insi(m,irw,val, x, desc_a,info,dupl,local)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_ipk_), intent(in) :: m
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_i2pk_),intent(inout) :: x(:,:)
|
||||
integer(psb_lpk_), intent(in) :: irw(:)
|
||||
integer(psb_i2pk_), intent(in) :: val(:,:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), optional, intent(in) :: dupl
|
||||
logical, intent(in), optional :: local
|
||||
end subroutine psb_i2insi
|
||||
subroutine psb_i2insvi(m, irw,val, x,desc_a,info,dupl,local)
|
||||
import
|
||||
implicit none
|
||||
integer(psb_ipk_), intent(in) :: m
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_i2pk_),intent(inout) :: x(:)
|
||||
integer(psb_lpk_), intent(in) :: irw(:)
|
||||
integer(psb_i2pk_), intent(in) :: val(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), optional, intent(in) :: dupl
|
||||
logical, intent(in), optional :: local
|
||||
end subroutine psb_i2insvi
|
||||
end interface
|
||||
|
||||
end module psb_i2_tools_a_mod
|
||||
Reference in New Issue
Block a user