Skip to content

Commit 03b9a00

Browse files
author
Henry Jin
committed
release 5.2.1
1 parent a5e3d8b commit 03b9a00

File tree

606 files changed

+3925
-2946
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

606 files changed

+3925
-2946
lines changed

Chap_affinity.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
\label{chap:openmp_affinity}
33

44
OpenMP Affinity consists of a \code{proc\_bind} policy (thread affinity policy) and a specification of
5-
places (\texttt{"}location units\texttt{"} or \plc{processors} that may be cores, hardware
5+
places (``location units'' or \plc{processors} that may be cores, hardware
66
threads, sockets, etc.).
77
OpenMP Affinity enables users to bind computations on specific places.
88
The placement will hold for the duration of the parallel region.
@@ -26,7 +26,7 @@
2626
usual case; but actually, the execution unit is implementation defined.) Processor
2727
numbers are numbered sequentially from 0 to the number of cores less one (without SMT), or
2828
0 to the number HW-threads less one (with SMT). OpenMP places use the processor number to designate
29-
binding locations (unless an \texttt{"}abstract name\texttt{"} is used.)
29+
binding locations (unless an ``abstract name'' is used.)
3030

3131

3232
The processors available to a process may be a subset of the system's

Chap_devices.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
convenient for providing persistent data throughout multiple
2222
\code{target} regions. The \code{target} \code{enter} \code{data} and
2323
\code{target} \code{exit} \code{data} constructs are unstructured, because
24-
they can occur anywhere and do not support a "structure"
24+
they can occur anywhere and do not support a ``structure''
2525
(a region) for enclosing \code{target} constructs, as does the
2626
\code{target} \code{data} construct.
2727

Chap_directives.tex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,17 @@
4141
A clause may just be a keyword (e.g., \scode{untied}) or it may also accept argument lists
4242
(e.g., \scode{shared(x,y,z)}) and/or optional modifiers (e.g., \scode{tofrom} in
4343
\scode{map(tofrom:}~\scode{x,y,z)}).
44-
Clause modifiers may be "simple" or "complex" -- a complex modifier consists of a
44+
Clause modifiers may be ``simple'' or ``complex'' -- a complex modifier consists of a
4545
keyword followed by one or more parameters, bracketed by parentheses, while a simple
4646
modifier does not. An example of a complex modifier is the \scode{iterator} modifier,
4747
as in \scode{map(iterator(i=0:n),}~\scode{tofrom:}~\scode{p[i])}, or the \scode{step} modifier, as in
4848
\scode{linear(x:}~\scode{ref,}~\scode{step(4))}.
4949
In the preceding examples, \scode{tofrom} and \scode{ref} are simple modifiers.
5050

51+
For Fortran, a declarative directive (such as \code{declare}~\code{reduction})
52+
must appear after any \code{USE}, \code{IMPORT}, and \code{IMPLICIT} statements
53+
in the specification part.
54+
5155

5256
%===== Examples Sections =====
5357
\input{directives/pragmas}

Chap_introduction.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
The documents and source codes for OpenMP Examples can be downloaded from
5858
\href{https://github.com/OpenMP/Examples}{https://github.com/OpenMP/Examples}.
5959
Each directory holds the contents of a chapter and has a \splc{sources} subdirectory of its codes.
60-
The codes for this OpenMP \VER{} Examples document have the tag
61-
\href{https://github.com/OpenMP/Examples/tree/v\VER}{\plc{v\PVER}}.
60+
This OpenMP Examples \VER{} document and its codes are tagged as
61+
\href{https://github.com/OpenMP/Examples/tree/v\VER}{\plc{v\VER}}.
6262

6363
Complete information about the OpenMP API and a list of the compilers that support
6464
the OpenMP API can be found at the OpenMP.org web site

Chap_parallel_execution.tex

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@
4949
A worksharing construct distributes the execution of the associated region
5050
among the members of the team that encounter it. There is an
5151
implied barrier at the end of the worksharing region
52-
(there is no barrier at the beginning). The worksharing
53-
constructs are:
52+
(there is no barrier at the beginning).
53+
54+
\newpage
55+
The worksharing constructs are:
5456

5557
\begin{compactitem}
5658

@@ -66,10 +68,10 @@
6668
an \plc{associated} loop. Nested loops can form a single region when the
6769
\code{collapse} clause (with an integer argument) designates the number of
6870
\plc{associated} loops to be executed in parallel, by forming a
69-
"single iteration space" for the specified number of nested loops.
71+
``single iteration space'' for the specified number of nested loops.
7072
The \code{ordered} clause can also control multiple associated loops.
7173

72-
An associated loop must adhere to a "canonical form" (specified in the
74+
An associated loop must adhere to a ``canonical form'' (specified in the
7375
\plc{Canonical Loop Form} of the OpenMP Specifications document) which allows the
7476
iteration count (of all associated loops) to be computed before the
7577
(outermost) loop is executed. %[58:27-29].

Chap_program_control.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
The \code{cancel} construct is also a cancellation point for any other thread of the team
3737
to also continue execution at the end of the named region.
3838

39-
Also, once the specified region has been activated for cancellation any thread that encounnters
39+
Also, once the specified region has been activated for cancellation any thread that encounters
4040
a \code{cancellation}~\code{point} construct with the same named region (\plc{construct-type-clause}),
4141
continues execution at the end of the region.
4242

@@ -80,7 +80,7 @@
8080
%construct with one of the loops constructs \code{do} or \code{for}. The
8181
%\code{parallel do SIMD} and \code{parallel for SIMD} constructs are composite constructs (composed from
8282
%the parallel loop constructs and the \code{SIMD} construct), because the \code{collapse} clause must
83-
%explicitly address the ordering of loop chunking \plc{and} SIMD "combined" execution.
83+
%explicitly address the ordering of loop chunking \plc{and} SIMD ``combined'' execution.
8484

8585
Certain nestings are forbidden, and often the reasoning is obvious. For example, worksharing constructs cannot be nested, and
8686
the \code{barrier} construct cannot be nested inside a worksharing construct, or a \code{critical} construct.
@@ -108,6 +108,7 @@
108108
\input{program_control/nested_loop}
109109
\input{program_control/nesting_restrict}
110110
\input{program_control/target_offload}
111+
\input{program_control/pause_resource}
111112
\input{program_control/reproducible}
112113
\input{program_control/interop}
113114
\input{program_control/utilities}

Chap_synchronization.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
\input{synchronization/worksharing_critical}
8686
\input{synchronization/barrier_regions}
8787
\input{synchronization/atomic}
88+
\input{synchronization/atomic_cas}
8889
\input{synchronization/atomic_restrict}
8990
\input{synchronization/flush_nolist}
9091
\input{synchronization/acquire_release}

Chap_tasking.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
but the work units are tightly controlled by an iteration limit and limited
88
scheduling, or a limited number of \code{sections} or \code{single} regions.
99
Worksharing was designed
10-
with \texttt{"}data parallel\texttt{"} computing in mind. Tasking was designed for
11-
\texttt{"}task parallel\texttt{"} computing and often involves non-locality or irregularity
10+
with ``data parallel'' computing in mind. Tasking was designed for
11+
``task parallel'' computing and often involves non-locality or irregularity
1212
in memory access.
1313

1414
The \code{task} construct can be used to execute work chunks: in a while loop;

Contributions.md

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,27 @@ For a brief revision history, see `Changes.log` in the repo.
2626
* Clone your fork locally
2727
* If you are working on generic or old-version updates, create a branch off master.
2828
* If you are working on an example for a release candidate for version #.#, create a branch off work_#.#.
29-
1.) `git clone --branch <master|work_#.#> https://github.com/<my_account>/examples-internal`
30-
2.) `git checkout -b <branch_name>`
31-
3.) ... `add`, `commit`
32-
4.) `git push -u origin <branch_name>`
33-
5.) `make` or `make diff` will create a full-document pdf or just a pdf with differences (do this at any point).
29+
1) `git clone --branch <master|work_#.#> https://github.com/<my_account>/examples-internal`
30+
2) `git checkout -b <branch_name>`
31+
3) ... `add`, `commit`
32+
4) `git push -u origin <branch_name>`
33+
5) `make` or `make diff` will create a full-document pdf or just a pdf with differences (do this at any point).
3434
* `git status` and `git branch -a` are your friends
3535
* Submit an issue for your work (usually with a diff pdf), and then you will be asked to submit a pull request
3636
* Create an issue by selecting the (issue tab)[https://github.com/openmp/examples-internal/issues] and clicking on `new issue`.
3737
* Use this MarkDown Cheatsheet for (issue formatting)[https://wordpress.com/support/markdown-quick-reference/]
3838
* More MarkDown details are available (here)[https://markdown-it.github.io]
3939
* You can cut and paste markdown formatted text in a (reader)[https://dillinger.io] to see formatting effects.
40-
* Forced spaces are available in Markdown. On a Mac is is "option+space".
40+
* Forced spaces are available in Markdown. On a Mac it is "option+space".
4141
* Polling is available. Go to (gh-poll)[https://app.gh-polls.com/]. Type an option on each line, then click `copy markdown`, and paste the contents into the issue. (Use preview to check your poll, and then submit it.)
4242
* Create a pull request
4343

4444

4545
## Processing source code
4646

4747
* Prepare source code (C/C++ and Fortran) and a text description (use similar styles found in recent examples)
48-
* Determine the *example* name `<ename>`, *sequence* number `<seq-no>` and *compiler* suffix `<csuffix>` for the example
49-
* The syntax is: `<ename>.<seq-no>.<csuffix>` (e.g. `affinity_display.1.f90`)
48+
* Determine the *example* name `<ename>`, *sequence* identifier `<seq-id>` and *compiler* suffix `<csuffix>` for the example
49+
* The syntax is: `<ename>.<seq-id>.<csuffix>` (e.g. `affinity_display.1.f90`)
5050
* The example name may be a Section name (e.g. affinity), or a Subsection name (affinity_display)
5151
* If you are creating a new Chapter, it may be the chapter name.
5252
* New examples are usually added at the end of a Section or Subsection. Number it as the next number in the sequence numbers for examples in that Section or Subsection.
@@ -56,29 +56,42 @@ For a brief revision history, see `Changes.log` in the repo.
5656
```
5757
@@name: <ename>.<seq-no>
5858
@@type: C|C++|F-fixed|F-free
59-
@@requires: preprocessing
60-
@@compilable: yes|no|maybe
61-
@@linkable: yes|no|maybe
62-
@@expect: success|compile-time-error|runtime-error|undefined-behavior
63-
@@version: omp_<verno>
59+
@@operation: view|compile|link|run
60+
@@expect: success|ct-error|rt-error|unspecified
61+
@@version: [pre_]omp_<verno>
62+
@@env: <environment_variables>
63+
@@depend: <source_code_name>
6464
```
6565
* **name**
6666
is the name of an example
6767
* **type**
6868
is the source code type, which can be translated into or from proper file extension (C:c,C++:cpp,F-fixed:f,F-free:f90)
69-
* **requires**
70-
any additional requirements, currently `preprocessing` for requiring preprocessing
71-
* **compilable**
72-
indicates whether the source code is compilable
73-
* **linkable**
74-
indicates whether the source code is linkable
69+
* **operation**
70+
indicates how the source code is treated. Possible values are:
71+
`view` - code for illustration only, not compilable;
72+
`compile` - incomplete program, such as function or subroutine;
73+
`link` - complete program, but no verification value;
74+
`run` - complete program with verification value.
7575
* **expect**
76-
indicates some expected result for testing purpose "`success|compile-time-error|ct-error`" applies
77-
to the result of code compilation; "`runtime-error|rt-error`" is for a case where compilation may be
78-
successful, but the code contains potential runtime issues (such as race condition); `undefined-behavior` could result from a non-conforming code.
79-
Alternative would be to just use "`conforming`" or "`non-conforming`".
76+
indicates some expected result for testing purpose.
77+
`success` means no issue;
78+
`ct-error` applies to the result of code compilation;
79+
`rt-error` is for a case where compilation may be successful, but the code
80+
contains potential runtime issues (including race condition);
81+
`unspecified` could result from a non-conforming code or is for code
82+
that is viewable only.
8083
* **version**
81-
indicates features for a specific OpenMP version, such as "`omp_5.0`"
84+
indicates that the example uses features in a specific OpenMP version, such as "`omp_5.0`"
85+
The prefix `pre_` indicates that the example uses features prior to a specific version, such as "`pre_omp_3.0`".
86+
* **env**
87+
specifies any environment variables needed to run the code.
88+
This tag is optional and can be repeated.
89+
* **depend**
90+
specifies a source code file on which the current code depends.
91+
This tag is optional and can be repeated.
92+
* For **env** and **depend**, make sure to specify
93+
a proper skipping number `<s>` in the LaTeX macros described below
94+
to match with the number of `env` and `depend` tags.
8295
8396
8497
## Process for text
@@ -134,7 +147,7 @@ The following describes LaTeX macros defined specifically for examples.
134147
to this macro is the file extension (such as `h`, `hpp`, `inc`).
135148
136149
The `<s>` option to each macro allows finer-control of any additional lines
137-
to be skipped due to addition of new `@@` tags, such as `@@requires`.
150+
to be skipped due to addition of new `@@` tags, such as `@@env`.
138151
The default value for `<s>` is 0.
139152
140153
### Language h-rules
@@ -173,4 +186,4 @@ if it is different.
173186
174187
## License
175188
176-
For copyright information, please see `omp_copyright.txt`.
189+
For copyright information, please see [omp_copyright.txt](omp_copyright.txt).

Deprecated_Features_Chapt.tex

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)