mpi tutorial 介绍基本的mpi函数,源码地址
0, 基本概念
buffer, data count, data type, destination, source, tag。下述的mli函数的参数,都包括这些名词。其中buffer,就是发送/接收的变量名。c/c++中,参数按引用传递。
mpi是spmd模型,适合粗粒度并行。各节点的数据,除了通信沟通外,相互独立。
mpi_wtime(), 类似 omp_get_wtime(void)
MPI_Init() , 在mpi-2中,参数可以为null; mpi-1中,必须与main的参数一致。
一, 点对点通信
1.1 静态数据传输
MPI_Send(void* data, int count, MPI_Datatype datatype, int destination, int tag, MPI_Comm communicator)