      program example32b
      include 'mpif.h'
      integer rank, fh, ierr
      character buf(10)
      call MPI_INIT(ierr)
      call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
      call MPI_FILE_OPEN(MPI_COMM_WORLD, "file1.txt",
     &                   MPI_MODE_RDONLY, MPI_INFO_NULL, fh,
     &                   ierr)
      call MPI_FILE_SET_VIEW(fh, rank*10, MPI_CHARACTER,
     &                       MPI_CHARACTER, "native",
     &                       MPI_INFO_NULL, ierr)
      call MPI_FILE_READ_ALL(fh, buf, 10, MPI_CHARACTER,
     &                       MPI_STATUS_IGNORE, ierr)
      print *, "process ", rank, ", buf=", buf
      call MPI_FILE_CLOSE(fh, ierr)
      call MPI_FINALIZE(ierr)	
      end
