[Fwd: Re: Polyhedron benchmark on Opteron]

FX Coudert fxcoudert@gmail.com
Fri Sep 29 21:59:00 GMT 2006


Relaying Tobias' mail, as he is having problems with the mailing-list...

> Hello all,
>
> François-Xavier Coudert wrote:
>>  -- gas_dyn, by 115%
>> Compile Command : /utmp/coudert/gfortran/irun/bin/gfortran - 
>> march=k8 -ffast-math -funroll-loops -static -O3 %n.f90 -o %n
>> Compile Command : ifort %n.f90 -O3 -xW -ipo -static -V -o %n
>
>
> I get:
> ifort -assume buffered_io -O3 -xW -ipo -ip -static gas_dyn.f90
> time ./a.out > /dev/null
> real: 8.565s  user: 8.373s  sys:0.048s
>
> gfortran -O3 -msse3 -mtune=athlon64 -funroll-loops -ftree-vectorize
> -ffast-math -static gas_dyn.f90
> time ./a.out > /dev/null
> real: 15.214s  user: 14.977s  sys: 0.032s
>
>
> However, if I replace in the subroutine CHOZDT the
>
> ISET = MINLOC(DTEMP)
>
> by
>
> ISET(1) = huge(ISET)
> do i=1,nodes
>   if(iset(1) > dtemp(1)) iset(1) = i
> end do
>
> The run time is only:
> real: 1.233s  user: 1.120s  sys: 0.036s
>
> (The subroutine CHOZDT [and thus minloc] is called 20001 times.)

Isn't it iset > dtemp(i)? Otherwise, I do understand why the compiler  
can gain so much time :)

> Could one not inline minloc and maxloc for the case of only one
> dimension and no mask? (Or maybe also for arbitrary rank and no  
> mask or
> ...?) What to do about DIM?

Maybe vectorizing {MIN,MAX}{LOC,VAL} in the library could gain us  
some time. Otherwise, I'm not sure why inlinding would make such a  
difference.

> I had a look at the the other files and four of my real-world apps.
> The result is:
> - There are mostly one or two dimensions
> - Mask is only rarely used
> - dim is only rarely used
>
> Thus: Inlining for one and two dimensions if no mask and no DIM is  
> given
> should make sense. The size increase should be minimal, especially for
> one dimension. Whether it makes sense to do inlining for three and  
> more
> dimensions (with no DIM and no MASK), I don't know.
>
>
> * aermod.f90
> maxval(array(:))
> maxval(array(:,:,:),DIM=2)
> maxloc(array(:,:,:),DIM=2)
>
> * capacita.f90
> maxval(array(:,:))
>
> * channel.f90
> maxval(array(:,:))
>
> * fatigue.f90
> minval(array(:))
> maxval(array(:,:))
>
> * induct.f90
> minval(array(:))
> maxval(array(:))
>
> * nf.f90
> maxval(array(:))
>
> * rnflow.f90
> maxval(array(:))
>
> * test_fpu.f90:
> maxloc(array(:,k))
> maxloc(array(:))
>
>
> * FLEUR (www.flapw.de):
> minloc(array(:,:))
> maxloc(array(:))
> maxloc(array(:), mask = ...)
> minval(array(:,:))
> minval(array(:))
> maxval(array(:,:))
> maxval(array(:))
>
> * Octopus, www.tddft.org
> maxval(array(:,:))
> minval(array(:,:))
> maxval(array(:))
>
> * EXC!TING, exciting.sf.net
> [none]
>
> * Wien2k, www.wien2k.at
> maxval(array(:))
>
>
> Tobias



More information about the Fortran mailing list