40 lines · c
1// RUN: %gdb-compile 2>&1 | tee %t.compile2// RUN: env OMP_SCHEDULE=static,5 %gdb-run 2>&1 | tee %t.out | FileCheck %s3 4#include "../ompt_plugin.h"5#include <omp.h>6#include <pthread.h>7#include <stdio.h>8#include <unistd.h>9 10int main() {11 printf("Application: Process %d started.\n", getpid());12 13 omp_set_num_threads(3);14 omp_set_max_active_levels(10);15 16#pragma omp parallel // parallel region begins17 {18 printf("Outer region - thread_ID: %d\n", omp_get_thread_num());19 20#pragma omp parallel num_threads(2) // nested parallel region 121 {22 printf("Inner region - thread_ID: %d\n", omp_get_thread_num());23 24#pragma omp parallel num_threads(2) // nested parallel region 225 {26 int i;27#pragma omp for28 for (i = 0; i < 10; i++)29 ompd_tool_test(0);30 }31 }32 }33 34 return 0;35}36 37// CHECK-NOT: OMPT-OMPD mismatch38// CHECK-NOT: Python Exception39// CHECK-NOT: The program is not being run.40