MPI

From SourceWiki
Jump to navigation Jump to search

MPI: Message passing for distributed memory computing

Introduction

SPMD

Hello World

These programs assume that all processes can write to the screen. This is not a safe assumption.

Send and Receive

triple (address, count, type)

Synchronisation, Blocking and the role of Buffers

Independent 'compute elements' Synchronised communication requires that both sender and receiver are ready. Through the introduction of a buffer, a sender can deposit a message before the receiver is ready. MPI_Recv() only returns when the message has been received, however. Hence the term blocking.

A Common Bug

If all processes are waiting to receive prior to sending, then we will have deadlock.

Non-Blocking Communication

Latency Hiding

Collective Communications

Load Balancing