一对进程之间的数据转换,也就是说一边发送数据另一边接收数据,点到点通信是MPI通信机制的基础,它分为同步通信和异步通信二种机制。
阻塞式函数
1. int MPI_send(void *buf,int count,MPI_Datatype datatype,int dest,int tag,MPI_Comm comm)
IN buf 所要发送消息数据的首地址
IN count 发送消息数组元素的个数
IN datatype 发送消息的数据类型
IN dest 接收消息的进程编号
IN tag 消息标签
IN comm 通信子
2. int MPI_Recv(void *buf,int count,MPI_Datatype datatype,int source,int tag,MPI_Comm comm,MPI_Status *status)
OUT buf 接收消息数据的首地址
IN Count 接收消息数组元素的最大个数
IN datatype 接收消息的数据类型
IN source 发送消息的进程编号
IN tag 消息标签
IN comm 通信子
OUT status 接收消息时返回的状态
3. int MPI_Get_Count(MPI_Status status,MPI_Datatype datatype,int *count)
IN status 接收消息时返回的状态
IN datatype 接收消息时返回的类型
OUT Count 接收消息时数组元素的个数
4. int MPI_Sendrecv(void *sendbuf,int sendcount,MPI_Datatype sendtype,int dest,int sendtag,void *recvbuf,int recvcount,MPI_Datatype recvtype,int source,int recvtag,MPI_Comm comm,MPI_Status *status)
IN sendbuf 所要发送消息数据的首地址
IN sendcount 发送消息数组元素的个数
IN sendtype 发送消息的数据类型
IN dest 接收消息的进程编号
IN sendtag 发送消息标签
OUT recvbuf 接收消息数据的首地址
IN recvcou