Ifort vectorization not efficient

Ifort vectorization not efficient

Dear Intel developers,

I have a Fortran piece of code where my program spend a lot of times:

k=0

id = 1

do j = start, end  
  do i = 1, ns(j)
     k = k + 1  
     if(selectT(lx00(i), j, id) > 1.00) &
      tco(k) = 10.0 
  end do
end do

I'm using  intel/cs-xe-2012. I compiled by using -O3 -ip -ipo -xXost -vec-report=3. The compiler report that nested loop is vectorized, but the execution time of that piece of code is the same without vectorization. I tried to linearize selectT with any results. I tried also to build a "truth table" linearized:

do j = start, end  
  do i = 1, ns(j)
     k = k + 1   
     tco(k) = 10.0*select_cond(offset + lx00(i))
  end do
end do

Do you have any idea how to implement a good vectorization? I suspect the indirect address of lx00(i) break the vectorization, but it is unavoidable

 

Thanks a lot.

 

 

 

4 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

As this doesn't appear to be related to MPI, it might better be asked on the Fortran linux forum.

I don't think you've given enough information.  Indirect addressing would be vectorized by "simulated gather" or by gather instructions, depending on your platform, if you set -xHost.  In the 2nd version, you could try the effects of !dir$ vector nontemporal.  ifort sometimes works better with simulated gather than with gather instructions on corei7-4, so you could try architectures like -msse4.1 or -mavx.

Caching of the indirectly indexed array will depend heavily on locality.  You should be checking the opt-report to see whether you can get the compiler to put in indirect software prefetch, if the pattern isn't such that the hardware prefetchers work.  See

http://software.intel.com/sites/default/files/article/326703/5.3-prefetc...

I'm moving this to the Fortran forum.

Steve - Intel Developer Support

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen