Hello Zhaoxu,
yes, you are using the correct templates for an aocc build. The difference between the two is only that the
_omp version also enables OpenMP threading parallelization. This may be helpful if you are working on a large machine (>= 64 cores, see also
wiki/index.php/Combining_MPI_and_OpenMP).
As far as I know for a build with aocc you need to provide a few more things before you can compile VASP. The problem you are facing at the moment is that your
mpif90 (which is used as Fortran compiler in makefile.include) is the default MPI compiler wrapper for the Ubuntu 22.04 system. If you type
it will show that under the hood it is actually using gfortran and not aocc. Hence, the first step would be to build OpenMPI with the aocc compiler. This may not be trivial because there may be additional dependencies. Once this is done, you will get an alternative
mpif90 command that is correctly using the aocc compiler. Then when building VASP, you have to give the correct
mpif90 binary in the
FC and
FCL variables. This all is somewhat tricky, maybe it is better to install all necessary requirements via the
SPACK environment. For example, here I found instructions how to install OpenMPI for aocc:
https://developer.amd.com/spack/hpc-app ... s-openmpi/
Also note that in addition to the aocc compiler you need to install AMD's
AOCL library package and give the correct paths to it in the
makefile.include. Please understand that I cannot give you complete instructions on how to perform this installation as it may be a quite intricate process. If you are not bound to use the aocc compiler let me mention that you can get comparable performance for AMD machines also with alternative toolchains. A simpler alternative would be to use gfortran as the compiler and link to AMD's
AOCL libraries for numerics. Hence, there would be no need to build OpenMPI from scratch and you could use the
mpif90 as it is now. The corresponding
makefile.include template is this one:
Code: Select all
makefile.include.gnu_ompi_aocl_omp
Best,
Andreas Singraber