







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








-^
-^
-^
-^
Matrix-Vector Multiplication:
Rowwise 1-D Partitioning
Since each process starts with only one element of
x
an all-to-all broadcast is required to distribute all theelements to all the processes.
-^
Process
i^
now computes
The all-to-all broadcast and the computation of
y [
i ]
both
take time
(n)
. Therefore, the parallel time is
(n)
Advanced MPI-Routines
-^
Send and Receive Operations
-^
Collective Communication operations
-^
Topologies and Embedding
-^
Groups & Communication domain split
MPI_Comm comm, MPI_Status *status)
The arguments include arguments to the send andreceive functions. If we wish to use the same buffer forboth send and receive, we can use: int MPI_Sendrecv_replace(void *buf,int count,MPI_Datatype datatype, int dest, int sendtag,int source, int recvtag, MPI_Comm comm,
MPI_Status *status)
Collective Communication and
Computation Operations
-^
MPI provides an extensive set of functionsfor performing common collectivecommunication operations.
-^
Each of these operations is defined over agroup corresponding to the communicator.
-^
All processors in a communicator must callthese operations.
Predefined Reduction Operations
Operation
Meaning
Datatypes
MPI_MAX
Maximum
C integers and floating point
MPI_MIN
Minimum
C integers and floating point
MPI_SUM
Sum
C integers and floating point
MPI_PROD
Product
C integers and floating point
MPI_LAND
Logical AND
C integers
MPI_BAND
Bit-wise AND
C integers and byte
MPI_LOR
Logical OR
C integers
MPI_BOR
Bit-wise OR
C integers and byte
MPI_LXOR
Logical XOR
C integers
MPI_BXOR
Bit-wise XOR
C integers and byte
MPI_MAXLOC
max-min value-location
Data-pairs
MPI_MINLOC
min-min value-location
Data-pairs
Collective Communication Operations
-^
If the result of the reduction operation is needed byall processes, MPI provides:
int MPI_Allreduce(void sendbuf, voidrecvbuf, int count, MPI_Datatypedatatype, MPI_Op op, MPI_Comm comm)
To compute prefix-sums, MPI provides:
int MPI_Scan(void sendbuf, voidrecvbuf, int count, MPI_Datatypedatatype, MPI_Op op, MPI_Comm comm)
Collective Communication Operations
-^
The all-to-all personalized communication operationis performed by:
int MPI_Alltoall(void *sendbuf, intsendcount, MPI_Datatype senddatatype,void *recvbuf,int recvcount,MPI_Datatype recvdatatype,MPI_Comm comm)
Using this core set of collective operations, anumber of programs can be greatly simplified.