      program one2allbroadcast
      include 'mpif.h'
      integer nnodes,myid,vdim
      parameter(niters=1000)
      parameter(vdim=1000)
      integer comm,ierr
      integer status(MPI_STATUS_SIZE),root
      double precision time_begin,time_end
      double precision buffer(vdim)

      comm = MPI_COMM_WORLD
      call MPI_init(ierr)
      call MPI_COMM_RANK(comm,myid,ierr)
      call MPI_COMM_SIZE(comm,nnodes,ierr)
  
      root = 0
      if (myid == 0) then
         buffer = 9999.000
      endif

!start timer .....
      time_begin =  MPI_Wtime()
    
      do iter = 1,niters
! Do all-to-all personilized communication of matrix blocks
        call MPI_Bcast(buffer,vdim,MPI_DOUBLE_PRECISION,root,comm,ierr)
      enddo
! Stop timer

      time_end =  MPI_Wtime()

      if (myid == 0) then
        print *,'Elapsed time ',niters,'iterations for one2allbroadcast'
        print *,'is'
        print *,time_end-time_begin ,'seconds'   
       endif

      call MPI_FINALIZE(ierr)

      end


      


