source:
CIVL/examples/library/omp/teams.cvl@
f8f3bec
| Last change on this file since f8f3bec was 3af26ac, checked in by , 11 years ago | |
|---|---|
|
|
| File size: 369 bytes | |
| Line | |
|---|---|
| 1 | #include <civl-omp.cvh> |
| 2 | #include <stdio.h> |
| 3 | |
| 4 | void main() { |
| 5 | $omp_gteam gteam = $omp_gteam_create($here, 3); |
| 6 | |
| 7 | void thread(int tid) { |
| 8 | $omp_team team = $omp_team_create($here, gteam, tid); |
| 9 | |
| 10 | printf("Hello from thread %d\n", tid); |
| 11 | $omp_team_destroy(team); |
| 12 | } |
| 13 | |
| 14 | $parfor (int i: ($domain){ 0 .. 2 }) { |
| 15 | thread(i); |
| 16 | } |
| 17 | $omp_gteam_destroy(gteam); |
| 18 | } |
Note:
See TracBrowser
for help on using the repository browser.
