Skip to content

Commit

Permalink
Merge pull request #166 from deepmodeling/develop
Browse files Browse the repository at this point in the history
v2.3.1
  • Loading branch information
dyzheng authored Jul 15, 2022
2 parents b3287b2 + 0905df9 commit 3f71d01
Show file tree
Hide file tree
Showing 345 changed files with 7,610 additions and 1,743 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: |
git diff -U0 HEAD^ | clang-tidy-diff -p1 -path build -export-fixes fixes.yml
- name: Pull request comments from clang-tidy reports
uses: platisd/clang-tidy-pr-comments@1.1.6
uses: platisd/clang-tidy-pr-comments@master
with:
# The GitHub token (or a personal access token)
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -35,3 +35,4 @@ jobs:
# to avoid GitHub API timeouts for heavily loaded
# pull requests
suggestions_per_comment: 10
repo_path_prefix: /__w
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ jobs:
- name: Test
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V"
18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,25 @@ include_directories(${ABACUS_SOURCE_DIR})
add_executable(${ABACUS_BIN_NAME} source/main.cpp)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_compile_options(-O2 -g)
add_compile_options(-Wno-write-strings)
set(FETCHCONTENT_QUIET FALSE) # Notify user when cloning git repo

find_program(CCACHE ccache)
if (CCACHE)
set (CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE} ${CMAKE_CXX_COMPILER_LAUNCHER})
set (CMAKE_C_COMPILER_LAUNCHER ${CCACHE} ${CMAKE_C_COMPILER_LAUNCHER})
endif()

# Select 'Release' configuration for best performance;
# this will disable all assertions.
# Other default configurations are also available, see:
# https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#default-and-custom-configurations
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
add_compile_options(-O2 -g) # default flag
endif()

find_package(Cereal REQUIRED)
include_directories(${Cereal_INCLUDE_DIR})
include_directories(${CEREAL_INCLUDE_DIR})
add_compile_definitions(USE_CEREAL_SERIALIZATION)

find_package(ELPA REQUIRED)
Expand Down
17 changes: 13 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# To build this Dockerfile, run `docker build -t abacus - < Dockerfile`.
# Pull image with `docker pull ghcr.io/deepmodeling/abacus:latest`.
FROM ubuntu:latest
RUN apt update && apt install -y --no-install-recommends libopenblas-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev libxc-dev g++ make cmake bc time sudo vim git
FROM ubuntu:22.04
RUN apt update && apt install -y --no-install-recommends \
libopenblas-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev libxc-dev \
g++ make cmake bc time sudo vim git
# If you wish to use the LLVM compiler, replace 'g++' above with 'clang libomp-dev'.
RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && cd abacus-develop && cmake -B build && cmake --build build -j`nproc` && cmake --install build && cd .. && rm -rf abacus-develop

ENV GIT_SSL_NO_VERIFY=true TERM=xterm-256color \
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none
RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
cd abacus-develop && \
cmake -B build && \
cmake --build build -j`nproc` && \
cmake --install build && \
cd .. && rm -rf abacus-develop
# If you have trouble cloning repo, replace "github.com" with "gitee.com".
ENV OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none
CMD mpirun --use-hwthread-cpus abacus

# To run ABACUS built by this image with all available threads, execute `docker run -v <host>:<wd> -w <wd/input> abacus`.
Expand Down
77 changes: 18 additions & 59 deletions Dockerfile.gnu
Original file line number Diff line number Diff line change
@@ -1,59 +1,18 @@
FROM debian:bullseye-slim

RUN apt-get update && apt-get install -y --no-install-recommends libopenblas-dev liblapack-dev libscalapack-mpi-dev git g++ gfortran libssl-dev make cmake vim wget bc unzip python3-numpy
ENV OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none

ENV GIT_SSL_NO_VERIFY=1 TERM=xterm-256color

RUN cd /tmp \
&& git clone https://github.com/USCiLab/cereal.git \
&& cp -r cereal/include /usr/local \
&& rm -rf cereal

RUN cd /tmp \
&& wget https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/2021.05.002/elpa-2021.05.002.tar.gz --no-check-certificate --quiet \
&& tar xzf elpa-2021.05.002.tar.gz && rm elpa-2021.05.002.tar.gz \
&& cd elpa-2021.05.002 && mkdir build && cd build \
&& ../configure CFLAGS="-O3 -march=native -funsafe-loop-optimizations -funsafe-math-optimizations -ftree-vect-loop-version -ftree-vectorize" \
FCFLAGS="-O2 -mavx" --disable-avx512 \
&& make -j8 && make PREFIX=/usr/local install \
&& ln -s /usr/local/include/elpa-2021.05.002/elpa /usr/local/include/ \
&& cd /tmp && rm -rf elpa-2021.05.002

RUN cd /tmp \
&& wget http://www.fftw.org/fftw-3.3.9.tar.gz --no-check-certificate --quiet \
&& tar zxvf fftw-3.3.9.tar.gz \
&& cd fftw-3.3.9 \
&& ./configure --enable-mpi-fortran --enable-orterun-prefix-by-default FC=gfortran \
&& make -j8 && make PREFIX=/usr/local install \
&& cd /tmp && rm -rf fftw-3.3.9 && rm fftw-3.3.9.tar.gz

RUN cd /tmp \
&& wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.1%2Bcpu.zip --no-check-certificate --quiet \
&& unzip libtorch-cxx11-abi-shared-with-deps-1.9.1+cpu.zip \
&& cp -r libtorch/include /usr/local \
&& cp -r libtorch/lib /usr/local \
&& cp -r libtorch/share /usr/local \
&& rm -rf libtorch

RUN cd /tmp \
&& wget https://gitlab.com/libxc/libxc/-/archive/5.1.5/libxc-5.1.5.tar.gz --no-check-certificate --quiet \
&& tar xzf libxc-5.1.5.tar.gz \
&& cd libxc-5.1.5 \
&& mkdir build \
&& cmake -B build -DBUILD_TESTING=OFF \
&& cmake --build build \
&& cmake --install build \
&& cd /tmp \
&& rm -rf libxc-5.1.5 \
&& rm libxc-5.1.5.tar.gz

RUN cd /tmp \
&& git clone https://github.com/llohse/libnpy.git \
&& cp libnpy/include/npy.hpp /usr/local/include \
&& rm -rf libnpy

RUN cd /tmp \
&& git clone https://github.com/google/googletest.git \
&& cd googletest && cmake . && make install \
&& rm -rf googletest
FROM ubuntu:22.04
RUN apt update && apt install -y --no-install-recommends \
libopenblas-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev \
libxc-dev libgtest-dev libgmock-dev python3-numpy \
bc cmake git g++ make bc time sudo unzip vim wget

ENV GIT_SSL_NO_VERIFY=true TERM=xterm-256color \
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none

RUN git clone https://github.com/llohse/libnpy.git && \
cp libnpy/include/npy.hpp /usr/local/include && \
rm -r libnpy

RUN wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.1%2Bcpu.zip \
--no-check-certificate --quiet -O libtorch.zip && \
unzip -q libtorch.zip && rm libtorch.zip && \
cd libtorch && cp -r . /usr/local && \
cd .. && rm -r libtorch
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ABACUS is an electronic structure package based on density functional theory(DFT
Please refer to our [GitHub repository](https://github.com/deepmodeling/abacus-develop) for more information and support.
# Table of contents

- [Table of contents](#table-of-contents)
- [Features](#features)
- [Download and install](#download-and-install)
- [Quickstart guide](#quickstart-guide)
Expand All @@ -27,6 +28,7 @@ Please refer to our [GitHub repository](https://github.com/deepmodeling/abacus-d
- [Citations](#citations)
- [Development team](#development-team)
- [Communicating and making contributions](#communicating-and-making-contributions)
- [Miscellaneous](#miscellaneous)

# Features

Expand Down Expand Up @@ -139,7 +141,7 @@ The following provides basic sample jobs in ABACUS. More can be found in the dir
- [Basic electronic structure calculation with PW basis set](docs/examples/basic-pw.md)
- [Basic electronic structure calculation with LCAO basis set](docs/examples/basic-lcao.md)
- [DFT + dispersion calculations](docs/examples/dispersion.md)
- [DOS, wave functions](docs/examples/dos.md)
- [Density of states](docs/examples/dos.md)
- [Band structure](docs/examples/band-struc.md)
- [Magnetic properties](docs/examples/magnetic.md)
- [Force calculation and structure relaxation](docs/examples/force.md)
Expand All @@ -153,6 +155,8 @@ The following provides basic sample jobs in ABACUS. More can be found in the dir
- [Hybrid functional](docs/examples/hybrid.md)
- [Electric field and dipole correction](docs/examples/electric_dipole.md)
- [Stochastic DFT and mix stochastic-deterministic DFT](docs/examples/stochastic.md)
- [Wave functions](docs/examples/wavefunction.md)
- [BSSE for molecular formation energy](docs/examples/BSSE.md)

[back to top](#readme-top)

Expand Down
171 changes: 171 additions & 0 deletions docs/examples/BSSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# BSSE

[back to main page](../../README.md)

An empty atom is defined in the `STRU` file when an element name contains the "empty" suffix, such as "H_empty" in the following example: calculating the molecular formation energy of H$_2$O by using the BSSE (Basis Set Superposition Errors) method.

$$
\Delta E(\text{H}_2\text{O}) = E(\text{H}_2\text{O}) - E(\text{O}) - E(\text{H}^1) - E(\text{H}^2)
$$

## $E(\text{H}_2\text{O})$

```
ntype 2
```
```
ATOMIC_SPECIES
H 1.008 H_ONCV_PBE-1.0.upf
O 15.9994 O_ONCV_PBE-1.0.upf
NUMERICAL_ORBITAL
H_gga_8au_60Ry_2s1p.orb
O_gga_6au_60Ry_2s2p1d.orb
LATTICE_CONSTANT
1.889725989
LATTICE_VECTORS
20 0 0
0 20 0
0 0 20
ATOMIC_POSITIONS
Cartesian # Cartesian(Unit is LATTICE_CONSTANT)
H
0.5
2
0.9584 0.0000 0.0000 0 0 0
-0.2392 0.9281 0.0000 0 0 0
O
0.5
1
0.0000 0.0000 0.0000 0 0 0
```

## $E(\text{O})$

```
ntype 2
```
```
ATOMIC_SPECIES
H_empty 1.008 H_ONCV_PBE-1.0.upf
O 15.9994 O_ONCV_PBE-1.0.upf
NUMERICAL_ORBITAL
H_gga_8au_60Ry_2s1p.orb
O_gga_6au_60Ry_2s2p1d.orb
LATTICE_CONSTANT
1.889725989
LATTICE_VECTORS
20 0 0
0 20 0
0 0 20
ATOMIC_POSITIONS
Cartesian # Cartesian(Unit is LATTICE_CONSTANT)
H_empty
0.5
2
0.9584 0.0000 0.0000 0 0 0
-0.2392 0.9281 0.0000 0 0 0
O
0.5
1
0.0000 0.0000 0.0000 0 0 0
```

## $E(\text{H}^1)$

```
ntype 3
```
```
ATOMIC_SPECIES
H 1.008 H_ONCV_PBE-1.0.upf
H_empty_2 1.008 H_ONCV_PBE-1.0.upf
O_empty 15.9994 O_ONCV_PBE-1.0.upf
NUMERICAL_ORBITAL
H_gga_8au_60Ry_2s1p.orb
H_gga_8au_60Ry_2s1p.orb
O_gga_6au_60Ry_2s2p1d.orb
LATTICE_CONSTANT
1.889725989
LATTICE_VECTORS
20 0 0
0 20 0
0 0 20
ATOMIC_POSITIONS
Cartesian # Cartesian(Unit is LATTICE_CONSTANT)
H
0.5
1
0.9584 0.0000 0.0000 0 0 0
H_empty_2
0.5
1
-0.2392 0.9281 0.0000 0 0 0
O_empty
0.5
1
0.0000 0.0000 0.0000 0 0 0
```

## $E(\text{H}^2)$

```
ntype 3
```
```
ATOMIC_SPECIES
H_empty_1 1.008 H_ONCV_PBE-1.0.upf
H 1.008 H_ONCV_PBE-1.0.upf
O_empty 15.9994 O_ONCV_PBE-1.0.upf
NUMERICAL_ORBITAL
H_gga_8au_60Ry_2s1p.orb
H_gga_8au_60Ry_2s1p.orb
O_gga_6au_60Ry_2s2p1d.orb
LATTICE_CONSTANT
1.889725989
LATTICE_VECTORS
20 0 0
0 20 0
0 0 20
ATOMIC_POSITIONS
Cartesian # Cartesian(Unit is LATTICE_CONSTANT)
H_empty_1
0.5
1
0.9584 0.0000 0.0000 0 0 0
H
0.5
1
-0.2392 0.9281 0.0000 0 0 0
O_empty
0.5
1
0.0000 0.0000 0.0000 0 0 0
```

[back to top](#BSSE)
10 changes: 7 additions & 3 deletions docs/examples/dos.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# DOS, wave functions
# Density_of_states

[back to main page](../../README.md)

The main task of this example is to calculate the density of states (DOS) of the system. At first, do a ground-state energy calculation as in [this example](#basic-lcao.md) ***with one additional keyword in the INPUT file***:
# DOS

The main task of this example is to calculate the density of states (DOS) of the system. At first, do a ground-state energy calculation ***with one additional keyword in the INPUT file***:

```
out_chg 1
Expand Down Expand Up @@ -72,6 +74,8 @@ Gamma
```
Run the program, and you will see a file named DOS1_smearing.dat in the output directory. The first two columns in the file are the energy and DOS, respectively.Plot file DOS1_smearing.dat with graphing software, and you’ll get the DOS.

# PDOS

Along with the DOS1_smearing.dat file, we also produce the projected density of states (PDOS) in a file called PDOS.

The PDOS file starts with number of atomic orbitals in the system, then a list of energy values, such as:
Expand Down Expand Up @@ -102,4 +106,4 @@ The rest of the fileis arranged in sections, each section with a header such as
```
which tells the atom and symmetry of the current atomic orbital, and followed by the PDOS values. The values can thus be plotted against the energies.

[back to top](#dos,-wave-functions)
[back to top](#Density_of_states)
Loading

0 comments on commit 3f71d01

Please sign in to comment.