[Omp] Another thing on the implicit barrier

Shengyan Hong shhong at cse.psu.edu
Sun Mar 18 11:24:05 PDT 2007


Every Openmp member,
>>         !$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
>>         end do
>>
>>         return
>>         end
For this loop, is it 3 implicit barriers before each "end do" in the 
3-level loop? Or just 1 implicit barrier  before the last "end do"?
        Thank you very much.
                                                Shengyan Hong

On Sun, 18 Mar 2007, Eugene Loh wrote:

> Shengyan Hong wrote:
>
>> Every Openmp member,
>>         In the parallel loop of Fortran, there is an implicit barrier.
>>         !$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
>>         end do
>> 
>>         return
>>         end
>> 
>>         How can I test the idle time in the implicit barrier?
>> 
> It depends on what tools you have available.  For example, with the Sun 
> Studio software suite, you can use the Sun Performance Analyzer.  Set the 
> environment variable "SUNW_MP_THR_IDLE" to "SPIN" before you execute your 
> program.  Then execute the program and look at the performance profile.  You 
> should see "<OMP-implicit_barrier>" time.  Specifically, you can see the 
> breakdown of this implicit-barrier time by loop and by thread. 
> Alternatively, the time-line viewer will give you a graphical picture of all 
> this.  You can write me off-line if you'd like some help with this.
>
> If you want to insert some timers or other instrumentation into the source 
> code, I guess you have to insert them right before and after that last "END 
> DO" statement.  I forget:  did you have one thread per "DO K=1,D3" iteration? 
> If so, I think you could capture one timestamp per "K" iteration right before 
> the last "END DO" statement and one timestamp for all threads right after 
> that "END DO".
>
> On Mar 12, Henry Jin showed another way in this email thread of capturing 
> barrier time by converting the implicit barrier to an explicit one.
>


More information about the Omp mailing list