rendered paste bodyProgram test
USE MPI
real,target ::vector (100)
integer status (MPI_STATUS_SIZE)
integer p, my_rank, ierr
integer i, src, dst, count, tag
pointer point(:)
point => vector
do i = 1, 100
vector = i
enddo
! vector = 30
call MPI_INIT(ierr)
call MPI_COMM_rank(MPI_COMM_WORLD,my_rank,ierr)
call MPI_COMM_size(MPI_COMM_WORLD,p,ierr)
src = 0
tag = 47
count = 50
if (my_rank == 0) then
dst = 1
src = 1
call MPI_SEND(point, count, MPI_REAL, dst, tag, MPI_COMM_WORLD, ierr)
call MPI_RECV(point, count, MPI_REAL, src, tag, MPI_COMM_WORLD, status, ierr)
do i = 1, 100
write (*,*) vector(i), point(i)
enddo
else
dst = 0
call MPI_RECV(point, count, MPI_REAL, src, tag, MPI_COMM_WORLD, status, ierr)
do i = 0, count
point(i) = 15
enddo
call MPI_SEND(point, count, MPI_REAL, dst, tag, MPI_COMM_WORLD, ierr)
endif
call MPI_Finalize(ierr)
END