Jean Zay : Compiling an OpenACC code

On Jean Zay, PGI compilers offer the possibility of using OpenACC.

Compiling options for PGI

Documentation about the compilers is accessible on the PGI Web site.

Activating OpenACC support

The PGI compiling options for activating OpenACC are the following:

  • -acc: This option activates the OpenACC support. You can specify some suboptions:
    • [no]autopar: Activate automatic parallelization for the ACC PARALLEL directive. The default is to activate it.
    • [no]routineseq: Compile all the routines for the accelerator. The default is to not compile each routine as a sequential directive.
    • strict: Display warning messages if using non-OpenACC directives for the accelerator.
    • verystrict: Stops the compilation if using any non-OpenACC directives for the accelerator.
    • sync: Ignore async clauses.
    • [no]wait: Wait for the completion of each calculation kernel on the accelerator. By default, kernel launching is blocked except if async is used.
    • Example :
      $ pgfortran -acc=noautopar,sync -o prog_ACC prog_ACC.f90
  • -ta: This option activates offloading on the accelerator. It automatically activates the -acc option.
    • It will be useful for choosing the architecture for compiling the code.
    • To use the V100 GPUs of Jean Zay, it is necessary to use the tesla suboption of -ta and the cc70 compute capability. For example:
      $ pgfortran -ta=tesla:cc70 -o prog_gpu prog_gpu.f90
    • Some useful tesla suboptions:
      • managed: Creates a shared view of the GPU and CPU memory.
      • pinned: Activates CPU memory pinning. This can improve data transfer performance.
      • autocompare: Activates comparison of CPU/GPU results.

The other options are available in the PGI Web documentation.