[MPI] 具有虚拟进程拓扑的 MPI 程序设计
2012-11-06 20:17
766 查看
学习资料 《并行算法实践》 (陈国良 等)
学习笔记
虚拟进程拓扑概念
在许多应用程序中,进程的线性排列不能充分地反映进程间在逻辑上的通信模型(通常由问题几何和所用的算法决定),进程经常排列成二维或三维网格形式的拓扑模型,而且,通常用一个图来描述逻辑进程排列, 这种逻辑进程排列称为“虚拟拓扑”。拓扑是组内通信域上的额外、可选的属性,它不能附加在组间通信域上(inter-communicator)上。
虚拟进程拓扑有两种类型:具有规则的网格形状的笛卡儿拓扑 和 具有任意形状的图拓扑。
(NOTE: 这里根据规则与否,分成笛卡儿拓扑 和 图拓扑 两种,这里的笛卡儿拓扑,联想到的是 笛卡儿坐标)
笛卡儿拓扑和图拓扑调用的简单对比如下,这里的主要操作为:创建、得到维度、得到拓扑信息、物理映射。
---------------------------------------------------------------------------------------------------------------------------
操作 笛卡儿拓扑 图拓扑
创建 MPI_CART_CREATE MPI_GRAPH_CREATE
得到维数 MPI_CARTDIM_GET MPI_GRAPHDIMS_GET
得到拓扑信息 MPI_CART_GET MPI_GRAPH_GET
物理映射 MPI_CART_MAP MPI_GRAPH_MAP
------------------------------------------------------------------------------------------------------------------------------
主要函数
笛卡儿拓扑
int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods, int reorder, MPI_Comm *comm_cart)
int MPI_Cart_get( MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords)
int MPI_Cart_rank( MPI_Comm comm, int *coords, int *rank)
int MPI_Cartdim_get( MPI_Comm comm, int *ndims)
int MPI_Cart_shift( MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest)
int MPI_Cart_coords( MPI_Comm comm, int rank, int maxdims, in *coords)
int MPI_Cart_sub( MPI_Comm comm, int *remain_dims, MPI_Comm *newcomm)
int MPI_Cart_map(MPI_Comm comm, int ndims , int *dims, int *periods,int *newrank)
图拓扑
int MPI_Graph_create(MPI_Comm comm_old, int nnodes, int *index, int *edges, int reorder, MPI_Comm *comm_graph)
int MPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges)
int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int *index, int *edges)
int MPI_Graph_neighbors_count( MPI_Comm comm, int rank, int *nneighbors)
int MPI_Graph_neighbors_count( MPI_Comm comm, int rank, int maxneighbors, int *neighbors)
int MPI_Graph_map(MPI_Comm comm, int nodes, int *index, int *edges, int *newrank)
学习笔记
虚拟进程拓扑概念
在许多应用程序中,进程的线性排列不能充分地反映进程间在逻辑上的通信模型(通常由问题几何和所用的算法决定),进程经常排列成二维或三维网格形式的拓扑模型,而且,通常用一个图来描述逻辑进程排列, 这种逻辑进程排列称为“虚拟拓扑”。拓扑是组内通信域上的额外、可选的属性,它不能附加在组间通信域上(inter-communicator)上。
虚拟进程拓扑有两种类型:具有规则的网格形状的笛卡儿拓扑 和 具有任意形状的图拓扑。
(NOTE: 这里根据规则与否,分成笛卡儿拓扑 和 图拓扑 两种,这里的笛卡儿拓扑,联想到的是 笛卡儿坐标)
笛卡儿拓扑和图拓扑调用的简单对比如下,这里的主要操作为:创建、得到维度、得到拓扑信息、物理映射。
---------------------------------------------------------------------------------------------------------------------------
操作 笛卡儿拓扑 图拓扑
创建 MPI_CART_CREATE MPI_GRAPH_CREATE
得到维数 MPI_CARTDIM_GET MPI_GRAPHDIMS_GET
得到拓扑信息 MPI_CART_GET MPI_GRAPH_GET
物理映射 MPI_CART_MAP MPI_GRAPH_MAP
------------------------------------------------------------------------------------------------------------------------------
主要函数
笛卡儿拓扑
int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods, int reorder, MPI_Comm *comm_cart)
int MPI_Cart_get( MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords)
int MPI_Cart_rank( MPI_Comm comm, int *coords, int *rank)
int MPI_Cartdim_get( MPI_Comm comm, int *ndims)
int MPI_Cart_shift( MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest)
int MPI_Cart_coords( MPI_Comm comm, int rank, int maxdims, in *coords)
int MPI_Cart_sub( MPI_Comm comm, int *remain_dims, MPI_Comm *newcomm)
int MPI_Cart_map(MPI_Comm comm, int ndims , int *dims, int *periods,int *newrank)
图拓扑
int MPI_Graph_create(MPI_Comm comm_old, int nnodes, int *index, int *edges, int reorder, MPI_Comm *comm_graph)
int MPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges)
int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int *index, int *edges)
int MPI_Graph_neighbors_count( MPI_Comm comm, int rank, int *nneighbors)
int MPI_Graph_neighbors_count( MPI_Comm comm, int rank, int maxneighbors, int *neighbors)
int MPI_Graph_map(MPI_Comm comm, int nodes, int *index, int *edges, int *newrank)
相关文章推荐
- 【MPI学习6】MPI并行程序设计模式:具有不连续数据发送的MPI程序设计
- MPI的拓扑(虚拟拓扑和笛卡尔拓扑)
- 【MPI学习6】MPI并行程序设计模式:具有不连续数据发送的MPI程序设计
- MPI学习六 具有不连续数据发送的MPI程序设计
- 【MPI学习6】MPI并行程序设计模式:具有不连续数据发送的MPI程序设计
- [MPI] MPI具有不连续数据发送的程序设计
- 关于 程序设计—多进程还是多线程
- 采用虚拟命名管道的字符设备和阻塞型I/O实现进程间的通信实现KWIC程序
- LINUX 进程控制程序设计
- MPI并行程序设计的环境配置
- Java程序设计(六)----矩阵(具有初始化矩阵的功能、修改矩阵元素的功能)
- 为什么执行ping命令时不需要root权限? 怎样让进程具有root权限?
- 【MPI学习2】MPI并行程序设计模式:对等模式 & 主从模式
- 进程控制理论<四>---那些年我们一起学习linux程序设计 .
- 进程的虚拟地址映射
- 进程的虚拟地址空间划分
- 监控apache虚拟主机进程
- IIS部署WCF之“句柄无效”和“必须具有能够进行密钥交换的私钥。该进程必须具有访问私钥的权限。”
- [Azure]使用Azure Powershell输出ARM模式下某个账号中所有订阅下的虚拟网络拓扑