main
|
Last change
on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago |
|
Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.
git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c
|
-
Property mode
set to
100644
|
|
File size:
398 bytes
|
| Rev | Line | |
|---|
| [c7c308c] | 1 | #include <civlc.cvh>
|
|---|
| 2 | #ifndef BAD
|
|---|
| 3 | #define OFFSET 0
|
|---|
| 4 | #else
|
|---|
| 5 | #define OFFSET 1
|
|---|
| 6 | #endif
|
|---|
| 7 |
|
|---|
| 8 | int main () {
|
|---|
| 9 | int x[4] = {1, 2, 3, 4};
|
|---|
| 10 | int y = 10;
|
|---|
| 11 |
|
|---|
| 12 | #pragma omp parallel sections firstprivate(y) shared(x)
|
|---|
| 13 | {
|
|---|
| 14 | {
|
|---|
| 15 | x[0] = x[0 + OFFSET] + y;
|
|---|
| 16 | }
|
|---|
| 17 | #pragma omp section
|
|---|
| 18 | {
|
|---|
| 19 | x[1] = x[1 + OFFSET] + y;
|
|---|
| 20 | }
|
|---|
| 21 | #pragma omp section
|
|---|
| 22 | {
|
|---|
| 23 | x[2] = x[2 + OFFSET] + y;
|
|---|
| 24 | }
|
|---|
| 25 | #pragma omp section
|
|---|
| 26 | {
|
|---|
| 27 | x[3] = x[3 + OFFSET] + y;
|
|---|
| 28 | }
|
|---|
| 29 | }
|
|---|
| 30 | return 0;
|
|---|
| 31 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.