2004-11-01 17:57:32 +00:00
|
|
|
!
|
2004-11-22 00:37:56 +00:00
|
|
|
! $HEADER$
|
|
|
|
!
|
2004-11-01 17:57:32 +00:00
|
|
|
! test_send.f90 - tests mpi_send variants (calls functions in send_t.c)
|
|
|
|
!
|
|
|
|
! Actual tests do not use MPI, they just test parameters and types.
|
|
|
|
!
|
|
|
|
|
|
|
|
program main
|
|
|
|
use mpi
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(kind=MPI_INTEGER1_KIND) :: ai1(10) = (/1,2,3,4,5,6,7,8,9,10/)
|
|
|
|
integer, target :: ai(10) = (/10,9,8,7,6,5,4,3,2,1/)
|
|
|
|
integer, pointer :: pai(:)
|
|
|
|
integer :: count, dest, tag, ierr
|
|
|
|
|
|
|
|
count = 10
|
|
|
|
dest = 59
|
|
|
|
tag = 999
|
|
|
|
|
|
|
|
call mpi_send(ai, count, MPI_INTEGER, dest, tag, MPI_COMM_WORLD, ierr)
|
|
|
|
if (ierr /= MPI_SUCCESS) then
|
|
|
|
print *, "FAILURE test_send: ierr = ", ierr
|
|
|
|
end if
|
|
|
|
|
|
|
|
pai => ai
|
|
|
|
call mpi_send(pai, count, MPI_INTEGER, dest, tag, MPI_COMM_WORLD, ierr)
|
|
|
|
if (ierr /= MPI_SUCCESS) then
|
|
|
|
print *, "FAILURE test_send: ierr = ", ierr
|
|
|
|
end if
|
|
|
|
|
|
|
|
call mpi_send(ai1, count, MPI_INTEGER1, dest, tag, MPI_COMM_SELF, ierr)
|
|
|
|
if (ierr /= MPI_SUCCESS) then
|
|
|
|
print *, "FAILURE test_send: ierr = ", ierr
|
|
|
|
end if
|
|
|
|
|
|
|
|
end program
|