Skip to content

Commit

Permalink
Merge branch 'develop' into warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hongriTianqi authored Jan 11, 2024
2 parents ee2c432 + 71a023b commit 80e2301
Show file tree
Hide file tree
Showing 58 changed files with 620 additions and 205 deletions.
2 changes: 1 addition & 1 deletion cmake/FindIntelMKL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# MKL_FOUND - True if mkl found.
#

find_path(MKL_INCLUDE_DIR mkl_dfti.h HINTS ${MKLROOT}/include)
find_path(MKL_INCLUDE_DIR mkl_service.h HINTS ${MKLROOT}/include)

find_library(MKL_INTEL NAMES mkl_intel_lp64 HINTS ${MKLROOT}/lib ${MKLROOT}/lib/intel64)
find_library(MKL_INTEL_THREAD NAMES mkl_intel_thread HINTS ${MKLROOT}/lib ${MKLROOT}/lib/intel64)
Expand Down
6 changes: 3 additions & 3 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -1538,10 +1538,10 @@ These variables are used to control the output of properties.

### out_mat_hs

- **Type**: Boolean
- **Type**: Boolean Integer(optional)
- **Availability**: Numerical atomic orbital basis
- **Description**: Whether to print the upper triangular part of the Hamiltonian matrices (in Ry) and overlap matrices for each k point into files in the directory `OUT.${suffix}`. For more information, please refer to [hs_matrix.md](../elec_properties/hs_matrix.md#out_mat_hs). Also controled by [out_interval](#out_interval) and [out_app_flag](#out_app_flag).
- **Default**: False
- **Description**: Whether to print the upper triangular part of the Hamiltonian matrices (in Ry) and overlap matrices for each k point into files in the directory `OUT.${suffix}`. The second number controls precision. For more information, please refer to [hs_matrix.md](../elec_properties/hs_matrix.md#out_mat_hs). Also controled by [out_interval](#out_interval) and [out_app_flag](#out_app_flag).
- **Default**: False 8

### out_mat_r

Expand Down
94 changes: 74 additions & 20 deletions docs/advanced/input_files/stru.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
- [no latname](#no-latname)
- [latname fcc](#latname-fcc)
- [Structure of the file](#structure-of-the-file)
- [ATOMIC_SPECIES](#ATOMIC_SPECIES)
- [NUMERICAL_ORBITAL](#NUMERICAL_ORBITAL)
- [LATTICE_CONSTANT](#LATTICE_CONSTANT)
- [LATTICE_VECTORS](#LATTICE_VECTORS)
- [LATTICE_PARAMETERS](#LATTICE_PARAMETERS)
- [ATOMIC_POSITIONS](#ATOMIC_POSITIONS)
- [More Key Words](#More-Key-Words)

## Examples

Expand Down Expand Up @@ -70,7 +77,7 @@ The `STRU` file contains several sections, and each section must start with a ke
`ATOMIC_SPECIES`, `NUMERICAL_ORBITAL`, or `LATTICE_CONSTANT`, etc. to signify what type of
information that comes below.

- ATOMIC_SPECIES
### ATOMIC_SPECIES

This section provides information about the type of chemical elements contained the unit cell. Each line defines one type of element. The user should specify the name, the mass, and the pseudopotential file used for each element. The mass of the elment is only used in molecular dynamics simulations. For electronic-structure calculations, the actual mass value isn’t important.
In the above example, we see information is provided for the element `Si`:
Expand All @@ -92,7 +99,8 @@ information that comes below.
2. [SG15-ONCV](http://quantum-simulation.org/potentials/sg15_oncv/upf/).
3. [DOJO](http://www.pseudo-dojo.org/).
4. [BLPS](https://github.com/PrincetonUniversity/BLPSLibrary).
- NUMERICAL_ORBITAL

### NUMERICAL_ORBITAL

Numerical atomic orbitals are only needed for `LCAO` calculations. Thus this section will be neglected in calcultions with plane wave basis. In the above example, numerical atomic orbitals is specified for the element `Si`:

Expand All @@ -102,13 +110,13 @@ information that comes below.
‘Si_gga_8au_60Ry_2s2p1d.orb’ is name of the numerical orbital file. Again here the path is not specified, which means that this file is located in the work directory.

Numerical atomic orbitals may be downloaded from the [official website](http://abacus.ustc.edu.cn/pseudo/list.htm).
- LATTICE_CONSTANT
### LATTICE_CONSTANT

The lattice constant of the system in unit of Bohr.
- LATTICE_VECTORS
### LATTICE_VECTORS

The lattice vectors of the unit cell. It is a 3by3 matrix written in 3 lines. Please note that *the lattice vectors given here are scaled by the lattice constant*. This section must be removed if the type Bravais lattice is specified using the input parameter `latname`. (See [input parameters](input-main.md#latname).)
- LATTICE_PARAMETERS
### LATTICE_PARAMETERS

This section is only relevant when `latname` (see [input parameters](input-main.md#latname)) is used to specify the Bravais lattice type. The example above is a fcc lattice, where no additional information except the lattice constant is required to determine the geometry of the lattice.

Expand Down Expand Up @@ -216,7 +224,7 @@ information that comes below.
v3 = (y*n, y*(l-n*m/sqrt(1-m^2)), y*fac)
```
where $fac=\frac{\sqrt{1+2*m*n*l-m^2 -n^2 -l^2 }}{\sqrt{1-m^2}}$
- ATOMIC_POSITIONS
### ATOMIC_POSITIONS

This section specifies the positions and other information of individual atoms.

Expand All @@ -235,20 +243,66 @@ information that comes below.

The last two lines in this example are the coordinates of atomic positions. There are three numbers in each line, which specifies the atomic positions, following by other parameters marked by keywords.

Several other parameters could be defined after the atom position using key word :
### More Key Words

Several other parameters could be defined after the atom position using key words :

- `m` or NO key word: three numbers, which take value in 0 or 1, control how the atom move in geometry relaxation calculations. In example below, the numbers `0 0 0` following the coordinates of the first atom means this atom are *not allowed* to move in all three directions, and the numbers `1 1 1` following the coordinates of the second atom means this atom *can* move in all three directions.
- `v` or `vel` or `velocity`: set the three components of initial velocity of atoms in geometry relaxation calculations(e. g. `v 1.0 1.0 1.0`).
- `mag` or `magmom` : set the start magnetization for each atom. In colinear case only one number should be given. In non-colinear case one have two choice:either set one number for the norm of magnetization here and specify two polar angle later(e. g. see below), or set three number for the xyz commponent of magnetization here (e. g. `mag 0.0 0.0 1.0`). Note that if this parameter is set, the initial magnetic moment setting in the second line will be invalid.
- `angle1`: in non-colinear case, specify the angle between c-axis and real spin, in angle measure instead of radian measure
- `angle2`: in non-colinear case, specify angle between a-axis and real spin in projection in ab-plane , in angle measure instead of radian measure

e.g.:

```
Fe
1.0
2
0.0 0.0 0.0 m 0 0 0 mag 1.0 angle1 90 angle2 0
0.5 0.5 0.5 m 1 1 1 mag 1.0 angle1 90 angle2 180
```
- `mag` or `magmom` : set the start magnetization for each atom. In colinear case only one number should be given. In non-colinear case one have two choice:either set one number for the norm of magnetization here and specify two polar angle later(e. g. see below), or set three number for the xyz commponent of magnetization here (e. g. `mag 0.0 0.0 1.0`). Note that if this parameter is set, the initial magnetic moment setting in the second line will be overrided.
- `angle1`: in non-colinear case, specify the angle between c-axis and real spin, in angle measure instead of radian measure
- `angle2`: in non-colinear case, specify angle between a-axis and real spin in projection in ab-plane , in angle measure instead of radian measure

e.g.:

```
Fe
1.0
2
0.0 0.0 0.0 m 0 0 0 mag 1.0 angle1 90 angle2 0
0.5 0.5 0.5 m 1 1 1 mag 1.0 angle1 90 angle2 180
```

- Default: If users do not specalize a finite magnetic moment for all atoms in a magnetic calculations (`nspin==2 || nspin == 4`), e.g.:
```
Fe
0.0
2
0.0 0.0 0.0 m 0 0 0
0.5 0.5 0.5 m 1 1 1
O
0.0
2
0.0 0.0 0.0 m 0 0 0
0.5 0.5 0.5 m 1 1 1
```
For `nspin==2`, we will autoset atomic magmon is `1.0`:
```
Fe
1.0
2
0.0 0.0 0.0 m 0 0 0
0.5 0.5 0.5 m 1 1 1
Fe
1.0
2
0.0 0.0 0.0 m 0 0 0
0.5 0.5 0.5 m 1 1 1
```
For `nspin==4`, we will autoset atomic magmon as follow:
```
Fe
0.0
2
0.0 0.0 0.0 m 0 0 0 mag 1 1 1
0.5 0.5 0.5 m 1 1 1 mag 1 1 1
O
0.0
2
0.0 0.0 0.0 m 0 0 0 mag 1 1 1
0.5 0.5 0.5 m 1 1 1 mag 1 1 1
```
However, this autoset will not be vaild once `STRU` specalize a finite magnetic for any single atom.
10 changes: 5 additions & 5 deletions docs/advanced/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The new EXX implementation depends on two external libraries:

These two libraries are added as submodules in the [deps](https://github.com/deepmodeling/abacus-develop/tree/develop/deps) folder. Set `-DENABLE_LIBRI=ON` to build with these two libraries.

If you prefer using manually downloaded libraries, provide `-DLIBRI_DIR=${path to your LibRI folder} -DLIBCOMM_DIR=${path to your LibComm folder}`.
If you prefer using manually downloaded libraries, provide `-DLIBRI_DIR=${path to your LibRI folder} -DLIBCOMM_DIR=${path to your LibComm folder}`.

## Build Unit Tests

Expand Down Expand Up @@ -85,7 +85,7 @@ cmake -B build -DUSE_CUDA=1 -DCMAKE_CUDA_COMPILER=${path to cuda toolkit}/bin/nv

> Note: This flag is **enabled by default**. It will get better performance than the standard implementation on `gcc` and `clang`. But it **will be disabled** when using `Intel Compiler` since the math functions will get wrong results and the performance is also unexpectly poor.
To build math functions from source code, instead of using c++ standard implementation, define `USE_ABACUS_LIBM` flag.
To build math functions from source code, instead of using c++ standard implementation, define `USE_ABACUS_LIBM` flag.

Currently supported math functions:
`sin`, `cos`, `sincos`, `exp`, `cexp`
Expand Down Expand Up @@ -136,7 +136,7 @@ CEREAL_DIR = /usr/local/include/cereal

##------------------- FOR GNU COMPILER ------------------------------
## FFTW_DIR should contain lib/libfftw3.a.
## OPENBLAS_LIB_DIR should contain libopenblas.a.
## OPENBLAS_LIB_DIR should contain libopenblas.a.
## SCALAPACK_LIB_DIR should contain libscalapack.a
## All three above will only be used when CXX=mpicxx or g++
## ELPA_DIR should contain an include folder and lib/libelpa.a
Expand Down Expand Up @@ -270,8 +270,8 @@ directly.

> `deepmd_c`/`deepmd_cc` and `tensorflow_cc` libraries would be called according to `DeePMD_DIR` and `TensorFlow_DIR`, which is showed in detail in [this page](https://github.com/deepmodeling/deepmd-kit/blob/master/doc/inference/cxx.md).
### Add LibRI and LibComm Support
To use new EXX, you need two libraries: [LibRI](https://github.com/abacusmodeling/LibRI) and [LibComm](https://github.com/abacusmodeling/LibComm) and need to define `LIBRI_DIR` and `LIBCOMM_DIR` in the file `Makefile.vars` or use
### Add LibRI Support
To use new EXX, you need two libraries: [LibRI](https://github.com/abacusmodeling/LibRI) and [LibComm](https://github.com/abacusmodeling/LibComm) and need to define `LIBRI_DIR` and `LIBCOMM_DIR` in the file `Makefile.vars` or use
```makefile
make LIBRI_DIR=/public/software/LibRI LIBCOMM_DIR=/public/software/LibComm
```
Expand Down
35 changes: 30 additions & 5 deletions docs/quick_start/easy_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ Please refer to our [guide](https://github.com/deepmodeling/abacus-develop/wiki/

## Install requirements by toolchain

We offer a set of [toolchain](https://github.com/deepmodeling/abacus-develop/tree/develop/toolchain)
We offer a set of [toolchain](https://github.com/deepmodeling/abacus-develop/tree/develop/toolchain)
scripts to compile and install all the requirements
automatically and suitable for machine characteristic in an online or offline way.
The toolchain can be downloaded with ABACUS repo, which is easily used and can
automatically and suitable for machine characteristic in an online or offline way.
The toolchain can be downloaded with ABACUS repo, which is easily used and can
have a convenient installation under HPC environment in both `GNU` or `Intel-oneAPI` toolchain.
Sometimes, ABACUS by toolchain installation may have highly efficient performance.
A Tutorial for using this toolchain can be accessed in [bohrium-notebook](https://nb.bohrium.dp.tech/detail/5215742477)
Expand Down Expand Up @@ -197,7 +197,7 @@ We also support [Gitpod](https://www.gitpod.io/): [Open in Gitpod](https://gitpo

## Install by conda

Conda is a package management system with a separated environment, not requiring system privileges. A pre-built ABACUS binary with all requirements is available at [conda-forge](https://anaconda.org/conda-forge/abacus). Conda will install the GPU-accelerated version of ABACUS if a valid GPU driver is present.
Conda is a package management system with a separated environment, not requiring system privileges. A pre-built ABACUS binary with all requirements is available at [conda-forge](https://anaconda.org/conda-forge/abacus). It supports advanced features including Libxc, LibRI, and DeePKS. Conda will install the GPU-supported version of ABACUS if a valid GPU driver is present. Please refer to [the advanced installation guide](../advanced/install.md) for more details.

```bash
# Install
Expand All @@ -212,6 +212,31 @@ OMP_NUM_THREADS=1 mpirun -n 4 abacus
conda update -n abacus_env abacus -c conda-forge
```

For more details on building a conda package of ABACUS, please refer to the [conda recipe file](https://github.com/deepmodeling/abacus-develop/blob/develop/conda/meta.yaml).
> If OpenBLAS gives warning about OpenMP threads, please install conda package `openblas=*=openmp*` or `blas=*=mkl`. See [switching BLAS implementation in conda](https://conda-forge.org/docs/maintainer/knowledge_base.html#switching-blas-implementation).
> ABACUS supports `OpenMPI` and `MPICH` variant. Install `mpich` or `openmpi` package to switch MPI library if required.
For more details on building a conda package of ABACUS locally, please refer to the [conda recipe file](https://github.com/deepmodeling/abacus-develop/blob/develop/conda/meta.yaml).

> Note: The [deepmodeling conda channel](https://anaconda.org/deepmodeling/abacus) offers historical versions of ABACUS.
### Developing with conda

It is possible to build ABACUS from source based on the conda environment.

```bash
conda create -n abacus_env abacus -c conda-forge
conda activate abacus_env
export CMAKE_PREFIX_PATH=$CONDA_PREFIX:$CMAKE_PREFIX_PATH

# By default OpenBLAS is used; run `conda install "blas=*=mkl" mkl_fft -c conda-forge` to switch implementation.
export MKLROOT=$CONDA_PREFIX # If Intel MKL is required.

export CMAKE_PREFIX_PATH=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'`:$CMAKE_PREFIX_PATH # If DEEPKS support is required;
# usually expands to `$CONDA_PREFIX/lib/python3.1/site-packages/torch/share/cmake`
```

And, follow the instructions in [Build and Install](#build-and-install) part above withou manually setting paths to dependencies.
See [the advanced installation guide](../advanced/install.md) for more features.
Make sure the environment variables are set before running `cmake`.
Possible command: `cmake -B build -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON`.
Loading

0 comments on commit 80e2301

Please sign in to comment.