xlf vs xlc - Aix

This is a discussion on xlf vs xlc - Aix ; Hi all, I have to compare the running times of C++ programs (compiled with xlC) and F77 programs (compiled with xlf). The C++ programs use objects of a library written by us, while F77 programs do not use any library ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: xlf vs xlc

  1. xlf vs xlc

    Hi all,

    I have to compare the running times of C++ programs (compiled with xlC)
    and F77 programs (compiled with xlf). The C++ programs use objects of a
    library written by us, while F77 programs do not use any library calls.
    I have so far observed that the C++ programs are around 2-3 times
    slower than F77 programs. This may be due to several library calls in
    the C++ programs. Apart from this, do F77 programs gain from any
    additional optimizations from xlf, that xlC cannot apply to C++
    programs (like some optimizations that may be constrained by aliases in
    C++). If so, how can I enable those optimizatios? Are there any other
    parameter that I have to consider while comparing the codes generated
    by these two compilers.

    Ganesh


  2. Re: xlf vs xlc

    Ganesh wrote:
    > Hi all,
    >
    > I have to compare the running times of C++ programs (compiled with xlC)
    > and F77 programs (compiled with xlf). The C++ programs use objects of a
    > library written by us, while F77 programs do not use any library calls.
    > I have so far observed that the C++ programs are around 2-3 times
    > slower than F77 programs. This may be due to several library calls in
    > the C++ programs. Apart from this, do F77 programs gain from any
    > additional optimizations from xlf, that xlC cannot apply to C++
    > programs (like some optimizations that may be constrained by aliases in
    > C++). If so, how can I enable those optimizatios? Are there any other
    > parameter that I have to consider while comparing the codes generated
    > by these two compilers.
    >
    > Ganesh
    >


    Did you run a profiling tool on your codes ?
    Compile/link with -p option, run the code wich will produce a mon.out
    file and then run "prof your-exe-file"

    It will give you important informations:
    - slow part of the code (bad loops....)
    - short sub-programs often called (wich need to be inlined, may be
    important with C++ code)
    - etc

    Patrick

+ Reply to Thread