0 華柬师免大学|数学科学学院 chool of Ma sEast China Normal University OpenMP并行编程 (二) 工作共享结构 同步与数据环境
OpenMP 并行编程 (二) —— 工作共享结构 —— 同步与数据环境
华东师范大学数学科学学院 目录页 School of Mathematical Sciences,ECNU 案 Contents 编译制导:工作共享结构(续) 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 编译制导:工作共享结构(续) 编译制导:同步指令 3 编译制导:数据环境指令
华东师范大学数学科学学院 目录页 School of Mathematical Sciences,ECNU 案 Contents 工作共享结构(续) sections section 1 工作共享结构 single master 2 同步结构 ■ task(略) 3 数据环境结构 http://math.ecnu.edu.cn/-jypan
http://math.ecnu.edu.cn/~jypan 目录页 Contents 华东师范大学 数学科学学院 School of Mathematical Sciences, ECNU http://math.ecnu.edu.cn/~jypan sections / section single master task(略) 1 2 工作共享结构 同步结构 3 数据环境结构 1 工作共享结构(续)
内容提要 OpenMP编译制导 ●工作共享结构: for,sections,single,master,task,workshare ●同步指令: critical,barrier,atomic,flush,ordered 。数据环境指令 threadprivate ·子句: private,firstprivate,..... http://math.ecnu.edu.cn/-jypan 4
http://math.ecnu.edu.cn/~jypan 4 内容提要 OpenMP 编译制导 工作共享结构: for,sections,single,master,task,workshare 同步指令: critical,barrier,atomic,flush,ordered 数据环境指令 threadprivate 子句: private,firstprivate,… …
SECTIONS结构 !Somp sections [clause clause ... !Somp section structured-block Fortran !Somp section structured-block !Somp end sections [nowait] #pragma omp sections [clause clause...] { #pragma omp section C/C++ structured-block #pragma omp section structured-block ●sections也可以与parallel合并,即#pragma omp parallel sections http://math.ecnu.edu.cn/-jypan 5
http://math.ecnu.edu.cn/~jypan 5 SECTIONS 结构 Fortran !$omp sections [clause clause ...] !$omp section structured-block !$omp section structured-block !$omp end sections [nowait] C/C++ #pragma omp sections [clause clause ...] { #pragma omp section structured-block #pragma omp section structured-block . . . . . . . . . . . . } sections 也可以与 parallel 合并,即 #pragma omp parallel sections