8.5.2. Current Practice #2

PreviousUpNext
Up: Motivating Examples Next: (Approximate) Current Practice #3 Previous: Current Practice #1


Example

int main(int argc, char *argv[]) 
{ 
  int me, count; 
  void *data; 
  ... 
 
  MPI_Init(&argc, &argv); 
  MPI_Comm_rank(MPI_COMM_WORLD, &me); 
 
  if(me == 0) 
  { 
      /* get input, create buffer ``data'' */ 
      ... 
  } 
 
  MPI_Bcast(data, count, MPI_BYTE, 0, MPI_COMM_WORLD); 
 
  ... 
  MPI_Finalize(); 
  return 0; 
} 
Example Current Practice #2 illustrates the use of a collective communication.


PreviousUpNext
Up: Motivating Examples Next: (Approximate) Current Practice #3 Previous: Current Practice #1


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

(Unofficial) MPI-5.0 of June 9, 2025
HTML Generated on March 2, 2025