      PROGRAM depends_on_buffering

      INCLUDE 'mpif.h'
      INTEGER myrank, ierr, status(MPI_STATUS_SIZE)
      REAL a(100), b(100)

C     Initialize MPI:

      call MPI_INIT(ierr)

C     Get my rank:

      call MPI_COMM_RANK(MPI_COMM_WORLD, myrank, ierr)

C     Process 0 sends and receives; same for process 1

      if( myrank.eq.0 )then
         call MPI_SEND( a, 100, MPI_REAL, 1, 17, MPI_COMM_WORLD, ierr)
         call MPI_RECV( b, 100, MPI_REAL, 1, 19, MPI_COMM_WORLD,
     $        status, ierr )

      else if ( myrank.eq.1 )then
         call MPI_SEND( a, 100, MPI_REAL, 0, 19, MPI_COMM_WORLD, ierr )
         call MPI_RECV( b, 100, MPI_REAL, 0, 17, MPI_COMM_WORLD,
     $        status, ierr)   

   endif

C Terminate MPI:

   call MPI_FINALIZE(ierr)

   END
