97. Example using MPI_BCAST

PreviousUpNext
Up: Broadcast Next: Gather Previous: Broadcast

The examples in this section use intracommunicators.


Example Broadcast 100 ints from process 0 to every process in the group.


    MPI_Comm comm; 
    int array[100]; 
    int root=0; 
    ... 
    MPI_Bcast(array, 100, MPI_INT, root, comm); 
As in many of our example code fragments, we assume that some of the variables (such as comm in the above) have been assigned appropriate values.


PreviousUpNext
Up: Broadcast Next: Gather Previous: Broadcast


Return to MPI-3.1 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-3.1 of June 4, 2015
HTML Generated on June 4, 2015