MPI基础知识
来源:互联网 发布:北京php培训公司排名 编辑:程序博客网 时间:2024/05/17 23:01
MPI6个常用的函数:
1. MPI_Init(...);
2. MPI_Comm_size(....);
3. MPI_Comm_rank(....);
4. MPI_Send(....);
5. MPI_Recv(.....);
6. MPI_Finalize();
MPI集群通信函数
1. 广播broadcast
int MPI_Bcast (
void *buffer,/*发送/接收buf*/
int count, /*元素个数*/
MPI_Datatype datatype,
int root, /*指定根进程*/
MPI_Comm comm)
根进程既是发送缓冲区也是接收缓冲区
2. 数据收集 gather
int MPI_Gather(void* sendbuf, int sendcount,
MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, int root, MPI_Comm comm)
3. 数据散发 scatter
int MPI_Scatter(void* sendbuf, int sendcount,
MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, int root, MPI_Comm comm)
sendbuf 待发送数据首地址
sendcounts 待发送数据数量
sendtype 待发送数据的类型
recvbuf 接收到数据的存放位置
recvcount 接收的数据数量
recvtype 接收数据的类型
root 根进程号
comm 通信器名字
4. 数据归约 reduce
对组中所有进程的发送缓冲区中的数据用OP参数指定的操
作进行运算,并将结果送回到根进程的接收缓冲区中.
int MPI_Reduce ( void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm
comm )
操作符 含义
MPI_MAX 最大
MPI_MIN 最小
MPI_SUM 求合
MPI_PROD 乘积
MPI_LAND 逻辑与
MPI_BAND 按位与
MPI_LOR 逻辑或
MPI_BOR 按位或
MPI_LXOR 逻辑异或
MPI_BXOR 按位异或
MPI_MAXLOC max value and location
MPI_MINLOC min value and location
- MPI基础知识
- MPI
- mpi
- MPI
- MPI
- MPI
- MPI
- MPI
- 基础MPI: Hello MPI
- MPI入门
- MPI简介
- MPI介绍
- MPI简介
- MPI命令
- MPI Simpler
- mpi&&c++
- MPI/DP
- openMP & MPI
- Android Uid和Pid区别。
- Android 模拟系统事件(二)
- 跟曾国藩学读书
- nyoj 513 A+B Problem IV 【Java大数】
- 《程序员的思维修炼》
- MPI基础知识
- 群
- Android ANR异常及解决方法
- golang笔记-注释-标识符
- Android 模拟系统事件(三)
- nyoj 803 A/B Problem 【Java大数】
- 芯片互联设计
- 1.C++异常处理
- 使用jmeter进行性能测试-Jmeter教程及技巧汇总