当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

华东师范大学:《高等数值分析(高性能计算/并行计算)》课程教学资源(讲义)04 OpenMP并行编程(三)运行库函数、环境变量

资源类别:文库,文档格式:PDF,文档页数:29,文件大小:631.97KB,团购合买
点击下载完整版文档(PDF)

華東狮免天學数学科学学院 School of Mathematical Sciences.East China Normal University OpenMP并行编程 (三) 运行库函数 环境变量 1 http://math.ecnu.edu.cn/~jypan

http://math.ecnu.edu.cn/~jypan 1 OpenMP 并行编程 (三) —— 运行库函数 —— 环境变量

华东师范大学数学科学学院 目录页 School of Mathematical Sciences,ECNU Contents 运行库函数 2 环境变量 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 1 2 运行库函数 环境变量 3 编程示例

华东师范大学数学科学学院 目录页 School of Mathematical Sciences,ECNU Contents 运行库函数 Runtime Library Routines 运行环境函数 1 运行库函数 锁函数 ■ 时间函数 2 环境变量 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  运行环境函数  锁函数  时间函数 1 2 运行库函数 环境变量 1 运行库函数 Runtime Library Routines 3 编程示例

运行环境函数 Execution Environment Routines omp_set_num_threads(int) 设置并行域中的线程个数(用在串行域中) omp_get_num_threads() 返回当前并行域中的线程个数 omp_get_max_threads() 返回并行域中缺省可用的最大线程个数 omp_get_thread_num() 返回当前线程的线程号,0号为主线程 omp_get_num_procs() 返回系统中处理器的个数 omp_in_parallel() 判断是否在并行域中 启用或关闭线程数目动态改变功能 omp_set_dynamic(int) (用在串行域中) omp_get_dynamic() 判断系统是否支持动态改变线程数目 omp_set_nested(int) 启用或关闭并行域嵌套功能(缺省为关闭) omp_get_nested() 判断系统是否支持并行域的嵌套 http://math.ecnu.edu.cn/-jypan 4

http://math.ecnu.edu.cn/~jypan 4 运行环境函数 Execution Environment Routines omp_set_num_threads(int) 设置并行域中的线程个数(用在串行域中) omp_get_num_threads() 返回当前并行域中的线程个数 omp_get_max_threads() 返回并行域中缺省可用的最大线程个数 omp_get_thread_num() 返回当前线程的线程号,0号为主线程 omp_get_num_procs() 返回系统中处理器的个数 omp_in_parallel() 判断是否在并行域中 omp_set_dynamic(int) 启用或关闭线程数目动态改变功能 (用在串行域中) omp_get_dynamic() 判断系统是否支持动态改变线程数目 omp_set_nested(int) 启用或关闭并行域嵌套功能(缺省为关闭) omp_get_nested() 判断系统是否支持并行域的嵌套

运行环境函数 ●omp_set_num_threads subroutine omp_set_num_threads(num threads) Fortran integer num threads C/C++ void omp_set_num_threads(int num_threads); ●omp_get_num_threads Fortran integer function omp_get_num_threads() C/C++ int omp_get_num_threads(void); omp_get_max_threads Fortran integer function omp_get_max_threads( C/C++ int omp_get_max_threads(void); http://math.ecnu.edu.cn/-jypan 5

http://math.ecnu.edu.cn/~jypan 5 运行环境函数 Fortran subroutine omp_set_num_threads(num_threads) integer num_threads C/C++ void omp_set_num_threads(int num_threads);  omp_set_num_threads Fortran integer function omp_get_num_threads() C/C++ int omp_get_num_threads(void);  omp_get_num_threads Fortran integer function omp_get_max_threads() C/C++ int omp_get_max_threads(void);  omp_get_max_threads

运行环境函数 ●omp_get_thread_num Fortran integer function omp_get_thread_num( C/C++ int omp_get_thread_num(void); ● omp_get_num_procs Fortran integer function omp_get_num_procsO C/C++ int omp_get_num_procs(void); ● omp_in_parallel Fortran logical function omp_in_parallel() C/C++ int omp_in_parallel(void); http://math.ecnu.edu.cn/-jypan 6

http://math.ecnu.edu.cn/~jypan 6 运行环境函数 Fortran integer function omp_get_thread_num() C/C++ int omp_get_thread_num(void);  omp_get_thread_num Fortran integer function omp_get_num_procs() C/C++ int omp_get_num_procs(void);  omp_get_num_procs Fortran logical function omp_in_parallel() C/C++ int omp_in_parallel(void);  omp_in_parallel

运行环境函数 ● omp_set_dynamic Fortran subroutine omp_set_dynamic (dynamic_threads) logical dynamic threads C/C++ void omp_set_dynamic(int dynamic_threads); ● omp_get_dynamic Fortran logical function omp_get_dynamic( C/C++ int omp_get_dynamic(void); ● omp_set_nested subroutine omp_set_nested (nested) Fortran logical nested C/C++ void omp_set_nested(int nested); http://math.ecnu.edu.cn/-jypan

http://math.ecnu.edu.cn/~jypan 7 运行环境函数 Fortran subroutine omp_set_dynamic (dynamic_threads) logical dynamic_threads C/C++ void omp_set_dynamic(int dynamic_threads);  omp_set_dynamic Fortran logical function omp_get_dynamic() C/C++ int omp_get_dynamic(void);  omp_get_dynamic Fortran subroutine omp_set_nested (nested) logical nested C/C++ void omp_set_nested(int nested);  omp_set_nested

运行环境函数 ●omp_get_nested Fortran logical function omp_get_nested( C/C++ int omp_get_nested(void); http://math.ecnu.edu.cn/-jypan 8

http://math.ecnu.edu.cn/~jypan 8 运行环境函数 Fortran logical function omp_get_nested() C/C++ int omp_get_nested(void);  omp_get_nested

运行环境函数 ■OpenMP3.1中新函数 ●omp_set_schedule subroutine omp_set_schedule(kind,modifier) Fortran integer (kind=omp_sched_kind)kind integer modifier C/C++ void omp_set_schedule(omp_sched_t kind,int modifier); ● omp_get_schedule subroutine omp_get_schedule(kind,modifier) Fortran integer(kind=omp_sched_kind)kind integer modifier C/C++ void omp_get_schedule(omp_sched_t kind,int modifier ) http://math.ecnu.edu.cn/-jypan 9

http://math.ecnu.edu.cn/~jypan 9 运行环境函数 Fortran subroutine omp_set_schedule(kind, modifier) integer (kind=omp_sched_kind) kind integer modifier C/C++ void omp_set_schedule(omp_sched_t kind, int modifier);  omp_set_schedule Fortran subroutine omp_get_schedule(kind, modifier) integer (kind=omp_sched_kind) kind integer modifier C/C++ void omp_get_schedule(omp_sched_t * kind, int * modifier );  omp_get_schedule  OpenMP 3.1 中新函数

运行环境函数 omp_get_thread_limit returns the maximum number of OpenMP threads available to the program Fortran integer function omp_get_thread_limit() C/C++ int omp_get_thread_limit(void); omp_set_max_active_levels limits the number of nested active parallel regions Fortran subroutine omp_set_max_active_levels(max_levels) integer max levels C/C++ void omp_set_max_active_levels(int max_levels); http://math.ecnu.edu.cn/-jypan 10

http://math.ecnu.edu.cn/~jypan 10 运行环境函数 Fortran integer function omp_get_thread_limit() C/C++ int omp_get_thread_limit(void);  omp_get_thread_limit Fortran subroutine omp_set_max_active_levels (max_levels) integer max_levels C/C++ void omp_set_max_active_levels (int max_levels);  omp_set_max_active_levels returns the maximum number of OpenMP threads available to the program limits the number of nested active parallel regions

点击下载完整版文档(PDF)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共29页,试读已结束,阅读完整版请下载
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有