gomp - cost of threadprivate data access

Matevz Tadel matevz.tadel@cern.ch
Sun Mar 15 22:31:00 GMT 2009


Andrew Thomas Pinski wrote:
> 
> 
> Sent from my iPhone
> 
> On Mar 15, 2009, at 1:15 PM, Matevz Tadel <matevz.tadel@cern.ch> wrote:
> 
>> Hello,
>>
>> We have parallelized a relatively large f77 project (GEANT3, ~200k 
>> loc) using OpenMP.
>>
>> Now we are running comparisons between standard and parallel version 
>> and it turns out that just making the commons threadprivate results in 
>> 20% percent speed penalty. This extra time is spent in 
>> __tls_get_addr() function which seems to be called for every access of 
>> a threadprivate variable.
>>
>> Would it be in principle possible to optimize this access?
> 
> Which target is this on?  If the target implements tls directly, then 
> this function should not be called.

It is GNU/linux on x86_64, fedora 10

kernel 2.6.27.12-170.2.5.fc10.x86_64
glibc-2.9-3.x86_64

>> I figure that the base address of all referenced commons could be 
>> obtained once per function thus drastically reducing the 
>> __tls_get_addr() call count.
>>
>> We are using gcc-4.3 branch from the beginning of February, with 
>> patches to allow equivalence statements among threadprivate data.
>>
>> Callgrind output of a sample run is available at:
>>
>> -O2     <https://mtadel.web.cern.ch/mtadel/callgrind.out.13032>
>> -O2 -g  <https://mtadel.web.cern.ch/mtadel/callgrind.out.13055>
>>
>> Best,
>> Matevz



More information about the Fortran mailing list