openmp + pthreads

Frédéric Bastien nouiz@nouiz.org
Wed Feb 20 14:37:00 GMT 2008


Hi,

I just started using openmp, so don't trust my answer completly.

You can download an OpenMP validation suite from
http://www2.cs.uh.edu/~openuh/. I have done it and gcc 4.2.3 failed
the test for nested openmp directive. So meaby gcc don't support
nested openmp directive. You can test it for your version in your
configuration with the test suite.

good luck.

Frederic Bastien

On Tue, Feb 19, 2008 at 4:34 PM, Haris Saybasili
<haris.saybasili@gmail.com> wrote:
> Hi everybody,
>
>  I have a program that uses pthreads for multitasking. I want to use
>  OpenMP for making some of these threads to perform faster (1 OMP
>  parallel section in main(), 1 OMP parallel section in one of the
>  thread's function). However, when I use OpenMP's parallel sections in
>  more than 1 thread, I generally experience deadlocks! Sometimes it
>  works, sometimes the program stops (like a deadlock) when entering the
>  parallel section of the thread's function.
>
>  - I set OMP_DYNAMIC to TRUE for being able to use
>  omp_set_num_threads() function.
>  - I am using gcc-4.2.2 with openmp support
>
>  If I use OpenMP parallelism just in the main(), it works without any
>  problem. If I also use it in the thread's function in addition to
>  main(), most of the time, deadlock occurs.
>
>  Each of these threads will use the same  number of OpenMP threads, and
>  they run asynchronously. There is no synchronization between them.
>  What can be the source of the problem?
>
>  Thanks
>
>  Haris
>



More information about the Gcc-help mailing list