program bcast !!! 10-June-2005 c....... This program send the value of Pi to other processors include 'mpif.h' c........initialize MPI call mpi_init(ierr) call mpi_comm_rank(mpi_comm_world,iam,ierr) call mpi_comm_size(mpi_comm_world,nproc,ierr) c........set a value for pi if (iam.eq.0) pi = 2*asin(1.0) c......set some important information for the routine call MPI_BCAST c......count is the number of data items to be passed c......root is the processor doing the sending; all others receive icount=1 iroot=0 c......send pi to the other tasks CALL MPI_BCAST(pi, icount, MPI_REAL, iroot, MPI_COMM_WORLD, ierr) c......have all tasks print the value of rsq to verify success PRINT *, "TASK #", iam ," has Pi= ", pi c......close out MPI call mpi_finalize(ierr) stop end