source: CIVL/doc/omp/independence.txt@ e898536

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since e898536 was 17f3717, checked in by Matthew B. Dwyer <matthewbdwyer@…>, 11 years ago

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@2406 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 1.9 KB
Line 
1In general the structure of an OMP Parallel statement looks like this:
2
3#pragma omp parallel
4 {
5 S1
6#pragma omp ...
7 S2
8 S3
9 }
10
11Where the parallel contains regions of C code, e.g., S1, S3, that
12are executed by each thread, and OMP statements, e.g., S2, which
13control how threads are executed by threads. OMP worksharing and
14synchronization statements have different semantics from parallel
15(and enclosing workshares), but the principle is the same.
16
17To perform an independence analysis each region of the program which
18may execute in parallel must be subjected to analysis.
19
20This requires that the barrier semantics of OMP constructs be
21made explicit and that an analysis collects all sets of potentially
22parallel regions. See a summary of implicit barriers and other
23thread-ordering related OMP statements below.
24
25An interesting challenge arises due to the nesting of OMP statements
26within control flow constructs and the "shape" of the regions that
27may arise. For example:
28
29#pragma omp parallel
30 if (c)
31#pragma omp for
32 S1
33 else
34 S2
35
36
37Independence comes down to whether two potentially parallel regions
38may exhibit a read-write dependence. These dependences arise from
39accesses to shared variables including shared arrays where the index
40expressions cannot be determined to be disjoint.
41
42--------------------------------------------------
43Barrier semantics for OMP statements:
44
45parallel
46 end barrier
47
48critical
49 no barrier, but special semantics should be considered to improve
50 precision of independence analysis
51
52barrier
53 end barrier
54
55atomic
56 no barrier, but special semantics should be considered to improve
57 precision of independence analysis
58
59ordered
60 no barrier, but special semantics should be considered to improve
61 precision of independence analysis
62
63for
64 end barrier
65
66for nowait
67
68sections
69 end barrier
70
71sections nowait
72
73section
74
75single
76 end barrier
77
78single nowait
79
80
Note: See TracBrowser for help on using the repository browser.