Skip to content
Snippets Groups Projects
intel-compilers.md 2.94 KiB
Newer Older
  • Learn to ignore specific revisions
  • Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    # Intel Compilers
    
    ## Introduction
    
    
    Jan Siwiec's avatar
    Jan Siwiec committed
    Intel compilers are compilers for Intel processor-based systems, available for Microsoft Windows, Linux, and macOS operating systems.
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    
    ## Installed Versions
    
    
    Jan Siwiec's avatar
    Jan Siwiec committed
    !!! important "New Compilers in intel/2023a Module"
        An `intel/2023a` module has been installed on the Karolina and Barbora clusters.
    
    Jan Siwiec's avatar
    Jan Siwiec committed
        This module contains new compilers `icx`, `icpx`, and `ifx`.<br>
    
    Jan Siwiec's avatar
    Jan Siwiec committed
        See the porting guides for [ICC Users to DPCPP or ICX][b] or for [Intel® Fortran Compiler][c].
    
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    Intel compilers are available in multiple versions via the `intel` module. The compilers include the icc C and C++ compiler and the ifort Fortran 77/90/95 compiler.
    
    
    For the current list of installed versions, use:
    
    ```console
    $ ml av intel/
    ```
    
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    ```console
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    $ icc -v
    
    icc version 19.1.3.304 (gcc version 10.2.0 compatibility)
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    $ ifort -v
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    ```
    
    
    ## Instructions Vectorization
    
    Intel compilers provide vectorization of the code via the AVX-2/AVX-512 instructions and support threading parallelization via OpenMP.
    
    For maximum performance on the Barbora cluster compute nodes, compile your programs using the AVX-512 instructions, with reporting where the vectorization was used. We recommend the following compilation options for high performance.
    
    
    Jan Siwiec's avatar
    Jan Siwiec committed
    !!! info
    
        Barbora non-accelerated nodes support AVX-512 instructions (cn1-cn192).
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    
    
    ```console
    $ icc -ipo -O3 -xCORE-AVX512 -qopt-report1 -qopt-report-phase=vec myprog.c mysubroutines.c -o myprog.x
    ```
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    
    
    In this example, we compile the program enabling interprocedural optimizations between source files (`-ipo`), aggressive loop optimizations (`-O3`), and vectorization (`-xCORE-AVX512`).
    
    For maximum performance on the Barbora GPU nodes or Karolina cluster compute nodes, compile your programs using the AVX-2 instructions, with reporting where the vectorization was used. We recommend the following compilation options for high performance.
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    
    ```console
    
    $ icc -ipo -O3 -xCORE-AVX2 -qopt-report1 -qopt-report-phase=vec myprog.c mysubroutines.c -o myprog.x
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    ```
    
    
    Jan Siwiec's avatar
    Jan Siwiec committed
    !!! warn
    
        Karolina cluster has AMD cpu, use compiler options `-march=core-avx2`.
    
    
    Lukáš Krupčík's avatar
    Lukáš Krupčík committed
    In this example, we compile the program enabling interprocedural optimizations between source files (`-ipo`), aggressive loop optimizations (`-O3`), and vectorization (`-xCORE-AVX2`).
    
    The compiler recognizes the omp, simd, vector, and ivdep pragmas for OpenMP parallelization and AVX2 vectorization. Enable the OpenMP parallelization by the `-openmp` compiler switch.
    
    ```console
    $ icc -ipo -O3 -xCORE-AVX2 -qopt-report1 -qopt-report-phase=vec -openmp myprog.c mysubroutines.c -o myprog.x
    ```
    
    Read more [here][a].
    
    
    [a]: https://software.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top.html
    
    Jan Siwiec's avatar
    Jan Siwiec committed
    [b]: https://www.intel.com/content/www/us/en/developer/articles/guide/porting-guide-for-icc-users-to-dpcpp-or-icx.html
    [c]: https://www.intel.com/content/www/us/en/developer/articles/guide/porting-guide-for-ifort-to-ifx.html?wapkw=ifx