多核环境下矩阵库设计和优化

自1946年计算机问世以来,数值计算一直是计算机应用的主要领域之一,它已经广泛应用到人类生产与生活的各个方面,矩阵运算是数值计算最基本和经常使用的运算之一,它是数值计算的一个基础,提高矩阵运算的性能则显得更为重要。本文把矩阵运算与多核、并行联系起来,并分别从矩阵库的设计,矩阵库的并行化以及多核环境下矩阵库运算的优化三个方面阐述了矩阵库的实现,具体内容如下:(1)矩阵库的设计先在完成功能、运算需求、可维护性、面向对象、并行化等方面确定了矩阵库的设计原则;然后结合矩阵的数学定义、C++的特点和以后程序扩充的需要的基础上,给出了矩阵库的组织结构,并在Microsoft Visual C++ 2008 Express Edition平台上完成矩阵库的设计方案,最后在文中给出矩阵行列式求值的示例。(2)矩阵库的并行研究在浅析浅析现有的消息传递模型、数据并行模型、共享存储并行编程模型三种并行模型之后,通过比较重点介绍了一种面向共享内存的多处理器多线程并行程序语言—OpenMP,并对OpenMP指令、库函数和并行化的循环选取原则作了介绍。然后在Microsoft Visual C++ 2008 Express Edition平台上用OpenMP并行机制对设计好的矩阵库串行程序实施并行化。同时,给出了矩阵行列式求值的并行化处理示例。(3)利用Intel VTune进行优化在介绍现有的一些优化工具之后,重点介绍了英特尔公司针对英特尔多核处理器开发的Intel VTune优化工具,然后在上述平台下用Intel VTune优化工具对并行处理后的矩阵库进行程序浅析浅析,采集大量浅析浅析数据,以得到各种因素对运算效率的影响,并对算法进一步浅析浅析和改善。(4)根据本文给出的矩阵库的中的矩阵的构造、矩阵的加减乘除运算、矩阵相等、矩阵转置、判断矩阵对称、判断矩阵对称正定、一般矩阵的秩、求逆矩阵、求对称正定矩阵逆、求托伯利兹矩阵逆等运算,在现有的软硬件平台上完成了串行、并行、优化后不同方面的对比实验。通过对矩阵各种基本操作的应用和对输出结果的浅析浅析,计算结果准确,程序基本达到矩阵基本运算的初衷;通过实例的运算比较,结果表明并行优化后的程序的性能有改善。

【Abstract】wWw.shuoshilunwen.com Since the advent of computer in 1946, numerical computation has been one of the main fields of computer application, which has been widely used in the human’s production and all aspects of life. In the numerical computation, the matrix is one of the most basic and often use operation. In a sense, the matrix is a common in numerical computation, the popularity of which is very important. This paper related matrix to multi-core and parallel computing, and expounded the realization of matrix library separately from the design of matrix library, matrix library parallelization and multi-core environment matrix optimization. The details are as following:(1) The design of matrix library Firstly, confirms the matrix library’ design principles from function, computing requirements, maintainability, object-oriented and parallelization; and then ge the organizational structure of matrix library when combined with matrix ’Mathematical definition, c++’ characteristics and the need of program later expansion. After making clear basic operations of matrix library, based on the platform Microsoft Visual C++ 2008 Express Edition propose solutions of parallel matrix library, and the paper ge the example of calculating determinant’ evaluation.(2) The Parallel research of matrix library After analyzing Message traner model, data parallel model and sharing storage parallel programming model three parallel model, through comparing and analysis emphatically introduces OpenMP which is an application programming interface (API) that supports multi-platform shared memory multi processing programming in C, C++, and Fortran on many architectures, and introduces it’s command, library function and the cycle selecting principles of Parallelization, then implements paralleli of the matrix library which has designed on the platform of Microsoft Visual c++ 2008 Express Edition. Meanwhile, the paper ge parallel calculating determinant evaluation.(3) Optimizing with Intel VTune Introduceing some existing optimization tools, the paper emphatically introduces Intel VTune which was developed for Intel cpu from Intel company, then using Intel VTune to analyse the program and collect informations. After know the actors which affect the efficiency, we improve the program.(4) According to all the operations of matrix such as construction, additional, substract, multiplication, division, equal, transposition, judge symmetrical and positive definite.matrix’ as sequence, inverse matrix, etc.,at the end, do Comparative experiments on existing platform.Based on the application of the basic operation of matrix and the analysis of the output, the calculation results accurate, procedures achieve to the original intention. And through the contrast can see the program after optimization of parallel performance has improved significantly.

【关键词】 多核;矩阵运算;并行计算;共享内存;OPenMP;
【Key words】 multi-core processor chips;OPenMP;parallel computing;matrix operation;shared-memory;

相关论文

设计多核环境Cache一致性协议探究

【毕业论文】:商业应用和科学计算对计算能力要求的不断提高,传统的单核处理器已经够各类应用对计算能力的要求,多核处理器应运而生。多核处。
浏览量:15021 点赞量:4873

多核环境下负载均衡策略和设计

随着多核计算机的发展及多核处理器的普及,目前基于多核处理器的并行计算已经成为了高性能计算的首要选择。多核计算机已经可以完成许多大规。
浏览量:131373 点赞量:28447

多核环境下矩阵库设计和优化

自1946年计算机问世以来,数值计算一直是计算机应用的主要领域之一,它已经广泛应用到人类生产与生活的各个方面,矩阵运算是数值计算最基本和。
浏览量:17627 点赞量:5260

环境响应型聚合物设计合成与其性能-学士

摘要:环境响应型聚合物作为智能材料,在过去数十年引起了科学家们浓厚的探讨兴趣,它们可以将环境刺激(如温度、pH、离子强度和葡萄糖浓度。
浏览量:158833 点赞量:34546