On 18 Sep 10:38, Jakub Jelinek wrote:
> and what test5.c should print I have no idea (does ICC already support this
> and can you see what it prints?).
>
> test5.c:
> #include <omp.h>
> #include <stdio.h>
>
> int
> main ()
> {
> omp_set_dynamic (0);
> omp_set_nested (1);
> #pragma omp parallel num_threads (3)
> if (omp_get_thread_num () == 2)
> {
> #pragma omp parallel num_threads (3)
> if (omp_get_thread_num () == 1)
> {
> #pragma omp target if (0)
> {
> printf ("inp %d\n", omp_in_parallel ());
> #pragma omp parallel num_threads (2)
> printf ("%d %d %d %d %d\n", omp_get_level (),
> omp_get_ancestor_thread_num (0),
> omp_get_ancestor_thread_num (1),
> omp_get_ancestor_thread_num (2),
> omp_get_ancestor_thread_num (3));
> }
> }
> }
> return 0;
> }
>
> Jakub
ICC prints:
inp 1
3 0 2 1 0
3 0 2 1 1
-- Ilya