高性能计算-OpenMPProgramming浅析.ppt

  1. 1、本文档共24页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
OpenMP Programming OpenMP Introduction OpenMP-Open Multi-Processing OpenMP is an Application Program Interface (API) Comprised of three components: Compiler directives Runtime library routines(运行库例程) Environment variables OpenMP program A program that consists of a base program, annotated with OpenMP directives and runtime library routines. base program A program written in a programming language. Three components of OpenMP Directives/pragmas Create threads Share the work amongst threads Synchronize threads Library routines external functions(外部功能) Control and query the parallel execution environment(控制和查询并行执行环境) Environment variables control the behavior of an OpenMP program Directives specifying how a compiler or assembler should process its input OpenMP directives for C/C++ are specified with the pragma preprocessing directive #pragma omp directive-name [clause[ [,] clause]...] new-line #pragma omp parallel #pragma omp for #pragma omp parallel for #pragma omp barrier Create threads/Share the work amongst threads/Synchronize threads Runtime Library a header file named omp.h omp_set_num_threads, omp_get_num_threads omp_get_max_threads, omp_get_thread_num omp_get_num_procs, omp_in_parallel omp_set_dynamic, omp_get_dynamic omp_set_nested, omp_get_nested omp_set_schedule, omp_get_schedule omp_get_thread_limit omp_set_max_active_levels omp_get_max_active_levels omp_get_level, omp_get_ancestor_thread_num omp_get_team_size, omp_get_active_level omp_in_final external functions/Control and query the parallel execution environment environment variables:control the behavior of an OpenMP program OMP_NUM_THREADS OMP_SCHEDULE OMP_DYNAMIC OMP_PROC_BIND OMP_NESTED OMP_STACKSIZE OMP_WAIT_POLICY OMP_MAX_ACTIVE_LEVELS OMP_THREAD_LIMIT The OpenMP Execution Model The OpenMP Memory Model parallel construct A set of implicit(隐含) tasks, one per thread, is generated. The code for each task is defined by the code inside the parallel construct. #pragma omp parallel [clause[ [, ]clau

文档评论(0)

希望之星 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档