• Optimization options

    From Beliavsky@21:1/5 to All on Wed Apr 27 07:12:17 2022
    Regarding compiler options to maximize speed I may tweet

    The ifort -fast and gfortran -O3 -march=native options can be used to
    increase speed. Gfortran -Ofast turns on -ffast-math and can give a
    further 2x speedup in some cases, but it can also give incorrect
    results and should be used with care. Use gfortran -Og to debug.

    That is 274 characters. If there is something wrong, please let me know.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steve Lionel@21:1/5 to Beliavsky on Thu Apr 28 09:01:51 2022
    On 4/27/2022 10:12 AM, Beliavsky wrote:
    Regarding compiler options to maximize speed I may tweet

    The ifort -fast and gfortran -O3 -march=native options can be used to increase speed. Gfortran -Ofast turns on -ffast-math and can give a
    further 2x speedup in some cases, but it can also give incorrect
    results and should be used with care. Use gfortran -Og to debug.

    That is 274 characters. If there is something wrong, please let me know.By itself this is mostly OK, but for the ifort users I'll probably add a
    comment that -fast also turns on -xHost, and is best used when compiling
    and running on the same processor. Like the gfortran option, the things
    turned on by -fast can also change results.

    The suggestion of using -Og to debug differences caused by high
    optimization isn't useful, in my opinion.

    I'd also wonder if it's appropriate for these tweets to be about
    individual compilers and not the language.

    --
    Steve Lionel
    ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
    Retired Intel Fortran developer/support
    Email: firstname at firstnamelastname dot com
    Twitter: @DoctorFortran
    LinkedIn: https://www.linkedin.com/in/stevelionel
    Blog: https://stevelionel.com/drfortran
    WG5: https://wg5-fortran.org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)