technical:recipes:quantum-espresso

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
technical:recipes:quantum-espresso [2024-05-10 10:51] – [VALET Package Definition] bkangtechnical: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/LAPACK/FFTW/ScaLAPACK/BLACS, and Open MPI for parallelism. 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/LAPACK/FFTW/ScaLAPACK/BLACS, and Open MPI for parallelism.
  
-We will create a directory to hold our base build of quantum-espresso 7.3, naming it with the version identifier:  ''qe-7.3'' The source is then unpacked therein:+Unpack "qe-7.3-ReleasePack.tar.gz" will create a directory to hold our base build of quantum-espresso 7.3, naming it with the version identifier:  ''qe-7.3'' The source is then unpacked therein:
 <code bash> <code bash>
-[user@login00.darwin ~]$ QE_SRC_PREFIX="${QE_BASEDIR}/qe-7.3" +[user@login00.darwin ~]$ tar -xvzf "${QE_BASEDIR}/qe-7.3-ReleasePack.tar.gz"
-[user@login00.darwin ~]$ mkdir -m $QE_BASEDIR_PRIVS "$QE_SRC_PREFIX" +
-[user@login00.darwin ~]$ cd "$QE_SRC_PREFIX" +
-[user@login00.darwin qe-7.3]$ tar -xf "${QE_BASEDIR}/qe-7.3-ReleasePack.tar.gz"+
 </code> </code>
  
Line 39: Line 36:
 <code bash> <code bash>
 [user@login00.darwin ~]$ QE_INSTALL_PREFIX="${QE_BASEDIR}/v7.3" [user@login00.darwin ~]$ QE_INSTALL_PREFIX="${QE_BASEDIR}/v7.3"
 +[user@login00.darwin ~]$ export QE_INSTALL_PREFIX
 +[user@login00.darwin ~]$ QE_SRC_PREFIX="${QE_BASEDIR}/qe-7.3"
 [user@login00.darwin ~]$ mkdir -m $QE_BASEDIR_PRIVS "$QE_INSTALL_PREFIX" [user@login00.darwin ~]$ mkdir -m $QE_BASEDIR_PRIVS "$QE_INSTALL_PREFIX"
 [user@login00.darwin ~]$ QE_BUILDDIR="${QE_SRC_PREFIX}/build" [user@login00.darwin ~]$ QE_BUILDDIR="${QE_SRC_PREFIX}/build"
Line 47: Line 46:
 Here, we create ''build.sh'' : Here, we create ''build.sh'' :
 <file make build.sh.darwin> <file make build.sh.darwin>
 +#!/bin/bash -l
 +
 +vpkg_require cmake/3.28.3 openmpi/4.1.5:intel-oneapi-2023 git
 +
 +PREFIX="${QE_INSTALL_PREFIX}"
 +
 +cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx \
 +-DCMAKE_Fortran_COMPILER=mpifort \
 +-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
 +-DCMAKE_C_FLAGS="-msse3 -axsse3,sse4.2,AVX,core-AVX2,CORE-AVX512" \
 +-DCMAKE_Fortran_FLAGS="-msse3 -axsse3,sse4.2,AVX,core-AVX2,CORE-AVX512" \
 +-DQE_ENABLE_OPENMP=ON -DCMAKE_BUILD_TYPE:STRING=RELWITHDEBINFO ../
 +
 +make -j 20
 +make install
 +</file>
 +
 +<file make build.sh.caviness>
 #!/bin/bash -l #!/bin/bash -l
  
Line 63: Line 80:
 make install make install
 </file> </file>
 +
 Executing the script compile and install quantum-expresso 7.3. Executing the script compile and install quantum-expresso 7.3.
 <code bash> <code bash>
Line 91: Line 109:
  
 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. 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/variants of the software:
 +<code yaml>
 +quantum-espresso:
 +    prefix: /home/user/sw/quantum-espresso
 +    description: quantum-espresso
 +    url: "https://www.quantum-espresso.org/"
 +</code>
 +The //package identifier// is the top-level key in the document — ''quantum-espresso'' — and the value of ''$QE_BASEDIR'' is the value of the ''prefix'' key in this section.  The URL and description are information taken from the official quantum-espresso web site.
 +
 +==== Versions ====
 +
 +The ''versions'' key is used to provide a list of the versions/variants of the software:
 +<code yaml>
 +quantum-espresso:
 +    prefix: /home/user/sw/quantum-espresso
 +    description: quantum-espresso
 +    url: "https://www.quantum-espresso.org/"
 +    
 +    versions:
 +        "v7.3":
 +            description: compiled with Open MPI, Intel compilers, MKL, ScaLAPACK
 +            dependencies:
 +                - openmpi/4.1.5:intel-oneapi-2023
 +               
 +</code>
 +
 +<WRAP center round tip 80%>
 +The version identifier ''v7.3'' is inferred to be the path prefix to the version in question here.  The package's prefix (''/home/user/sw/quantum-espresso'') with the version identifier appended (''/home/user/sw/quantum-espresso/v7.3'') is implicit.
 +
 +The implicit behavior is overridden by providing a ''prefix'' key in the version definition:  a relative path is appended to the package's prefix, an absolute path is used as-is.
 +</WRAP>
 +
 +It is a good idea to specify which version definition should act as the default.  This yields the following package definition file
 +
 +<file yaml quantum-espresso.vpkg_yaml.darwin>
 +quantum-espresso:
 +    prefix: /home/user/sw/quantum-espresso
 +    description: quantum-espresso
 +    url: "https://www.quantum-espresso.org/"
 +    
 +    default-version: "v7.3"
 +    
 +    versions:
 +        "v7.3":
 +            description: compiled with Open MPI, Intel compilers, MKL, ScaLAPACK
 +            dependencies:
 +                - openmpi/4.1.5:intel-oneapi-2023
 +</file>
 +
 +<file yaml quantum-espresso.vpkg_yaml.caviness>
 +quantum-espresso:
 +    prefix: /home/user/sw/quantum-espresso
 +    description: quantum-espresso
 +    url: "https://www.quantum-espresso.org/"
 +    
 +    default-version: "v7.3"
 +    
 +    versions:
 +        "v7.3":
 +            description: compiled with Open MPI, Intel compilers, MKL, ScaLAPACK
 +            dependencies:
 +                - openmpi/4.1.4:intel-oneapi-2023
 +</file>
 +
 +saved at ''$VALET_PKG_DIR/quantum-espresso.vpkg_yaml''.
 +
 +==== Checking the definition file ====
 +
 +The package definition file can be checked for proper syntax using the VALET command ''vpkg_check'':
 +<code bash>
 +[user@login00.darwin ~]$ vpkg_check "$VALET_PKG_DIR/quantum-espresso.vpkg_yaml"
 +/home/user/.valet/quantum-espresso.vpkg_yaml is OK
 +[quantum-espresso] {
 +  contexts: all
 +  actions: {
 +    QUANTUM_DASH_ESPRESSO_PREFIX=${VALET_PATH_PREFIX} (contexts: development)
 +  }
 +  https://www.quantum-espresso.org/
 +  quantum-espresso
 +  prefix: /work/user/sw/quantum-espresso
 +  source file: /home/user/.valet/quantum-espresso.vpkg_yaml
 +  default version: quantum-espresso/v7.3
 +  versions: {
 +    [quantum-espresso/v7.3] {
 +      contexts: all
 +      dependencies: {
 +        openmpi/4.1.5:intel-oneapi-2023
 +      }
 +      compiled with Open MPI, Intel compilers, MKL, ScaLAPACK
 +      prefix: /work/user/sw/quantum-espresso/v7.3
 +    }
 +  }
 +}
 +
 +</code>
 +The file had no errors in its YAML syntax.  Notice also that the standard path (''bin'') is found and noted by VALET!
 +
 +==== Runtime environment ====
 +
 +To load **quantum-espresso** 7.3 into the runtime environment, the ''vpkg_require'' command is used:
 +<code bash>
 +[user@login00.darwin ~]$ vpkg_require quantum-espresso/v7.3
 +Adding dependency `binutils/2.35.1` to your environment
 +Adding dependency `gcc/12.2.0` to your environment
 +Adding dependency `intel-oneapi/2023.0.0.25537` to your environment
 +Adding dependency `ucx/1.13.1` to your environment
 +Adding dependency `openmpi/4.1.5:intel-oneapi-2023` to your environment
 +Adding package `quantum-espresso/v7.3` to your environment
 +[user@login00.darwin ~]$ which pw.x
 +~/sw/quantum-espresso/v7.3/bin/pw.x
 +</code>
 +
 +===== 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.
 +
 +{{:technical:recipes:scale.jpg?400|}}
  
  • technical/recipes/quantum-espresso.1715352686.txt.gz
  • Last modified: 2024-05-10 10:51
  • by bkang