      include 'mpif.h'
      integer,parameter :: numdat=100
      integer::buf(numdat)
      integer::nprocs,myrank,ierr
      integer::ist,ied
c 
      call MPI_INIT(ierr)
      call MPI_COMM_RANK(MPI_COMM_WORLD,myrank,ierr)
      call MPI_COMM_SIZE(MPI_COMM_WORLD,nprocs,ierr)
c
      ist=((numdat-1)/nprocs+1)*myrank+1
      ied=((numdat-1)/nprocs+1)*(myrank+1)
      read(10+myrank,*) (buf(i),i=ist,ied)
c
      isum=0
      do i=ist,ied
        isum = isum + buf(i)
      enddo
c
      write(6,*) myrank,';partial sum=',isum
      call MPI_FINALIZE(ierr)
      stop
      end
