OpenMP Application Program Interface(Chinese Version中文)

Discuss the OpenMP 3.1 API Specifications with the OpenMP Arch. Review Board. (Read Only)

OpenMP Application Program Interface(Chinese Version中文)

Postby doom_ood » Sun Feb 12, 2012 1:00 am

1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
引言
1.1 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 范围
1.2 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 词汇
1.2.1 Threading Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 线程概念
1.2.2 OpenMP Language Terminology . . . . . . . . . . . . . . . . . . . . . 2
1.2.2 OpenMP语言术语
1.2.3 Tasking Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.3 任务术语
1.2.4 Data Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2.4 数据术语
1.2.5 Implementation Terminology . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2.5 实现术语
1.3 Execution Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3 执行模型
1.4 Memory Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.4 内存模型
1.4.1 Structure of the OpenMP Memory Model . . . . . . . . . . . . . . . 13
1.4.1 OpenMP内存模型的结构
1.4.2 The Flush Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.4.2 刷出操作
1.4.3 OpenMP Memory Consistency . . . . . . . . . . . . . . . . . . . . . . 16
1.4.3 OpenMP内存一致性
1.5 OpenMP Compliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.5 OpenMP的柔韧性
1.6 Normative References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.6 被提名的引用
1.7 Organization of this document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.7 这份文档的组织
2. Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.命令
2.1 Directive Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.1 命令格式
2.1.1 Fixed Source Form Directives . . . . . . . . . . . . . . . . . . . . . . . 23
2.1.1 固定的源形式定义
2.1.2 Free Source Form Directives . . . . . . . . . . . . . . . . . . . . . . . . 24
2.1.2 自由的源形式定义
2.2 Conditional Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.2 条件编译
2.2.1 Fixed Source Form Conditional Compilation Sentinels . . . . 26
2.2.1 固定源形式条件定义的哨兵
2.2.2 Free Source Form Conditional Compilation Sentinel . . . . . . 27
2.2.2 自由源形式条件定义的哨兵
2.3 Internal Control Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.3 内部控制变量
2.3.1 ICV Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.3.1 ICV描述
2.3.2 Modifying and Retrieving ICV Values . . . . . . . . . . . . . . . . . . 29
2.3.2 改变和取得ICV数值
2.3.3 How the Per-Data Environment ICVs Work . . . . . . . . . . . . . 30
2.3.3 每个数据环境ICV如何起作用
2.3.4 ICV Override Relationships . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.3.4 ICV重载关系
2.4 parallel Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.4 parallel结构
2.4.1 Determining the Number of Threads for a parallel Region 36
2.4.1 决定并行区域的线程数量
2.5 Worksharing Constructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.5 worksharing结构
2.5.1 Loop Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.5.1 loop结构
2.5.2 sections Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.5.2 section结构
2.5.3 single Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.5.3 single 结构
2.5.4 workshare Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.5.4 workshare结构
2.6 Combined Parallel Worksharing Constructs . . . . . . . . . . . . . . . . . . . 55
2.6 混合parallel worksharing结构
2.6.1 Parallel Loop Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.6.1 parallel loop construct结构
2.6.2 parallel sections Construct . . . . . . . . . . . . . . . . . . . . . 57
2.6.2 parallel section结构
2.6.3 parallel workshare Construct . . . . . . . . . . . . . . . . . . . . 59
2.6.3 parallel workshare 结构
2.7 Tasking Constructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.7 Tasking结构.
2.7.1 task Construct . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . 61
2.7.1 task结构
2.7.2 taskyield Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
2.7.2 taskyield 结构
2.7.3 Task Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.7.3 Task调度
2.8 Master and Synchronization Constructs . . . . . . . . . . . . . . . . . . . . . . 67
2.8 Master和Synchronization结构
2.8.1 master Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
2.8.1 master结构
2.8.2 critical Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.8.2 critical结构
2.8.3 barrier Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
2.8.3 barrier结构
2.8.4 taskwait Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
2.8.4 taskwait结构
2.8.5 atomic Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
2.8.5 atomic结构
2.8.6 flush Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
2.8.6 flush结构
2.8.7 ordered Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
2.8.7 ordered结构
2.9 Data Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
2.9 数据环境
2.9.1 Data-sharing Attribute Rules . . . . . . . . . . . . . . . . . . . . . . . . 84
2.9.1 数据分享属性规则
2.9.2 threadprivate Directive . . . . . . . . . . . . . . . . . . . . . . . . . 88
2.9.2 threadprivate 命令
2.9.3 Data-Sharing Attribute Clauses . . . . . . . . . . . . . . . . . . . . . . 92 iii
2.9.3 数据分享属性子句
2.9.4 Data Copying Clauses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
2.9.4 数据拷贝子句
2.10 Nesting of Regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
2.10 区域的嵌套
3. Runtime Library Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3. 运行时库函数
3.1 Runtime Library Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3.1 运行时库定义
3.2 Execution Environment Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
3.2 执行环境函数
3.2.1 omp_set_num_threads . . . . . . . . . . . . . . . . . . . . . . . . . . 116
3.2.2 omp_get_num_threads . . . . . . . . . . . . . . . . . . . . . . . . . . 117
3.2.3 omp_get_max_threads . . . . . . . . . . . . . . . . . . . . . . . . . . 118
3.2.4 omp_get_thread_num . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
3.2.5 omp_get_num_procs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
3.2.6 omp_in_parallel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
3.2.7 omp_set_dynamic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
3.2.8 omp_get_dynamic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
3.2.9 omp_set_nested . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
3.2.10 omp_get_nested . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
3.2.11 omp_set_schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
3.2.12 omp_get_schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
3.2.13 omp_get_thread_limit . . . . . . . . . . . . . . . . . . . . . . . . . 131
3.2.14 omp_set_max_active_levels . . . . . . . . . . . . . . . . . . . . 132
3.2.15 omp_get_max_active_levels . . . . . . . . . . . . . . . . . . . . 134
3.2.16 omp_get_level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
3.2.17 omp_get_ancestor_thread_num . . . . . . . . . . . . . . . . . . 136
3.2.18 omp_get_team_size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
3.2.19 omp_get_active_level . . . . . . . . . . . . . . . . . . . . . . . . . 139
3.2.20 omp_in_final . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
3.3 Lock Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
3.3 锁函数
3.3.1 omp_init_lock and omp_init_nest_lock . . . . . . . . . 143
3.3.2 omp_destroy_lock and omp_destroy_nest_lock . . . 144
3.3.3 omp_set_lock and omp_set_nest_lock . . . . . . . . . . . .
3.3.4 omp_unset_lock and omp_unset_nest_lock . . . . . . . . 146
3.3.5 omp_test_lock and omp_test_nest_lock . . . . . . . . . . 147
3.4 Timing Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
3.4.1 omp_get_wtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
3.4.2 omp_get_wtick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
4. Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
4. 环境变量
4.1 OMP_SCHEDULE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
4.2 OMP_NUM_THREADS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
4.3 OMP_DYNAMIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
4.4 OMP_PROC_BIND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
4.5 OMP_NESTED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
4.6 OMP_STACKSIZE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
4.7 OMP_WAIT_POLICY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
4.8 OMP_MAX_ACTIVE_LEVELS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
4.9 OMP_THREAD_LIMIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
A. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
A. 例子
A.1 A Simple Parallel Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
A.2 The OpenMP Memory Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
A.3 Conditional Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
A.4 Internal Control Variables (ICVs) . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
A.5 The parallel Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
A.6 Controlling the Number of Threads on Multiple Nesting Levels . . . . 175
A.7 Interaction Between the num_threads Clause and omp_set_dynamic 177
A.8 Fortran Restrictions on the do Construct . . . . . . . . . . . . . . . . . . . . . 179
A.9 Fortran Private Loop Iteration Variables . . . . . . . . . . . . . . . . . . . . . . 181
A.10 The nowait clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
A.11 The collapse clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
A.12 The parallel sections Construct . . . . . . . . . . . . . . . . . . . . . . . . 189 v
A.13 The firstprivate Clause and the sections Construct . . . . . . 190
A.14 The single Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
A.15 Tasking Constructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
A.16 The taskyield Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
A.17 The workshare Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
A.18 The master Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
A.19 The critical Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
A.20 worksharing Constructs Inside a critical Construct . . . . . . . . . . 221
A.21 Binding of barrier Regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
A.22 The atomic Construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
A.23 Restrictions on the atomic Construct . . . . . . . . . . . . . . . . . . . . . . . 230
A.24 The flush Construct without a List . . . . . . . . . . . . . . . . . . . . . . . . . 233
A.25 Placement of flush, barrier, taskwait and taskyield Directives 236
A.26 The ordered Clause and the ordered Construct . . . . . . . . . . . . . 239
A.27 The threadprivate Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
A.28 Parallel Random Access Iterator Loop . . . . . . . . . . . . . . . . . . . . . . . 250
A.29 Fortran Restrictions on shared and private Clauses with Common
Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
A.30 The default(none) Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
A.31 Race Conditions Caused by Implied Copies of Shared Variables in
Fortran . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
A.32 The private Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
A.33 Fortran Restrictions on Storage Association with the private Clause 260
A.34 C/C++ Arrays in a firstprivate Clause . . . . . . . . . . . . . . . . . . . 263
A.35 The lastprivate Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
A.36 The reduction Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
A.37 The copyin Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
A.38 The copyprivate Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
A.39 Nested Loop Constructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
A.40 Restrictions on Nesting of Regions . . . . . . . . . . . . . . . . . . . . . . . . . . 281
A.41 The omp_set_dynamic and omp_set_num_threads Routines . . 288
A.42 The omp_get_num_threads Routine . . . . . . . . . . . . . . . . . . . . . . 289
A.43 The omp_init_lock Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
A.44 Ownership of Locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
A.45 Simple Lock Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
A.46 Nestable Lock Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
B. Stubs for Runtime Library Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
B.运行时库函数的桩
B.1 C/C++ Stub Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
B.1 C/C++ 桩函数
B.2 Fortran Stub Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
B.2 fortran桩函数
C. OpenMP C and C++ Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
C. OpenMP C和C++语法
C.1 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
C.1 注释
C.2 Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
C.2 规则
D. Interface Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
D. 接口解释
D.1 Example of the omp.h Header File . . . . . . . . . . . . . . . . . . . . . . . . . 326
D.1 omp.h头文件的例子
D.2 Example of an Interface Declaration include File . . . . . . . . . . . . . 328
D.2 包括了文件的接口定义的例子
D.3 Example of a Fortran Interface Declaration module . . . . . . . . . . . . 330
D.3 fortran接口定义模块的例子
D.4 Example of a Generic Interface for a Library Routine . . . . . . . . . . . . 334
D.4 库函数的通用接口的例子
E. OpenMP Implementation-Defined Behaviors . . . . . . . . . . . . . . . . . . . . . 335
E. OpenMP 实现的行为
F. Features History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
F. 特性的历史
F.1 Version 3.0 to 3.1 Differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
F.1 3.0与3.1的区别
F.2 Version 2.5 to 3.0 Differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
F.2 2.5和3.0的区别
doom_ood
 
Posts: 20
Joined: Mon Feb 06, 2012 4:17 am

Re: OpenMP Application Program Interface(Chinese Version中文)

Postby doom_ood » Sun Feb 12, 2012 1:18 am

Introduction
The collection of compiler directives, library routines, and environment variables described in this document collectively define the specification of the OpenMP Application Program Interface (OpenMP API) for shared-memory parallelism in C, C++ and Fortran programs.
本文档中描述的编译命令、库函数和环境变量的集合,为C、C++和fortran的程序员编写共享内存并行程序,定义了OpenMP应用程序接口(OpenMP API)的标准。
This specification provides a model for parallel programming that is portable across shared memory architectures from different vendors. Compilers from numerous vendors support the OpenMP API. More information about the OpenMP API can be found at the following web site
该标准为并行程序提供了一个模型,并且在不同厂商的共享内存结构中是可移植的。众多厂商生产的编译器都支持OpenMP API。更多的关于OpenMP API的信息可以在下面的网站找到。
http://www.openmp.org
The directives, library routines, and environment variables defined in this document allow users to create and manage parallel programs while permitting portability. The directives extend the C, C++ and Fortran base languages with single program multiple data (SPMD) constructs, tasking constructs, worksharing constructs, and synchronization constructs, and they provide support for sharing and privatizing data.
The functionality to control the runtime environment is provided by library routines and environment variables. Compilers that support the OpenMP API often include a command line option to the compiler that activates and allows interpretation of all OpenMP directives.
该文档中定义的命令,库函数和环境变量允许用户来创造和管理并行程序,同时使得程序可移植。命令使用单程序多数据结构(SPMD)、任务结构,任务分享结构和同步结构,扩展了C、C++和fortran语言本身。而且他们为共享和私有数据提供了支持。控制运行时环境的功能通过库函数和环境变量来提供。支持OpenMP API的编译器经常包括一个命令行选项,来激活和允许所有OpenMP 命令的解释。
1.1 Scope
The OpenMP API covers only user-directed parallelization, wherein the programmer explicitly specifies the actions to be taken by the compiler and runtime system in order to execute the program in parallel. OpenMP-compliant implementations are not required to check for data dependencies, data conflicts, race conditions, or deadlocks, any of which may occur in conforming programs. In addition, compliant implementations are
not required to check for code sequences that cause a program to be classified as non-conforming.
OpenMP API仅覆盖了用户导向的并行,programmer明确的规定了编译器和运行时系统进行的操作,使得程序可以并行执行。为了数据依赖、数据冲突和竞争条件以及死锁的检查,OpenMP的柔韧性实现并不是必须的。另外,为了检查哪些导致程序被分类为不一致的代码序列,柔韧性实现也不是必须的。
Application developers are responsible for correctly using the OpenMP API to produce a conforming program. The OpenMP API does not cover compiler-generated automatic parallelization and directives to the compiler to assist such parallelization.
应用开发者对于正确使用OpenMP API来生产一致性程序是负责人的。openMP API不能够由编译器自动产生并行化,也没有命令来使得编译器来帮助这种并行化。
doom_ood
 
Posts: 20
Joined: Mon Feb 06, 2012 4:17 am

Re: OpenMP Application Program Interface(Chinese Version中文)

Postby doom_ood » Sun Feb 12, 2012 8:23 pm

1.2 Glossary
1.2 词汇
1.2.1 Threading Concepts
1.2.1 线程概念
thread An execution entity with a stack and associated static memory, called threadprivate memory.
线程--一个拥有一个堆栈和叫做线程私有内存的相关静态内存的可执行体。
OpenMP thread A thread that is managed by the OpenMP runtime system.
OpenMP线程--一个被OpenMP 运行时系统管理的线程。
thread-safe routine A routine that performs the intended function even when executed concurrently (by more than one thread).
线程安全函数--当被并行执行时(被一个以上线程),一个执行了特定功能的函数。
1.2.2 OpenMP Language Terminology
1.2.2 OpenMP语言术语
base language A programming language that serves as the foundation of the OpenMP specification.
基语言--一种作为OpenMP标准的基础的编程语言。
base program A program written in a base language.
基程序--一个使用base language写就的程序。
structured block For C/C++, an executable statement, possibly compound, with a single entry at the top and a single exit at the bottom, or an OpenMP construct.
结构块--对于C/C++,一个可执行语句,可能是复合的,在头部有一个单一入口,尾部有一个单一出口,或者是一个OpenMP结构。
For Fortran, a block of executable statements with a single entry at the top and a single exit at the bottom, or an OpenMP construct.
对于Fortran,在头部有单一入口并且在底部有单一出口的可执行语句块,或一个openMP 结构。
COMMENTS:
For all base languages,
对于所有base language,
• Access to the structured block must not be the result of a branch.
对于结构块的访问不一定是分支的结果。
• The point of exit cannot be a branch out of the structured block.
出口点不可以在结构块外部的分支。
For C/C++:
对于C/C++:
• The point of entry must not be a call to setjmp().
入口点不能是对于setjmp的调用。
• longjmp() and throw() must not violate the entry/exit criteria.
longjmp和throw不能破坏出口/入口的标准。
• Calls to exit() are allowed in a structured block.
对于exit的调用在结构块中是被允许的。
• An expression statement, iteration statement, selection statement, or try block is considered to be a structured block if the corresponding compound statement obtained by enclosing it in { and } would be a structured block.
表达式语句、遍历语句、选择语句、或try块被认为是结构块,仅当被and包围起来的与之相应的混合语句是结构块时。
For Fortran:
对于Fortran:
• STOP statements are allowed in a structured block.
STOP语句在结构块中是被允许的。
enclosing context In C/C++, the innermost scope enclosing an OpenMP construct.
包围背景--在C/C++中,包含了一个OpenMP 结构的最内部的范围。
In Fortran, the innermost scoping unit enclosing an OpenMP construct.
在fortran中,包含了一个OpenMP结构的最内部的范围。
directive In C/C++, a #pragma, and in Fortran, a comment, that specifies OpenMP program behavior.
命令--C/C++中,#pragma和fortran中的一个comment,规定了OpenMP 程序的行为。
white space A non-empty sequence of space and/or horizontal tab characters.
空格--一个空格和水平制表符的非空序列。
OpenMP program A program that consists of a base program, annotated with OpenMP directives
and runtime library routines.
OpenMP 程序--一个由OpenMP命令和运行时库函数来注解的基程序组成的程序。
conforming program An OpenMP program that follows all the rules and restrictions of the OpenMP specification.
一致性程序--一个遵循了所有OpenMP标准的规则和限制的OpenMP程序。
declarative directive An OpenMP directive that may only be placed in a declarative context. A declarative directive has no associated executable user code, but instead has one or more associated user declarations.
定义性命令--一个OpenMP命令,仅被放置在定义背景中。定义命令没有相关的可执行用户代码,但是有一个或多个的用户定义。
executable directive An OpenMP directive that is not declarative. That is, it may be placed in an executable context.
可执行命令--一个不是定义的OpenMP 命令。也就是说,可能被放置在可执行背景中。
stand-alone directive An OpenMP executable directive that has no associated executable user code.
独立命令--没有与之相应的可执行用户代码的OpenMP可执行命令。
loop directive An OpenMP executable directive whose associated user code must be a loop nest that is a structured block.
循环命令--响应的用户代码必须是结构块的循环嵌套OpenMP可执行命令。
For C/C++, only the for directive is a loop directive.
对于C/C++,仅for命令是循环命令。
For Fortran, only the do directive and the optional end do directive are loop directives.
对于fortran,仅do命令和optional end do命令是循环命令。
associated loop(s) The loop(s) controlled by a loop directive.
相关循环--被循环定义的循环。
construct An OpenMP executable directive (and for Fortran, the paired end directive, if any) and the associated statement, loop or structured block, if any, not including the code in any called routines. That is, in the lexical extent of an executable directive.
结构--一个OpenMP可执行命令(对于Fortran,成对的end directive)和相关的语句、循环或结构块,如果有的话,不仅包括了被调用函数的代码。也就是在可执行命令的粒度。
region All code encountered during a specific instance of the execution of a given construct or of an OpenMP library routine. A region includes any code in called routines as well as any implicit code introduced by the OpenMP implementation. The generation of a task at the point where a task directive is encountered is a part of the region of the encountering thread, but the explicit task region associated with the task directive is not.
区域--所有具有给定结构或OpenMP库函数的执行实例中的所有执行代码。一个区域包含了在调用函数中的任何代码以及任何明确的又OpenMP 实现导致的代码。当遇到任务命令时产生的任务是改线程的区域的一部分,但是与任务命令相关联的明确的任务区域不是。
A region may also be thought of as the dynamic or runtime extent of a construct or of an OpenMP library routine.
一个区域也可能被认为是动态的或者运行时结构或者OpenMP库函数。
During the execution of an OpenMP program, a construct may give rise to many regions.
在一个OpenMP 程序运行时,一个结构可能产生很多区域。
active parallel region A parallel region that is executed by a team consisting of more than one thread.
活跃并行区域--一个被多于一个线程组成的线程伍执行的并行区域。
inactive parallel region A parallel region that is executed by a team of only one thread.
非活跃并行区域--一个被由一个线程组成的线程伍并行区域。
sequential part All code encountered during the execution of an OpenMP program that is not part of a parallel region corresponding to a parallel construct or a task region corresponding to a task construct.
序列部分--所有在OpenMP 程序执行过程中遇到的代码,不是任务结构对应的任务区域或并行结构对应的并行区域的一部分。
COMMENTS:
The sequential part executes as if it were enclosed by an inactive parallel region.
序列部分执行好像它被非活跃区域包围一样。
Executable statements in called routines may be in both the sequential part and any number of explicit parallel regions at different points in the program execution.
被调用函数中的可执行语句可能在序列部分和任何数量的明确的并行区域。
master thread The thread that encounters a parallel construct, creates a team, generates a set of tasks, then executes one of those tasks as thread number 0.
主线程--遇到并行结构、建立线程伍、产生任务然后以线程号0来执行任务中的一个的那个线程。
parent thread The thread that encountered the parallel construct and generated a parallel region is the parent thread of each of the threads in the team of that parallel region. The master thread of a parallel region is the same thread as its parent thread with respect to any resources associated with an OpenMP thread.
父线程--遇到了并行结构并且产生并行区域的线程是并行区域中线程伍的每一个线程的父线程。与OpenMP线程相关的任何资源方面,并行区域的主线程与父线程是相同的线程。
ancestor thread For a given thread, its parent thread or one of its parent thread’s ancestor threads.
祖先线程--对于一个给定线程,其父线程或其父线程之一的祖先线程。
team A set of one or more threads participating in the execution of a parallel region.
线程伍--在一个并行区域中参与执行的一个或多个线程。
COMMENTS:
For an active parallel region, the team comprises the master thread and at least one additional thread.
对于一个活跃并行区域,线程伍听从于主线程和至少一个附属线程。
For an inactive parallel region, the team comprises only the master thread.
对于非活跃并行区域,线程伍仅听从于主线程。
initial thread The thread that executes the sequential part.
初始线程--执行了序列部分的线程。
implicit parallel region The inactive parallel region that encloses the sequential part of an OpenMP program.
明确并行区域--包含了OpenMP程序的序列部分的非活跃并行区域。
nested construct A construct (lexically) enclosed by another construct.
嵌套结构--一个被其他结构包围的结构。
nested region A region (dynamically) enclosed by another region. That is, a region encountered during the execution of another region.
嵌套区域--一个被另一个区域包围的区域。也就是,在另一个区域执行时遇到的区域。
COMMENT: Some nestings are conforming and some are not.
一些嵌套是一致的而另一些不是。
closely nested region A region nested inside another region with no parallel region nested between them.
紧密嵌套区域--一个嵌套在另一个区域中的区域,而且没有并行区域在他们之间嵌套。
all threads All OpenMP threads participating in the OpenMP program.
所有线程--在OpenMP程序中的所有OpenMP线程。
current team All threads in the team executing the innermost enclosing parallel region encountering thread
当前线程伍--执行最内包围并行区域的线程伍中的所有线程。
For a given region, the thread that encounters the corresponding construct.
对于给定区域,遇到相应结构的线程。
all tasks All tasks participating in the OpenMP program.
所有任务--所有参与在OpenMP 程序的任务。
current team tasks All tasks encountered by the corresponding team. Note that the implicit tasks constituting the parallel region and any descendant tasks encountered during the execution of these implicit tasks are included in this binding task set.
当前线程伍任务--被相应线程伍相遇的所有任务。注意,组成并行区域和任何后代任务的明确任务被包含在了绑定的任务集中。
generating task For a given region the task whose execution by a thread generated the region.
产生任务--对于给定区域,产生了该区域的线程。
binding thread set The set of threads that are affected by, or provide the context for, the execution of a region.
绑定线程集--被区域的执行影响或为之提供了北京的一组线程。
The binding thread set for a given region can be all threads, the current team, or the encountering thread.
给定区域的绑定线程集可以使所有线程,当前线程或者遇到的线程。
The binding task set for a given region can be all tasks, the current team tasks, or the generating task.
给定区域的绑定线程集可以是所有任务,当前线程伍的任务,或产生的任务。
binding region The enclosing region that determines the execution context and limits the scope of the effects of the bound region is called the binding region.Binding region is not defined for regions whose binding thread set is all threads or the encountering thread, nor is it defined for regions whose binding
task set is all tasks.
绑定区域--决定了执行背景并且限制了范围区域的影响范围的包围区域被称为绑定区域。绑定区域不是为绑定线程伍是所有线程的区域而定义的,也不是为绑定任务集是所有任务的区域定义的。
COMMENTS:
The binding region for an ordered region is the innermost enclosing loop region.
顺序区域的绑定区域是最内部循环区域。
The binding region for a taskwait region is the innermost enclosing task region.
任务等待区域的绑定区域是最内部任务区域。
For all other regions for which the binding thread set is the current team or the binding task set is the current team tasks, the binding region is the innermost enclosing parallel region.
对于绑定线程集是当前线程伍或绑定任务集是当前线程伍任务的所有其他区域,绑定区域是最内包围的并行区域。
For regions for which the binding task set is the generating task, the binding region is the region of the generating task.
对于绑定任务集是产生任务的区域,绑定区域是产生任务的区域。
A parallel region need not be active nor explicit to be a binding region.
一个并行区域作为绑定区域不需要是活跃或明确的。
A task region need not be explicit to be a binding region.
一个任务区域作为绑定区域必须要是明确的。
A region never binds to any region outside of the innermost enclosing parallel region.
一个区域绝不绑定到最内层包围并行区域的任何外围区域。
orphaned construct A construct that gives rise to a region whose binding thread set is the current team, but is not nested within another construct giving rise to the binding region.
孤儿结构--产生绑定线程伍是当前线程伍的结构,但是不在另一个产生绑定区域的结构内嵌套。
worksharing construct A construct that defines units of work, each of which is executed exactly once by one of the threads in the team executing the construct.
工作共享结构--定义了工作的单位的结构,单位被执行结构的线程伍中的一个线程执行了一次。
For C/C++, worksharing constructs are for, sections, and single.
对于C/C++,工作共享结构是for,sections,和single。
For Fortran, worksharing constructs are do, sections, single and workshare.
对于fortran,工作共享结构是do,sections,single和workshare。
sequential loop A loop that is not associated with any OpenMP loop directive.
序列循环--不与任何OpenMP循环命令相关联的循环。
barrier A point in the execution of a program encountered by a team of threads, beyond which no thread in the team may execute until all threads in the team have reached the barrier and all explicit tasks generated by the team have executed to completion.
障碍--被线程伍遇到的程序的执行位置。那之后线程伍中没有线程可以执行,直到线程伍中的所有线程到达障碍并且所有线程伍产生的明确任务执行到结束。
doom_ood
 
Posts: 20
Joined: Mon Feb 06, 2012 4:17 am


Return to OpenMP 3.1 API Specifications

Who is online

Users browsing this forum: No registered users and 1 guest