|
|
@ -1,34 +1,34 @@
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Parallel Sparse BLAS version 3.5
|
|
|
|
! Parallel Sparse BLAS version 3.5
|
|
|
|
! (C) Copyright 2006-2018
|
|
|
|
! (C) Copyright 2006-2018
|
|
|
|
! Salvatore Filippone
|
|
|
|
! Salvatore Filippone
|
|
|
|
! Alfredo Buttari
|
|
|
|
! Alfredo Buttari
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Redistribution and use in source and binary forms, with or without
|
|
|
|
! Redistribution and use in source and binary forms, with or without
|
|
|
|
! modification, are permitted provided that the following conditions
|
|
|
|
! modification, are permitted provided that the following conditions
|
|
|
|
! are met:
|
|
|
|
! are met:
|
|
|
|
! 1. Redistributions of source code must retain the above copyright
|
|
|
|
! 1. Redistributions of source code must retain the above copyright
|
|
|
|
! notice, this list of conditions and the following disclaimer.
|
|
|
|
! notice, this list of conditions and the following disclaimer.
|
|
|
|
! 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
! 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
! notice, this list of conditions, and the following disclaimer in the
|
|
|
|
! notice, this list of conditions, and the following disclaimer in the
|
|
|
|
! documentation and/or other materials provided with the distribution.
|
|
|
|
! documentation and/or other materials provided with the distribution.
|
|
|
|
! 3. The name of the PSBLAS group or the names of its contributors may
|
|
|
|
! 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
|
|
|
|
! not be used to endorse or promote products derived from this
|
|
|
|
! software without specific written permission.
|
|
|
|
! software without specific written permission.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
|
|
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
|
|
|
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
! 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
|
|
|
|
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
! POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
! POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! The merge-sort routines
|
|
|
|
! The merge-sort routines
|
|
|
|
! References:
|
|
|
|
! References:
|
|
|
@ -40,7 +40,7 @@
|
|
|
|
! Data Structures and Algorithms
|
|
|
|
! Data Structures and Algorithms
|
|
|
|
! Addison-Wesley
|
|
|
|
! Addison-Wesley
|
|
|
|
!
|
|
|
|
!
|
|
|
|
logical function psb_eisaperm(n,eip)
|
|
|
|
logical function psb_eisaperm(n,eip)
|
|
|
|
use psb_sort_mod, psb_protect_name => psb_eisaperm
|
|
|
|
use psb_sort_mod, psb_protect_name => psb_eisaperm
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
@ -93,10 +93,10 @@
|
|
|
|
9999 continue
|
|
|
|
9999 continue
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end function psb_eisaperm
|
|
|
|
end function psb_eisaperm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_emsort_u(x,nout,dir)
|
|
|
|
subroutine psb_emsort_u(x,nout,dir)
|
|
|
|
use psb_sort_mod, psb_protect_name => psb_emsort_u
|
|
|
|
use psb_sort_mod, psb_protect_name => psb_emsort_u
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_error_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
@ -129,10 +129,10 @@
|
|
|
|
9999 call psb_error_handler(err_act)
|
|
|
|
9999 call psb_error_handler(err_act)
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end subroutine psb_emsort_u
|
|
|
|
end subroutine psb_emsort_u
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function psb_ebsrch(key,n,v) result(ipos)
|
|
|
|
function psb_ebsrch(key,n,v) result(ipos)
|
|
|
|
use psb_sort_mod, psb_protect_name => psb_ebsrch
|
|
|
|
use psb_sort_mod, psb_protect_name => psb_ebsrch
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
integer(psb_ipk_) :: ipos, n
|
|
|
|
integer(psb_ipk_) :: ipos, n
|
|
|
@ -167,9 +167,9 @@
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end function psb_ebsrch
|
|
|
|
end function psb_ebsrch
|
|
|
|
|
|
|
|
|
|
|
|
function psb_essrch(key,n,v) result(ipos)
|
|
|
|
function psb_essrch(key,n,v) result(ipos)
|
|
|
|
use psb_sort_mod, psb_protect_name => psb_essrch
|
|
|
|
use psb_sort_mod, psb_protect_name => psb_essrch
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
integer(psb_ipk_) :: ipos, n
|
|
|
|
integer(psb_ipk_) :: ipos, n
|
|
|
@ -187,9 +187,9 @@
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end function psb_essrch
|
|
|
|
end function psb_essrch
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_emsort(x,ix,dir,flag)
|
|
|
|
subroutine psb_emsort(x,ix,dir,flag)
|
|
|
|
use psb_sort_mod, psb_protect_name => psb_emsort
|
|
|
|
use psb_sort_mod, psb_protect_name => psb_emsort
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_ip_reord_mod
|
|
|
|
use psb_ip_reord_mod
|
|
|
@ -286,9 +286,9 @@
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine psb_emsort
|
|
|
|
end subroutine psb_emsort
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psi_e_msort_up(n,k,l,iret)
|
|
|
|
subroutine psi_e_msort_up(n,k,l,iret)
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_const_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
integer(psb_ipk_) :: n, iret
|
|
|
|
integer(psb_ipk_) :: n, iret
|
|
|
@ -390,9 +390,9 @@
|
|
|
|
end do outer
|
|
|
|
end do outer
|
|
|
|
end do mergepass
|
|
|
|
end do mergepass
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine psi_e_msort_up
|
|
|
|
end subroutine psi_e_msort_up
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psi_e_msort_dw(n,k,l,iret)
|
|
|
|
subroutine psi_e_msort_dw(n,k,l,iret)
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_const_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
integer(psb_ipk_) :: n, iret
|
|
|
|
integer(psb_ipk_) :: n, iret
|
|
|
@ -494,9 +494,9 @@
|
|
|
|
end do outer
|
|
|
|
end do outer
|
|
|
|
end do mergepass
|
|
|
|
end do mergepass
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine psi_e_msort_dw
|
|
|
|
end subroutine psi_e_msort_dw
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psi_e_amsort_up(n,k,l,iret)
|
|
|
|
subroutine psi_e_amsort_up(n,k,l,iret)
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_const_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
integer(psb_ipk_) :: n, iret
|
|
|
|
integer(psb_ipk_) :: n, iret
|
|
|
@ -598,9 +598,9 @@
|
|
|
|
end do outer
|
|
|
|
end do outer
|
|
|
|
end do mergepass
|
|
|
|
end do mergepass
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine psi_e_amsort_up
|
|
|
|
end subroutine psi_e_amsort_up
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psi_e_amsort_dw(n,k,l,iret)
|
|
|
|
subroutine psi_e_amsort_dw(n,k,l,iret)
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_const_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
integer(psb_ipk_) :: n, iret
|
|
|
|
integer(psb_ipk_) :: n, iret
|
|
|
@ -702,12 +702,6 @@
|
|
|
|
end do outer
|
|
|
|
end do outer
|
|
|
|
end do mergepass
|
|
|
|
end do mergepass
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine psi_e_amsort_dw
|
|
|
|
end subroutine psi_e_amsort_dw
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|