Collective Allreduce

      PROGRAM ALLREDUCE
      INCLUDE 'mpif.h'
      integer rank, size, j, k, nloop
      real t1, t2, tmin, d_in, d_out

      CALL MPI_INIT(IERR)
      CALL MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierr)
      CALL MPI_COMM_RANK(mpi_COMM_WORLD, rank, ierr)

      NUMBER_OF_TESTS = 10

      nloop = 1000
      tmin  = 1000

      do i= 1, NUMBER_OF_TESTS
         call MPI_Barrier( **********)
         d_in = 1.0
         t1 = MPI_Wtime()
         do j=1, nloop 
            call MPI_Allreduce( ****************************)
         enddo
         t2 = (MPI_Wtime() - t1) / nloop
         if (t2.lt.tmin) tmin = t2
      enddo

      if (rank.eq.0) write(*,*) 'Allreduce   ', size, '  ',tmin  

      CALL MPI_FINALIZE(ierr)

      END