華束师充天学|数学科学学院 School of Mathematical Sciences.East China Normal University OpenMP并行编程 (一) 并行编程介绍 并行域与工作共享 http://math.ecnu.edu.cn/~jypan
http://math.ecnu.edu.cn/~jypan 1 OpenMP 并行编程 (一) —— 并行编程介绍 —— 并行域与工作共享
华东师范大学数学科学学院 目录页 School of Mathematical Sciences,ECNU Contents 1 OpenMP介绍 2 并行编程模式 3 并行域操作 4 工作共享结构 OpenMP Specifications,https://www.openmp.org/specifications Using OpenMP-The Next Step,van der Pas et al,2017 Using OpenMP,Chapman,Jost,and Van Der Pas,2007 http://math.ecnu.edu.cn/-jypan
http://math.ecnu.edu.cn/~jypan 华东师范大学 数学科学学院 School of Mathematical Sciences, ECNU 1 2 OpenMP 介绍 并行编程模式 3 并行域操作 4 工作共享结构 OpenMP Specifications, https://www.openmp.org/specifications Using OpenMP – The Next Step, van der Pas et al, 2017 Using OpenMP, Chapman, Jost, and Van Der Pas, 2007 目录页 Contents
华东师范大学数学科学学院 目录页 School of Mathematical Sciences,ECNU Contents OpenMP介绍 1 OpenMP介绍 2 并行编程模式 3 并行域操作 4 工作共享结构 http://math.ecnu.edu.cn/-jypan
http://math.ecnu.edu.cn/~jypan 华东师范大学 数学科学学院 School of Mathematical Sciences, ECNU 1 2 OpenMP介绍 并行编程模式 3 并行域操作 1 OpenMP 介绍 4 工作共享结构 目录页 Contents
OpenMP简介 口通过在源代码(串行)中添加OpenMP指令和调用 QpenMP OpenMP库函数来实现在共享内存系统上的并行。 https://www.openmp.org 口为共享内存并行程序员提供了一种简单灵活的开发并 行应用的接口模型,使程序既可以在台式机上执行, 也可以在超级计算机上执行,具有良好的可移植性。 Jointly defined by a group of major computer hardware and software vendors and major parallel computing user facilities,the OpenMP API is a portable,scalable model that gives shared-memory parallel programmers a simple and flexible interface for developing parallel applications on platforms ranging from embedded systems and accelerator devices to multicore systems and shared-memory systems. https://www.openmp.org API:Application Programming Interface http://math.ecnu.edu.cn/~jypan 4
http://math.ecnu.edu.cn/~jypan 4 OpenMP 简介 Jointly defined by a group of major computer hardware and software vendors and major parallel computing user facilities, the OpenMP API is a portable, scalable model that gives shared-memory parallel programmers a simple and flexible interface for developing parallel applications on platforms ranging from embedded systems and accelerator devices to multicore systems and shared-memory systems. https://www.openmp.org API:Application Programming Interface 通过在源代码(串行)中添加 OpenMP 指令和调用 OpenMP 库函数来实现在共享内存系统上的并行。 为共享内存并行程序员提供了一种简单灵活的开发并 行应用的接口模型,使程序既可以在台式机上执行, 也可以在超级计算机上执行,具有良好的可移植性。 https://www.openmp.org
使用说明 FORTRAN/C/C++自带程序库,无需另外安装 ▣ 编译时不打开OpenMP编译选项,则编译器将忽略OpenMP指令, 从而生成串行可执行程序(串行等价性) ▣打开OpenMP编译选项,编译器将对OpenMP指令进行处理,编译 生成OpenMP并行可执行程序 口并行线程数可以在程序启动时利用环境变量等方法进行动态设置 口编程方式:增量并行 口支持与MPI混合编程 http://math.ecnu.edu.cn/-jypan 5
http://math.ecnu.edu.cn/~jypan 5 使用说明 FORTRAN/C/C++ 自带程序库,无需另外安装 编译时不打开 OpenMP 编译选项,则编译器将忽略 OpenMP 指令, 从而生成串行可执行程序(串行等价性) 打开 OpenMP 编译选项,编译器将对 OpenMP 指令进行处理,编译 生成 OpenMP 并行可执行程序 并行线程数可以在程序启动时利用环境变量等方法进行动态设置 编程方式:增量并行 支持与 MPI 混合编程