Compiling CMAQ with the new nvidia-hpc SDK compilers

Does anyone have experience compiling CMAQ with the new nvidia-hpc SDK compilers? We were using the ‘free’ PGI compiler, but that license has expired. Since we have not changed compilers in quite a while, I would need to know which flags may need to be changed etc. We are running Ubuntu 18.04.6 LTS.

@mgeigert -

Licensed PGI compilers are still available, However, starting in August 2020 it transitioned to the free NVIDIA HPC SDK compiler. The latest version is 22.1.

You can use the new compiler with openmpi to build your CCTM after you upgrade your compiler from PGI to NVIDIA HPC SDK compiler,

You may edit config_cmaq.csh at following part.

#> Portland Group fortran compiler …

setenv MPI_INCL_DIR nvidia compiler path/include
setenv MPI_LIB_DIR nvidia compiler path/lib

#> I/O API, netCDF, and MPI libraries

setenv mpi_lib “-lmpi”

Keep in mind that you also need to setup environment parameters for I/O API and netCDF libraries.

Hope it is helpful to you.

Feng

Hi @mgeigert,

We (EPA dev team) have had experience building and running the new Nvidia-HPC. We specifically have been testing our nvhpc version 21.9. From our testing, no CMAQ flags need to be changed from what you were previously using (or the default provided with the scripts). However, I cannot speak for externally maintained libraries not developed by the EPA.

Internally, we have had no issues building I/O API 3.2, netCDF and openMPI libraries with this compiler version (and default flags), but perhaps @cjcoats can expand on if he’s seen anything.

A couple of things to note:

  • You may need to change the cmaq_config.csh to point to updated libraries compiled with the new compiler (as alluded to by @FengLiu).
  • For better performance, you may want to change “-tp px” to something more hardware specific to target your machine (may cause issues on heterogenous clusters).