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-10 10:40] – [Compilation and Installation] bkang | technical:recipes:quantum-espresso [2024-05-12 11:05] (current) – [Runtime environment] bkang | ||
---|---|---|---|
Line 26: | Line 26: | ||
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/ | 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/ | ||
- | We will create a directory to hold our base build of quantum-espresso 7.3, naming it with the version identifier: | + | Unpack " |
<code bash> | <code bash> | ||
- | [user@login00.darwin ~]$ QE_SRC_PREFIX=" | + | [user@login00.darwin ~]$ tar -xvzf " |
- | [user@login00.darwin ~]$ mkdir -m $QE_BASEDIR_PRIVS " | + | |
- | [user@login00.darwin ~]$ cd " | + | |
- | [user@login00.darwin qe-7.3]$ tar -xf " | + | |
</ | </ | ||
Line 39: | Line 36: | ||
<code bash> | <code bash> | ||
[user@login00.darwin ~]$ QE_INSTALL_PREFIX=" | [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 ~]$ mkdir -m $QE_BASEDIR_PRIVS " | ||
[user@login00.darwin ~]$ QE_BUILDDIR=" | [user@login00.darwin ~]$ QE_BUILDDIR=" | ||
Line 47: | Line 46: | ||
Here, we create '' | Here, we create '' | ||
<file make build.sh.darwin> | <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 | #!/bin/bash -l | ||
Line 63: | Line 80: | ||
make install | make install | ||
</ | </ | ||
+ | |||
Executing the script compile and install quantum-expresso 7.3. | Executing the script compile and install quantum-expresso 7.3. | ||
<code bash> | <code bash> | ||
[user@login00.darwin build]$ ./build.sh | [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. | ||
+ | |||
+ | {{: | ||
+ |