.f90 runs slower than .f

Paul Richard Thomas paul.richard.thomas@gmail.com
Thu Aug 2 18:41:00 GMT 2012


Hi Rachel,

> Dear Fortraners, I have not used this list before so sorry if I breach
> protocol! I couldn't find my problem on bugzilla, please send me a link if I
> failed to find it.

This is a list devoted to the development of gfortran.  That said, we
are very intersted in performance issuessuch as this.

>
> I am updating some old software currently in Fortran 77 but I am reusing
> some of the original routines. Most of the time (>75%) goes in the attached
> routine psq which does a finite difference operator on complex 3x3 unitary
> matrices. When I compile and run with it as a fortran 77 routine, ie .f it
> takes 3.8 sec but with the EXACT same file changed to .f90 it takes 10
> seconds. It would be easier to change it to Fortran 90 standard to use
> modules etc. Performance is a major issue.

It would help enormously if you would provide a driver main program so
that we can test your assertion.  If I have understood correctly, the
time that you are quoting includes compilation?  Or is it just the run
time?

>
> I compiled with gfortran-4.7:
> FFLAGS  = -static -O3  -pg  -ffree-form
> with some flags that link to a fortran XML reader (should be irrelevant),
> and yes I have tried turning off -pg.
> I'm not a computer scientist so I don't really understand what the compiler
> would be doing that could cause this or how I can stop it. Does it make

None of us are computer scientists either - most are physicists or
chemists who devote some of their spare time to developing a free
F2003/8 compiler.

> certain assumptions about .f files that it cannot about .f90 (like no
> pointers)? The rest of the code is using some fortran 2003/2008 features.

I know of no such restrictions - if pointers ain't used, they ain't used :-)
>
> My makefile treats both cases identically, ie.
> FSRC= .... psq.f....
> in either case.
>
> I do not have the same problem with ifort (see below).

I think that you should describe the problem a bit more fully.   It
might just be that it is the interface between the f95 and the f77
parts that is the trouble.  As I said above, provide a driver that
illustrates the problem and we will take a look.

Cheers

Paul
>
> Thanks for your help
> Rachel
>
-- 
The knack of flying is learning how to throw yourself at the ground and miss.
       --Hitchhikers Guide to the Galaxy



More information about the Fortran mailing list