HP-MPI User's Guide (11th Edition)
Introduction
MPI concepts
Chapter 112
To code a broadcast, use
MPI_Bcast(void *buf, int count, MPI_Datatype dtype, int
root, MPI_Comm comm);
where
buf Specifies the starting address of the buffer.
count Indicates the number of buffer entries.
dtype Denotes the datatype of the buffer entries.
root Specifies the rank of the root.
comm Designates the communication context that identifies a
group of processes.
For example “compute_pi.f” on page 241 uses MPI_BCAST to broadcast
one integer from process 0 to every process in MPI_COMM_WORLD.
To code a scatter, use
MPI_Scatter (void* sendbuf, int sendcount, MPI_Datatype
sendtype, void* recvbuf, int recvcount, MPI_Datatype
recvtype, int root, MPI_Comm comm);
where
sendbuf Specifies the starting address of the send buffer.
sendcount Specifies the number of elements sent to each process.
sendtype Denotes the datatype of the send buffer.
recvbuf Specifies the address of the receive buffer.
recvcount Indicates the number of elements in the receive buffer.
recvtype Indicates the datatype of the receive buffer elements.
root Denotes the rank of the sending process.
comm Designates the communication context that identifies a
group of processes.
Computation
Computational operations do global reduction operations, such as sum,
max, min, product, or user-defined functions across all members of a
group. There are a number of global reduction functions:
Reduce Returns the result of a reduction at one node.