Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
technical:recipes:quantum-espresso [2024-05-12 10:44] – [Versions] bkang | technical:recipes:quantum-espresso [2024-05-12 11:05] (current) – [Runtime environment] bkang | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Building Quantum Espresso on Caviness/ | ||
+ | |||
+ | The build procedure outlined herein uses Open MPI on top of the Intel compiler suite. | ||
+ | |||
+ | ===== Directory Preparation ===== | ||
+ | |||
+ | To begin, choose a directory in which the Quantum Espresso version(s) will be built and installed. | ||
+ | <code bash> | ||
+ | [user@login00.darwin ~]$ QE_BASEDIR=~/ | ||
+ | [user@login00.darwin ~]$ QE_BASEDIR_PRIVS=0700 | ||
+ | </ | ||
+ | If you are managing Quantum Espresso software for your entire workgroup, you could instead use | ||
+ | <code bash> | ||
+ | [user@login00.darwin ~]$ QE_BASEDIR=" | ||
+ | [user@login00.darwin ~]$ QE_BASEDIR_PRIVS=2770 | ||
+ | </ | ||
+ | |||
+ | |||
+ | If the directory hierarchy does not yet exist, it can be setup using | ||
+ | <code bash> | ||
+ | [user@login00.darwin ~]$ mkdir -p -m $QE_BASEDIR_PRIVS " | ||
+ | </ | ||
+ | |||
+ | ===== Source Preparation ===== | ||
+ | |||
+ | In this example version 7.3 of quantum-espresso will be built. Our standard recipes for quantum-espresso will entail use of the Intel compilers, the MKL for BLAS/ | ||
+ | |||
+ | Unpack " | ||
+ | <code bash> | ||
+ | [user@login00.darwin ~]$ tar -xvzf " | ||
+ | </ | ||
+ | |||
+ | ===== Compilation and Installation===== | ||
+ | |||
+ | We use cmake for compilation and installation on " | ||
+ | <code bash> | ||
+ | [user@login00.darwin ~]$ QE_INSTALL_PREFIX=" | ||
+ | [user@login00.darwin ~]$ export QE_INSTALL_PREFIX | ||
+ | [user@login00.darwin ~]$ QE_SRC_PREFIX=" | ||
+ | [user@login00.darwin ~]$ mkdir -m $QE_BASEDIR_PRIVS " | ||
+ | [user@login00.darwin ~]$ QE_BUILDDIR=" | ||
+ | [user@login00.darwin ~]$ mkdir -m $QE_BASEDIR_PRIVS " | ||
+ | [user@login00.darwin ~]$ cd " | ||
+ | </ | ||
+ | Our current working directory is now the //build root//. | ||
+ | Here, we create '' | ||
+ | <file make build.sh.darwin> | ||
+ | #!/bin/bash -l | ||
+ | |||
+ | vpkg_require cmake/ | ||
+ | |||
+ | PREFIX=" | ||
+ | |||
+ | cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx \ | ||
+ | -DCMAKE_Fortran_COMPILER=mpifort \ | ||
+ | -DCMAKE_INSTALL_PREFIX=" | ||
+ | -DCMAKE_C_FLAGS=" | ||
+ | -DCMAKE_Fortran_FLAGS=" | ||
+ | -DQE_ENABLE_OPENMP=ON -DCMAKE_BUILD_TYPE: | ||
+ | |||
+ | make -j 20 | ||
+ | make install | ||
+ | </ | ||
+ | |||
+ | <file make build.sh.caviness> | ||
+ | #!/bin/bash -l | ||
+ | |||
+ | vpkg_require cmake/ | ||
+ | |||
+ | PREFIX=" | ||
+ | |||
+ | cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx \ | ||
+ | -DCMAKE_Fortran_COMPILER=mpifort \ | ||
+ | -DCMAKE_INSTALL_PREFIX=" | ||
+ | -DCMAKE_C_FLAGS=" | ||
+ | -DCMAKE_Fortran_FLAGS=" | ||
+ | -DQE_ENABLE_OPENMP=ON -DCMAKE_BUILD_TYPE: | ||
+ | |||
+ | make -j 20 | ||
+ | make install | ||
+ | </ | ||
+ | |||
+ | Executing the script compile and install quantum-expresso 7.3. | ||
+ | <code bash> | ||
+ | [user@login00.darwin build]$ ./build.sh | ||
+ | </ | ||
+ | |||
+ | ===== VALET Package Definition ===== | ||
+ | |||
+ | With this version of quantum espresso built, the remaining step is to leverage VALET for setup of the runtime environment when you use the software. | ||
+ | <code bash> | ||
+ | [user@login00.darwin build]$ vpkg_rollback all | ||
+ | [user@login00.darwin build]$ cd | ||
+ | [user@login00.darwin ~]$ echo $QE_BASEDIR | ||
+ | / | ||
+ | </ | ||
+ | Since this build was done in the user's home directory, they were personal copies of the software and should use a //VALET package definition file// stored in '' | ||
+ | <code bash> | ||
+ | [user@login00.darwin ~]$ VALET_PKG_DIR=~/ | ||
+ | </ | ||
+ | versus an installation made for an entire workgroup, which would store the VALET package definition files in '' | ||
+ | <code bash> | ||
+ | [user@login00.darwin ~]$ VALET_PKG_DIR=" | ||
+ | </ | ||
+ | Whichever scheme is in-use, ensure the directory exists: | ||
+ | <code bash> | ||
+ | [user@login00.darwin ~]$ mkdir -p --mode=$VALET_PKG_DIR_MODE " | ||
+ | </ | ||
+ | |||
+ | VALET allows package definitions in a variety of formats (XML, JSON, YAML) but YAML tends to be the simplest format so we will use it here. | ||
+ | |||
+ | ==== Package section ==== | ||
+ | |||
+ | The //package section// of the definition file includes items that apply to all versions/ | ||
+ | <code yaml> | ||
+ | quantum-espresso: | ||
+ | prefix: / | ||
+ | description: | ||
+ | url: " | ||
+ | </ | ||
+ | The //package identifier// | ||
+ | |||
+ | ==== Versions ==== | ||
+ | |||
+ | The '' | ||
+ | <code yaml> | ||
+ | quantum-espresso: | ||
+ | prefix: / | ||
+ | description: | ||
+ | url: " | ||
+ | | ||
+ | versions: | ||
+ | " | ||
+ | description: | ||
+ | dependencies: | ||
+ | - openmpi/ | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round tip 80%> | ||
+ | The version identifier '' | ||
+ | |||
+ | The implicit behavior is overridden by providing a '' | ||
+ | </ | ||
+ | |||
+ | It is a good idea to specify which version definition should act as the default. | ||
+ | |||
+ | <file yaml quantum-espresso.vpkg_yaml.darwin> | ||
+ | quantum-espresso: | ||
+ | prefix: / | ||
+ | description: | ||
+ | url: " | ||
+ | | ||
+ | default-version: | ||
+ | | ||
+ | versions: | ||
+ | " | ||
+ | description: | ||
+ | dependencies: | ||
+ | - openmpi/ | ||
+ | </ | ||
+ | |||
+ | <file yaml quantum-espresso.vpkg_yaml.caviness> | ||
+ | quantum-espresso: | ||
+ | prefix: / | ||
+ | description: | ||
+ | url: " | ||
+ | | ||
+ | default-version: | ||
+ | | ||
+ | versions: | ||
+ | " | ||
+ | description: | ||
+ | dependencies: | ||
+ | - openmpi/ | ||
+ | </ | ||
+ | |||
+ | saved at '' | ||
+ | |||
+ | ==== Checking the definition file ==== | ||
+ | |||
+ | The package definition file can be checked for proper syntax using the VALET command '' | ||
+ | <code bash> | ||
+ | [user@login00.darwin ~]$ vpkg_check " | ||
+ | / | ||
+ | [quantum-espresso] { | ||
+ | contexts: all | ||
+ | actions: { | ||
+ | QUANTUM_DASH_ESPRESSO_PREFIX=${VALET_PATH_PREFIX} (contexts: development) | ||
+ | } | ||
+ | https:// | ||
+ | quantum-espresso | ||
+ | prefix: / | ||
+ | source file: / | ||
+ | default version: quantum-espresso/ | ||
+ | versions: { | ||
+ | [quantum-espresso/ | ||
+ | contexts: all | ||
+ | dependencies: | ||
+ | openmpi/ | ||
+ | } | ||
+ | compiled with Open MPI, Intel compilers, MKL, ScaLAPACK | ||
+ | prefix: / | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | The file had no errors in its YAML syntax. | ||
+ | |||
+ | ==== Runtime environment ==== | ||
+ | |||
+ | To load **quantum-espresso** 7.3 into the runtime environment, | ||
+ | <code bash> | ||
+ | [user@login00.darwin ~]$ vpkg_require quantum-espresso/ | ||
+ | Adding dependency `binutils/ | ||
+ | Adding dependency `gcc/ | ||
+ | Adding dependency `intel-oneapi/ | ||
+ | Adding dependency `ucx/ | ||
+ | Adding dependency `openmpi/ | ||
+ | Adding package `quantum-espresso/ | ||
+ | [user@login00.darwin ~]$ which pw.x | ||
+ | ~/ | ||
+ | </ | ||
+ | |||
+ | ===== Scaling ===== | ||
+ | |||
+ | This is the wall time for the structure relaxation of silicon with respect to the number of cores. The wall time decreases with an increased number of cores. | ||
+ | |||
+ | {{: | ||