[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / openmp / libompd / test / openmp_examples / nested.c
blobeb9cef9f44cc0e59899c3657948c0f7a2ccd58ee
1 // RUN: %gdb-compile 2>&1 | tee %t.compile
2 // RUN: env OMP_SCHEDULE=guided,10 %gdb-run 2>&1 | tee %t.out | FileCheck %s
4 #include "../ompt_plugin.h"
5 #include <omp.h>
6 #include <stdio.h>
7 #include <unistd.h>
9 int main() {
10 printf("Application: Process %d started.\n", getpid());
12 int i;
13 omp_set_num_threads(3);
14 omp_set_max_active_levels(10);
16 #pragma omp parallel // parallel region begins
18 printf("outer parallel region Thread ID == %d\n", omp_get_thread_num());
19 /* Code for work to be done by outer parallel region threads over here. */
21 if (omp_get_thread_num() == 2)
22 sleep(1);
24 #pragma omp parallel num_threads(2) // nested parallel region
26 /* Code for work to be done by inner parallel region threads over here. */
27 printf("inner parallel region thread id %d\n", omp_get_thread_num());
29 // if (omp_get_thread_num() == 1) sleep(1000);
31 #pragma omp parallel num_threads(2) //
34 #pragma omp for
35 for (i = 0; i < 20; i++) {
36 // Some independent iterative computation to be done.
37 printf("");
38 ompd_tool_test(0);
44 // sleep(1000);
46 return 0;
49 // CHECK-NOT: OMPT-OMPD mismatch
50 // CHECK-NOT: Python Exception
51 // CHECK-NOT: The program is not being run.