一 定义
MPI和Openmp是常用的应用在CPU上的并行化框架。
MPI是一个跨语言的通讯协议,用于编写并行计算机。支持点对点和广播。MPI的目标是高性能,大规模性,和可移植性。MPI在今天仍为高性能计算的主要模型。
特点:
-
A partitioned address space 每个线程只能通过调用api去读取非本地数据。所有的交互(Non-local Memory)都需要协同进行(握手)。
-
Supports only explicit parallelization 只支持显性的并行化,用户必须明确的规定消息传递的方式。
二 最基本的操作Send & Receive
MPI所有的操作都是基于Send & Receive上进行的。
协议 Protocols For Send/Receive:
Blocking Operations |
Non-Blocking Operations |
|
Buffered |
Sending process returns after data has been copied into communication buffer |
Sending process returns after initiating DMA transfer to buffer. This operation may not be completed on return |
Non-Buffe |