華柬师免大學|数学科学学院 School of Mathematical Sciences.East China Normal University 矩阵向量乘积 并行算法 (OpenMP) http://math.ecnu.edu.cn/~jypan
http://math.ecnu.edu.cn/~jypan 矩阵向量乘积 并行算法 (OpenMP)
华东师范大学数学科学学院 目录页 School of Mathematical Sciences,ECNU Contents 1 并行计算预备知识 2 矩阵向量并行乘积 http://math.ecnu.edu.cn/~jypan
http://math.ecnu.edu.cn/~jypan 目录页 Contents 华东师范大学 数学科学学院 School of Mathematical Sciences, ECNU http://math.ecnu.edu.cn/~jypan 1 2 并行计算预备知识 矩阵向量并行乘积
华东师范大学数学科学学院 目录页 School of Mathematical Sciences,ECNU Contents 预备知识 ■ 加速比与并行效率 性能优化 一些记号和设定 http://math.ecnu.edu.cn/~jypan
http://math.ecnu.edu.cn/~jypan 目录页 Contents 华东师范大学 数学科学学院 School of Mathematical Sciences, ECNU http://math.ecnu.edu.cn/~jypan 加速比与并行效率 性能优化 一些记号和设定 1 预备知识
并行算法基础知识 ●加速比 Ts Sp(q)= Tp(q) 其中T,串行程序执行时间,T,()为q个进程(线程)的执行时间 ·并行效率 Ep(q)= Sp(q) q http://math.ecnu.edu.cn/-jypan 4
http://math.ecnu.edu.cn/~jypan 4 并行算法基础知识 加速比 其中 Ts 串行程序执行时间,Tp(q) 为 q 个进程(线程)的执行时间 并行效率
程序性能优化 ■ 串行程序性能优化一并行程序性能优化的基础 ●调用高性能库。如:BLAS、LAPACK、FFTW ●选择编译器优化选项:-O2、-O3 ●合理定义数组维数 ●注意嵌套循环次数:数据访问的空间局部性和时间局部性 ●循环展开 ●数据分块 http://math.ecnu.edu.cn/-jypan 5
http://math.ecnu.edu.cn/~jypan 5 程序性能优化 串行程序性能优化 —并行程序性能优化的基础 调用高性能库。如:BLAS、LAPACK、FFTW 选择编译器优化选项:-O2、-O3 合理定义数组维数 注意嵌套循环次数:数据访问的空间局部性和时间局部性 数据分块 循环展开