RE: In OpenMP: bug (?) when using task and shared together

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry, my bad. The shared variable is on the stack, so I had to add a taskwait at the end (code follows). A warning would have been nice...

--- start c code ---
void recurse(int levelsToGo)
{

    if ( levelsToGo == 0 )
    {
        printf("*");
    }
    else
    {
        #pragma omp task shared(levelsToGo)
        {
            recurse(levelsToGo-1);
        }

        #pragma omp task shared(levelsToGo)
        {
            recurse(levelsToGo-1);
        }

        #pragma omp taskwait

    }
}
--- end c code ---



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux