Message Passing Interface
The Message Passing Interface (MPI) is a standardized and portable message-passing system designed to function on a wide variety of parallel computing architectures. MPI is widely used for communication in distributed systems, especially in high-performance computing (HPC) environments. It provides a set of library routines that can be used to implement parallel algorithms and exchange information between processes.
Process Model:
MPI_COMM_WORLD
, includes all processes.Initialization and Finalization:
MPI_Init
: Initializes the MPI environment.MPI_Finalize
: Cleans up the MPI environment.Point-to-Point Communication:
MPI_Send
: Sends a message to a specified process.MPI_Recv
: Receives a message from a specified process.MPI_Isend
: Initiates a non-blocking send operation.MPI_Irecv
: Initiates a non-blocking receive operation.Collective Communication:
MPI_Bcast
: Broadcasts a message from one process to all other processes.MPI_Scatter
: Distributes distinct chunks of data from one process to all processes.MPI_Gather
: Gathers distinct chunks of data from all processes to one process.MPI_Allgather
: Gathers data from all processes and distributes it to all processes.MPI_Reduce
: Reduces values from all processes to a single value using a specified operation.MPI_Allreduce
: Similar to MPI_Reduce
, but the result is distributed to all processes.