Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
209 commits
Select commit Hold shift + click to select a range
5056f2c
add ewald, passed ener and force test
Aug 28, 2019
b29499a
Merge branch 'devel' into ewald
Oct 16, 2019
eb4ca51
add descrption for the printed data
Oct 16, 2019
c98dd91
implement op ewald_recp, tested force
Oct 17, 2019
d329268
fix bug in ewald, tested virial
Oct 18, 2019
88dcb12
Merge branch 'devel' into ewald
Oct 18, 2019
5c25712
Merge branch 'devel' into ewald
Oct 22, 2019
fdad3ca
add test for ewald_recp python interface. add test for data type sel
Oct 23, 2019
8b729fe
fix bug of wrong index in prod virial. more strict virial test
Oct 27, 2019
c23adee
implement data modifier, substract long-range interaction from data
Oct 28, 2019
8d5d3e8
batch evaluate ewald and correction
Nov 5, 2019
9481af7
Merge branch 'devel' into ewald
Nov 6, 2019
0639458
result of data statisitic (davg, dstd) are private members of descrip…
Nov 6, 2019
a23ec38
rename dstat to input_stat. Refactorize the stat data generation
Nov 6, 2019
afd400f
mv energy shift computation to output data stat of fitting classes
Nov 6, 2019
fd9cff2
modify data only when the data is asked. save computational cost
Nov 7, 2019
4da6fae
modify batch data on load
Nov 7, 2019
835140f
infer global polar
Nov 8, 2019
1c9c74d
use average eig value as bias of polar fitting
Nov 8, 2019
3668f19
fix bug. return to old convention of pass merged data to input stat, …
Nov 8, 2019
122007b
add missing test file
Nov 8, 2019
83509c4
add missing test data
Nov 8, 2019
acb29fa
multi-threading for ewald
Nov 8, 2019
361e7b1
Merge branch 'devel' into ewald
Nov 9, 2019
d7134fd
do not apply polar fitting bias, which does not have effect
Nov 10, 2019
11e0fd2
provide stop learning rate and set the decay rate automatically
Nov 10, 2019
0257797
ewald reciprocal: build computational graph on initialization
Nov 11, 2019
4ebc65e
revise test_ewald according to new interface
Nov 11, 2019
b5be8fe
expance three fold loop to enable better multi-thread parallelization
Nov 11, 2019
151d07a
add c++ interface for DeepTensor, not tested
Nov 16, 2019
d34c055
fix bugs in DeepTensor. mv common methods of DeepPot and DeepTensor i…
Nov 20, 2019
72e9933
fix bug in data modifier: order of fcorr should be mapped back
Nov 21, 2019
44bb07a
first working version of force modification
Nov 22, 2019
06ea446
fix bug of over-boundary back map
Nov 22, 2019
98eef65
handel the case of nloc_real == 0
Nov 25, 2019
68f740d
fix bug of excluding empty from nlist
Nov 25, 2019
c655b6e
pass name_scope at the interface of DeepTensor and DataModifier
Nov 26, 2019
2a47c3e
fix bug of make_default_mesh
Dec 2, 2019
33f9e13
simplify atype for eval_modify. sort in eval_modify
Dec 2, 2019
76a4f85
fix bug of DataModifier: increase start index of descriptor slicing. …
Dec 3, 2019
9ec7cf4
fix bug of binary search. add source files pppm_dplr, fix_dplr
Dec 6, 2019
cd7bc37
remove tmp files after test
Dec 6, 2019
188c918
change the DataModification: freeze dipole part with name dipole_char…
Dec 8, 2019
bd879a0
merge with ewald
Dec 11, 2019
c1311dc
Merge pull request #137 from amcadmus/devel
amcadmus Dec 20, 2019
25f1ea0
support no pbc
Dec 20, 2019
ca47461
Merge pull request #7 from deepmodeling/devel
denghuilu Dec 20, 2019
f0453ff
Merge pull request #8 from deepmodeling/master
denghuilu Dec 20, 2019
258731f
fix the virial assembly bug, no influence on the results
Dec 20, 2019
8f09de9
support no-pbc-training
Dec 20, 2019
b998077
fix the virial assembly bug, no influence on the results
Dec 20, 2019
74f5ece
Merge pull request #141 from denghuilu/devel-up
amcadmus Dec 21, 2019
b88c832
fix bug when compiling with float32
Dec 24, 2019
f5835ef
Merge pull request #142 from amcadmus/devel
amcadmus Dec 24, 2019
1c20a69
when the key `systems` is provided with a string, all possible system…
Dec 27, 2019
c6aaf49
init session only once for data stats
Dec 27, 2019
e8bbee4
add energy dipole loss
Dec 27, 2019
30482b3
fix bug of getting loss_type from None loss_param
Dec 27, 2019
6cceef0
Merge pull request #143 from amcadmus/devel
amcadmus Dec 27, 2019
2919614
warning rather than raising when the required batch size is smaller t…
Dec 27, 2019
5a88334
Merge pull request #9 from deepmodeling/devel
denghuilu Jan 6, 2020
8b59c84
fix bug of "-l-ldeepmd"
Jan 6, 2020
5c9cb15
Merge pull request #145 from denghuilu/devel-submit
amcadmus Jan 7, 2020
b2ab223
Merge remote-tracking branch 'upstream/devel' into devel
Jan 7, 2020
fc78c79
Merge pull request #146 from amcadmus/devel
amcadmus Jan 7, 2020
58610f3
scale and shift the polar output
Jan 9, 2020
d20753a
bump test tensorflow version to 2.1
njzjz Jan 9, 2020
1847b0d
scale tensor loss
Jan 9, 2020
3d74f12
Merge pull request #147 from njzjz/tf2.1
amcadmus Jan 9, 2020
eb35073
Merge pull request #10 from deepmodeling/devel
denghuilu Jan 9, 2020
6eeca8f
fix bug of "not support architecture compute_75" when use CUDA-9.0 to…
Jan 9, 2020
a45ae94
Merge remote-tracking branch 'upstream/devel' into devel
Jan 9, 2020
286c318
compatible with latest lammps pppm interface
Jan 9, 2020
3cd4867
fix bug of "unsupported architecture " when use some version's CUDA t…
Jan 9, 2020
04a1f1c
delete unused functions
Jan 9, 2020
79faee4
Update CMakeLists.txt
Jan 9, 2020
33bc642
Merge pull request #149 from amcadmus/devel
amcadmus Jan 9, 2020
db582f3
move message out
Jan 9, 2020
bb39b15
Merge pull request #148 from denghuilu/devel-submit
amcadmus Jan 10, 2020
505d7c6
fix bug of ndim when nframe==1
Jan 11, 2020
e83c217
Merge remote-tracking branch 'upstream/devel' into devel
Jan 11, 2020
044c38d
Merge pull request #150 from amcadmus/devel
amcadmus Jan 11, 2020
b76e438
clean codes
njzjz Jan 13, 2020
ce6e68a
fix bug
njzjz Jan 13, 2020
b05f237
Merge pull request #152 from njzjz/clean
amcadmus Jan 15, 2020
0ffb5bf
Merge remote-tracking branch 'upstream/devel' into devel
Jan 15, 2020
0828a7b
use travis-ci to build wheels and upload to pypi
njzjz Jan 18, 2020
fa84b3b
also upload tar.gz
njzjz Jan 19, 2020
4615af8
Merge pull request #155 from njzjz/whl
amcadmus Jan 20, 2020
9682111
use envs TF_INTRA_OP_PARALLELISM_THREADS and TF_INTER_OP_PARALLELISM_…
Jan 20, 2020
140762f
document the enviromental variables controling multithreading
Jan 21, 2020
1a81455
update pip installation method; remove useless troubleshooting
njzjz Jan 21, 2020
be45422
Merge pull request #156 from amcadmus/devel
amcadmus Jan 21, 2020
a959868
fix bug of test data
Jan 22, 2020
3af58b6
add setup requirements
Jan 22, 2020
a2ac409
comment upgrading of pip
njzjz Jan 22, 2020
243ebcf
Merge pull request #158 from amcadmus/devel
amcadmus Jan 22, 2020
57abf99
add get_type_map for c++ api
njzjz Jan 22, 2020
d3f7cde
add document for cpu-only tensorflow
njzjz Jan 23, 2020
d9800f1
Merge pull request #160 from njzjz/get_type_map
amcadmus Jan 23, 2020
2470705
Merge pull request #157 from njzjz/njzjz-patch-1
amcadmus Jan 23, 2020
715c7a0
Merge pull request #11 from deepmodeling/devel
denghuilu Jan 23, 2020
b7940fc
fix bug of 0 output when sec_a.back() is lager than 1024
Jan 23, 2020
fb79cbe
fix bug of 0 output when sec_a.back() is lager than 1024
Jan 23, 2020
69b9093
Merge pull request #161 from denghuilu/devel-submit
amcadmus Jan 23, 2020
637692b
fix bug #165
Jan 31, 2020
a20ddee
fix bug of nopbc in dp test
Jan 31, 2020
ed5be25
Merge pull request #167 from amcadmus/devel
amcadmus Jan 31, 2020
d517991
allow no interaction between custom atom types
njzjz Jan 31, 2020
86c75da
std should be set to 1 if its value vanishes
Feb 1, 2020
2b98a4e
protect the descrpt to 1e-2 rather than set to 1
Feb 1, 2020
93b77cc
Merge branch 'devel' of https://github.com/amcadmus/deepmd-kit into t…
njzjz Feb 1, 2020
36ae8f2
Merge pull request #168 from amcadmus/devel
amcadmus Feb 1, 2020
c3ee122
Merge branch 'devel' of https://github.com/deepmodeling/deepmd-kit in…
njzjz Feb 1, 2020
f78195d
recursively test systems
Feb 1, 2020
e12373e
Merge pull request #169 from amcadmus/devel
amcadmus Feb 1, 2020
ce4fa4d
supports user-specified atomic energy
njzjz Feb 2, 2020
60c3c7c
supports setting davg of descriptor to 0
njzjz Feb 2, 2020
1194f8c
implement block weighted prob_sys_size
Feb 2, 2020
a2aa039
set automatic system probability style
Feb 2, 2020
d7e13b2
control auto_prob_style from input parameter. print probabilities of …
Feb 2, 2020
07d5cb8
Merge pull request #172 from amcadmus/devel
amcadmus Feb 2, 2020
f04b47b
set CMAKE_LINK_WHAT_YOU_USE flag (fix #163)
njzjz Feb 6, 2020
38584cc
Merge pull request #174 from njzjz/link
amcadmus Feb 7, 2020
9ce5527
change the key name; supprot DescrptSeR
njzjz Feb 7, 2020
7268d48
loss_pf do not needs to be divided by atom number
njzjz Feb 7, 2020
a370fbf
Merge pull request #177 from njzjz/njzjz-patch-2
amcadmus Feb 8, 2020
be68d16
miss a line
njzjz Feb 8, 2020
9ec295e
Merge pull request #171 from njzjz/typemask
amcadmus Feb 9, 2020
0f8c6c3
add the missing line for install-tf.1.14.md
njzjz Feb 12, 2020
fadabc3
Merge pull request #179 from njzjz/readme_missing_line
amcadmus Feb 13, 2020
741d0a9
Update common.py
GeiduanLiu Feb 13, 2020
2863799
Update DescrptSeA.py
GeiduanLiu Feb 13, 2020
2aeaaa7
Update DescrptSeR.py
GeiduanLiu Feb 13, 2020
61a1950
Update Fitting.py
GeiduanLiu Feb 13, 2020
c26c30b
Update Fitting.py
GeiduanLiu Feb 13, 2020
ba3349a
Update Fitting.py
GeiduanLiu Feb 13, 2020
e1bf0d0
Update common.py
GeiduanLiu Feb 14, 2020
ab8118f
Update DescrptSeA.py
GeiduanLiu Feb 14, 2020
a53cb52
Update DescrptSeR.py
GeiduanLiu Feb 14, 2020
ff5e25d
Update Fitting.py
GeiduanLiu Feb 14, 2020
7c91ec1
Update common.py
GeiduanLiu Feb 14, 2020
dab2927
Update DescrptSeA.py
GeiduanLiu Feb 16, 2020
afd422e
Update DescrptSeR.py
GeiduanLiu Feb 16, 2020
d49895d
Update common.py
GeiduanLiu Feb 16, 2020
df22289
Update Fitting.py
GeiduanLiu Feb 16, 2020
2729530
Update DescrptSeA.py
GeiduanLiu Feb 16, 2020
15ca413
Update DescrptSeR.py
GeiduanLiu Feb 16, 2020
dbe4e97
Update common.py
GeiduanLiu Feb 16, 2020
306d40b
Merge pull request #180 from GeiduanLiu/devel
amcadmus Feb 17, 2020
850ffce
following the symlinks to find system dirs
Feb 17, 2020
77eac60
Merge pull request #185 from amcadmus/devel
amcadmus Feb 17, 2020
12fdcf4
compute averaged testing error for many systems
Feb 18, 2020
6efe946
Merge pull request #186 from amcadmus/devel
amcadmus Feb 18, 2020
6a1b1fb
Update common.py
GeiduanLiu Feb 19, 2020
5c45e7f
Merge pull request #188 from GeiduanLiu/devel
amcadmus Feb 20, 2020
dd1bf21
solve the efficiency problem when testing multiple systems
Feb 20, 2020
17338c2
Merge pull request #189 from amcadmus/devel
amcadmus Feb 20, 2020
c09cdcb
update calculator type_dict
haidi-ustc Feb 21, 2020
f8d79b3
Merge pull request #191 from haidi-ustc/devel
amcadmus Feb 21, 2020
05a8478
Update calculator.py
haidi-ustc Feb 22, 2020
193570f
Merge pull request #192 from haidi-ustc/devel
amcadmus Feb 22, 2020
1dae1bc
Update common.py
GeiduanLiu Feb 22, 2020
edd4155
Update DescrptSeA.py
GeiduanLiu Feb 22, 2020
7165038
Update DescrptSeR.py
GeiduanLiu Feb 22, 2020
0c4ea37
Update DescrptSeA.py
GeiduanLiu Feb 22, 2020
e0d3fc9
Update Network.py
GeiduanLiu Feb 22, 2020
dec7a7e
Update Fitting.py
GeiduanLiu Feb 22, 2020
8d6fc08
Update Fitting.py
GeiduanLiu Feb 22, 2020
886ca09
Update DescrptSeA.py
GeiduanLiu Feb 22, 2020
afca35f
Update common.py
GeiduanLiu Feb 23, 2020
03bc29a
Update common.py
GeiduanLiu Feb 23, 2020
4f0f54d
Update Fitting.py
GeiduanLiu Feb 23, 2020
f19a06f
Update DescrptSeA.py
GeiduanLiu Feb 23, 2020
c87cfe8
Update DescrptSeR.py
GeiduanLiu Feb 23, 2020
0721f60
Update Fitting.py
GeiduanLiu Feb 23, 2020
38448be
Merge pull request #194 from GeiduanLiu/devel
amcadmus Feb 24, 2020
276a489
find pthreads when compiling
njzjz Feb 25, 2020
48979b0
Merge pull request #196 from njzjz/devel
amcadmus Feb 26, 2020
25a7f8a
fix the bug of loading dp model to the default tf graph
Mar 1, 2020
f1e92e6
Merge pull request #201 from amcadmus/devel
amcadmus Mar 1, 2020
634a7d3
Call LAMMPS builtin citeme function
njzjz Mar 4, 2020
8983e77
Merge pull request #202 from njzjz/cite
amcadmus Mar 5, 2020
d928618
fix bug of getting ntypes from data
Mar 24, 2020
7918287
fix bug of getting ntypes from data
Mar 25, 2020
ba3ed02
set trainable of fitting layers
Mar 30, 2020
9cd81c4
Merge pull request #206 from amcadmus/devel
amcadmus Mar 30, 2020
6ed1414
Update main.py
GeiduanLiu Mar 30, 2020
edb1ce9
Create transform.py
GeiduanLiu Mar 30, 2020
959dbfd
Update Fitting.py
GeiduanLiu Mar 30, 2020
df5f3a6
Update main.py
GeiduanLiu Mar 30, 2020
86c7fcb
Merge pull request #13 from deepmodeling/devel
denghuilu Mar 30, 2020
8385272
Update transform.py
GeiduanLiu Mar 31, 2020
de11ba8
Merge pull request #208 from GeiduanLiu/devel
amcadmus Mar 31, 2020
288f61d
Update transform.py
GeiduanLiu Mar 31, 2020
b68e261
Merge pull request #209 from GeiduanLiu/devel
amcadmus Mar 31, 2020
8f6dea1
Update transform.py
GeiduanLiu Mar 31, 2020
2b02556
Merge pull request #210 from GeiduanLiu/devel
amcadmus Mar 31, 2020
28dc891
Merge pull request #14 from deepmodeling/devel
denghuilu Apr 1, 2020
4c2439b
fix bug of load transform
Apr 1, 2020
0e42066
Increase the max neighbor size of an atom from 256 to 1024
Apr 2, 2020
62cc79a
Add boundary check if nnei is larger than 1024
Apr 2, 2020
3a38dc4
Add boundary check if nnei is larger than 1024
Apr 2, 2020
3dc069b
Merge pull request #212 from denghuilu/devel
amcadmus Apr 2, 2020
708370b
cmake find tensorflow: handel the case that headers are installed to …
Apr 10, 2020
25b5ada
fix bug in finding protobuf
Apr 11, 2020
10e5780
Merge pull request #214 from amcadmus/devel
amcadmus Apr 11, 2020
c8b1238
merge with stable commit 10e5780
May 23, 2020
e015eac
fix bug in test
May 23, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ addons:
- g++-7
- gcc-8
- g++-8
matrix:
jobs:
include:
- python: 3.6
- stage: unit tests
python: 3.6
env:
- CC=gcc-4.8
- CXX=g++-4.8
Expand Down Expand Up @@ -65,14 +66,31 @@ matrix:
env:
- CC=gcc-5
- CXX=g++-5
- TENSORFLOW_VERSION=2.0
- TENSORFLOW_VERSION=2.1
- python: 3.7
env:
- CC=gcc-8
- CXX=g++-8
- TENSORFLOW_VERSION=2.0
- TENSORFLOW_VERSION=2.1
- stage: build whls
services: docker
env:
- TWINE_USERNAME=__token__
- CIBW_BUILD="cp36-* cp37-*"
- CIBW_BEFORE_BUILD="pip install tensorflow && sed -i 's/libresolv.so.2\"/libresolv.so.2\", \"libtensorflow_framework.so.2\"/g' \$(find / -name policy.json)"
- CIBW_SKIP="*-win32 *-manylinux_i686"
- CC=gcc-7
- CXX=g++-7
- TENSORFLOW_VERSION=2.1
install:
- python -m pip install twine cibuildwheel==1.1.0 scikit-build
script:
- python -m cibuildwheel --output-dir wheelhouse
- python setup.py sdist
after_success:
- if [[ $TRAVIS_TAG ]]; then python -m twine upload wheelhouse/*; python -m twine upload dist/*.tar.gz; fi
before_install:
# - pip install --upgrade pip
#- pip install --upgrade pip
- pip install --upgrade setuptools
- pip install tensorflow==$TENSORFLOW_VERSION
install:
Expand Down
73 changes: 38 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,17 @@ Both CPU and GPU version offline package are avaiable in [the Releases page](htt

## Install the python interface
### Install the Tensorflow's python interface
First, check the python version and compiler version on your machine
First, check the python version on your machine
```bash
python --version; gcc --version
python --version
```
If your python version is 3.7.x, it is highly recommended that the GNU C/C++ compiler is higher than or equal to 5.0.

We follow the virtual environment approach to install the tensorflow's Python interface. The full instruction can be found on [the tensorflow's official website](https://www.tensorflow.org/install/pip). Now we assume that the Python interface will be installed to virtual environment directory `$tensorflow_venv`
```bash
virtualenv -p python3 $tensorflow_venv
source $tensorflow_venv/bin/activate
pip install --upgrade pip
pip install --upgrade tensorflow==1.14.0
pip install --upgrade tensorflow==2.1.0
```
It is notice that everytime a new shell is started and one wants to use `DeePMD-kit`, the virtual environment should be activated by
```bash
Expand All @@ -136,31 +135,21 @@ If one has multiple python interpreters named like python3.x, it can be specifie
```bash
virtualenv -p python3.7 $tensorflow_venv
```
If one needs the GPU support of deepmd-kit, the GPU version of tensorflow should be installed by
```bash
pip install --upgrade tensorflow-gpu==1.14.0
If one does not need the GPU support of deepmd-kit and is concerned about package size, the CPU-only version of tensorflow should be installed by
```bash
pip install --upgrade tensorflow-cpu==2.1.0
```
To verify the installation, run
```bash
python -c "import tensorflow as tf; sess=tf.Session(); print(sess.run(tf.reduce_sum(tf.random_normal([1000, 1000]))))"
python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
```
One should remember to activate the virtual environment every time he/she uses deepmd-kit.

### Install the DeePMD-kit's python interface

Clone the DeePMD-kit source code
```bash
cd /some/workspace
git clone --recursive https://github.com/deepmodeling/deepmd-kit.git deepmd-kit -b devel
```
If one downloads the .zip file from the github, then the default folder of source code would be `deepmd-kit-master` rather than `deepmd-kit`. For convenience, you may want to record the location of source to a variable, saying `deepmd_source_dir` by
```bash
cd deepmd-kit
deepmd_source_dir=`pwd`
```
Then execute
Execute
```bash
pip install .
pip install deepmd-kit
```
To test the installation, one may execute
```bash
Expand Down Expand Up @@ -189,11 +178,30 @@ If one does not need to use DeePMD-kit with Lammps or I-Pi, then the python inte

### Install the Tensorflow's C++ interface

It is highly recommended that one keeps the same C/C++ compiler as the python interface. The C++ interface of DeePMD-kit was tested with compiler gcc >= 4.8. It is noticed that the I-Pi support is only compiled with gcc >= 4.9.
Check the compiler version on your machine

```
gcc --version
```

The C++ interface of DeePMD-kit was tested with compiler gcc >= 4.8. It is noticed that the I-Pi support is only compiled with gcc >= 4.9.

First the C++ interface of Tensorflow should be installed. It is noted that the version of Tensorflow should be in consistent with the python interface. We assume that you have followed our instruction and installed tensorflow python interface 1.14.0 with, then you may follow [the instruction for CPU](doc/install-tf.1.14.md) to install the corresponding C++ interface (CPU only). If one wants GPU supports, he/she should follow [the instruction for GPU](doc/install-tf.1.14-gpu.md) to install the C++ interface.

### Install the DeePMD-kit's C++ interface

Clone the DeePMD-kit source code
```bash
cd /some/workspace
git clone --recursive https://github.com/deepmodeling/deepmd-kit.git deepmd-kit
```

For convenience, you may want to record the location of source to a variable, saying `deepmd_source_dir` by
```bash
cd deepmd-kit
deepmd_source_dir=`pwd`
```

Now goto the source code directory of DeePMD-kit and make a build place.
```bash
cd $deepmd_source_dir/source
Expand Down Expand Up @@ -437,8 +445,6 @@ positional arguments:

optional arguments:
-h, --help show this help message and exit
-t INTER_THREADS, --inter-threads INTER_THREADS
With default value 0. Setting the "inter_op_parallelism_threads" key for the tensorflow, the "intra_op_parallelism_threads" will be set by the env variable OMP_NUM_THREADS
--init-model INIT_MODEL
Initialize a model by the provided checkpoint
--restart RESTART Restart the training from the provided checkpoint
Expand All @@ -449,6 +455,15 @@ The keys `intra_op_parallelism_threads` and `inter_op_parallelism_threads` are T

**`--restart model.ckpt`**, continues the training from the checkpoint `model.ckpt`.

On some resources limited machines, one may want to control the number of threads used by DeePMD-kit. This is achieved by three environmental variables: `OMP_NUM_THREADS`, `TF_INTRA_OP_PARALLELISM_THREADS` and `TF_INTER_OP_PARALLELISM_THREADS`. `OMP_NUM_THREADS` controls the multithreading of DeePMD-kit implemented operations. `TF_INTRA_OP_PARALLELISM_THREADS` and `TF_INTER_OP_PARALLELISM_THREADS` controls `intra_op_parallelism_threads` and `inter_op_parallelism_threads`, which are Tensorflow configurations for multithreading. An explanation is found [here](https://stackoverflow.com/questions/41233635/meaning-of-inter-op-parallelism-threads-and-intra-op-parallelism-threads).

For example if you wish to use 3 cores of 2 CPUs on one node, you may set the environmental variables and run DeePMD-kit as follows:
```bash
export OMP_NUM_THREADS=6
export TF_INTRA_OP_PARALLELISM_THREADS=3
export TF_INTER_OP_PARALLELISM_THREADS=2
dp train input.json
```

## Freeze a model

Expand Down Expand Up @@ -606,18 +621,6 @@ rm -r *
```
and redo the `cmake` process.

## Training: TensorFlow abi binary cannot be found when doing training
If you confront such kind of error:

```
$deepmd_root/lib/deepmd/libop_abi.so: undefined symbol:
_ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringB5cxx11Ev
```

This may happen if you are using a gcc >= 5.0, and tensorflow was compiled with gcc < 5.0. You may set `-DOP_CXX_ABI=0` in the process of `cmake`.

Another possible reason might be the large gap between the python version of TensorFlow and the TensorFlow c++ interface.

## MD: cannot run LAMMPS after installing a new version of DeePMD-kit
This typically happens when you install a new version of DeePMD-kit and copy directly the generated `USER-DEEPMD` to a LAMMPS source code folder and re-install LAMMPS.

Expand Down
1 change: 1 addition & 0 deletions doc/install-tf.1.14.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Now, copy the libraries to the tensorflow's installation directory:
mkdir $tensorflow_root/lib
cp -d bazel-bin/tensorflow/libtensorflow_cc.so* $tensorflow_root/lib/
cp -d bazel-bin/tensorflow/libtensorflow_framework.so* $tensorflow_root/lib/
cp -d $tensorflow_root/lib/libtensorflow_framework.so.1 $tensorflow_root/lib/libtensorflow_framework.so
```
Then copy the headers
```bash
Expand Down
4 changes: 2 additions & 2 deletions examples/water/train/polar.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@

"learning_rate" :{
"type": "exp",
"start_lr": 0.001,
"decay_steps": 5000,
"decay_rate": 0.95,
"start_lr": 0.001,
"stop_lr": 3.51e-8,
"_comment": "that's all"
},

Expand Down
8 changes: 4 additions & 4 deletions examples/water/train/polar_se_a.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"_comment": " model parameters",
"model":{
"type_map": ["O", "H"],
"data_stat_nbatch": 1,
"data_stat_nbatch": 10,
"descriptor" :{
"type": "se_a",
"sel": [46, 92],
Expand All @@ -18,7 +18,7 @@
"fitting_net": {
"type": "polar",
"sel_type": [0],
"fit_diag": true,
"fit_diag": false,
"neuron": [100, 100, 100],
"resnet_dt": true,
"seed": 1,
Expand All @@ -29,9 +29,9 @@

"learning_rate" :{
"type": "exp",
"start_lr": 0.01,
"decay_steps": 5000,
"decay_rate": 0.95,
"start_lr": 0.01,
"stop_lr": 3.51e-7,
"_comment": "that's all"
},

Expand Down
4 changes: 2 additions & 2 deletions examples/water/train/wannier.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

"learning_rate" :{
"type": "exp",
"start_lr": 0.001,
"decay_steps": 5000,
"decay_rate": 0.95,
"start_lr": 0.001,
"stop_lr": 3.51e-8,
"_comment": "that's all"
},

Expand Down
5 changes: 3 additions & 2 deletions examples/water/train/water.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"_comment": " model parameters",
"model":{
"type_map": ["O", "H"],
"data_stat_nbatch": 10,
"descriptor": {
"type": "loc_frame",
"sel_a": [16, 32],
Expand All @@ -28,9 +29,9 @@

"learning_rate" :{
"type": "exp",
"start_lr": 0.001,
"decay_steps": 5000,
"decay_rate": 0.95,
"start_lr": 0.001,
"stop_lr": 3.51e-8,
"_comment": "that's all"
},

Expand Down
4 changes: 2 additions & 2 deletions examples/water/train/water_se_a.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

"learning_rate" :{
"type": "exp",
"start_lr": 0.001,
"decay_steps": 5000,
"decay_rate": 0.95,
"start_lr": 0.001,
"stop_lr": 3.51e-8,
"_comment": "that's all"
},

Expand Down
4 changes: 2 additions & 2 deletions examples/water/train/water_se_ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

"learning_rate" :{
"type": "exp",
"start_lr": 0.005,
"decay_steps": 5000,
"decay_rate": 0.95,
"start_lr": 0.005,
"stop_lr": 1.76e-7,
"_comment": "that's all"
},

Expand Down
5 changes: 3 additions & 2 deletions examples/water/train/water_se_r.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
},

"learning_rate" : {
"start_lr": 0.005,
"type": "exp",
"decay_steps": 5000,
"decay_rate": 0.95,
"start_lr": 0.005,
"stop_lr": 1.76e-7,
"_comment": " that's all"
},

Expand Down
4 changes: 2 additions & 2 deletions examples/water/train/water_srtab_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

"learning_rate" :{
"type": "exp",
"start_lr": 0.001,
"decay_steps": 5000,
"decay_rate": 0.95,
"start_lr": 0.001,
"stop_lr": 3.51e-8,
"_comment": "that's all"
},

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from skbuild.cmaker import get_cmake_version
from packaging.version import LegacyVersion
from os import path, makedirs
import imp,sys
import imp

readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.md')
try:
Expand All @@ -20,7 +20,7 @@
tf_install_dir = imp.find_module('tensorflow', [site_packages_path])[1]

install_requires=['numpy', 'scipy']
setup_requires=['setuptools_scm']
setup_requires=['setuptools_scm', 'scikit-build', 'cmake']

# add cmake as a build requirement if cmake>3.0 is not installed
try:
Expand Down
14 changes: 14 additions & 0 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.7)
project(DeePMD)
set(CMAKE_LINK_WHAT_YOU_USE TRUE)

# build cpp or python interfaces
if (NOT DEFINED BUILD_CPP_IF)
Expand Down Expand Up @@ -48,6 +49,9 @@ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-ignored-attributes")
# find tensorflow, I need tf abi info
find_package(tensorflow REQUIRED)

# find threads
find_package(Threads)

# auto op_cxx_abi
if (NOT DEFINED OP_CXX_ABI)
if (BUILD_PY_IF)
Expand Down Expand Up @@ -133,6 +137,16 @@ if (USE_TTM)
set(TTM_DEF "-DUSE_TTM")
endif (USE_TTM)

# old pppm interface
if(NOT DEFINED OLD_LMP_PPPM)
set(OLD_LMP_PPPM FALSE)
endif(NOT DEFINED OLD_LMP_PPPM)
if (OLD_LMP_PPPM)
set(OLD_LMP_PPPM_DEF "-DOLD_LMP_PPPM")
message(STATUS "Use old lammps pppm interface")
endif()
add_definitions (${OLD_LMP_PPPM_DEF})

# define build type
if ((NOT DEFINED CMAKE_BUILD_TYPE) OR CMAKE_BUILD_TYPE STREQUAL "")
set (CMAKE_BUILD_TYPE release)
Expand Down
Loading