Skip to content

Commit 67a658e

Browse files
committed
Adding instructions for conda environments.
1 parent dc0e564 commit 67a658e

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

conda_env/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# How to compile Quantum ESPRESSO and Yambo in a conda environment
2+
3+
The following are instructions on how to prepare a conda env (python virtual environment) to then compile Quantum ESPRESSO and Yambo,
4+
and run parallel calculations.
5+
6+
```shell
7+
conda create -n codes python=3.11
8+
conda activate codes
9+
```
10+
11+
Once activated the environment, you can proceed with the following sections.
12+
Each time you run a calculation, you need the environment to be activated, to have the correct modules...
13+
14+
15+
## Prepare a working openmpi env:
16+
17+
```shell
18+
conda install openmpi hdf5=*=*openmpi* fftw=*=*openmpi* libxc=*=*cpu* libnetcdf=*=*openmpi* netcdf-fortran=*=*openmpi* libblas lapack scalapack gfortran
19+
20+
conda install -c conda-forge ucx # to have correct MPI communication setup and run in parallel.
21+
```
22+
23+
OR conda install yambo, to directly download the executables from the conda-forge... but I prefer to compile it by hands (see below sections).
24+
25+
## How to install Quantum ESPRESSO
26+
27+
Download the Quantum ESPRESSO source from gitlab
28+
29+
```shell
30+
./install/configure --with-hdf5 --enable-openmp
31+
```
32+
33+
## How to install Yambo
34+
35+
A comment on the configure: conda install the dynamic netcdf lib (you know it noticing that in the lib, it is *.so and not *.a, the latter being the static version. Yambo by default does not find the dynamical one, you have to explicitely tell him. like in the line below.)
36+
37+
```shell
38+
export PATH_YAMBO_LIB="/home/jovyan/.conda/envs/codes/" # the path to your venv: check it via "conda env list"
39+
40+
./configure --enable-mpi --enable-open-mp --with-fft-path=$PATH_YAMBO_LIB --with-hdf5-path=$PATH_YAMBO_LIB --with-netcdf-libs=$PATH_YAMBO_LIB/lib/libnetcdf.so --with-netcdff-libs=$PATH_YAMBO_LIB/lib/libnetcdff.so --disable-hdf5-par-io --with-libxc-path=$PATH_YAMBO_LIB --with-scalapack-libs=$PATH_YAMBO_LIB/lib/libscalapack.so --with-blacs-libs=$PATH_YAMBO_LIB/lib/libscalapack.so --enable-par-linalg
41+
```
42+
43+
### Special instructions on how to run:
44+
45+
Follow this, if you have trouble in running in parallel:
46+
47+
```shell
48+
mpirun --mca btl_vader_single_copy_mechanism none -np 2 /home/jovyan/codes/q-e-kcw/bin/pw.x < Si.scf.in > prova.out
49+
```
50+
51+
## because:
52+
53+
```shell
54+
^C^C(codes) jovyan@6f222c4867e7:~/work/koopmans_calcs/interface_yambo/trial_Si/BANDS/KI_uniq$ mpirun --mca btl_vader_single_copy_mechanism 0 -np 2 /home/jovyan/codes/q-e-kcw/bin/pw.x < Si.scf.in > prova.out
55+
--------------------------------------------------------------------------
56+
An invalid value was supplied for an enum variable.
57+
58+
Variable : btl_vader_single_copy_mechanism
59+
Value : 0
60+
Valid values : 1:"cma", 4:"emulated", 3:"none"
61+
--------------------------------------------------------------------------
62+
--------------------------------------------------------------------------
63+
WARNING: Linux kernel CMA support was requested via the
64+
btl_vader_single_copy_mechanism MCA variable, but CMA support is
65+
not available due to restrictive ptrace settings.
66+
67+
The vader shared memory BTL will fall back on another single-copy
68+
mechanism if one is available. This may result in lower performance.
69+
70+
Local host: 6f222c4867e7
71+
```

0 commit comments

Comments
 (0)