if I use thread binding in the following way:

export OMP_NUM_THREADS=8
export GOMP_CPU_AFFINITY="0 1 2 3 4 5 6 7"

for code that has three parallel regions:

!$omp parallel default(private) shared(bindings,n_thread)
!$omp end parallel
!$omp parallel default(private) shared(bindings,n_thread) num_threads(2)
!$omp end parallel
!$omp parallel default(private) shared(bindings,n_thread)
!$omp end parallel

I get the following:

> ./a.out
 Entering first parallel region all threads
bindings are 0 1 2 3 4 5 6 7
 Entering second parallel region using two threads
bindings are 0 1
 Entering third parallel region using all threads
bindings are 0 1 0 1 2 3 4 5

so it the last parallel section 2 times 2 threads bind to the same CPU (this is
also what is effectively happing looking at the CPU usage in top).

this seems to be happening for gcc 4.3 - 4.6

The testcase will be attached.


-- 
           Summary: unexpected thread binding for openmp
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44833

Reply via email to