This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Polyhedron Fortran comparison - now contains gfortran


Tim Prince wrote:
Ron Young wrote:
I think you should turn off inlining ,when comparing to other compliers. No inlining makes a big difference on my code. I hope inlining will work soon.

The -ipo option in ifort does things that are not in gfortran yet.

I'm missing what you're getting at here. Most available Fortran source doesn't push the limits of what gfortran or commercial compilers can do with in-lining. ifort 9.1 may do as much in-lining as gfortran -O3. Unless you can show where it make a difference in the Polyhedron benchmarks, I'll hold to my opinion that there's not much in it. Certainly, Polyhedron benchmarks aren't constructed to help you predict the performance of code which is constructed so as to depend on in-lining.

I thought this could account for some the differences seen in the
benchmarks. The -ipa option also  does in-lining across files. There are
many libraries written is Fortran , that have small subroutines that
will be in lined on most compliers. When I tried the Absoft Fortran
complier last year it did not do in-lining. This could account for some
of its improvement this time.

Here is a example . The subroutine ijkm is used in a hundred places in
the program. If the compiler does in-lining
no problem. A lot of programs are written this way with small pieces of
common code stuck into subroutines, to made the code more readable and
so they can be used in other programs.


program main Nk=1000 Nj=1000 Ni=1000 do k=1,Nk do j=1,Nj do i=1,Ni c ijk=i +Ni*(j-1+Nj*(k-1)) c mjk=ijk-1 c imk=ijk-Ni c ijm=ijk-Ni*Nj call ijkm(Ni,Nj,i,j,k,ijk,mjk,imk,ijm) enddo enddo enddo write(6,*)ijk,mjk,imk,ijm end program subroutine ijkm(Ni,Nj,i,j,k,ijk,mjk,imk,ijm) c c ------------------------- DESCRIPTION -------------------------------- c This routine converts the 3D cell address i,j,k into the indices used to c access data for the cell and its adjacent cells


ijk=i +Ni*(j-1+Nj*(k-1)) mjk=ijk-1 imk=ijk-Ni ijm=ijk-Ni*Nj c c if(i.gt.Ni.or.j.gt.Nj.or.i.lt.1.or.j.lt.1) c & write(*,*)'ijkm:i,j,k,Ni,Nj=',i,j,k,Ni,Nj return end





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]