LLVM OpenMP 19.0.0git
omp_par_in_loop.c
Go to the documentation of this file.
1// RUN: %libomp-c99-compile-and-run
2//
3#include <stdlib.h>
4#include <stdio.h>
5#include <math.h>
6#include <omp.h>
7
8#define TYPE long
9#define MAX_ITER (TYPE)((TYPE)1000000)
10#define EVERY (TYPE)((TYPE)100000)
11
12int main(int argc, char* argv[]) {
13 TYPE x = MAX_ITER;
16 #pragma omp parallel for schedule(nonmonotonic:dynamic,1)
17 for (TYPE i = 0; i < x; i++) {
18 int tid = omp_get_thread_num();
20 #pragma omp parallel proc_bind(spread)
21 {
22 if (i % EVERY == (TYPE)0)
23 printf("Outer thread %d at iter %ld\n", tid, i);
24 }
25 }
26 printf("passed\n");
27 return 0;
28}
#define i
Definition: kmp_stub.cpp:87
#define omp_set_max_active_levels
Definition: kmp_stub.cpp:29
#define omp_set_num_threads
Definition: kmp_stub.cpp:34
#define TYPE
#define EVERY
#define MAX_ITER
int main()
Definition: test-touch.c:21