[Omp] Help on the Barrier case
Shengyan Hong
shhong at cse.psu.edu
Thu Mar 8 12:39:07 PST 2007
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
More information about the Omp
mailing list