Virtual Topologies - Faculty of Science, HKBU

Virtual Topologies
Virtual Topologies

Introduction Many computational science and engineering problems reduce at the end to either a series of matrix or some form of grid operations, be it through differential, integral or other methods the dimensions of the matrices or grids are often determined by the physical problems Frequently in multiprocessing these matrices or grids are partitioned, or domain-decomposed so that each partition (or subdomain) is assigned to a process One such example is an m x n matrix decomposed into p g x n submatrices with each assigned to be worked on by one of the p processes
Introduction • Many computational science and engineering problems reduce at the end to either a series of matrix or some form of grid operations, be it through differential, integral or other methods. The dimensions of the matrices or grids are often determined by the physical problems. • Frequently in multiprocessing, these matrices or grids are partitioned, or domain-decomposed, so that each partition (or subdomain) is assigned to a process. • One such example is an m x n matrix decomposed into p q x n submatrices with each assigned to be worked on by one of the p processes

Introduction In this case, each process represents one distinct submatrix in a straightforward manner. However, an algorithm might dictate that the matrix be decomposed into a pxg logical grid, whose elements are themselves each an rx s matrix. This requirement might be due to a number of reasons: efficiency considerations, ease in code mplementation code clarity to name a few Although it is still possible to refer to each of these pxq subdomains by a linear rank number, it is obvious that a mapping of the linear process rank to a 2D virtual rank numbering would facilitate a much clearer and natural computational representation To address the needs of this and other topological layouts, the MPl library provides two types of topology routines Cartesian and graph topologies. Only Cartesian topology and the associated routines will be discussed in this chapter
Introduction • In this case, each process represents one distinct submatrix in a straightforward manner. However, an algorithm might dictate that the matrix be decomposed into a pxq logical grid, whose elements are themselves each an r x s matrix. This requirement might be due to a number of reasons: efficiency considerations, ease in code implementation, code clarity, to name a few. • Although it is still possible to refer to each of these pxq subdomains by a linear rank number, it is obvious that a mapping of the linear process rank to a 2D virtual rank numbering would facilitate a much clearer and natural computational representation. • To address the needs of this and other topological layouts, the MPI library provides two types of topology routines: Cartesian and graph topologies. Only Cartesian topology and the associated routines will be discussed in this chapter

MPI Topology Routines
MPI Topology Routines

Virtual Topology MPI Routines Some of the MPl topology routines are MPI CART CREATE MPI CART COORDS MPI CART RANK MPI CART SUB MPI CARTDIM GET MPI CART GET MPI CART SHIFT These routines are discussed in the following sections
Virtual Topology MPI Routines • Some of the MPI topology routines are – MPI_CART_CREATE – MPI_CART_COORDS – MPI_CART_RANK – MPI_CART_SUB – MPI_CARTDIM_GET – MPI_CART_GET – MPI_CART_SHIFT • These routines are discussed in the following sections

MPI CART CREATE Definition of mPl cart create Used to create cartesian coordinate structures of arbitrary dimensions, on the processes. The new communicator receives no cached information The MP cart create routine creates a new communicator using a Cartesian topology int MPl Cart create(MPI Comm old comm, int ndims int *dim size, int*periods, int reorder, MPI Comm new comm The function returns an int error flag
MPI_CART_CREATE • Definition of MPI_CART_CREATE – Used to create Cartesian coordinate structures, of arbitrary dimensions, on the processes. The new communicator receives no cached information. • The MPI_CART_CREATE routine creates a new communicator using a Cartesian topology. int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dim_size, int *periods, int reorder, MPI_Comm *new_comm) • The function returns an int error flag

MPI CART CREATE Variable C Type In/out Description Name old comm MPI Comm Input Communicator handle Indies Input Number of dimensions dim size Input Array of size dims providing length in each dimension periods int Input Array of size dims specifying periodicity status of each dimension reorder int Input whether process rank reordering by MPI is permitted new comm MPI Comm* Output Communicator handle
MPI_CART_CREATE Variable Name C Type In/Out Description old_comm MPI_Comm Input Communicator handle ndims int Input Number of dimensions dim_size int * Input Array of size ndims providing length in each dimension periods int * Input Array of size ndims specifying periodicity status of each dimension reorder int Input whether process rank reordering by MPI is permitted new_comm MPI_Comm * Output Communicator handle

MPI CART CREATE ude" stdio. h #include"mpi. h MPI Comm old comm, new comm tint ndis, reorder, periods [2], dim size[2] old comm= MPI COMM WORLD dims 2 2D matrix/grid*/ dim size[0]=3:/rows*/ dim size[1]=2;/*columns*/ periods[0]=1; /row periodic(each column forms a ring)*/ periods[1]=0; /columns non-periodic * reorder =1; / allows processes reordered for efficiency * MPI Cart create(old comm, ndims, dim size, periods, reorder, &new comm)
MPI_CART_CREATE #include "stdio.h" #include "mpi.h" MPI_Comm old_comm, new_comm; int ndims, reorder, periods[2], dim_size[2]; old_comm = MPI_COMM_WORLD; ndims = 2; /* 2D matrix/grid */ dim_size[0] = 3; /* rows */ dim_size[1] = 2; /* columns */ periods[0] = 1; /* row periodic (each column forms a ring) */ periods[1] = 0; /* columns non-periodic */ reorder = 1; /* allows processes reordered for efficiency */ MPI_Cart_create(old_comm, ndims, dim_size, periods, reorder, &new_comm);

MPI CART CREATE In the above example we use MPI CART CREATE to map 0,0(0) 0,1(1) or rename)6 processes from a linear ordering(0, 1, 2, 3, 4, 5) into a two-dimensional matrix ordering of 3 rows by 2 1,0(2 1,1(3) columns(ie.,(0,0),(0,1), 2,1) Figure 8.1(a)depicts the resulting cartesian grid representation for the 2,0(4) 2,1(5) processes. The index pair i, represent row"iand column j. The corresponding(inear) rank number is enclosed in Figure 8.1(a). Cartesian parentheses Grid
MPI_CART_CREATE • In the above example we use MPI_CART_CREATE to map (or rename) 6 processes from a linear ordering (0,1,2,3,4,5) into a two-dimensional matrix ordering of 3 rows by 2 columns ( i.e., (0,0), (0,1), ..., (2,1) ). • Figure 8.1 (a) depicts the resulting Cartesian grid representation for the processes. The index pair "i,j" represent row "i" and column "j". The corresponding (linear) rank number is enclosed in parentheses. 0,0 (0) 0,1 (1) 1,0 (2) 1,1 (3) 2,0 (4) 2,1 (5) Figure 8.1 (a). Cartesian Grid

MPI CART CREATE With processes renamed in a 2d. No periodicity is imposed on the grid topology, we are able to second dimension( periods[1]=0) assign or distribute work,or Any reference to the column index distinguish among the processes by their grid topology rather than outside of its defined range(in this by their linear process ranks case 0 to 1)will result in a Additionally, we have imposed negative process rank(equal to periodicity along the first MPI PROC NULL Which is-1), dimension( periods[0]=1), which which signifies that it is out of means that any reference beyond range the first or last entry of any column Similarly, if periodicity was defined will be wrapped around cyclically only for the column index (i.e For example, row index i=-1, due periods[0]=0 periods[1]=1), each to periodicity, corresponds to i=2 row would wrap around itself Similarly. i=-2 maps onto i=1 Likewise,i=3 is the same asi=0
MPI_CART_CREATE • With processes renamed in a 2D grid topology, we are able to assign or distribute work, or distinguish among the processes by their grid topology rather than by their linear process ranks. • Additionally, we have imposed periodicity along the first dimension ( periods[0]=1 ), which means that any reference beyond the first or last entry of any column will be wrapped around cyclically. • For example, row index i = -1, due to periodicity, corresponds to i = 2. Similarly, i = -2 maps onto i = 1. Likewise, i = 3 is the same as i = 0. • No periodicity is imposed on the second dimension ( periods[1]=0 ). Any reference to the column index outside of its defined range (in this case 0 to 1) will result in a negative process rank (equal to MPI_PROC_NULL which is -1), which signifies that it is out of range. • Similarly, if periodicity was defined only for the column index (i.e., periods[0]=0; periods[1]=1), each row would wrap around itself
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《Adobe Photoshop CS》软件教程(PPT讲稿)第13章 使用路径.ppt
- 《软件开发》课程PPT教学课件:Chapter 16 异常处理 Exception Handling.ppt
- 西安电子科技大学:《计算机网络 Computer Networks》课程教学资源(PPT课件讲稿)基于CORBA的分布式平台(CORBA编程-Hello World例程).ppt
- 电子工业出版社:《计算机网络》课程教学资源(第五版,PPT课件讲稿)第七章 网络安全.ppt
- 北京大学:浅谈计算机研究的层次与境界(李振华).pptx
- 南京大学:《计算机图形学》课程教学资源(PPT课件讲稿)计算机图形学引言(主讲:路通).ppt
- 国家十一五规划教材:《电子商务案例分析》课程教学资源(PPT课件)第11章 网络社区模式案例分析.ppt
- 西安电子科技大学:《操作系统 Operating Systems》课程教学资源(PPT课件讲稿)Chapter 08 多处理器系统 Multiple Processor Systems.ppt
- 计算机问题求解(PPT讲稿)图论中的其它专题.pptx
- SIGCOMM 2002:New Directions in Traffic Measurement and Accounting.ppt
- 厦门大学计算机科学系:《大数据技术原理与应用》课程教学资源(PPT课件)第十章 数据可视化.ppt
- 成都信息工程大学(成都信息工程学院):分层分流培养个性发展的计算机卓越工程师——专业课分层教学探索与实践.ppt
- 沈阳理工大学:《Java程序设计基础》课程教学资源(PPT课件讲稿)第1章 创建Java开发环境.ppt
- 北京师范大学网络教育:《计算机应用基础》课程教学资源(PPT讲稿)第8章 计算机安全、第9章 多媒体技术.pptx
- 西安电子科技大学:《8086CPU 指令系统》课程教学资源(PPT课件讲稿,共五部分,王晓甜).pptx
- 北京大学:《搜索引擎 Search Engines》课程教学资源(PPT讲稿)Evaluating Search Engines(Search Engines Information Retrieval in Practice).ppt
- 香港浸会大学:《Data Communications and Networking》课程教学资源(PPT讲稿)Chapter 4 Transmission Media.ppt
- 《EDA技术》实用教程(PPT讲稿)第5章 QuartusII 应用向导.ppt
- 《数字图像处理 Digital Image Processing》课程教学资源(PPT课件讲稿)第2章 图像分析.ppt
- 东南大学计算机学院:《操作系统概念 OPERATING SYSTEM CONCEPTS》课程教学资源(PPT课件)Operating-System Structures.ppt
- 《Java语言程序设计》课程教学资源(PPT课件讲稿)第三章 面向对象特征.ppt
- 中国科学技术大学:《算法基础》课程教学资源(PPT课件讲稿)第七讲 顺序统计学(主讲人:吕敏).pptx
- 清华大学出版社:《C语言程序设计》课程教学资源(PPT课件讲稿)第7章 用户自定义函数.ppt
- 清华大学:Mandarin Pronunciation Variation Modeling.ppt
- 西安电子科技大学:《MATLAB程序设计语言》课程教学资源(PPT讲稿)Chapter1 Matlab系统概述.ppt
- 中国科学技术大学:《网络算法学》课程教学资源(PPT课件)第六章 传输控制.ppt
- 香港浸会大学:《Data Communications and Networking》课程教学资源(PPT讲稿)Socket Programming Part II:Design of Server Software.ppt
- 上海交通大学:《软件开发》课程教学资源(PPT课件)第一讲 概述.ppt
- 《计算机网络原理》课程教学资源(PPT课件讲稿)第二章 网络实现模型.ppt
- 香港理工大学:INSTRUCTION SETS 指令.pptx
- 计算机问题求解(PPT讲稿)B树.pptx
- 北京大学远程教育:《计算机应用基础》课程PPT教学课件(专科)串讲(综合复习).pptx
- 《Microsoft Access 2003》教程PPT:第9章 报表设计.ppt
- 《编译原理和技术》课程PPT教学课件:第十三章 函数式语言的编译.ppt
- 四川大学:Object-Oriented Design and Programming(Java,PPT课件).ppt
- 安徽理工大学:《汇编语言》课程教学资源(PPT课件讲稿)第五章 循环与分支程序设计.ppt
- 《C程序设计》课程PPT教学课件(电子教案)第六章 函数.ppt
- 基于语义关联和信息增益的TFIDF改进算法研究.ppt
- Integrated analysis of regulatoryand metabolic networks revealsnovel regulatory mechanisms inSaccharomyces cerevisiae.ppt
- 山东大学:《计算机图形学》课程PPT教学课件(Programming with OpenGL)Part 3:Three Dimensions.ppt