17 lines
315 B
C
17 lines
315 B
C
|
#include <stdio.h>
|
||
|
#include <omp.h>
|
||
|
|
||
|
int main(int argc, const char *argv[])
|
||
|
{
|
||
|
int sum = 0;
|
||
|
|
||
|
// TODO: Use a reduction clause instead to add up the values
|
||
|
#pragma omp parallel for num_threads(2)
|
||
|
for (int i = 0; i < 10000; i++) {
|
||
|
sum++;
|
||
|
}
|
||
|
|
||
|
printf("sum: %d\n", sum);
|
||
|
return 0;
|
||
|
}
|