-
Notifications
You must be signed in to change notification settings - Fork 41
Update QuantumESPRESSO documentation #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
61cb123
update qe docs
simonpintarelli 86e7ed2
cleanup
simonpintarelli aca13e8
fix tabbing
simonpintarelli c6c1a62
Update docs/software/sciapps/quantumespresso.md
simonpintarelli 5ba5ac4
updates
simonpintarelli beb63fb
typo
simonpintarelli 677fad8
change version on eiger
simonpintarelli 06a2040
missing link
simonpintarelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,154 @@ | ||||||||||||||
| [](){#ref-uenv-quantumespresso} | ||||||||||||||
| # Quantum ESPRESSO | ||||||||||||||
| !!! todo | ||||||||||||||
| complete docs | ||||||||||||||
|
|
||||||||||||||
| [Quantum ESPRESSO](https://www.quantum-espresso.org/) is an integrated suite of Open-Source computer codes for electronic-structure calculations and materials modeling at the nanoscale. It is based on density-functional theory, plane waves, and pseudopotentials: | ||||||||||||||
|
|
||||||||||||||
| * `pw.x`: Plane-Wave Self-Consistent Field (PWscf) | ||||||||||||||
| * `pw.x` First Principles Molecular Dynamics (FPMD) | ||||||||||||||
| * `cp.x` Car-Parrinello (CP) | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| !!! note "uenvs" | ||||||||||||||
|
|
||||||||||||||
| [Quantum ESPRESSO](https://www.quantum-espresso.org/) is provided on [ALPS][platforms-on-alps] via [uenv][ref-uenv]. | ||||||||||||||
| Please have a look at the [uenv documentation][ref-uenv] for more information about uenvs and how to use them. | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| ## How to run | ||||||||||||||
|
|
||||||||||||||
| The following sbatch script can be used as a template. | ||||||||||||||
|
|
||||||||||||||
| === "GH200" | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| #SBATCH -N 1 | ||||||||||||||
| #SBATCH --ntasks-per-node=4 | ||||||||||||||
| #SBATCH --cpus-per-task=71 | ||||||||||||||
| #SBATCH --gpus-per-task=1 | ||||||||||||||
| #SBATCH -A <account> | ||||||||||||||
| #SBATCH --uenv=quantumespresso/v7.4:v2 | ||||||||||||||
| #SBATCH --view=default | ||||||||||||||
|
|
||||||||||||||
| export OMP_NUM_THREADS=20 | ||||||||||||||
| export MPICH_GPU_SUPPORT_ENABLED=1 | ||||||||||||||
| export OMP_PLACES=cores | ||||||||||||||
|
|
||||||||||||||
| srun -u --cpu-bind=socket /user-environment/env/default/bin/pw.x < pw.in | ||||||||||||||
| ``` | ||||||||||||||
| Current observation is that best perfomance is achieved using [one MPI rank per GPU][ref-slurm-gh200-single-rank-per-gpu]. How to run multiple ranks per GPU is described [here][ref-slurm-gh200-multi-rank-per-gpu]. | ||||||||||||||
|
|
||||||||||||||
| === "Eiger" | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| #SBATCH -N 1 | ||||||||||||||
| #SBATCH --ntasks-per-node=128 | ||||||||||||||
| #SBATCH -A <account> | ||||||||||||||
| #SBATCH --uenv=quantumespresso/v7.3.1 | ||||||||||||||
| #SBATCH --view=default | ||||||||||||||
| #SBATCH --hint=nomultithread | ||||||||||||||
|
|
||||||||||||||
| export OMP_NUM_THREADS=1 | ||||||||||||||
|
|
||||||||||||||
| srun -u /user-environment/env/default/bin/pw.x < pw.in | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| ## Building QE from Source | ||||||||||||||
|
|
||||||||||||||
| ### Using modules | ||||||||||||||
|
|
||||||||||||||
| === "GH200" | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| uenv start --view=modules quantumespresso/v7.4:v2 | ||||||||||||||
| module load cmake \ | ||||||||||||||
| fftw \ | ||||||||||||||
| nvhpc \ | ||||||||||||||
| nvpl-lapack \ | ||||||||||||||
| nvpl-blas \ | ||||||||||||||
| cray-mpich \ | ||||||||||||||
| netlib-scalapack \ | ||||||||||||||
| libxc | ||||||||||||||
|
|
||||||||||||||
| mkdir build && cd build | ||||||||||||||
| FC=mpif90 CXX=mpic++ CC=mpicc cmake .. \ | ||||||||||||||
| -DQE_ENABLE_MPI=ON \ | ||||||||||||||
| -DQE_ENABLE_OPENMP=ON \ | ||||||||||||||
| -DQE_ENABLE_SCALAPACK:BOOL=OFF \ | ||||||||||||||
| -DQE_ENABLE_LIBXC=ON \ | ||||||||||||||
| -DQE_ENABLE_CUDA=ON \ | ||||||||||||||
| -DQE_ENABLE_PROFILE_NVTX=ON \ | ||||||||||||||
| -DQE_CLOCK_SECONDS:BOOL=OFF \ | ||||||||||||||
| -DQE_ENABLE_MPI_GPU_AWARE:BOOL=OFF \ | ||||||||||||||
| -DQE_ENABLE_OPENACC=ON | ||||||||||||||
| make -j20 | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| === "A100" | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| uenv start --view=modules quantumespresso/v7.3.1:v2 | ||||||||||||||
| module load cmake \ | ||||||||||||||
| cray-mpich | ||||||||||||||
| cuda \ | ||||||||||||||
| fftw \ | ||||||||||||||
| gcc \ | ||||||||||||||
| libxc \ | ||||||||||||||
| nvhpc \ | ||||||||||||||
| openblas | ||||||||||||||
| mkdir build && cd build | ||||||||||||||
| FC=mpif90 CXX=mpic++ CC=mpicc cmake .. \ | ||||||||||||||
| -DQE_ENABLE_MPI=ON \ | ||||||||||||||
| -DQE_ENABLE_OPENMP=ON \ | ||||||||||||||
| -DQE_ENABLE_SCALAPACK:BOOL=OFF \ | ||||||||||||||
| -DQE_ENABLE_LIBXC=ON \ | ||||||||||||||
| -DQE_ENABLE_CUDA=ON \ | ||||||||||||||
| -DQE_CLOCK_SECONDS:BOOL=OFF \ | ||||||||||||||
| -DQE_ENABLE_MPI_GPU_AWARE:BOOL=OFF \ | ||||||||||||||
| -DQE_ENABLE_OPENACC=ON | ||||||||||||||
| make -j20 | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| ### Using spack | ||||||||||||||
|
|
||||||||||||||
| 1. Clone spack using the same version that has been used to build the uenv. | ||||||||||||||
| ```bash | ||||||||||||||
| uenv start quantumespresso/v7.3.1 | ||||||||||||||
| # clone the same spack version as has been used to build the uenv | ||||||||||||||
| git clone -b $(jq -r .spack.commit /user-environment/meta/configure.json) $(jq -r .spack.repo /user-environment/meta/configure.json) $SCRATCH/spack | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| 2. Activate spack with the uenv configured as upstream | ||||||||||||||
| ```bash | ||||||||||||||
| # ensure spack is using the uenv as upstream repository (always required) | ||||||||||||||
| export SPACK_SYSTEM_CONFIG_PATH=/user-environment/config | ||||||||||||||
| # active spack (always required) | ||||||||||||||
| . $SCRATCH/spack/share/spack/setup-env.sh | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| 3. Create an anonymous environment for QE | ||||||||||||||
| ```bash | ||||||||||||||
| spack env create -d $SCRATCH/qe-env | ||||||||||||||
| spack -e $SCRATCH/qe-env add quantum-espresso%nvhpc +cuda | ||||||||||||||
| spack -e $SCRATCH/qe-env config add packages:all:prefer:cuda_arch=90 | ||||||||||||||
| spack -e $SCRATCH/qe-env develop -p /path/to/your/QE-src quantum-espresso@=develop | ||||||||||||||
| spack -e $SCRATCH/qe-env concretize -f | ||||||||||||||
| ``` | ||||||||||||||
| Check the output of `spack concretize -f`. All dependencies should have been picked up from spack upstream, marked eiter by a green `[^]` or `[e]`. | ||||||||||||||
| Next we create a local filesystem view, this instructs spack to create symlinks for binaries and libraries in a local directory `view`. | ||||||||||||||
| ```bash | ||||||||||||||
| spack -e $SCRATCH/qe-env env view enable view | ||||||||||||||
| spack -e $SCRATCH/qe-env install | ||||||||||||||
| ``` | ||||||||||||||
| To recompile QE after editing the source code re-run `spack -e $SCRATCH/qe-env install`. | ||||||||||||||
|
|
||||||||||||||
| 4. Run `pw.x` using the filesystem view generated in 3. | ||||||||||||||
| ```bash | ||||||||||||||
| uenv start quantumespresso/v7.3.1 | ||||||||||||||
| MPICH_GPU_SUPPORT_ENABLED=1 srun [...] $SCRATCH/qe-env/view/bin/pw.x < pw.in | ||||||||||||||
| ``` | ||||||||||||||
| Note: The `pw.x` is linked to the uenv, it won't work without activating the uenv, also it will only work with the exact same version of the uenv. The physical installation path is in `$SCRATCH/spack`, deleting this directory will leave the anonymous spack environment created in 3. with dangling symlinks. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.