Precompiler options: Difference between revisions

From VASP Wiki
No edit summary
 
(36 intermediate revisions by 5 users not shown)
Line 51: Line 51:


=== -D_OPENMP ===
=== -D_OPENMP ===
:(Optional for hybrid MPI + OpenMP parallelization) Activate all OpenMP related code paths.
:(Optional ) Switch on [[Combining MPI and OpenMP|a combination of MPI and OpenMP for the parallelization]].


== Specific for the OpenACC port to GPUs ==
== Specific for the OpenACC port to GPUs ==
Line 70: Line 70:


=== -DVASP_HDF5 ===
=== -DVASP_HDF5 ===
:(Strongly recommended) Set this to add support for reading and writing HDF5 files. This option is available since VASP 6.2.0.
:(Strongly recommended) Set this to add [[:Category:HDF5 support|HDF5 support]]. This option has been available since VASP 6.2.0.
:'''N.B.''': one needs to [[Makefile.include#HDF5_support_.28strongly_recommended.29|add HDF5 to makefile.include]].


=== -Duse_shmem ===
=== -Duse_shmem ===
:Use MPI-3 shared memory segments to reduce memory demands. This can be really helpful to keep the memory demands of GW calculations at an acceptable level.
:Use [[Shared memory|shared-memory]] segments to reduce the memory demands of [[ALGO|GW (ALGO = EVGW0, EVGW, QPGW0, and QPGW)]] and [[Machine_learning_force_field_calculations:_Basics#Performance_and_memory_usage|machine-learned–force-field]] calculations.


=== -Dshmem_bcast_buffer ===
=== -Dshmem_bcast_buffer ===
:Use [[Shared memory|shared-memory]] segments to reduce the amount of MPI communication in hybrid-functional calculations.


=== -Dshmem_rproj ===
=== -Dshmem_rproj ===
:Use [[Shared memory|shared-memory]] segments to reduce the storage demands of the [[LREAL|real-space PAW projectors]].


=== -Dsysv ===
=== -Dsysv ===
:Use <tt>ipcs</tt> [[Shared memory|shared-memory]] segments and <tt>system-V</tt> semaphores.


=== -DVASP2WANNIER90 ===
=== -DVASP2WANNIER90 ===
Line 86: Line 90:


=== -Dlibbeef ===
=== -Dlibbeef ===
:Set this to include the BEEF class of van-der-Waals functionals.
:Set this to include the GGA BEEF functional (corresponds to {{TAG|GGA}}=BF).
:'''N.B.''': one needs to [[Installing_VASP.6.X.X#For_libbeef_.28optional.29|add libbeef to makefile.include]].
:'''N.B.''': one needs to [[Makefile.include#Libbeef_.28optional.29|add libbeef to makefile.include]].


=== -DDFTD4 ===
=== -DDFTD4 ===
:Set this to include the DFTD4 van-der-Waals functional.
:Set this to include the [[DFT-D4]] van der Waals functional.
:'''Note''' that you need to [[Installing_VASP.6.X.X#For_DFTD4_.28optional.29|install DFTD4 and add it to the makefile.include]].
:'''Note''' that you need to [[Makefile.include#DFT-D4_.28optional.29|install DFT-D4 and add it to the makefile.include]].
 
=== -DLIBMBD ===
:Set this to include the library libMBD of many-body dispersion (MBD) methods for van der Waals interactions.
:'''Note''' that you need to [[Makefile.include#libMBD_.28optional.29|install LibMBD and add it to the makefile.include]].


=== -DPROFILING ===
=== -DPROFILING ===
Line 98: Line 106:
=== -DUSELIBXC ===
=== -DUSELIBXC ===
:Set this to include the library of exchange-correlation functionals Libxc.
:Set this to include the library of exchange-correlation functionals Libxc.
:'''Note''' that you need to install Libxc >= 5.2.0 (or the master version from gitlab for the latest implemented functionals) with the option <code>--disable-fhc</code> and add it to the [[Makefile.include#Libxc_.28optional.29|makefile.include]].
:'''Note''' that you need to install Libxc >= 5.2.0 (or the master version from [https://gitlab.com/libxc/libxc gitlab] for the latest implemented functionals) with the option <code>--disable-fhc</code> and [[Makefile.include#Libxc_.28optional.29|add this to the makefile.include]].
 
=== -DELPA ===
:Set this to include the library of ELPA eigenvalue solvers.
:'''N.B.''': one needs to [[Makefile.include#ELPA_.28optional.29|add ELPA to makefile.include]].


=== -DLAPACK36 ===
=== -DLAPACK36 ===


:Required for [http://www.netlib.org/lapack/lapack-3.6.0.html <tt>LAPACK-3.6.0</tt>] and newer to replaced deprecated routine <tt>DGEGV</tt> by <tt>DGGEV</tt>.  
:Required for [http://www.netlib.org/lapack/lapack-3.6.0.html <tt>LAPACK-3.6.0</tt>] and newer to replaced deprecated routine <tt>DGEGV</tt> by <tt>DGGEV</tt>.


== Deprecated ==
== Deprecated ==
{{NB|deprecated| <code>-DNGZhalf</code>, <code>-DwNGZhalf</code>, <code>-DNGXhalf</code>, <code>-DwNGXhalf</code> are deprecated options. Building the standard, gamma-only, or non-collinear version of the code is specified through an additional argument to the make command as discussed in [[Installing VASP.6.X.X|Installing VASP.6.X.X]].|:}}
{{NB|deprecated| <code>-DNGZhalf</code>, <code>-DwNGZhalf</code>, <code>-DNGXhalf</code>, <code>-DwNGXhalf</code> are deprecated options. Building the standard, gamma-only, or non-collinear version of the code is specified through an additional argument to the make command as discussed in [[Installing VASP.6.X.X|Installing VASP.6.X.X]].|:}}
=== -DnoAugXCmeta ===
=== -DnoAugXCmeta ===
:This option was added to compute the metaGGA contributions from the non-augmented pseudo density (instead of the augmented density). There is a condition concerning the behavior of the von-Weizsäcker kinetic energy density (second derivative of the charge density) and the kinetic energy density computed from the orbitals ingrained into TPSS and revTPSS. This condition can be strongly violated when one augments the charge density. For the TPSS and revTPSS the functionals can become unstable in those cases. SCAN and its derivates (RSCAN, R2SCAN, etc) do not assume the aforementioned conditions to be met and remain stable for the augmented density as well so this option should not be used as it may negatively affect the final results.
:This option was added to compute the meta-GGA contributions from the non-augmented pseudo density (instead of the augmented density). There is a condition concerning the behavior of the von-Weizsäcker kinetic energy density (calculated using the first derivative of the charge density) and the kinetic energy density computed from the orbitals ingrained into TPSS and revTPSS. This condition can be strongly violated when one augments the charge density. For the TPSS and revTPSS the functionals can become unstable in those cases. SCAN and its derivates (RSCAN, R2SCAN, etc) do not assume the aforementioned conditions to be met and remain stable for the augmented density as well so this option should not be used as it may negatively affect the final results.


=== -DVASP2WANNIER90 and -DVASP2WANNIER90v2 ===
=== -DVASP2WANNIER90 and -DVASP2WANNIER90v2 ===
:Set this to include the interface between VASP and Wannier90.
:Set this to include the interface between VASP and Wannier90.
:Up to VASP 6.1.x you need to set -DVASP2WANNIER90 to interface with Wannier90 v.1.x, and -DVASP2WANNIER90v2 for Wannier90 v.2.x, and add the Wannier90 library to makefile.include.
:Up to VASP 6.1.x you need to set -DVASP2WANNIER90 to interface with Wannier90 v.1.x, and -DVASP2WANNIER90v2 for Wannier90 v.2.x, and add the Wannier90 library to [[makefile.include]].
:Since VASP 6.2.0 you need to set -DVASP2WANNIER90 to interface with Wannier90 v.2.x or v.3.x.
:Since VASP 6.2.0 you need to set -DVASP2WANNIER90 to interface with Wannier90 v.2.x or v.3.x.
== Related articles ==
[[Installing VASP.6.X.X]],
[[makefile.include]],
[[Compiler options]],
[[Linking to libraries]],
[[OpenACC GPU port of VASP]],
[[Toolchains]],
[[Validation tests]],
[[Known issues]]


----
----
[[The_VASP_Manual|Contents]]


[[Category:VASP]]
[[Category:VASP]][[Category:Installation]][[Category:Performance]][[Category:GPU]]
[[Category:Installation]]

Latest revision as of 09:30, 11 September 2024

Precompiler flags are used to activate/deactivate certain code features at the time of compilation, e.g., the use of MPI, the advanced molecular dynamics features, etc. Many precompiler flags are set by default in the templates provided for the makefile.include file. The commands are as follows:

CPP
The command to invoke the precompiler you want to use, for instance:
  • Using Intel's Fortran precompiler:
CPP=fpp -f_com=no -free -w0 $*$(FUFFIX) $*$(SUFFIX) $(CPP_OPTIONS)
  • Using cpp:
CPP=/usr/bin/cpp -P -C -traditional $*$(FUFFIX) >$*$(SUFFIX) $(CPP_OPTIONS)
Mind: This variable has to include $(CPP_OPTIONS). If not, CPP_OPTIONS will be ignored!
CPP_OPTIONS
Specify the precompiler flags:
CPP_OPTIONS=[-Dflag1 [-Dflag2] ... ]
Mind: CPP_OPTIONS is only used in makefile.include, where it is added to the CPP variable.

Default

-DHOST=[string]

A string (20 characters max.) that describes the platform on which VASP is compiled, e.g., -DHOST=\"LinuxIFC\" for a Linux host using an Intel Fortran compiler.

-DMPI

(Mandatory) Set this to compile the parallel version of VASP.

-Duse_collective

Set this to use MPI collectives in the all-to-all communication and global summations.
In case one specifies this, the value of MPI_BLOCK (below) will be meaningless.

-DMPI_BLOCK=[integer]

Specifies the block size used by the in-house MPI all-to-all communication and global summations.

-DscaLAPACK

Set this to use scaLAPACK.

-DCACHE_SIZE=[integer]

Specifies the size of the cache memory. Only used by the in-house real-to-complex FFT routines (fft3dlib.F).
By default these are no longer used, instead we use the real-to-complex FFT routines from fftw3.

-Davoidalloc

Set this to use automatic instead of allocatable arrays in many routines related to the real space projection operators.

-Dvasp6

Set this to activate all VASP.6.X.X specific features.

-Dtbdyn

Adds the advanced molecular dynamics routines.

-Dfock_dblbuf

Uses double buffer technique for the computation of exchange potential. Available as of VASP.6, N/A for the CUDA-C GPU-port.

-D_OPENMP

(Optional ) Switch on a combination of MPI and OpenMP for the parallelization.

Specific for the OpenACC port to GPUs

-D_OPENACC

Mandatory: Activate all OpenACC related code paths.

-DUSENCCL

Mandatory: Use the NVIDIA Collective Communications Library (NCCL) instead of MPI for relevant instances of collective reduction operations (MPI_Allreduce).

-DUSENCCLP2P

Optional but strongly recommended (requires NCCL >= 2.7.8): Use the NVIDIA Collective Communications Library (NCCL) instead of MPI for relevant instances of all-to-all operations (MPI_Alltoallv).

-Dqd_emulate

Mandatory: To compile the OpenACC GPU-port you need either the NVIDIA HPC-SDK or a recent version (>= 19.10) of PGI's Compilers & Tools. Both of these compilers do not natively support quadruple precision and require the use of the QD library to emulate quadruple precision arithmetic.

Optional

-DVASP_HDF5

(Strongly recommended) Set this to add HDF5 support. This option has been available since VASP 6.2.0.
N.B.: one needs to add HDF5 to makefile.include.

-Duse_shmem

Use shared-memory segments to reduce the memory demands of GW (ALGO = EVGW0, EVGW, QPGW0, and QPGW) and machine-learned–force-field calculations.

-Dshmem_bcast_buffer

Use shared-memory segments to reduce the amount of MPI communication in hybrid-functional calculations.

-Dshmem_rproj

Use shared-memory segments to reduce the storage demands of the real-space PAW projectors.

-Dsysv

Use ipcs shared-memory segments and system-V semaphores.

-DVASP2WANNIER90

Set this to include the interface between VASP and Wannier90.
Deprecated: For VASP<6.2.0, see -DVASP2WANNIER90 and -DVASP2WANNIER90v2 in the deprecated section below!

-Dlibbeef

Set this to include the GGA BEEF functional (corresponds to GGA=BF).
N.B.: one needs to add libbeef to makefile.include.

-DDFTD4

Set this to include the DFT-D4 van der Waals functional.
Note that you need to install DFT-D4 and add it to the makefile.include.

-DLIBMBD

Set this to include the library libMBD of many-body dispersion (MBD) methods for van der Waals interactions.
Note that you need to install LibMBD and add it to the makefile.include.

-DPROFILING

Switches on detailed profiling of the code. This carries a (slight) performance penalty.

-DUSELIBXC

Set this to include the library of exchange-correlation functionals Libxc.
Note that you need to install Libxc >= 5.2.0 (or the master version from gitlab for the latest implemented functionals) with the option --disable-fhc and add this to the makefile.include.

-DELPA

Set this to include the library of ELPA eigenvalue solvers.
N.B.: one needs to add ELPA to makefile.include.

-DLAPACK36

Required for LAPACK-3.6.0 and newer to replaced deprecated routine DGEGV by DGGEV.

Deprecated

Deprecated: -DNGZhalf, -DwNGZhalf, -DNGXhalf, -DwNGXhalf are deprecated options. Building the standard, gamma-only, or non-collinear version of the code is specified through an additional argument to the make command as discussed in Installing VASP.6.X.X.

-DnoAugXCmeta

This option was added to compute the meta-GGA contributions from the non-augmented pseudo density (instead of the augmented density). There is a condition concerning the behavior of the von-Weizsäcker kinetic energy density (calculated using the first derivative of the charge density) and the kinetic energy density computed from the orbitals ingrained into TPSS and revTPSS. This condition can be strongly violated when one augments the charge density. For the TPSS and revTPSS the functionals can become unstable in those cases. SCAN and its derivates (RSCAN, R2SCAN, etc) do not assume the aforementioned conditions to be met and remain stable for the augmented density as well so this option should not be used as it may negatively affect the final results.

-DVASP2WANNIER90 and -DVASP2WANNIER90v2

Set this to include the interface between VASP and Wannier90.
Up to VASP 6.1.x you need to set -DVASP2WANNIER90 to interface with Wannier90 v.1.x, and -DVASP2WANNIER90v2 for Wannier90 v.2.x, and add the Wannier90 library to makefile.include.
Since VASP 6.2.0 you need to set -DVASP2WANNIER90 to interface with Wannier90 v.2.x or v.3.x.

Related articles

Installing VASP.6.X.X, makefile.include, Compiler options, Linking to libraries, OpenACC GPU port of VASP, Toolchains, Validation tests, Known issues