Skip to content

Commit 343b008

Browse files
committed
Merge branch 'master' of github.com:CompPhysVienna/n2p2 into polynomial_symmetry_functions
2 parents 841bf35 + f4a18fc commit 343b008

File tree

27 files changed

+2786
-80
lines changed

27 files changed

+2786
-80
lines changed

AUTHORS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ Vienna. Code development started in 2015 and the first release to the public
77
was in 2018.
88

99
Contributions are much appreciated and will be recorded here:
10+
11+
* CabanaMD interface (`libnnpif/CabanaMD`): Saaketh Desai and Sam Reeve

CHANGELOG.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ Changelog
33

44
All notable changes to this project will be documented in this file.
55

6-
[Unreleased]
7-
------------
6+
[2.0.0] - 2020-10-05
7+
--------------------
88

99
Added
1010
^^^^^
1111

1212
* Training library (Multi-stream Kalman filter training).
1313
* Tools for HDNNP data set handling, etc.
1414
* Python interface (basic functionality).
15-
* Sphinx documentation.
15+
* Sphinx documentation (+ Doxygen API reference).
16+
* CabanaMD interface (by Saaketh Desai and Sam Reeve)
1617

1718
Changed
1819
^^^^^^^

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
n2p2 - The neural network potential package
22
===========================================
33

4-
[![DOI](https://zenodo.org/badge/142296892.svg)](https://zenodo.org/badge/latestdoi/142296892)
4+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1344446.svg)](https://doi.org/10.5281/zenodo.1344446)
5+
[![GitHub release](https://img.shields.io/github/release/CompPhysVienna/n2p2.svg)](https://GitHub.com/CompPhysVienna/n2p2/releases/)
56
[![Build Status](https://travis-ci.org/CompPhysVienna/n2p2.svg?branch=master)](https://travis-ci.org/CompPhysVienna/n2p2)
67
[![Coverage](https://codecov.io/gh/CompPhysVienna/n2p2/branch/master/graph/badge.svg)](https://codecov.io/gh/CompPhysVienna/n2p2)
78
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
@@ -33,7 +34,10 @@ doc/sphinx/html/index.html
3334

3435
# Authors
3536

36-
- Andreas Singraber (University of Vienna)
37+
- Andreas Singraber
38+
- Saaketh Desai and Sam Reeve (CabanaMD interface)
39+
40+
See also AUTHORS.rst for a list of contributions.
3741

3842
# License
3943

src/application/nnp-select.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ int main(int argc, char* argv[])
5555
Log log;
5656
ifstream inputFile;
5757
ofstream outputFile;
58+
ofstream rejectFile;
5859
ofstream logFile;
5960

6061
logFile.open("nnp-select.log");
@@ -99,6 +100,7 @@ int main(int argc, char* argv[])
99100

100101
inputFile.open("input.data");
101102
outputFile.open("output.data");
103+
rejectFile.open("reject.data");
102104
string line;
103105
while (getline(inputFile, line))
104106
{
@@ -125,9 +127,14 @@ int main(int argc, char* argv[])
125127
{
126128
outputFile << line << '\n';
127129
}
130+
else
131+
{
132+
rejectFile << line << '\n';
133+
}
128134
}
129135
inputFile.close();
130136
outputFile.close();
137+
rejectFile.close();
131138

132139
log << "*****************************************"
133140
"**************************************\n";

src/doc/sphinx/source/index.rst

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,15 @@ Documentation
3737
quickly as possible.
3838

3939
This package uses automatic documentation generation via `Doxygen
40-
<http://www.doxygen.nl>`__ and `Sphinx <http://www.sphinx-doc.org>`__. An online
41-
version of the documentation which is automatically updated with the main
42-
repository can be found `here <https://compphysvienna.github.io/n2p2>`__.
40+
<http://www.doxygen.nl>`__, `Sphinx <http://www.sphinx-doc.org>`__ and `Breathe
41+
<https://breathe.readthedocs.io/en/latest/#>`__. An online version of the
42+
documentation which is automatically updated with the main repository can be
43+
found `here <https://compphysvienna.github.io/n2p2>`__.
44+
45+
.. note::
46+
47+
The online documentation describes the ``master`` branch of the *n2p2*
48+
repository and not the release versions.
4349

4450
.. This package uses automatic documentation generation via `Doxygen
4551
.. <http://www.doxygen.nl>`__, `Sphinx <http://www.sphinx-doc.org>`__
@@ -86,12 +92,12 @@ Molecular dynamics simulation
8692
-----------------------------
8793

8894
Similarly, if you have a working neural network potential setup and would like
89-
to run an MD simulation with an external MD software (so far only LAMMPS is
90-
supported), these components are required:
95+
to run an MD simulation with an external MD software (LAMMPS or CabanaMD), these
96+
components are required:
9197

9298
* :ref:`libnnp <libnnp>`
9399
* `libnnpif`
94-
* :ref:`lammps-nnp <if_lammps>`
100+
* :ref:`lammps-nnp <if_lammps>` (for LAMMPS)
95101

96102
Training a new neural network potential
97103
---------------------------------------
@@ -171,11 +177,17 @@ list of keywords is provided :ref:`here <keywords>`.
171177
topics/descriptors
172178
topics/keywords
173179
topics/cfg_file
174-
topics/if_lammps
175-
topics/pair_nnp
176180
topics/training
177181
topics/units
178182

183+
.. toctree::
184+
:hidden:
185+
:caption: Interfaces
186+
187+
interfaces/if_lammps
188+
interfaces/pair_nnp
189+
interfaces/if_cabanamd
190+
179191
.. toctree::
180192
:hidden:
181193
:caption: Tools
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
.. _if_cabanamd:
2+
3+
CabanaMD interface
4+
==================
5+
6+
Purpose
7+
-------
8+
The CabanaMD interface adds the neural network potential method in a proxy
9+
application which uses the Cabana particle library. `Cabana
10+
<https://github.com/ECP-copa/Cabana>`_ uses the `Kokkos
11+
<https://github.com/kokkos/kokkos>`_ programming model to run on multi-core CPUs
12+
and GPUs; `CabanaMD <https://github.com/ECP-copa/CabanaMD>`_ provides a simple
13+
MD code to explore performance with Cabana and Kokkos. The Cabana version of
14+
n2p2 reimplements a small part of the neural network potential to enable
15+
simulations on the GPU [1]_.
16+
17+
18+
Build instructions
19+
------------------
20+
21+
Go to the ``src`` directory and compile with the CabanaMD interface enabled:
22+
23+
.. code-block:: none
24+
25+
cd src
26+
make libnnpif INTERFACES=CabanaMD
27+
28+
Alternatively, set the ``INTERFACES`` variable in the master makefile
29+
(``src/makefile``) to ``CabanaMD`` and just run in the ``src`` directory:
30+
31+
.. code-block:: none
32+
33+
make libnnpif
34+
35+
For dynamic linking add the argument ``MODE=shared``.
36+
37+
.. note::
38+
If dynamic linking (\ ``make libnnpif MODE=shared``\ ) is used, you need to make the NNP
39+
libraries visibile in your system, e.g. add this line in your ``.bashrc``\ :
40+
41+
.. code-block:: none
42+
43+
export LD_LIBRARY_PATH=<path-to-n2p2>/lib:${LD_LIBRARY_PATH}
44+
45+
This completes the necessary steps on the n2p2 side, further instructions on how
46+
to build CabandaMD together with this interface are provided `here
47+
<https://github.com/ECP-copa/CabanaMD/wiki>`__.
48+
49+
50+
Usage
51+
-----
52+
53+
See `here <https://github.com/ECP-copa/CabanaMD/wiki>`__ for building and running
54+
CabanaMD after building n2p2 (with the CabanaMD interface).
55+
56+
.. [1] Desai, S.; Reeve, S. T.; Belak, J. F. Implementing a Neural Network
57+
Interatomic Model with Performance Portability for Emerging Exascale
58+
Architectures. `arXiv:2002.00054 <https://arxiv.org/abs/2002.00054>`__
59+
[cond-mat, physics:physics] 2020

src/doc/sphinx/source/tools/nnp-select.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ File output:
5151
------------
5252

5353
* ``output.data``\ : The requested subset of training structures.
54+
* ``reject.data``\ : The rejected configurations, i.e. all data minus ``output.data``.
5455
* ``nnp-select.log`` : Log file (copy of screen output).
5556

5657
Examples:

src/doc/sphinx/source/topics/build.rst

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,45 @@ components, this depends on the intended use. The following table lists all
1212
components and their respective requirements (follow the links for more
1313
information).
1414

15-
+---------------------------------+----------------------------+------------------------------------------------------+
16-
| Component | Requirements | Function |
17-
+=================================+============================+======================================================+
18-
| :ref:`libnnp <libnnp>` | C++11 compiler (icpc, g++) | NNP core library (NN, SF, Structure, ...) |
19-
+---------------------------------+----------------------------+------------------------------------------------------+
20-
| libnnpif | libnnp, MPI | Interfaces to other software (LAMMPS, ...) |
21-
+---------------------------------+----------------------------+------------------------------------------------------+
22-
| libnnptrain | libnnp, MPI, GSL, Eigen | Dataset and training routines (Kalman, ...). |
23-
+---------------------------------+----------------------------+------------------------------------------------------+
24-
| :ref:`nnp-convert` | libnnp | Convert between structure file formats. |
25-
+---------------------------------+----------------------------+------------------------------------------------------+
26-
| nnp-cutoff | libnnp | Test speed of different cutoff functions. |
27-
+---------------------------------+----------------------------+------------------------------------------------------+
28-
| nnp-dist | libnnp | Calculate radial and angular distribution functions. |
29-
+---------------------------------+----------------------------+------------------------------------------------------+
30-
| :ref:`nnp-predict` | libnnp | Predict energy and forces for one structure. |
31-
+---------------------------------+----------------------------+------------------------------------------------------+
32-
| :ref:`nnp-prune` | libnnp | Prune symmetry functions. |
33-
+---------------------------------+----------------------------+------------------------------------------------------+
34-
| :ref:`nnp-select` | libnnp | Select subset from data set. |
35-
+---------------------------------+----------------------------+------------------------------------------------------+
36-
| nnp-symfunc | libnnp | Symmetry function shape from settings file. |
37-
+---------------------------------+----------------------------+------------------------------------------------------+
38-
| nnp-comp2 | libnnptrain | Compare prediction of 2 NNPs for data set. |
39-
+---------------------------------+----------------------------+------------------------------------------------------+
40-
| nnp-dataset | libnnptrain | Calculate energies and forces for a whole data set. |
41-
+---------------------------------+----------------------------+------------------------------------------------------+
42-
| :ref:`nnp-norm` | libnnptrain | Calculate normalization factors for data set. |
43-
+---------------------------------+----------------------------+------------------------------------------------------+
44-
| :ref:`nnp-scaling` | libnnptrain | Calculate symmetry function values for data set. |
45-
+---------------------------------+----------------------------+------------------------------------------------------+
46-
| nnp-train | libnnptrain | Train a neural network potential. |
47-
+---------------------------------+----------------------------+------------------------------------------------------+
48-
| :ref:`lammps-nnp <if_lammps>` | libnnpif | Pair style `nnp` for LAMMPS |
49-
+---------------------------------+----------------------------+------------------------------------------------------+
50-
| pynnp | libnnp, python, cython | Python interface to NNP library. |
51-
+---------------------------------+----------------------------+------------------------------------------------------+
52-
| doc | Sphinx, Doxygen, Exhale | Documentation. |
53-
+---------------------------------+----------------------------+------------------------------------------------------+
15+
+---------------------------------+------------------------------+------------------------------------------------------+
16+
| Component | Requirements | Function |
17+
+=================================+==============================+======================================================+
18+
| :ref:`libnnp <libnnp>` | C++11 compiler (icpc, g++) | NNP core library (NN, SF, Structure, ...) |
19+
+---------------------------------+------------------------------+------------------------------------------------------+
20+
| libnnpif | libnnp, MPI | Interfaces to other software (LAMMPS, ...) |
21+
+---------------------------------+------------------------------+------------------------------------------------------+
22+
| libnnptrain | libnnp, MPI, GSL, Eigen 3.3+ | Dataset and training routines (Kalman, ...). |
23+
+---------------------------------+------------------------------+------------------------------------------------------+
24+
| :ref:`nnp-convert` | libnnp | Convert between structure file formats. |
25+
+---------------------------------+------------------------------+------------------------------------------------------+
26+
| nnp-cutoff | libnnp | Test speed of different cutoff functions. |
27+
+---------------------------------+------------------------------+------------------------------------------------------+
28+
| nnp-dist | libnnp | Calculate radial and angular distribution functions. |
29+
+---------------------------------+------------------------------+------------------------------------------------------+
30+
| :ref:`nnp-predict` | libnnp | Predict energy and forces for one structure. |
31+
+---------------------------------+------------------------------+------------------------------------------------------+
32+
| :ref:`nnp-prune` | libnnp | Prune symmetry functions. |
33+
+---------------------------------+------------------------------+------------------------------------------------------+
34+
| :ref:`nnp-select` | libnnp | Select subset from data set. |
35+
+---------------------------------+------------------------------+------------------------------------------------------+
36+
| nnp-symfunc | libnnp | Symmetry function shape from settings file. |
37+
+---------------------------------+------------------------------+------------------------------------------------------+
38+
| nnp-comp2 | libnnptrain | Compare prediction of 2 NNPs for data set. |
39+
+---------------------------------+------------------------------+------------------------------------------------------+
40+
| nnp-dataset | libnnptrain | Calculate energies and forces for a whole data set. |
41+
+---------------------------------+------------------------------+------------------------------------------------------+
42+
| :ref:`nnp-norm` | libnnptrain | Calculate normalization factors for data set. |
43+
+---------------------------------+------------------------------+------------------------------------------------------+
44+
| :ref:`nnp-scaling` | libnnptrain | Calculate symmetry function values for data set. |
45+
+---------------------------------+------------------------------+------------------------------------------------------+
46+
| nnp-train | libnnptrain | Train a neural network potential. |
47+
+---------------------------------+------------------------------+------------------------------------------------------+
48+
| :ref:`lammps-nnp <if_lammps>` | libnnpif | Pair style `nnp` for LAMMPS |
49+
+---------------------------------+------------------------------+------------------------------------------------------+
50+
| pynnp | libnnp, python, cython | Python interface to NNP library. |
51+
+---------------------------------+------------------------------+------------------------------------------------------+
52+
| doc | Sphinx, Doxygen, Breathe | Documentation. |
53+
+---------------------------------+------------------------------+------------------------------------------------------+
5454

5555
The master makefile
5656
-------------------

0 commit comments

Comments
 (0)