source: CIVL/mods/dev.civl.com/doc/omp/independence.txt@ 1aaefd4

main test-branch
Last change on this file since 1aaefd4 was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 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
52 region within critical will never be executed in multiple threads
53
54barrier
55 end barrier
56
57atomic
58 no barrier, but special semantics should be considered to improve
59 precision of independence analysis
60
61ordered
62 no barrier, but special semantics should be considered to improve
63 precision of independence analysis
64
65for
66 end barrier
67
68for nowait
69
70sections
71 end barrier
72
73sections nowait
74
75section
76
77single
78 end barrier
79
80single nowait
81
82
Note: See TracBrowser for help on using the repository browser.