Skip to main content
âš  INFORMATION
This page was translated by an AI (LLM) with a cursory human check and is awaiting full review.

Compilation of OpenACC code (Fortran, C/C++)

On Jean Zay, the NVIDIA HPC compilers provide the possibility to use OpenACC.

Compilation options for NVIDIA HPC​

The documentation for NVIDIA compilers is available on the NVIDIA website.

Taking OpenACC into account​

The compilation options for OpenACC support by the NVIDIA HPC compiler are as follows:

  • -acc: this option enables OpenACC support. It can be given the following sub-options:
    • [no]autopar: Enable (or not) automatic parallelisation for the ACC PARALLEL directive. The default is to enable it.
    • [no]routineseq: Compile (or not) all routines for the accelerator. The default is not to compile each routine as sequential.
    • strict: Display warning messages in case of use of non-OpenACC directives for the accelerator.
    • verystrict: Stop the compilation in case of use of non-OpenACC directives for the accelerator.
    • sync: Ignore async clauses.
    • [no]wait: Wait (or not) for the end of each computation kernel on the accelerator. Kernel launch is blocked by default, unless async is used.
    • Example:
      nvfortran -acc=noautopar,sync -o prog_ACC prog_ACC.f90

`

  • -ta: This option enables offloading computation to the accelerator. It implies the -acc option.
    • It is useful for choosing the target architecture for which the code will be compiled.
    • To use the V100 GPUs of Jean Zay, you must use the tesla sub-option of -ta and the compute capability cc70. For example:
      nvfortran -ta=tesla:cc70 -o prog_gpu prog_gpu.f90
    • Some useful examples of tesla sub-options:
      • managed: Allows creating a shared view of GPU and CPU memory.
      • pinned: Enables memory pinning on the CPU. This can improve data transfer performance.
      • autocompare: Enables comparison of results on CPU and GPU.

The other options are available in the Web documentation NVIDIA.