mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-07 23:22:11 +01:00
24 lines
344 B
C
24 lines
344 B
C
/*
|
|
* @@name: ordered.3c
|
|
* @@type: C
|
|
* @@compilable: yes
|
|
* @@linkable: no
|
|
* @@expect: success
|
|
*/
|
|
void work(int i) {}
|
|
void ordered_good(int n)
|
|
{
|
|
int i;
|
|
#pragma omp for ordered
|
|
for (i=0; i<n; i++) {
|
|
if (i <= 10) {
|
|
#pragma omp ordered
|
|
work(i);
|
|
}
|
|
if (i > 10) {
|
|
#pragma omp ordered
|
|
work(i+1);
|
|
}
|
|
}
|
|
}
|