Skip to content

Commit 91a5eda

Browse files
committed
add class topology part in dev doc
1 parent 43d1871 commit 91a5eda

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

developers/readme.md

+22
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,28 @@ If you use new CUDA and HIP APIs, they should be added to this file.
6868
* `mc`: The module for doing hybrid Monte Carlo and molecular dynamics (MCMD) simulations.
6969
* `utilities`: The module containing some common utilities used in many of the other modules.
7070

71+
## Class Topology
72+
73+
* To quickly understand software architecture, there are two class topology figures for `gpumd` and `nep`. For each class, the corresponding files are in the `src` folder. For example, you could find class `Atom` in `atom.cu` and `atom.cuh`. In addition to these classes, there is another important class `GPU_Vector`. This class is designed perfectly and handles all data in GPU. The usage of it is almost the same of `std::vector`.
74+
* Meaning of the symbols:
75+
* Solid lines represent the class at the base of the arrow holds an instance of the class at the tip.
76+
* Full lines with `*` represent the class at the base of the arrow holds a pointer to an instance of the class at the tip.
77+
* Dashed lines represent the class at the tip of the arrow is derived from the class at the base.
78+
* Double solid lines represent the class at the base of arrow holds a vector of the class at the tip.
79+
* Red boundaries represent these classes have pure virtual functions so that couldn't be instantiated directly.
80+
* The shape of boundary represents the "level" of this class to make the figure
81+
* The topmost class of `gpumd` is `Run`, which holds all core class instances except `Minimize`. Class `Minimize` will be instantiated just when `minimize` is setting.
82+
![gpumd class topology](./main_gpumd_class_topology.png)
83+
* More details about `gpumd` class topology:
84+
* `Run` holds a vector of `Group` instances that each represents a group method.
85+
* `thermo` is a `std::vector` of `float` in the class `Run`.
86+
87+
* The classes in `nep` is simpler so here we list some main functions to make the training process clearer. There are just three main steps in the figure.
88+
* Step 1: initialize `para` by parameters set in `nep.in` file.
89+
* Step 2: initialize `fitness` by a reference of `para` and read `train.xyz` and `test.xyz` (if exist) to initialize two datasets.
90+
* Step 3: initialize `snes` by `para` and `fitness`. At the end of construct function, `SNES::compute` is called to start the training.
91+
![nep class topology](./main_nep_class_topology.png)
92+
7193
## Units
7294

7395
* Units for inputs and outputs should be specified in the user manual.

0 commit comments

Comments
 (0)