[Omp] Help on the Barrier case
eduncan
Eric.Duncan at Sun.COM
Thu Mar 8 13:24:53 PST 2007
Actually your program is non-compliant. If you look at the OpenMP V2.5
specification, section 2.9 Nesting of Regions:
This section describes a set of restrictions on the nesting of regions.
The restrictions on
nesting are as follows:
...
• A barrier region may not be closely nested inside a work-sharing,
critical,
ordered, or master region.
That doesn't answer your question, but I thought I would point it out.
Shengyan Hong wrote:
>Every member,
> In the ft benchmark, I add a barrier in the ft.f . The code is as
>follows.
>"
> !$omp parallel do default(shared) private(i,j,k)
> do k = 1, d3
> do j = 1, d2
> do i = 1, d1
> u1(i,j,k) = u0(i,j,k)*ex(t*indexmap(i,j,k))
> end do
> end do
> TID = OMP_GET_THREAD_NUM()
> PRINT *, 'thread = ', TID
> print *, "March 6 night"
> print *, "Before barrier"
> CALL MAGIC_BRK_SIM_START()
> !$OMP BARRIER
> print *, "After barrier"
> CALL MAGIC_BRK_SIM_START()
> end do
>
> return
> end
>"
> I run it on simics by using 8 processors with 8 threads. Now 8
>threads enter the barrier and leave the barrier.
> Now I have a problem. Every thread will have some time in the
>barrier. The minimum idle time of the 8 threads is 6.493*10^3 cycles. I
>think that there should at least one thread that has no idle
>time in the barrier. So I am wondering whether my experiment is correct or
>not.
> Thank you.
> Shengyan Hong
>_______________________________________________
>Omp mailing list
>Omp at openmp.org
>http://openmp.org/mailman/listinfo/omp
>
>
More information about the Omp
mailing list