Split P2P files. Reorganized MPI tags.
parent
1bbb8b424c
commit
57a2456c91
@ -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_c_p2p_mod
|
||||
use psi_penv_mod
|
||||
use psi_comm_buffers_mod
|
||||
|
||||
interface psb_snd
|
||||
module procedure psb_csnds, psb_csndv, psb_csndm, &
|
||||
& psb_csnds_ec, psb_csndv_ec, psb_csndm_ec
|
||||
end interface
|
||||
|
||||
interface psb_rcv
|
||||
module procedure psb_crcvs, psb_crcvv, psb_crcvm, &
|
||||
& psb_crcvs_ec, psb_crcvv_ec, psb_crcvm_ec
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine psb_csnds(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
|
||||
complex(psb_spk_), intent(in) :: dat
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
complex(psb_spk_), 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_complex_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_csnds
|
||||
|
||||
subroutine psb_csndv(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
|
||||
complex(psb_spk_), intent(in) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
complex(psb_spk_), allocatable :: dat_(:)
|
||||
integer(psb_mpk_) :: info
|
||||
|
||||
#if defined(SERIAL_MPI)
|
||||
#else
|
||||
allocate(dat_(size(dat)), stat=info)
|
||||
dat_(:) = dat(:)
|
||||
call psi_snd(ictxt,psb_complex_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_csndv
|
||||
|
||||
subroutine psb_csndm(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
|
||||
complex(psb_spk_), intent(in) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
complex(psb_spk_), 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_complex_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_csndm
|
||||
|
||||
subroutine psb_crcvs(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
|
||||
complex(psb_spk_), 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_c_spk_,src,psb_complex_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_crcvs
|
||||
|
||||
subroutine psb_crcvv(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
|
||||
complex(psb_spk_), intent(out) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
complex(psb_spk_), 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_c_spk_,src,psb_complex_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_crcvv
|
||||
|
||||
subroutine psb_crcvm(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
|
||||
complex(psb_spk_), intent(out) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
complex(psb_spk_), 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_c_spk_,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_complex_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_c_spk_,src,psb_complex_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_crcvm
|
||||
|
||||
|
||||
subroutine psb_csnds_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
complex(psb_spk_), 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_csnds_ec
|
||||
|
||||
subroutine psb_csndv_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
complex(psb_spk_), 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_csndv_ec
|
||||
|
||||
subroutine psb_csndm_ec(ictxt,dat,dst,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
complex(psb_spk_), 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_csndm_ec
|
||||
|
||||
subroutine psb_crcvs_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
complex(psb_spk_), 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_crcvs_ec
|
||||
|
||||
subroutine psb_crcvv_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
complex(psb_spk_), 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_crcvv_ec
|
||||
|
||||
subroutine psb_crcvm_ec(ictxt,dat,src,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
complex(psb_spk_), 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_crcvm_ec
|
||||
|
||||
|
||||
end module psi_c_p2p_mod
|
||||
@ -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_d_p2p_mod
|
||||
use psi_penv_mod
|
||||
use psi_comm_buffers_mod
|
||||
|
||||
interface psb_snd
|
||||
module procedure psb_dsnds, psb_dsndv, psb_dsndm, &
|
||||
& psb_dsnds_ec, psb_dsndv_ec, psb_dsndm_ec
|
||||
end interface
|
||||
|
||||
interface psb_rcv
|
||||
module procedure psb_drcvs, psb_drcvv, psb_drcvm, &
|
||||
& psb_drcvs_ec, psb_drcvv_ec, psb_drcvm_ec
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine psb_dsnds(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
|
||||
real(psb_dpk_), intent(in) :: dat
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
real(psb_dpk_), 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_double_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_dsnds
|
||||
|
||||
subroutine psb_dsndv(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
|
||||
real(psb_dpk_), intent(in) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
real(psb_dpk_), allocatable :: dat_(:)
|
||||
integer(psb_mpk_) :: info
|
||||
|
||||
#if defined(SERIAL_MPI)
|
||||
#else
|
||||
allocate(dat_(size(dat)), stat=info)
|
||||
dat_(:) = dat(:)
|
||||
call psi_snd(ictxt,psb_double_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_dsndv
|
||||
|
||||
subroutine psb_dsndm(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
|
||||
real(psb_dpk_), intent(in) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
real(psb_dpk_), 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_double_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_dsndm
|
||||
|
||||
subroutine psb_drcvs(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
|
||||
real(psb_dpk_), 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_r_dpk_,src,psb_double_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_drcvs
|
||||
|
||||
subroutine psb_drcvv(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
|
||||
real(psb_dpk_), intent(out) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
real(psb_dpk_), 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_r_dpk_,src,psb_double_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_drcvv
|
||||
|
||||
subroutine psb_drcvm(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
|
||||
real(psb_dpk_), intent(out) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
real(psb_dpk_), 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_r_dpk_,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_double_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_r_dpk_,src,psb_double_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_drcvm
|
||||
|
||||
|
||||
subroutine psb_dsnds_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
real(psb_dpk_), 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_dsnds_ec
|
||||
|
||||
subroutine psb_dsndv_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
real(psb_dpk_), 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_dsndv_ec
|
||||
|
||||
subroutine psb_dsndm_ec(ictxt,dat,dst,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
real(psb_dpk_), 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_dsndm_ec
|
||||
|
||||
subroutine psb_drcvs_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
real(psb_dpk_), 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_drcvs_ec
|
||||
|
||||
subroutine psb_drcvv_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
real(psb_dpk_), 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_drcvv_ec
|
||||
|
||||
subroutine psb_drcvm_ec(ictxt,dat,src,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
real(psb_dpk_), 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_drcvm_ec
|
||||
|
||||
|
||||
end module psi_d_p2p_mod
|
||||
@ -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_e_p2p_mod
|
||||
use psi_penv_mod
|
||||
use psi_comm_buffers_mod
|
||||
|
||||
interface psb_snd
|
||||
module procedure psb_esnds, psb_esndv, psb_esndm, &
|
||||
& psb_esnds_ec, psb_esndv_ec, psb_esndm_ec
|
||||
end interface
|
||||
|
||||
interface psb_rcv
|
||||
module procedure psb_ercvs, psb_ercvv, psb_ercvm, &
|
||||
& psb_ercvs_ec, psb_ercvv_ec, psb_ercvm_ec
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine psb_esnds(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_epk_), intent(in) :: dat
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_epk_), 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_int8_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_esnds
|
||||
|
||||
subroutine psb_esndv(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_epk_), intent(in) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_epk_), allocatable :: dat_(:)
|
||||
integer(psb_mpk_) :: info
|
||||
|
||||
#if defined(SERIAL_MPI)
|
||||
#else
|
||||
allocate(dat_(size(dat)), stat=info)
|
||||
dat_(:) = dat(:)
|
||||
call psi_snd(ictxt,psb_int8_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_esndv
|
||||
|
||||
subroutine psb_esndm(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_epk_), intent(in) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
integer(psb_epk_), 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_int8_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_esndm
|
||||
|
||||
subroutine psb_ercvs(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_epk_), 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_epk_,src,psb_int8_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_ercvs
|
||||
|
||||
subroutine psb_ercvv(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_epk_), intent(out) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
integer(psb_epk_), 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_epk_,src,psb_int8_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_ercvv
|
||||
|
||||
subroutine psb_ercvm(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_epk_), intent(out) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
integer(psb_epk_), 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_epk_,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_int8_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_epk_,src,psb_int8_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_ercvm
|
||||
|
||||
|
||||
subroutine psb_esnds_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_epk_), 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_esnds_ec
|
||||
|
||||
subroutine psb_esndv_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_epk_), 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_esndv_ec
|
||||
|
||||
subroutine psb_esndm_ec(ictxt,dat,dst,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_epk_), 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_esndm_ec
|
||||
|
||||
subroutine psb_ercvs_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_epk_), 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_ercvs_ec
|
||||
|
||||
subroutine psb_ercvv_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_epk_), 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_ercvv_ec
|
||||
|
||||
subroutine psb_ercvm_ec(ictxt,dat,src,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_epk_), 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_ercvm_ec
|
||||
|
||||
|
||||
end module psi_e_p2p_mod
|
||||
@ -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_m_p2p_mod
|
||||
use psi_penv_mod
|
||||
use psi_comm_buffers_mod
|
||||
|
||||
interface psb_snd
|
||||
module procedure psb_msnds, psb_msndv, psb_msndm, &
|
||||
& psb_msnds_ec, psb_msndv_ec, psb_msndm_ec
|
||||
end interface
|
||||
|
||||
interface psb_rcv
|
||||
module procedure psb_mrcvs, psb_mrcvv, psb_mrcvm, &
|
||||
& psb_mrcvs_ec, psb_mrcvv_ec, psb_mrcvm_ec
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine psb_msnds(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_mpk_), intent(in) :: dat
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_mpk_), 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_int4_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_msnds
|
||||
|
||||
subroutine psb_msndv(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_mpk_), intent(in) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_mpk_), allocatable :: dat_(:)
|
||||
integer(psb_mpk_) :: info
|
||||
|
||||
#if defined(SERIAL_MPI)
|
||||
#else
|
||||
allocate(dat_(size(dat)), stat=info)
|
||||
dat_(:) = dat(:)
|
||||
call psi_snd(ictxt,psb_int4_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_msndv
|
||||
|
||||
subroutine psb_msndm(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_mpk_), intent(in) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
integer(psb_mpk_), 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_int4_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_msndm
|
||||
|
||||
subroutine psb_mrcvs(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_mpk_), 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_mpk_,src,psb_int4_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_mrcvs
|
||||
|
||||
subroutine psb_mrcvv(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_mpk_), intent(out) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
integer(psb_mpk_), 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_mpk_,src,psb_int4_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_mrcvv
|
||||
|
||||
subroutine psb_mrcvm(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_mpk_), intent(out) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
integer(psb_mpk_), 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_mpk_,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_int4_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_mpk_,src,psb_int4_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_mrcvm
|
||||
|
||||
|
||||
subroutine psb_msnds_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_mpk_), 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_msnds_ec
|
||||
|
||||
subroutine psb_msndv_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_mpk_), 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_msndv_ec
|
||||
|
||||
subroutine psb_msndm_ec(ictxt,dat,dst,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_mpk_), 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_msndm_ec
|
||||
|
||||
subroutine psb_mrcvs_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_mpk_), 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_mrcvs_ec
|
||||
|
||||
subroutine psb_mrcvv_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_mpk_), 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_mrcvv_ec
|
||||
|
||||
subroutine psb_mrcvm_ec(ictxt,dat,src,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
integer(psb_mpk_), 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_mrcvm_ec
|
||||
|
||||
|
||||
end module psi_m_p2p_mod
|
||||
@ -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_s_p2p_mod
|
||||
use psi_penv_mod
|
||||
use psi_comm_buffers_mod
|
||||
|
||||
interface psb_snd
|
||||
module procedure psb_ssnds, psb_ssndv, psb_ssndm, &
|
||||
& psb_ssnds_ec, psb_ssndv_ec, psb_ssndm_ec
|
||||
end interface
|
||||
|
||||
interface psb_rcv
|
||||
module procedure psb_srcvs, psb_srcvv, psb_srcvm, &
|
||||
& psb_srcvs_ec, psb_srcvv_ec, psb_srcvm_ec
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine psb_ssnds(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
|
||||
real(psb_spk_), intent(in) :: dat
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
real(psb_spk_), 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_real_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_ssnds
|
||||
|
||||
subroutine psb_ssndv(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
|
||||
real(psb_spk_), intent(in) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
real(psb_spk_), allocatable :: dat_(:)
|
||||
integer(psb_mpk_) :: info
|
||||
|
||||
#if defined(SERIAL_MPI)
|
||||
#else
|
||||
allocate(dat_(size(dat)), stat=info)
|
||||
dat_(:) = dat(:)
|
||||
call psi_snd(ictxt,psb_real_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_ssndv
|
||||
|
||||
subroutine psb_ssndm(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
|
||||
real(psb_spk_), intent(in) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
real(psb_spk_), 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_real_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_ssndm
|
||||
|
||||
subroutine psb_srcvs(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
|
||||
real(psb_spk_), 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_r_spk_,src,psb_real_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_srcvs
|
||||
|
||||
subroutine psb_srcvv(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
|
||||
real(psb_spk_), intent(out) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
real(psb_spk_), 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_r_spk_,src,psb_real_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_srcvv
|
||||
|
||||
subroutine psb_srcvm(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
|
||||
real(psb_spk_), intent(out) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
real(psb_spk_), 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_r_spk_,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_real_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_r_spk_,src,psb_real_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_srcvm
|
||||
|
||||
|
||||
subroutine psb_ssnds_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
real(psb_spk_), 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_ssnds_ec
|
||||
|
||||
subroutine psb_ssndv_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
real(psb_spk_), 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_ssndv_ec
|
||||
|
||||
subroutine psb_ssndm_ec(ictxt,dat,dst,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
real(psb_spk_), 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_ssndm_ec
|
||||
|
||||
subroutine psb_srcvs_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
real(psb_spk_), 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_srcvs_ec
|
||||
|
||||
subroutine psb_srcvv_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
real(psb_spk_), 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_srcvv_ec
|
||||
|
||||
subroutine psb_srcvm_ec(ictxt,dat,src,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
real(psb_spk_), 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_srcvm_ec
|
||||
|
||||
|
||||
end module psi_s_p2p_mod
|
||||
@ -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_z_p2p_mod
|
||||
use psi_penv_mod
|
||||
use psi_comm_buffers_mod
|
||||
|
||||
interface psb_snd
|
||||
module procedure psb_zsnds, psb_zsndv, psb_zsndm, &
|
||||
& psb_zsnds_ec, psb_zsndv_ec, psb_zsndm_ec
|
||||
end interface
|
||||
|
||||
interface psb_rcv
|
||||
module procedure psb_zrcvs, psb_zrcvv, psb_zrcvm, &
|
||||
& psb_zrcvs_ec, psb_zrcvv_ec, psb_zrcvm_ec
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine psb_zsnds(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
|
||||
complex(psb_dpk_), intent(in) :: dat
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
complex(psb_dpk_), 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_dcomplex_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_zsnds
|
||||
|
||||
subroutine psb_zsndv(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
|
||||
complex(psb_dpk_), intent(in) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
complex(psb_dpk_), allocatable :: dat_(:)
|
||||
integer(psb_mpk_) :: info
|
||||
|
||||
#if defined(SERIAL_MPI)
|
||||
#else
|
||||
allocate(dat_(size(dat)), stat=info)
|
||||
dat_(:) = dat(:)
|
||||
call psi_snd(ictxt,psb_dcomplex_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_zsndv
|
||||
|
||||
subroutine psb_zsndm(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
|
||||
complex(psb_dpk_), intent(in) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: dst
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
complex(psb_dpk_), 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_dcomplex_tag,dst,dat_,psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_zsndm
|
||||
|
||||
subroutine psb_zrcvs(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
|
||||
complex(psb_dpk_), 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_c_dpk_,src,psb_dcomplex_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
end subroutine psb_zrcvs
|
||||
|
||||
subroutine psb_zrcvv(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
|
||||
complex(psb_dpk_), intent(out) :: dat(:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
complex(psb_dpk_), 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_c_dpk_,src,psb_dcomplex_tag,ictxt,status,info)
|
||||
call psb_test_nodes(psb_mesg_queue)
|
||||
#endif
|
||||
|
||||
end subroutine psb_zrcvv
|
||||
|
||||
subroutine psb_zrcvm(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
|
||||
complex(psb_dpk_), intent(out) :: dat(:,:)
|
||||
integer(psb_mpk_), intent(in) :: src
|
||||
integer(psb_ipk_), intent(in), optional :: m
|
||||
complex(psb_dpk_), 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_c_dpk_,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_dcomplex_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_c_dpk_,src,psb_dcomplex_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_zrcvm
|
||||
|
||||
|
||||
subroutine psb_zsnds_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
complex(psb_dpk_), 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_zsnds_ec
|
||||
|
||||
subroutine psb_zsndv_ec(ictxt,dat,dst)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
complex(psb_dpk_), 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_zsndv_ec
|
||||
|
||||
subroutine psb_zsndm_ec(ictxt,dat,dst,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
complex(psb_dpk_), 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_zsndm_ec
|
||||
|
||||
subroutine psb_zrcvs_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
complex(psb_dpk_), 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_zrcvs_ec
|
||||
|
||||
subroutine psb_zrcvv_ec(ictxt,dat,src)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
complex(psb_dpk_), 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_zrcvv_ec
|
||||
|
||||
subroutine psb_zrcvm_ec(ictxt,dat,src,m)
|
||||
|
||||
integer(psb_epk_), intent(in) :: ictxt
|
||||
complex(psb_dpk_), 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_zrcvm_ec
|
||||
|
||||
|
||||
end module psi_z_p2p_mod
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue