      program sample5
      include 'mpif.h'
      integer myrank,nprocs
      call MPI_INIT(ierr)
      call MPI_COMM_RANK(MPI_COMM_WORLD,myrank,ierr)
      call MPI_COMM_SIZE(MPI_COMM_WORLD,nprocs,ierr)
      call MPI_REDUCE(myrank,isum,1,MPI_INTEGER,MPI_SUM,0,
     +                 MPI_COMM_WORLD,ierr)
      if(myrank.eq.0) write(6,*)"Result = ",isum
      call MPI_FINALIZE(ierr)
      stop
      end
