On Sep 8, 11:15Â am, Fatemeh gmail.com> wrote:
> On Sep 8, 12:33 pm, Fatemeh gmail.com> wrote:
>
>
>
>
>
>> On Sep 8, 12:02 pm, "Dr Ivan D. Reid" brunel.ac.uk> wrote:
>
>>> On Mon, 8 Sep 2008 00:29:40 -0700 (PDT), Fatemeh
gmail.com>
>>> Â wrote in <23de88ca-360d-44d2-b1f2-da24b9216...@z66g2000hsc.googlegroups.com>:
>
>>>> I've written a code in fortran90. Since my sample is large, my code
>>>> runs slowly.
>>>> I need some flags in order to enter them to Makefile which can be able
>>>> to run the code with higher speed.
>>>> -----------------------------------------------------------------
>>>> this is my Makefile:
>>>> ----------------------------------
>>>> FC=ifort
>>>> NROBJS=nr.o nrtype.o parametros.o
>>>> MYOBJS= wfinside.o gauntutils.o leedutils.o
>>>> MYSUBFUN=DoubleFactorialDP.o FactorialDP.o Gaunt.o Legendre.o
>>>> SphericalHarmonicYZ.o SqrtFactorialDP.o ThreeJSymbol.o factorial.f90
>>>> bessel.o writefile.o intgral.o ComlexUnit.o
>>>> .SUFFIXES:
>>>> .SUFFIXES: .f90 .o
>
>>>> all: $(NROBJS) $(MYOBJS) $(MYSUBFUN) main-goodformat2.o
>>>>     $(FC) $(NROBJS) $(MYOBJS) $(MYSUBFUN) main-goodformat2.o  -o
>>>> wannier.exe
>
>>>> .f90.o:
>>>> Â Â Â Â $(FC) -c $<
>
>>>> nr.o: nr.f90 nrtype.o
>>>> nrtype.o: nrtype.f90
>
>>> ...
>
>>>> Would you please guide me if there is any flag for this purpose?
>>>> (I cannot write my code in Parallel. so I should find some flags!!!)
>>>> I'm anxiously looking forward your reply and guidelines.
>
>>> Â Â Â Â You don't appear to be using any optimisation. Â Try adding -O3 to
>>> your .f90.o: line. Â Type in 'ifort --help' to get a listing of some flags you
>>> can try. Â There's also a chance you can get better interprocedural optimisation
>>> by combining some of your source files together.
>
>>> --
>>> Ivan Reid, School of Engineering & Design, _____________ Â CMS Collaboration,
>>> Brunel University. Â Â Ivan.Reid@[
brunel.ac.uk|cern.ch] Â Â Room 40-1-B12, CERN
>>> Â Â Â Â KotPT -- "for stupidity above and beyond the call of duty".
>
>> IN WHICH LINE OF MAKEFILE SHOULD I ADD Â -O3 ?
>> WHAT IS YOUR MEAN ABOUT "combining some of the source files"?
>
> I wrote -O3 at the first line of makefile and it works, but the speed
> is still low. what should I do? Is there any usefull flag for my
> purpose?
>
> Thanks in advance.
> Fatemeh- Hide quoted text -
>
> - Show quoted text -
A further possibility is to examine whether the compiler's flags are,
by default, degrading run-time performance. In particular, ifort
peforms run-time array bounds checking by default, very useful for
code development, but if you're using arrays heavily, as I do, the
peformance hit can be large. If I use O3 and no run-time checking my
programs go up to three times faster than with O0 and bounds checking.
Regards,
Mike Metcalf