OpenMP-Examples/sources/Example_tasking.6c.c
2015-01-13 11:38:24 -08:00

28 lines
481 B
C

/*
* @@name: tasking.6c
* @@type: C
* @@compilable: yes
* @@linkable: no
* @@expect: success
*/
#define LARGE_NUMBER 10000000
double item[LARGE_NUMBER];
extern void process(double);
int main() {
#pragma omp parallel
{
#pragma omp single
{
int i;
#pragma omp task untied
// i is firstprivate, item is shared
{
for (i=0; i<LARGE_NUMBER; i++)
#pragma omp task
process(item[i]);
}
}
}
return 0;
}