diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index 3ccc0966c..000000000
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-name: Bug report
-about: Create a bug report to help us eliminate issues and improve dpgen. If this
- doesn’t look right, [choose a different type](https://github.com/deepmodeling/dpgen/issues/new/choose).
-title: "[BUG] _Replace With Suitable Title_"
-labels: bug
-assignees: ''
-
----
-
-**Summary**
-
-
-
-**DPGEN Version and Platform**
-
-
-
-**Job submission and computing cluster configuration**
-
-
-
-**Expected Behavior**
-
-
-
-**Actual Behavior**
-
-
-
-**Steps to Reproduce**
-
-
-
-**Further Information, Files, and Links**
-
-
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 000000000..dc19d9c8f
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,58 @@
+name: Bug report
+description: Create a bug report to help us eliminate issues and improve deepmd-kit.
+title: "[BUG] "
+labels: bug
+assignees: []
+body:
+ - type: textarea
+ id: summary
+ attributes:
+ label: Bug summary
+ description: Please provide a clear and concise description of what the bug is.
+ placeholder:
+ value:
+ validations:
+ required: true
+ - type: input
+ id: version
+ attributes:
+ label: DP-GEN Version
+ description: "`dpgen --version`"
+ validations:
+ required: true
+ - type: textarea
+ id: other-version
+ attributes:
+ label: Platform, Python Version, Remote Platform, etc
+ description: "If applicable, specify what platform you are running on."
+ placeholder:
+ value:
+ validations:
+ required: false
+ - type: textarea
+ id: log
+ attributes:
+ label: Input Files, Running Commands, Error Log, etc.
+ description: "Please provide necessary information including input file, running commands, error log , etc., AS DETAILED AS POSSIBLE to help locate and reproduce your problem. WARNING: Do not use image to show error log! Paste texts in a code block instead."
+ placeholder:
+ value:
+ validations:
+ required: true
+ - type: textarea
+ id: reproduce
+ attributes:
+ label: Steps to Reproduce
+ description: "Describe the steps required to (quickly) reproduce the issue. You can attach (small) files to the section below or add URLs where to download an archive with all necessary files. Please try to create an input set that is as minimal and small as possible and reproduces the bug as quickly as possible. **NOTE:** the less effort and time it takes to reproduce your reported bug, the more likely it becomes, that somebody will look into it and fix the problem."
+ placeholder:
+ value:
+ validations:
+ required: true
+ - type: textarea
+ id: further
+ attributes:
+ label: Further Information, Files, and Links
+ description: Put any additional information here, attach relevant text or image files and URLs to external sites, e.g. relevant publications
+ placeholder:
+ value:
+ validations:
+ required: false
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 000000000..9d7a41f32
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,14 @@
+blank_issues_enabled: false
+contact_links:
+ - name: Submit DeePMD-kit issue
+ url: https://github.com/deepmodeling/deepmd-kit/issues
+ about: If the issue is related to DeePMD-kit (model training and inference), submit to deepmd-kit repository
+ - name: Submit dpdata issue
+ url: https://github.com/deepmodeling/dpdata/issues
+ about: If the issue is related to dpdata (format conversion), submit to dpdata repository
+ - name: Submit dpdispatcher issue
+ url: https://github.com/deepmodeling/dpdispatcher/issues
+ about: If the issue is related to dpdispatcher (job submission), submit to dpdispatcher repository
+ - name: Request for Help
+ url: https://github.com/deepmodeling/dpgen/discussions/new?category=q-a
+ about: If you have an usage question
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100644
index 162e9e7e3..000000000
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project. If this doesn’t work right, [choose a different
- type]( https://github.com/deepmodeling/dpgen/issues/new/choose).
-title: "[Feature Request] _Replace with Title_"
-labels: new feature
-assignees: ''
-
----
-
-**Summary**
-
-
-
-**Detailed Description**
-
-
-
-**Further Information, Files, and Links**
-
-
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 000000000..18781a841
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,33 @@
+name: Feature request
+description: Suggest an idea for this project.
+title: "[Feature Request] "
+labels: enhancement
+assignees: []
+body:
+ - type: textarea
+ id: summary
+ attributes:
+ label: Summary
+ description: "Please provide a brief and concise description of the suggested feature or change"
+ placeholder:
+ value:
+ validations:
+ required: true
+ - type: textarea
+ id: details
+ attributes:
+ label: Detailed Description
+ description: "Please explain how you would like to see deepmd-kit enhanced, what feature(s) you are looking for, what specific problems this will solve. If possible, provide references to relevant background information like publications or web pages, and whether you are planning to implement the enhancement yourself or would like to participate in the implementation. If applicable add a reference to an existing bug report or issue that this will address."
+ placeholder:
+ value:
+ validations:
+ required: true
+ - type: textarea
+ id: further
+ attributes:
+ label: Further Information, Files, and Links
+ description: Put any additional information here, attach relevant text or image files and URLs to external sites, e.g. relevant publications
+ placeholder:
+ value:
+ validations:
+ required: false
diff --git a/.github/ISSUE_TEMPLATE/generic-issue.md b/.github/ISSUE_TEMPLATE/generic-issue.md
deleted file mode 100644
index 4eca84778..000000000
--- a/.github/ISSUE_TEMPLATE/generic-issue.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-name: Generic issue
-about: For issues that do not fit any of the other categories. If this doesn’t work
- right, [choose a different type]( https://github.com/deepmodeling/dpgen/issues/new/choose).
-title: _Replace With a Descriptive Title_
-labels: wontfix
-assignees: ''
-
----
-
-**Summary**
-
-
-
-**DPGEN Version and Platform**
-
-
-
-**Job submission and computing cluster configuration**
-
-
-
-**Details**
-
-
diff --git a/.github/ISSUE_TEMPLATE/generic-issue.yml b/.github/ISSUE_TEMPLATE/generic-issue.yml
new file mode 100644
index 000000000..0462bc3b3
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/generic-issue.yml
@@ -0,0 +1,38 @@
+name: Generic issue
+description: For issues that do not fit any of the other categories.
+assignees: []
+body:
+ - type: textarea
+ id: summary
+ attributes:
+ label: Summary
+ description: "Please provide a clear and concise description of what the question is."
+ placeholder:
+ value:
+ validations:
+ required: true
+ - type: input
+ id: version
+ attributes:
+ label: DP-GEN Version
+ description: "`dpgen --version`"
+ validations:
+ required: true
+ - type: textarea
+ id: other-version
+ attributes:
+ label: Platform, Python Version, etc
+ description: "If applicable, specify what platform you are running on."
+ placeholder:
+ value:
+ validations:
+ required: false
+ - type: textarea
+ id: details
+ attributes:
+ label: Details
+ description: "Please explain the issue in detail here."
+ placeholder:
+ value:
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/parameters.md b/.github/ISSUE_TEMPLATE/parameters.md
deleted file mode 100644
index 4fdf519aa..000000000
--- a/.github/ISSUE_TEMPLATE/parameters.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-name: Parameters
-about: Make a suggestion for a change of input parameters or a new output to dpgen.
- If this doesn’t work right, [choose a different type]( https://github.com/deepmodeling/dpgen/issues/new/choose).
-title: "[Parameters] _Replace With Suitable Title_"
-labels: documentation, enhancement
-assignees: ''
-
----
-
-**Summary**
-
-
-
-**Summary**
-
-
-
-**Detailed Description**
-
-
-
-**Further Information, Files, and Links**
-
-
diff --git a/.github/ISSUE_TEMPLATE/request-for-help.md b/.github/ISSUE_TEMPLATE/request-for-help.md
deleted file mode 100644
index 5f9b94e51..000000000
--- a/.github/ISSUE_TEMPLATE/request-for-help.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-name: Request for Help
-about: Don't post help requests here, go to [discussions](http://github.com/deepmodeling/dpgen/discussions)
- instead. Or [choose a different type]( https://github.com/deepmodeling/dpgen/issues/new/choose).
-title: ''
-labels: ''
-assignees: ''
-
----
-
-Before asking questions, you can
-
-search the previous issues or discussions
-check [Manual](https://github.com/deepmodeling/dpgen).
-
-Please **do not** post requests for help (e.g. with installing or using dpgen) here.
-Instead go to [discussions](https://github.com/deepmodeling/dpgen/discussions).
-
-This issue tracker is for tracking dpgen development related issues only.
-
-Thanks for your cooperation.
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 19f733d7c..d40539314 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -33,6 +33,21 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-to-pypi:
- uses: deepmodeling/workflows/.github/workflows/release-to-pypi.yml@main
- secrets:
- PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+ name: Release to pypi
+ runs-on: ubuntu-latest
+ permissions:
+ # IMPORTANT: this permission is mandatory for trusted publishing
+ id-token: write
+ steps:
+ - uses: actions/checkout@v3
+ - name: Setup python
+ uses: actions/setup-python@v4
+ with:
+ python-version: 3.x
+ architecture: x64
+ - name: Install dependencies
+ run: python -m pip install build
+ - run: python -m build
+ - name: Publish a Python distribution to PyPI
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
+ uses: pypa/gh-action-pypi-publish@release/v1
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index ebe9bdff4..acb7d8a4b 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- python-version: [3.8, 3.9]
+ python-version: ["3.9", "3.12"]
steps:
- uses: actions/checkout@v2
@@ -18,7 +18,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- run: pip install coverage git+https://github.com/materialsproject/pymatgen@b56698019098247ff54f50997a67c562b4375fc3 -e .
+ run: pip install -e .[test]
- name: Test
run: coverage run --source=./dpgen -m unittest -v && coverage report
- uses: codecov/codecov-action@v3
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index b5ce6e9c2..75592b2db 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.4.0
+ rev: v4.5.0
hooks:
# there are many log files in tests
# TODO: seperate py files and log files
@@ -12,22 +12,27 @@ repos:
exclude: "^tests/.*$"
- id: check-yaml
exclude: "^conda/.*$"
- #- id: check-json
+ - id: check-json
+ exclude: "^examples/CH4-lebesgue/.*$"
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
exclude: "^tests/tools/run_report_test_output/.*$"
- id: check-toml
+ - id: pretty-format-json
+ args:
+ - "--autofix"
+ - "--no-sort-keys"
+ - "--indent=4"
+ exclude: "^examples/CH4-lebesgue/.*$"
+
# Python
-- repo: https://github.com/psf/black
- rev: 22.12.0
- hooks:
- - id: black-jupyter
-- repo: https://github.com/charliermarsh/ruff-pre-commit
- rev: v0.0.253
+- repo: https://github.com/astral-sh/ruff-pre-commit
+ rev: v0.1.3
hooks:
- id: ruff
args: ["--fix"]
+ - id: ruff-format
# numpydoc
- repo: https://github.com/Carreau/velin
rev: 0.0.12
diff --git a/README.md b/README.md
index d2734fd9a..fb5ef39bc 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-![logo](./doc/logo.svg)
+
--------------------------------------------------------------------------------
@@ -10,7 +10,7 @@
[![conda install](https://img.shields.io/conda/dn/conda-forge/dpgen?label=conda%20install)](https://anaconda.org/conda-forge/dpgen)
[![pip install](https://img.shields.io/pypi/dm/dpgen?label=pip%20install)](https://pypi.org/project/dpgen)
-DP-GEN (Deep Generator) is a software written in Python, delicately designed to generate a deep learning based model of interatomic potential energy and force field. DP-GEN is dependent on [DeePMD-kit](https://github.com/deepmodeling/deepmd-kit/). With highly scalable interface with common softwares for molecular simulation, DP-GEN is capable to automatically prepare scripts and maintain job queues on HPC machines (High Performance Cluster) and analyze results.
+DP-GEN (Deep Potential GENerator) is a software written in Python, delicately designed to generate a deep learning based model of interatomic potential energy and force field. DP-GEN is dependent on [DeePMD-kit](https://github.com/deepmodeling/deepmd-kit/). With highly scalable interface with common softwares for molecular simulation, DP-GEN is capable to automatically prepare scripts and maintain job queues on HPC machines (High Performance Cluster) and analyze results.
If you use this software in any publication, please cite:
@@ -23,22 +23,14 @@ Yuzhi Zhang, Haidi Wang, Weijie Chen, Jinzhe Zeng, Linfeng Zhang, Han Wang, and
## Download and Install
-DP-GEN only supports Python 3.8 and above.
+DP-GEN only supports Python 3.9 and above. You can use one of the following methods to install DP-GEN:
+
+- Install via pip: `pip install dpgen`
+- Install via conda: `conda install -c conda-forge dpgen``
+- Install from source code: `git clone https://github.com/deepmodeling/dpgen && pip install ./dpgen`
-One can download the source code of dpgen by
-```bash
-git clone https://github.com/deepmodeling/dpgen.git
-```
-then you may install DP-GEN easily by:
-```bash
-cd dpgen
-pip install --user .
-```
-With this command, the dpgen executable is install to `$HOME/.local/bin/dpgen`. You may want to export the `PATH` by
-```bash
-export PATH=$HOME/.local/bin:$PATH
-```
To test if the installation is successful, you may execute
+
```bash
dpgen -h
```
@@ -47,7 +39,7 @@ dpgen -h
DP-GEN contains the following workflows:
-* [`dpgen run`](https://docs.deepmodeling.com/projects/dpgen/en/latest/run/): Main process of Deep Generator.
+* [`dpgen run`](https://docs.deepmodeling.com/projects/dpgen/en/latest/run/): Main process of Deep Potential Generator.
* [Init](https://docs.deepmodeling.com/projects/dpgen/en/latest/init/): Generating initial data.
* `dpgen init_bulk`: Generating initial data for bulk systems.
* `dpgen init_surf`: Generating initial data for surface systems.
diff --git a/conda/construct.yaml b/conda/construct.yaml
index 020ae1f56..83c1b0822 100644
--- a/conda/construct.yaml
+++ b/conda/construct.yaml
@@ -9,7 +9,7 @@ channels:
- deepmodeling
specs:
- - python 3.8
+ - python 3.9
- pip
- dpgen {{ version }}
diff --git a/doc/_static/css/custom.css b/doc/_static/css/custom.css
new file mode 100644
index 000000000..9ac71c813
--- /dev/null
+++ b/doc/_static/css/custom.css
@@ -0,0 +1,8 @@
+.wy-side-nav-search .wy-dropdown > a img.logo, .wy-side-nav-search > a img.logo {
+ width: 275px;
+}
+@media (prefers-color-scheme: dark) {
+ .wy-side-nav-search .wy-dropdown > a img.logo, .wy-side-nav-search > a img.logo {
+ content: url("../logo-dark.svg");
+ }
+}
diff --git a/doc/_static/logo-dark.svg b/doc/_static/logo-dark.svg
new file mode 100644
index 000000000..80b706fa1
--- /dev/null
+++ b/doc/_static/logo-dark.svg
@@ -0,0 +1 @@
+
diff --git a/doc/logo.svg b/doc/_static/logo.svg
similarity index 100%
rename from doc/logo.svg
rename to doc/_static/logo.svg
diff --git a/doc/autotest/Auto-test.md b/doc/autotest/Auto-test.md
index 7ecd36286..5d1042ddf 100644
--- a/doc/autotest/Auto-test.md
+++ b/doc/autotest/Auto-test.md
@@ -43,7 +43,7 @@ The default of `potcar_prefix` is "".
```
**ABACUS**:
-The default of `potcar_prefix` is "". The path of potcars/orb_files/deepks_desc is `potcar_prefix` + `potcars`/`orb_files`/`deepks_desc`.
+The default of `potcar_prefix` is "". The path of potcars/orb_files/deepks_desc is `potcar_prefix` + `potcars`/`orb_files`/`deepks_desc`/`deepks_model`.
```json
"interaction": {
"type": "abacus",
@@ -52,7 +52,8 @@ The default of `potcar_prefix` is "". The path of potcars/orb_files/deepks_desc
"potcars": {"Al": "pseudo_potential.al", "Mg": "pseudo_potential.mg"},
"orb_files": {"Al": "numerical_orb.al", "Mg": "numerical_orb.mg"},
"atom_masses": {"Al": 26.9815, "Mg":24.305},
- "deepks_desc": "jle.orb"
+ "deepks_desc": "jle.orb",
+ "deepks_model": "model.ptg"
}
```
**deepmd**:
diff --git a/doc/conf.py b/doc/conf.py
index 358c2a9b0..b0bcbb400 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -11,13 +11,10 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
-import subprocess
import sys
from datetime import date
# import sys
-import recommonmark
-from recommonmark.transform import AutoStructify
# -- Project information -----------------------------------------------------
@@ -75,13 +72,13 @@
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
-html_logo = "logo.svg"
+html_logo = "_static/logo.svg"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-# html_static_path = ['_static']
-# html_css_files = ['css/custom.css']
+html_static_path = ["_static"]
+html_css_files = ["css/custom.css"]
autodoc_default_flags = ["members"]
autosummary_generate = True
diff --git a/doc/init/init-bulk-jdata.rst b/doc/init/init-bulk-jdata.rst
index 8d37484bd..1cfccfdf5 100644
--- a/doc/init/init-bulk-jdata.rst
+++ b/doc/init/init-bulk-jdata.rst
@@ -2,7 +2,7 @@ dpgen init_bulk parameters
======================================
.. note::
- One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
+ One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_ online or hosted using the :ref:`command line interface ` :code:`dpgen gui`. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
.. dargs::
:module: dpgen.data.arginfo
diff --git a/doc/init/init-bulk-mdata.rst b/doc/init/init-bulk-mdata.rst
index 79f29a4de..63958089b 100644
--- a/doc/init/init-bulk-mdata.rst
+++ b/doc/init/init-bulk-mdata.rst
@@ -2,7 +2,7 @@ dpgen init_bulk machine parameters
==================================
.. note::
- One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
+ One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_ online or hosted using the :ref:`command line interface ` :code:`dpgen gui`. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
.. dargs::
:module: dpgen.data.arginfo
diff --git a/doc/init/init-reaction-jdata.rst b/doc/init/init-reaction-jdata.rst
index 2c1f2480f..829b9f955 100644
--- a/doc/init/init-reaction-jdata.rst
+++ b/doc/init/init-reaction-jdata.rst
@@ -2,7 +2,7 @@ dpgen init_reaction parameters
======================================
.. note::
- One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
+ One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_ online or hosted using the :ref:`command line interface ` :code:`dpgen gui`. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
.. dargs::
:module: dpgen.data.arginfo
diff --git a/doc/init/init-reaction-mdata.rst b/doc/init/init-reaction-mdata.rst
index 74f39dfd7..42254a653 100644
--- a/doc/init/init-reaction-mdata.rst
+++ b/doc/init/init-reaction-mdata.rst
@@ -2,7 +2,7 @@ dpgen init_reaction machine parameters
======================================
.. note::
- One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
+ One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_ online or hosted using the :ref:`command line interface ` :code:`dpgen gui`. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
.. dargs::
:module: dpgen.data.arginfo
diff --git a/doc/init/init-surf-jdata.rst b/doc/init/init-surf-jdata.rst
index aa61245d9..c46bfc893 100644
--- a/doc/init/init-surf-jdata.rst
+++ b/doc/init/init-surf-jdata.rst
@@ -2,7 +2,7 @@ dpgen init_surf parameters
======================================
.. note::
- One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
+ One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_ online or hosted using the :ref:`command line interface ` :code:`dpgen gui`. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
.. dargs::
:module: dpgen.data.arginfo
diff --git a/doc/init/init-surf-mdata.rst b/doc/init/init-surf-mdata.rst
index d1f6e7c4c..361308361 100644
--- a/doc/init/init-surf-mdata.rst
+++ b/doc/init/init-surf-mdata.rst
@@ -2,7 +2,7 @@ dpgen init_surf machine parameters
==================================
.. note::
- One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
+ One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_ online or hosted using the :ref:`command line interface ` :code:`dpgen gui`. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
.. dargs::
:module: dpgen.data.arginfo
diff --git a/doc/overview/cli.rst b/doc/overview/cli.rst
index e57f1b064..f2d04b5bb 100644
--- a/doc/overview/cli.rst
+++ b/doc/overview/cli.rst
@@ -1,3 +1,5 @@
+.. _cli:
+
Command line interface
======================
diff --git a/doc/overview/overview.md b/doc/overview/overview.md
index 801370e5f..6916dcf15 100644
--- a/doc/overview/overview.md
+++ b/doc/overview/overview.md
@@ -5,7 +5,7 @@
[![GitHub release](https://img.shields.io/github/release/deepmodeling/dpgen.svg?maxAge=86400)](https://github.com/deepmodeling/dpgen/releases/)
[![doi:10.1016/j.cpc.2020.107206](https://img.shields.io/badge/DOI-10.1016%2Fj.cpc.2020.107206-blue)](https://doi.org/10.1016/j.cpc.2020.107206)
![Citations](https://citations.njzjz.win/10.1016/j.cpc.2020.107206)
-[![conda install](https://img.shields.io/conda/dn/deepmodeling/dpgen?label=conda%20install)](https://anaconda.org/deepmodeling/dpgen)
+[![conda install](https://img.shields.io/conda/dn/conda-forge/dpgen?label=conda%20install)](https://anaconda.org/conda-forge/dpgen)
[![pip install](https://img.shields.io/pypi/dm/dpgen?label=pip%20install)](https://pypi.org/project/dpgen)
DP-GEN (Deep Generator) is a software written in Python, delicately designed to generate a deep learning based model of interatomic potential energy and force field. DP-GEN is dependent on [DeepMD-kit](https://github.com/deepmodeling/deepmd-kit/blob/master/README.md). With highly scalable interface with common softwares for molecular simulation, DP-GEN is capable to automatically prepare scripts and maintain job queues on HPC machines (High Performance Cluster) and analyze results.
@@ -21,28 +21,17 @@ Yuzhi Zhang, Haidi Wang, Weijie Chen, Jinzhe Zeng, Linfeng Zhang, Han Wang, and
## Download and install
-DP-GEN only supports Python 3.8 and above.
-
-Please follow our [GitHub](https://github.com/deepmodeling/dpgen) webpage to download the [latest released version](https://github.com/deepmodeling/dpgen/tree/master) and [development version](https://github.com/deepmodeling/dpgen/tree/devel).
-One can download the source code of dpgen by
-```bash
-git clone https://github.com/deepmodeling/dpgen.git
-```
-
-DP-GEN offers multiple installation methods. It is recommend using easily methods like:
-- offline packages: find them in [releases](https://github.com/deepmodeling/dpgen/releases/),
-- pip: use `pip install dpgen`, see [dpgen-PyPI](https://pypi.org/project/dpgen/)
-- conda: use `conda install -c deepmodeling dpgen`, see [dpgen-conda](https://anaconda.org/deepmodeling/dpgen)
+DP-GEN only supports Python 3.9 and above. You can use one of the following methods to install DP-GEN:
+- Install via pip: `pip install dpgen`
+- Install via conda: `conda install -c conda-forge dpgen``
+- Install from source code: `git clone https://github.com/deepmodeling/dpgen && pip install ./dpgen`
To test if the installation is successful, you may execute
+
```bash
dpgen -h
```
-or just
-```
-dpgen
-```
## Use DP-GEN
diff --git a/doc/requirements.txt b/doc/requirements.txt
index 66be0d098..6c5e67fb2 100644
--- a/doc/requirements.txt
+++ b/doc/requirements.txt
@@ -1,4 +1,5 @@
-sphinx>=4.0.2
+# https://github.com/sphinx-doc/sphinx/issues/11662
+sphinx>=4.0.2,!=7.2.5
recommonmark
sphinx_rtd_theme
sphinx_markdown_tables
diff --git a/doc/run/mdata.rst b/doc/run/mdata.rst
index cad09bec8..1ce5dde35 100644
--- a/doc/run/mdata.rst
+++ b/doc/run/mdata.rst
@@ -1,7 +1,7 @@
dpgen run machine parameters
============================
.. note::
- One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
+ One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_ online or hosted using the :ref:`command line interface ` :code:`dpgen gui`. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
.. dargs::
:module: dpgen.generator.arginfo
diff --git a/doc/run/param.rst b/doc/run/param.rst
index 6b99446f3..cdbb2dde7 100644
--- a/doc/run/param.rst
+++ b/doc/run/param.rst
@@ -3,7 +3,7 @@ dpgen run param parameters
=============================
.. note::
- One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
+ One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_ online or hosted using the :ref:`command line interface ` :code:`dpgen gui`. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
.. dargs::
:module: dpgen.generator.arginfo
diff --git a/doc/simplify/simplify-jdata.rst b/doc/simplify/simplify-jdata.rst
index 3933566dd..d98a64b26 100644
--- a/doc/simplify/simplify-jdata.rst
+++ b/doc/simplify/simplify-jdata.rst
@@ -2,7 +2,7 @@ dpgen simplify parameters
=========================
.. note::
- One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
+ One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_ online or hosted using the :ref:`command line interface ` :code:`dpgen gui`. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
.. dargs::
:module: dpgen.simplify.arginfo
diff --git a/doc/simplify/simplify-mdata.rst b/doc/simplify/simplify-mdata.rst
index 40edfc201..0008e0926 100644
--- a/doc/simplify/simplify-mdata.rst
+++ b/doc/simplify/simplify-mdata.rst
@@ -2,7 +2,7 @@ dpgen simplify machine parameters
=================================
.. note::
- One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
+ One can load, modify, and export the input file by using our effective web-based tool `DP-GUI `_ online or hosted using the :ref:`command line interface ` :code:`dpgen gui`. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
.. dargs::
:module: dpgen.simplify.arginfo
diff --git a/doc/simplify/simplify.md b/doc/simplify/simplify.md
index c462c85df..8a1fa6dec 100644
--- a/doc/simplify/simplify.md
+++ b/doc/simplify/simplify.md
@@ -70,7 +70,7 @@ Here is an example of `param.json` for QM7 dataset:
"learning_rate": {
"type": "exp",
"start_lr": 0.001,
- "decay_steps": 10,
+ "stop_lr": 5e-8,
"decay_rate": 0.99
},
"loss": {
@@ -85,12 +85,11 @@ Here is an example of `param.json` for QM7 dataset:
},
"training": {
"set_prefix": "set",
- "stop_batch": 10000,
+ "numb_steps": 10000,
"disp_file": "lcurve.out",
"disp_freq": 1000,
"numb_test": 1,
"save_freq": 1000,
- "save_ckpt": "model.ckpt",
"disp_training": true,
"time_training": true,
"profiling": false,
diff --git a/dpgen/__init__.py b/dpgen/__init__.py
index 927705f25..3fad112f2 100644
--- a/dpgen/__init__.py
+++ b/dpgen/__init__.py
@@ -1,5 +1,3 @@
-from __future__ import print_function, unicode_literals
-
import logging
import os
diff --git a/dpgen/arginfo.py b/dpgen/arginfo.py
index 63405bfdd..3d82aada2 100644
--- a/dpgen/arginfo.py
+++ b/dpgen/arginfo.py
@@ -1,11 +1,9 @@
-from typing import Tuple
-
from dargs import Argument
from dpgen.dispatcher.Dispatcher import mdata_arginfo
-def general_mdata_arginfo(name: str, tasks: Tuple[str]) -> Argument:
+def general_mdata_arginfo(name: str, tasks: tuple[str]) -> Argument:
"""Generate arginfo for general mdata.
Parameters
@@ -20,7 +18,6 @@ def general_mdata_arginfo(name: str, tasks: Tuple[str]) -> Argument:
Argument
arginfo
"""
-
doc_api_version = "Please set to 1.0"
doc_deepmd_version = "DeePMD-kit version, e.g. 2.1.3"
doc_run_mdata = "machine.json file"
diff --git a/dpgen/auto_test/ABACUS.py b/dpgen/auto_test/ABACUS.py
index ed246b19f..ea5ec627f 100644
--- a/dpgen/auto_test/ABACUS.py
+++ b/dpgen/auto_test/ABACUS.py
@@ -1,6 +1,5 @@
import os
-import numpy as np
from dpdata import LabeledSystem
from monty.serialization import dumpfn
@@ -20,8 +19,9 @@ def __init__(self, inter_parameter, path_to_poscar):
self.potcars = inter_parameter.get("potcars", None)
self.orbfile = inter_parameter.get("orb_files", None)
self.deepks = inter_parameter.get("deepks_desc", None)
+ self.deepks_model = inter_parameter.get("deepks_model", None)
self.path_to_poscar = path_to_poscar
- self.if_define_orb_file = False if self.orbfile == None else True
+ self.if_define_orb_file = False if self.orbfile is None else True
def make_potential_files(self, output_dir):
stru = os.path.abspath(os.path.join(output_dir, "STRU"))
@@ -40,7 +40,7 @@ def make_potential_files(self, output_dir):
else:
stru_path = output_dir
- if pp_files == None:
+ if pp_files is None:
raise RuntimeError("No pseudopotential information in STRU file")
pp_dir = os.path.abspath(self.potcar_prefix)
@@ -48,35 +48,68 @@ def make_potential_files(self, output_dir):
os.chdir(output_dir)
if not os.path.isdir("./pp_orb"):
os.mkdir("./pp_orb")
- for i in range(len(atom_names)):
- pp_orb_file = [[pp_files[i], self.potcars]]
- if orb_files != None:
- pp_orb_file.append([orb_files[i], self.orbfile])
- elif self.orbfile != None:
- assert atom_names[i] in self.orbfile, (
- "orb_file of %s is not defined" % atom_names[i]
+
+ pp_orb_file = []
+ for iatom, atomname in enumerate(atom_names):
+ # pseudopotential file
+ if not self.potcars:
+ raise RuntimeError(
+ "please specify the pseudopotential file for each atom type in 'potcars'"
+ )
+ if atomname not in self.potcars:
+ raise RuntimeError(
+ "please specify the pseudopotential file of '%s'" % atomname
+ )
+ pp_orb_file.append([pp_files[iatom], self.potcars[atomname]])
+
+ # orbital file
+ if orb_files:
+ if not self.orbfile:
+ raise RuntimeError(
+ "Orbital file is defined in STRU, so please specify the orbital file for each atom type in parameter setting file by 'orb_files'"
+ )
+ if atomname not in self.orbfile:
+ raise RuntimeError(
+ "please specify the orbital file of '%s'" % atomname
+ )
+ pp_orb_file.append([orb_files[iatom], self.orbfile[atomname]])
+ elif self.orbfile:
+ dlog.warning(
+ "Orbital is not needed by STRU, so ignore the setting of 'orb_files' in parameter setting file"
)
- pp_orb_file.append([self.orbfile[atom_names[i]], self.orbfile])
-
- if dpks_descriptor != None:
- pp_orb_file.append([dpks_descriptor[i], self.deepks])
- elif self.deepks != None:
- pp_orb_file.append([self.deepks, self.deepks])
-
- for tmpf, tmpdict in pp_orb_file:
- atom = atom_names[i]
- if os.path.isfile(os.path.join(stru_path, tmpf)):
- linked_file = os.path.join(stru_path, tmpf)
- elif tmpdict != None and os.path.isfile(
- os.path.join(pp_dir, tmpdict[atom])
- ):
- linked_file = os.path.join(pp_dir, tmpdict[atom])
- else:
- raise RuntimeError("Can not find file %s" % tmpf.split("/")[-1])
- target_file = os.path.join("./pp_orb/", tmpf.split("/")[-1])
- if os.path.isfile(target_file):
- os.remove(target_file)
- os.symlink(linked_file, target_file)
+
+ # dpks_descriptor
+ if dpks_descriptor:
+ if not self.deepks:
+ raise RuntimeError(
+ "Deepks descriptor file is defined in STRU, so please specify in parameter setting file by 'deepks_desc'"
+ )
+ pp_orb_file.append([dpks_descriptor, self.deepks])
+ elif self.deepks:
+ dlog.warning(
+ "Deepks descriptor is not needed by STRU, so ignore the setting of 'deepks_desc' in parameter setting file"
+ )
+
+ # dpks model
+ if self.deepks_model:
+ pp_orb_file.append([self.deepks_model, self.deepks_model])
+
+ # link the files
+ for file_stru, file_param in pp_orb_file:
+ filename_in_stru = os.path.split(file_stru)[1]
+ filename_in_para = os.path.split(file_param)[1]
+ if filename_in_stru != filename_in_para:
+ dlog.warning(
+ f"file name in STRU is not match that defined in parameter setting file: '{filename_in_stru}', '{filename_in_para}'."
+ )
+
+ src_file = os.path.join(pp_dir, file_param)
+ if not os.path.isfile(src_file):
+ raise RuntimeError("Can not find file %s" % src_file)
+ tar_file = os.path.join("pp_orb", filename_in_stru)
+ if os.path.isfile(tar_file):
+ os.remove(tar_file)
+ os.symlink(src_file, tar_file)
os.chdir(cwd)
@@ -84,7 +117,7 @@ def make_potential_files(self, output_dir):
def modify_input(self, incar, x, y):
if x in incar and incar[x] != y:
- dlog.info("setting %s to %s" % (x, y))
+ dlog.info(f"setting {x} to {y}")
incar[x] = y
def make_input_file(self, output_dir, task_type, task_param):
@@ -167,6 +200,9 @@ def make_input_file(self, output_dir, task_type, task_param):
% incar["basis_type"]
)
raise RuntimeError(mess)
+ if "deepks_model" in incar:
+ model_file = os.path.split(incar["deepks_model"])[1]
+ self.modify_input(incar, "deepks_model", os.path.join("pp_orb", model_file))
abacus.write_input(os.path.join(output_dir, "../INPUT"), incar)
cwd = os.getcwd()
os.chdir(output_dir)
@@ -178,7 +214,15 @@ def make_input_file(self, output_dir, task_type, task_param):
os.chdir(cwd)
if "kspacing" in incar:
- kspacing = float(incar["kspacing"])
+ if isinstance(incar["kspacing"], str):
+ kspacing = [float(i) for i in incar["kspacing"].split()]
+ elif isinstance(incar["kspacing"], (int, float)):
+ kspacing = [incar["kspacing"]]
+ else:
+ kspacing = incar["kspacing"]
+ if len(kspacing) == 1:
+ kspacing = 3 * kspacing
+
if os.path.isfile(os.path.join(output_dir, "STRU")):
kpt = abacus.make_kspacing_kpt(
os.path.join(output_dir, "STRU"), kspacing
@@ -190,7 +234,7 @@ def make_input_file(self, output_dir, task_type, task_param):
kpt = cal_setting["K_POINTS"]
else:
mess = "K point information is not defined\n"
- mess += "You can set key word 'kspacing' (unit in 1/bohr) as a float value in INPUT\n"
+ mess += "You can set key word 'kspacing' (unit in 1/bohr) as one or three float value in INPUT\n"
mess += "or set key word 'K_POINTS' as a list in 'cal_setting', e.g. [1,2,3,0,0,0]\n"
raise RuntimeError(mess)
abacus.write_kpt(os.path.join(output_dir, "KPT"), kpt)
diff --git a/dpgen/auto_test/EOS.py b/dpgen/auto_test/EOS.py
index 6ccd60fb8..2ab57dfcf 100644
--- a/dpgen/auto_test/EOS.py
+++ b/dpgen/auto_test/EOS.py
@@ -76,7 +76,7 @@ def __init__(self, parameter, inter_param=None):
parameter["init_from_suffix"] = parameter.get("init_from_suffix", "00")
self.init_from_suffix = parameter["init_from_suffix"]
self.parameter = parameter
- self.inter_param = inter_param if inter_param != None else {"type": "vasp"}
+ self.inter_param = inter_param if inter_param is not None else {"type": "vasp"}
def make_confs(self, path_to_work, path_to_equi, refine=False):
path_to_work = os.path.abspath(path_to_work)
@@ -259,7 +259,7 @@ def _compute_lower(self, output_file, all_tasks, all_res):
res_data[vol] = task_result["energies"][-1] / sum(
task_result["atom_numbs"]
)
- ptr_data += "%7.3f %8.4f \n" % (
+ ptr_data += "{:7.3f} {:8.4f} \n".format(
vol,
task_result["energies"][-1] / sum(task_result["atom_numbs"]),
)
diff --git a/dpgen/auto_test/Elastic.py b/dpgen/auto_test/Elastic.py
index 0c98e44ab..298d0983c 100644
--- a/dpgen/auto_test/Elastic.py
+++ b/dpgen/auto_test/Elastic.py
@@ -50,7 +50,7 @@ def __init__(self, parameter, inter_param=None):
# parameter['reproduce'] = False
# self.reprod = parameter['reproduce']
self.parameter = parameter
- self.inter_param = inter_param if inter_param != None else {"type": "vasp"}
+ self.inter_param = inter_param if inter_param is not None else {"type": "vasp"}
def make_confs(self, path_to_work, path_to_equi, refine=False):
path_to_work = os.path.abspath(path_to_work)
@@ -205,7 +205,7 @@ def post_process(self, task_list):
if self.inter_param["type"] == "abacus":
input_aba = abacus_scf.get_abacus_input_parameters("INPUT")
if "kspacing" in input_aba:
- kspacing = float(input_aba["kspacing"])
+ kspacing = [float(i) for i in input_aba["kspacing"].split()]
kpt = abacus.make_kspacing_kpt(poscar_start, kspacing)
kpt += [0, 0, 0]
abacus.write_kpt("KPT", kpt)
@@ -221,7 +221,10 @@ def post_process(self, task_list):
kspacing = incar.get("KSPACING")
kgamma = incar.get("KGAMMA", False)
ret = vasp.make_kspacing_kpoints(poscar_start, kspacing, kgamma)
- kp = Kpoints.from_string(ret)
+ try:
+ kp = Kpoints.from_string(ret)
+ except AttributeError:
+ kp = Kpoints.from_str(ret)
if os.path.isfile("KPOINTS"):
os.remove("KPOINTS")
kp.write_file("KPOINTS")
diff --git a/dpgen/auto_test/Gamma.py b/dpgen/auto_test/Gamma.py
index 97eed3b1b..cb66ea52d 100644
--- a/dpgen/auto_test/Gamma.py
+++ b/dpgen/auto_test/Gamma.py
@@ -7,10 +7,8 @@
import numpy as np
from ase.lattice.cubic import BodyCenteredCubic as bcc
from ase.lattice.cubic import FaceCenteredCubic as fcc
-from ase.lattice.hexagonal import HexagonalClosedPacked as hcp
from monty.serialization import dumpfn, loadfn
from pymatgen.core.structure import Structure
-from pymatgen.core.surface import SlabGenerator
from pymatgen.io.ase import AseAtomsAdaptor
import dpgen.auto_test.lib.abacus as abacus
@@ -22,9 +20,7 @@
class Gamma(Property):
- """
- Calculation of common gamma lines for bcc and fcc
- """
+ """Calculation of common gamma lines for bcc and fcc."""
def __init__(self, parameter, inter_param=None):
parameter["reproduce"] = parameter.get("reproduce", False)
@@ -95,7 +91,7 @@ def __init__(self, parameter, inter_param=None):
parameter["init_from_suffix"] = parameter.get("init_from_suffix", "00")
self.init_from_suffix = parameter["init_from_suffix"]
self.parameter = parameter
- self.inter_param = inter_param if inter_param != None else {"type": "vasp"}
+ self.inter_param = inter_param if inter_param is not None else {"type": "vasp"}
def make_confs(self, path_to_work, path_to_equi, refine=False):
path_to_work = os.path.abspath(path_to_work)
@@ -359,7 +355,7 @@ def __poscar_fix(self, poscar) -> None:
+ fix_dict[self.add_fix[2]]
+ "\n"
)
- with open(poscar, "r") as fin1:
+ with open(poscar) as fin1:
contents = fin1.readlines()
contents.insert(insert_pos - 1, "Selective dynamics\n")
for ii in range(insert_pos, 0, 1):
@@ -387,7 +383,7 @@ def __inLammpes_fix(self, inLammps) -> None:
+ fix_dict[self.add_fix[2]]
+ "\n"
)
- with open(inLammps, "r") as fin1:
+ with open(inLammps) as fin1:
contents = fin1.readlines()
for ii in range(len(contents)):
upper = re.search("variable N equal count\(all\)", contents[ii])
diff --git a/dpgen/auto_test/Interstitial.py b/dpgen/auto_test/Interstitial.py
index b98f18d15..ae5befc5d 100644
--- a/dpgen/auto_test/Interstitial.py
+++ b/dpgen/auto_test/Interstitial.py
@@ -10,7 +10,6 @@
import dpgen.auto_test.lib.abacus as abacus
import dpgen.auto_test.lib.lammps as lammps
-import dpgen.generator.lib.abacus_scf as abacus_scf
from dpgen.auto_test.Property import Property
from dpgen.auto_test.refine import make_refine
from dpgen.auto_test.reproduce import make_repro, post_repro
@@ -76,7 +75,7 @@ def __init__(self, parameter, inter_param=None):
parameter["init_from_suffix"] = parameter.get("init_from_suffix", "00")
self.init_from_suffix = parameter["init_from_suffix"]
self.parameter = parameter
- self.inter_param = inter_param if inter_param != None else {"type": "vasp"}
+ self.inter_param = inter_param if inter_param is not None else {"type": "vasp"}
def make_confs(self, path_to_work, path_to_equi, refine=False):
path_to_work = os.path.abspath(path_to_work)
@@ -248,7 +247,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
num_atom = super_size * 2
chl = -num_atom - 2
os.chdir(path_to_work)
- with open("POSCAR", "r") as fin:
+ with open("POSCAR") as fin:
fin.readline()
scale = float(fin.readline().split()[0])
latt_param = float(fin.readline().split()[0])
@@ -257,7 +256,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
if not os.path.isfile("task.000000/POSCAR"):
raise RuntimeError("need task.000000 structure as reference")
- with open("task.000000/POSCAR", "r") as fin:
+ with open("task.000000/POSCAR") as fin:
pos_line = fin.read().split("\n")
super_latt_param = float(pos_line[2].split()[0])
@@ -467,13 +466,13 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
def post_process(self, task_list):
if True:
- fin1 = open(os.path.join(task_list[0], "..", "element.out"), "r")
+ fin1 = open(os.path.join(task_list[0], "..", "element.out"))
for ii in task_list:
conf = os.path.join(ii, "conf.lmp")
inter = os.path.join(ii, "inter.json")
insert_ele = fin1.readline().split()[0]
if os.path.isfile(conf):
- with open(conf, "r") as fin2:
+ with open(conf) as fin2:
conf_line = fin2.read().split("\n")
insert_line = conf_line[-2]
type_map = loadfn(inter)["type_map"]
@@ -505,9 +504,7 @@ def _compute_lower(self, output_file, all_tasks, all_res):
ptr_data = os.path.dirname(output_file) + "\n"
if not self.reprod:
- with open(
- os.path.join(os.path.dirname(output_file), "element.out"), "r"
- ) as fin:
+ with open(os.path.join(os.path.dirname(output_file), "element.out")) as fin:
fc = fin.read().split("\n")
ptr_data += "Insert_ele-Struct: Inter_E(eV) E(eV) equi_E(eV)\n"
idid = -1
@@ -528,7 +525,7 @@ def _compute_lower(self, output_file, all_tasks, all_res):
supercell_index = loadfn(os.path.join(ii, "supercell.json"))
# insert_ele = loadfn(os.path.join(ii, 'task.json'))['insert_ele'][0]
insert_ele = fc[idid]
- ptr_data += "%s: %7.3f %7.3f %7.3f \n" % (
+ ptr_data += "{}: {:7.3f} {:7.3f} {:7.3f} \n".format(
insert_ele + "-" + str(supercell_index) + "-" + structure_dir,
evac,
task_result["energies"][-1],
diff --git a/dpgen/auto_test/Lammps.py b/dpgen/auto_test/Lammps.py
index 1a3693807..38f3d623d 100644
--- a/dpgen/auto_test/Lammps.py
+++ b/dpgen/auto_test/Lammps.py
@@ -31,7 +31,6 @@ def __init__(self, inter_parameter, path_to_poscar):
self.set_inter_type_func()
def set_inter_type_func(self):
-
if self.inter_type == "deepmd":
self.inter_func = inter_deepmd
@@ -45,7 +44,6 @@ def set_inter_type_func(self):
self.inter_func = inter_eam_alloy
def set_model_param(self):
-
if self.inter_type == "deepmd":
model_name = os.path.basename(self.model)
deepmd_version = self.inter.get("deepmd_version", "1.2.0")
@@ -140,36 +138,40 @@ def make_input_file(self, output_dir, task_type, task_param):
# deal with user input in.lammps for relaxation
if os.path.isfile(self.in_lammps) and task_type == "relaxation":
- with open(self.in_lammps, "r") as fin:
+ with open(self.in_lammps) as fin:
fc = fin.read()
# user input in.lammps for property calculation
if "input_prop" in cal_setting and os.path.isfile(cal_setting["input_prop"]):
- with open(os.path.abspath(cal_setting["input_prop"]), "r") as fin:
+ with open(os.path.abspath(cal_setting["input_prop"])) as fin:
fc = fin.read()
else:
if "etol" in cal_setting:
dlog.info(
- "%s setting etol to %s"
- % (self.make_input_file.__name__, cal_setting["etol"])
+ "{} setting etol to {}".format(
+ self.make_input_file.__name__, cal_setting["etol"]
+ )
)
etol = cal_setting["etol"]
if "ftol" in cal_setting:
dlog.info(
- "%s setting ftol to %s"
- % (self.make_input_file.__name__, cal_setting["ftol"])
+ "{} setting ftol to {}".format(
+ self.make_input_file.__name__, cal_setting["ftol"]
+ )
)
ftol = cal_setting["ftol"]
if "maxiter" in cal_setting:
dlog.info(
- "%s setting maxiter to %s"
- % (self.make_input_file.__name__, cal_setting["maxiter"])
+ "{} setting maxiter to {}".format(
+ self.make_input_file.__name__, cal_setting["maxiter"]
+ )
)
maxiter = cal_setting["maxiter"]
if "maxeval" in cal_setting:
dlog.info(
- "%s setting maxeval to %s"
- % (self.make_input_file.__name__, cal_setting["maxeval"])
+ "{} setting maxeval to {}".format(
+ self.make_input_file.__name__, cal_setting["maxeval"]
+ )
)
maxeval = cal_setting["maxeval"]
@@ -302,7 +304,7 @@ def compute(self, output_dir):
force = []
virial = []
stress = []
- with open(dump_lammps, "r") as fin:
+ with open(dump_lammps) as fin:
dump = fin.read().split("\n")
dumptime = []
for idx, ii in enumerate(dump):
@@ -356,7 +358,7 @@ def compute(self, output_dir):
fz = float(dump[idx + 9 + jj].split()[7])
force[-1].append([fx, fy, fz])
- with open(log_lammps, "r") as fp:
+ with open(log_lammps) as fp:
if "Total wall time:" not in fp.read():
warnings.warn("lammps not finished " + log_lammps + " skip")
return None
diff --git a/dpgen/auto_test/Property.py b/dpgen/auto_test/Property.py
index e0fb4d3c1..61b94614b 100644
--- a/dpgen/auto_test/Property.py
+++ b/dpgen/auto_test/Property.py
@@ -11,8 +11,7 @@
class Property(ABC):
@abstractmethod
def __init__(self, parameter):
- """
- Constructor
+ """Constructor.
Parameters
----------
@@ -23,8 +22,7 @@ def __init__(self, parameter):
@abstractmethod
def make_confs(self, path_to_work, path_to_equi, refine=False):
- """
- Make configurations needed to compute the property.
+ """Make configurations needed to compute the property.
The tasks directory will be named as path_to_work/task.xxxxxx
IMPORTANT: handel the case when the directory exists.
@@ -47,31 +45,24 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
@abstractmethod
def post_process(self, task_list):
- """
- post_process the KPOINTS file in elastic.
- """
+ """post_process the KPOINTS file in elastic."""
pass
@property
@abstractmethod
def task_type(self):
- """
- Return the type of each computational task, for example, 'relaxation', 'static'....
- """
+ """Return the type of each computational task, for example, 'relaxation', 'static'...."""
pass
@property
@abstractmethod
def task_param(self):
- """
- Return the parameter of each computational task, for example, {'ediffg': 1e-4}
- """
+ """Return the parameter of each computational task, for example, {'ediffg': 1e-4}."""
pass
def compute(self, output_file, print_file, path_to_work):
- """
- Postprocess the finished tasks to compute the property.
- Output the result to a json database
+ """Postprocess the finished tasks to compute the property.
+ Output the result to a json database.
Parameters
----------
@@ -107,18 +98,18 @@ def compute(self, output_file, print_file, path_to_work):
@abstractmethod
def _compute_lower(self, output_file, all_tasks, all_res):
- """
- Compute the property.
+ """Compute the property.
Parameters
----------
- output_file:
+ output_file
The file to output the property
all_tasks : list of str
The list of directories to the tasks
all_res : list of str
The list of results
- Returns:
+
+ Returns
-------
res_data : dist
The dict storing the result of the property
diff --git a/dpgen/auto_test/Surface.py b/dpgen/auto_test/Surface.py
index da5770598..b04123cfb 100644
--- a/dpgen/auto_test/Surface.py
+++ b/dpgen/auto_test/Surface.py
@@ -11,7 +11,6 @@
import dpgen.auto_test.lib.abacus as abacus
import dpgen.auto_test.lib.vasp as vasp
-import dpgen.generator.lib.abacus_scf as abacus_scf
from dpgen import dlog
from dpgen.auto_test.Property import Property
from dpgen.auto_test.refine import make_refine
@@ -83,7 +82,7 @@ def __init__(self, parameter, inter_param=None):
parameter["init_from_suffix"] = parameter.get("init_from_suffix", "00")
self.init_from_suffix = parameter["init_from_suffix"]
self.parameter = parameter
- self.inter_param = inter_param if inter_param != None else {"type": "vasp"}
+ self.inter_param = inter_param if inter_param is not None else {"type": "vasp"}
def make_confs(self, path_to_work, path_to_equi, refine=False):
path_to_work = os.path.abspath(path_to_work)
diff --git a/dpgen/auto_test/Task.py b/dpgen/auto_test/Task.py
index 848a8bebd..f293eb0bf 100644
--- a/dpgen/auto_test/Task.py
+++ b/dpgen/auto_test/Task.py
@@ -4,8 +4,7 @@
class Task(ABC):
@abstractmethod
def __init__(self, inter_parameter, path_to_poscar):
- """
- Constructor
+ """Constructor.
Parameters
----------
@@ -18,11 +17,10 @@ def __init__(self, inter_parameter, path_to_poscar):
@abstractmethod
def make_potential_files(self, output_dir):
- """
- Prepare potential files for a computational task.
+ """Prepare potential files for a computational task.
For example, the VASP prepares POTCAR.
DeePMD prepares frozen model(s).
- IMPORTANT: Interaction should be stored in output_dir/inter.json
+ IMPORTANT: Interaction should be stored in output_dir/inter.json.
Parameters
----------
@@ -40,8 +38,7 @@ def make_potential_files(self, output_dir):
@abstractmethod
def make_input_file(self, output_dir, task_type, task_param):
- """
- Prepare input files for a computational task
+ """Prepare input files for a computational task
For example, the VASP prepares INCAR.
LAMMPS (including DeePMD, MEAM...) prepares in.lammps.
@@ -62,8 +59,7 @@ def make_input_file(self, output_dir, task_type, task_param):
@abstractmethod
def compute(self, output_dir):
- """
- Compute output of the task.
+ """Compute output of the task.
IMPORTANT: The output configuration should be converted and stored in a CONTCAR file.
Parameters
@@ -89,25 +85,19 @@ def compute(self, output_dir):
@staticmethod
@abstractmethod
def forward_files(self):
- """
- Return forward files.
- """
+ """Return forward files."""
pass
@property
@staticmethod
@abstractmethod
def forward_common_files(self):
- """
- Return forward common files.
- """
+ """Return forward common files."""
pass
@property
@staticmethod
@abstractmethod
def backward_files(self):
- """
- Return backward files.
- """
+ """Return backward files."""
pass
diff --git a/dpgen/auto_test/VASP.py b/dpgen/auto_test/VASP.py
index cf317a438..09c524ea6 100644
--- a/dpgen/auto_test/VASP.py
+++ b/dpgen/auto_test/VASP.py
@@ -41,7 +41,7 @@ def make_potential_files(self, output_dir):
for jj in ele_pot_list:
if ii == jj:
with open(
- os.path.join(self.potcar_prefix, self.potcars[jj]), "r"
+ os.path.join(self.potcar_prefix, self.potcars[jj])
) as fin:
for line in fin:
print(line.strip("\n"), file=fp)
@@ -54,7 +54,6 @@ def make_potential_files(self, output_dir):
if ii == jj:
with open(
os.path.join(self.potcar_prefix, self.potcars[jj]),
- "r",
) as fin:
for line in fin:
print(line.strip("\n"), file=fp)
@@ -137,36 +136,41 @@ def make_input_file(self, output_dir, task_type, task_param):
if "ediff" in cal_setting:
dlog.info(
- "%s setting EDIFF to %s"
- % (self.make_input_file.__name__, cal_setting["ediff"])
+ "{} setting EDIFF to {}".format(
+ self.make_input_file.__name__, cal_setting["ediff"]
+ )
)
incar["EDIFF"] = cal_setting["ediff"]
if "ediffg" in cal_setting:
dlog.info(
- "%s setting EDIFFG to %s"
- % (self.make_input_file.__name__, cal_setting["ediffg"])
+ "{} setting EDIFFG to {}".format(
+ self.make_input_file.__name__, cal_setting["ediffg"]
+ )
)
incar["EDIFFG"] = cal_setting["ediffg"]
if "encut" in cal_setting:
dlog.info(
- "%s setting ENCUT to %s"
- % (self.make_input_file.__name__, cal_setting["encut"])
+ "{} setting ENCUT to {}".format(
+ self.make_input_file.__name__, cal_setting["encut"]
+ )
)
incar["ENCUT"] = cal_setting["encut"]
if "kspacing" in cal_setting:
dlog.info(
- "%s setting KSPACING to %s"
- % (self.make_input_file.__name__, cal_setting["kspacing"])
+ "{} setting KSPACING to {}".format(
+ self.make_input_file.__name__, cal_setting["kspacing"]
+ )
)
incar["KSPACING"] = cal_setting["kspacing"]
if "kgamma" in cal_setting:
dlog.info(
- "%s setting KGAMMA to %s"
- % (self.make_input_file.__name__, cal_setting["kgamma"])
+ "{} setting KGAMMA to {}".format(
+ self.make_input_file.__name__, cal_setting["kgamma"]
+ )
)
incar["KGAMMA"] = cal_setting["kgamma"]
@@ -190,7 +194,10 @@ def make_input_file(self, output_dir, task_type, task_param):
os.symlink("../INCAR", "INCAR")
os.chdir(cwd)
ret = vasp.make_kspacing_kpoints(self.path_to_poscar, kspacing, kgamma)
- kp = Kpoints.from_string(ret)
+ try:
+ kp = Kpoints.from_string(ret)
+ except AttributeError:
+ kp = Kpoints.from_str(ret)
kp.write_file(os.path.join(output_dir, "KPOINTS"))
def compute(self, output_dir):
@@ -201,7 +208,7 @@ def compute(self, output_dir):
else:
ls = LabeledSystem(outcar)
stress = []
- with open(outcar, "r") as fin:
+ with open(outcar) as fin:
lines = fin.read().split("\n")
for line in lines:
if "in kB" in line:
diff --git a/dpgen/auto_test/Vacancy.py b/dpgen/auto_test/Vacancy.py
index 06a65d728..b298407d7 100644
--- a/dpgen/auto_test/Vacancy.py
+++ b/dpgen/auto_test/Vacancy.py
@@ -9,7 +9,6 @@
from pymatgen.core.structure import Structure
import dpgen.auto_test.lib.abacus as abacus
-import dpgen.generator.lib.abacus_scf as abacus_scf
from dpgen import dlog
from dpgen.auto_test.Property import Property
from dpgen.auto_test.refine import make_refine
@@ -75,7 +74,7 @@ def __init__(self, parameter, inter_param=None):
parameter["init_from_suffix"] = parameter.get("init_from_suffix", "00")
self.init_from_suffix = parameter["init_from_suffix"]
self.parameter = parameter
- self.inter_param = inter_param if inter_param != None else {"type": "vasp"}
+ self.inter_param = inter_param if inter_param is not None else {"type": "vasp"}
def make_confs(self, path_to_work, path_to_equi, refine=False):
path_to_work = os.path.abspath(path_to_work)
@@ -242,7 +241,7 @@ def _compute_lower(self, output_file, all_tasks, all_res):
evac = task_result["energies"][-1] - equi_epa * natoms
supercell_index = loadfn(os.path.join(ii, "supercell.json"))
- ptr_data += "%s: %7.3f %7.3f %7.3f \n" % (
+ ptr_data += "{}: {:7.3f} {:7.3f} {:7.3f} \n".format(
str(supercell_index) + "-" + structure_dir,
evac,
task_result["energies"][-1],
diff --git a/dpgen/auto_test/calculator.py b/dpgen/auto_test/calculator.py
index 90e800371..aba707b06 100644
--- a/dpgen/auto_test/calculator.py
+++ b/dpgen/auto_test/calculator.py
@@ -4,9 +4,7 @@
def make_calculator(inter_parameter, path_to_poscar):
- """
- Make an instance of Task
- """
+ """Make an instance of Task."""
inter_type = inter_parameter["type"]
if inter_type == "vasp":
return VASP(inter_parameter, path_to_poscar)
diff --git a/dpgen/auto_test/common_equi.py b/dpgen/auto_test/common_equi.py
index 2c0bfbf8e..bd37fb9e8 100644
--- a/dpgen/auto_test/common_equi.py
+++ b/dpgen/auto_test/common_equi.py
@@ -1,8 +1,6 @@
import glob
import os
import shutil
-import warnings
-from multiprocessing import Pool
from monty.serialization import dumpfn
from packaging.version import Version
@@ -183,7 +181,6 @@ def run_equi(confs, inter_param, mdata):
"API version %s has been removed. Please upgrade to 1.0." % api_version
)
elif Version(api_version) >= Version("1.0"):
-
submission = make_submission(
mdata_machine=machine,
mdata_resources=resources,
diff --git a/dpgen/auto_test/common_prop.py b/dpgen/auto_test/common_prop.py
index 1f3ea3461..1cd821a4a 100644
--- a/dpgen/auto_test/common_prop.py
+++ b/dpgen/auto_test/common_prop.py
@@ -1,6 +1,5 @@
import glob
import os
-import warnings
from multiprocessing import Pool
from packaging.version import Version
@@ -23,9 +22,7 @@
def make_property_instance(parameters, inter_param):
- """
- Make an instance of Property
- """
+ """Make an instance of Property."""
prop_type = parameters["type"]
if prop_type == "eos":
return EOS(parameters, inter_param)
diff --git a/dpgen/auto_test/gen_confs.py b/dpgen/auto_test/gen_confs.py
index 29cc02ba8..2c23ed101 100755
--- a/dpgen/auto_test/gen_confs.py
+++ b/dpgen/auto_test/gen_confs.py
@@ -5,7 +5,7 @@
import re
from pymatgen.analysis.structure_matcher import StructureMatcher
-from pymatgen.ext.matproj import Composition, MPRester
+from pymatgen.ext.matproj import MPRester
import dpgen.auto_test.lib.crys as crys
@@ -50,7 +50,7 @@ def gen_ele_std(ele_name, ctype):
def gen_element(ele_name, key):
- assert type(ele_name) == str
+ assert isinstance(ele_name, str)
mpr = MPRester(key)
data = mpr.query(
{"elements": [ele_name], "nelements": 1},
@@ -87,13 +87,12 @@ def gen_element(ele_name, key):
def gen_element_std(ele_name):
- assert type(ele_name) == str
+ assert isinstance(ele_name, str)
for ii in global_std_crystal.keys():
ss = gen_ele_std(ele_name, ii)
def gen_alloy(eles, key):
-
mpr = MPRester(key)
data = mpr.query(
@@ -137,10 +136,10 @@ def _main():
print("generate %s" % (args.elements))
if len(args.elements) == 1:
- gen_element(args.elements[0], key)
+ gen_element(args.elements[0], args.key)
# gen_element_std(args.elements[0])
else:
- gen_alloy(args.elements, key)
+ gen_alloy(args.elements, args.key)
if __name__ == "__main__":
diff --git a/dpgen/auto_test/lib/abacus.py b/dpgen/auto_test/lib/abacus.py
index b72eec33a..34b53af62 100644
--- a/dpgen/auto_test/lib/abacus.py
+++ b/dpgen/auto_test/lib/abacus.py
@@ -1,10 +1,12 @@
#!/usr/bin/python3
+import glob
import os
-import sys
-from unicodedata import numeric
import dpdata
import numpy as np
+from dpdata.abacus.scf import make_unlabeled_stru
+from dpdata.utils import uniq_atom_names
+from dpdata.vasp import poscar as dpdata_poscar
from pymatgen.core.structure import Structure
import dpgen.generator.lib.abacus_scf as abacus_scf
@@ -121,116 +123,6 @@
"Mt": 268,
"Rg": 272,
"Hs": 277,
- "H": 1.0079,
- "He": 4.0026,
- "Li": 6.941,
- "Be": 9.0122,
- "B": 10.811,
- "C": 12.0107,
- "N": 14.0067,
- "O": 15.9994,
- "F": 18.9984,
- "Ne": 20.1797,
- "Na": 22.9897,
- "Mg": 24.305,
- "Al": 26.9815,
- "Si": 28.0855,
- "P": 30.9738,
- "S": 32.065,
- "Cl": 35.453,
- "K": 39.0983,
- "Ar": 39.948,
- "Ca": 40.078,
- "Sc": 44.9559,
- "Ti": 47.867,
- "V": 50.9415,
- "Cr": 51.9961,
- "Mn": 54.938,
- "Fe": 55.845,
- "Ni": 58.6934,
- "Co": 58.9332,
- "Cu": 63.546,
- "Zn": 65.39,
- "Ga": 69.723,
- "Ge": 72.64,
- "As": 74.9216,
- "Se": 78.96,
- "Br": 79.904,
- "Kr": 83.8,
- "Rb": 85.4678,
- "Sr": 87.62,
- "Y": 88.9059,
- "Zr": 91.224,
- "Nb": 92.9064,
- "Mo": 95.94,
- "Tc": 98,
- "Ru": 101.07,
- "Rh": 102.9055,
- "Pd": 106.42,
- "Ag": 107.8682,
- "Cd": 112.411,
- "In": 114.818,
- "Sn": 118.71,
- "Sb": 121.76,
- "I": 126.9045,
- "Te": 127.6,
- "Xe": 131.293,
- "Cs": 132.9055,
- "Ba": 137.327,
- "La": 138.9055,
- "Ce": 140.116,
- "Pr": 140.9077,
- "Nd": 144.24,
- "Pm": 145,
- "Sm": 150.36,
- "Eu": 151.964,
- "Gd": 157.25,
- "Tb": 158.9253,
- "Dy": 162.5,
- "Ho": 164.9303,
- "Er": 167.259,
- "Tm": 168.9342,
- "Yb": 173.04,
- "Lu": 174.967,
- "Hf": 178.49,
- "Ta": 180.9479,
- "W": 183.84,
- "Re": 186.207,
- "Os": 190.23,
- "Ir": 192.217,
- "Pt": 195.078,
- "Au": 196.9665,
- "Hg": 200.59,
- "Tl": 204.3833,
- "Pb": 207.2,
- "Bi": 208.9804,
- "Po": 209,
- "At": 210,
- "Rn": 222,
- "Fr": 223,
- "Ra": 226,
- "Ac": 227,
- "Pa": 231.0359,
- "Th": 232.0381,
- "Np": 237,
- "U": 238.0289,
- "Am": 243,
- "Pu": 244,
- "Cm": 247,
- "Bk": 247,
- "Cf": 251,
- "Es": 252,
- "Fm": 257,
- "Md": 258,
- "No": 259,
- "Rf": 261,
- "Lr": 262,
- "Db": 262,
- "Bh": 264,
- "Sg": 266,
- "Mt": 268,
- "Rg": 272,
- "Hs": 277,
}
key_words_list = [
"ATOMIC_SPECIES",
@@ -242,18 +134,21 @@
]
-def poscar2stru(poscar, inter_param, stru):
- """
- - poscar: POSCAR for input
+def poscar2stru(poscar, inter_param, stru="STRU"):
+ """- poscar: POSCAR for input
- inter_param: dictionary of 'interaction' from param.json
some key words for ABACUS are:
- atom_masses: a dictionary of atoms' masses
- orb_files: a dictionary of orbital files
- deepks_desc: a string of deepks descriptor file
- - stru: output filename, usally is 'STRU'
+ - stru: output filename, usally is 'STRU'.
"""
- stru = dpdata.System(poscar, fmt="vasp/poscar")
- stru_data = stru.data
+ # if use dpdata.System, the structure will be rotated to make cell to be lower triangular
+ with open(poscar) as fp:
+ lines = [line.rstrip("\n") for line in fp]
+ stru_data = dpdata_poscar.to_system_data(lines)
+ stru_data = uniq_atom_names(stru_data)
+
atom_mass = []
pseudo = None
orb = None
@@ -291,26 +186,27 @@ def poscar2stru(poscar, inter_param, stru):
if "deepks_desc" in inter_param:
deepks_desc = "./pp_orb/%s\n" % inter_param["deepks_desc"]
- stru.to(
- "stru",
- "STRU",
- mass=atom_mass,
+ stru_string = make_unlabeled_stru(
+ data=stru_data,
+ frame_idx=0,
pp_file=pseudo,
numerical_orbital=orb,
numerical_descriptor=deepks_desc,
+ mass=atom_mass,
)
+ with open(stru, "w") as fp:
+ fp.write(stru_string)
def stru_fix_atom(struf, fix_atom=[True, True, True]):
- """
- ...
+ """...
ATOMIC_POSITIONS
Cartesian #Cartesian(Unit is LATTICE_CONSTANT)
Si #Name of element
0.0 #Magnetic for this element.
2 #Number of atoms
0.00 0.00 0.00 0 0 0 #x,y,z, move_x, move_y, move_z
- 0.25 0.25 0.25 0 0 0
+ 0.25 0.25 0.25 0 0 0.
"""
fix_xyz = ["0" if i else "1" for i in fix_atom]
if os.path.isfile(struf):
@@ -333,7 +229,7 @@ def stru_fix_atom(struf, fix_atom=[True, True, True]):
elif flag_atom_number:
flag_atom_number -= 1
x, y, z = lines[i].split()[:3]
- lines[i] = "%s %s %s %s %s %s\n" % tuple([x, y, z] + fix_xyz)
+ lines[i] = "{} {} {} {} {} {}\n".format(*tuple([x, y, z] + fix_xyz))
elif flag_read_coord_type and flag_read_atom_number:
flag_read_atom_number -= 1
elif not flag_read_atom_number:
@@ -349,7 +245,7 @@ def stru_fix_atom(struf, fix_atom=[True, True, True]):
def stru_scale(stru_in, stru_out, scale):
- with open(stru_in, "r") as fin:
+ with open(stru_in) as fin:
lines = fin.readlines()
for i in range(len(lines)):
if "LATTICE_CONSTANT" in lines[i]:
@@ -378,19 +274,24 @@ def write_input(inputf, inputdict):
def make_kspacing_kpt(struf, kspacing):
+ if isinstance(kspacing, (int, float)):
+ kspacing = [kspacing] * 3
+ elif isinstance(kspacing, list) and len(kspacing) == 1:
+ kspacing = 3 * kspacing
+ assert len(kspacing) == 3, "kspacing need 3 values"
stru_data = abacus_scf.get_abacus_STRU(struf)
cell = stru_data["cells"] / abacus_scf.bohr2ang
volume = abs(cell[0].dot(np.cross(cell[1], cell[2])))
- coef = 2 * np.pi / volume / kspacing
+ coef = [2 * np.pi / volume / i for i in kspacing]
kpt = [
- max(1, int(np.linalg.norm(np.cross(cell[x], cell[y])) * coef + 1))
- for x, y in [[1, 2], [2, 0], [0, 1]]
+ max(1, int(np.linalg.norm(np.cross(cell[ixy[0]], cell[ixy[1]])) * coef[i] + 1))
+ for i, ixy in enumerate([[1, 2], [2, 0], [0, 1]])
]
return kpt
def check_finished(fname):
- with open(fname, "r") as fp:
+ with open(fname) as fp:
return "Total Time :" in fp.read()
@@ -407,18 +308,25 @@ def final_stru(abacus_path):
calculation = line.split()[1]
elif "out_stru" in line and line.split()[0] == "out_stru":
out_stru = bool(line.split()[1])
- logf = os.path.join(abacus_path, "OUT.%s/running_%s.log" % (suffix, calculation))
+ logf = os.path.join(abacus_path, f"OUT.{suffix}/running_{calculation}.log")
if calculation in ["relax", "cell-relax"]:
- if not out_stru:
+ if os.path.isfile(os.path.join(abacus_path, "OUT.%s/STRU_ION_D" % suffix)):
return "OUT.%s/STRU_ION_D" % suffix
else:
- with open(logf) as f1:
- lines = f1.readlines()
- for i in range(1, len(lines)):
- if lines[-i][36:41] == "istep":
- max_step = int(lines[-i].split()[-1])
- break
- return "OUT.%s/STRU_ION%d_D" % (suffix, max_step)
+ # find the final name by STRU_ION*_D,
+ # for abacus version < v3.2.2, there has no STRU_ION_D file but has STRU_ION0_D STRU_ION1_D ... STRU_ION10_D ...
+ # so we need to find the last STRU_ION*_D file
+ stru_ions = glob.glob(
+ os.path.join(abacus_path, f"OUT.{suffix}/STRU_ION*_D")
+ )
+ if len(stru_ions) > 0:
+ # sort the file name by the number in the file name
+ stru_ions.sort(key=lambda x: int(x.split("_")[-2][3:]))
+ final_stru_ion = os.path.basename(stru_ions[-1])
+ return f"OUT.{suffix}/{final_stru_ion}"
+ else:
+ # if there has no STRU_ION_D, return the input STRU
+ return "STRU"
elif calculation == "md":
with open(logf) as f1:
lines = f1.readlines()
diff --git a/dpgen/auto_test/lib/lammps.py b/dpgen/auto_test/lib/lammps.py
index cb27a8e98..a1e387232 100644
--- a/dpgen/auto_test/lib/lammps.py
+++ b/dpgen/auto_test/lib/lammps.py
@@ -1,9 +1,6 @@
#!/usr/bin/env python3
import os
-import random
-import subprocess as sp
-import sys
import dpdata
from dpdata.periodic_table import Element
@@ -13,9 +10,8 @@
def cvt_lammps_conf(fin, fout, type_map, ofmt="lammps/data"):
- """
- Format convert from fin to fout, specify the output format by ofmt
- Imcomplete situation
+ """Format convert from fin to fout, specify the output format by ofmt
+ Imcomplete situation.
"""
supp_ofmt = ["lammps/dump", "lammps/data", "vasp/poscar"]
supp_exts = ["dump", "lmp", "poscar/POSCAR"]
@@ -26,7 +22,7 @@ def cvt_lammps_conf(fin, fout, type_map, ofmt="lammps/data"):
ofmt = "lammps/data"
elif "poscar" in fout or "POSCAR" in fout:
ofmt = "vasp/poscar"
- if not ofmt in supp_ofmt:
+ if ofmt not in supp_ofmt:
raise RuntimeError(
"output format " + ofmt + " is not supported. use one of " + str(supp_ofmt)
)
@@ -40,15 +36,14 @@ def cvt_lammps_conf(fin, fout, type_map, ofmt="lammps/data"):
def apply_type_map(conf_file, deepmd_type_map, ptypes):
- """
- apply type map.
+ """Apply type map.
conf_file: conf file converted from POSCAR
deepmd_type_map: deepmd atom type map
- ptypes: atom types defined in POSCAR
+ ptypes: atom types defined in POSCAR.
"""
natoms = _get_conf_natom(conf_file)
ntypes = len(deepmd_type_map)
- with open(conf_file, "r") as fp:
+ with open(conf_file) as fp:
lines = fp.read().split("\n")
# with open(conf_file+'.bk', 'w') as fp:
# fp.write("\n".join(lines))
@@ -85,7 +80,7 @@ def apply_type_map(conf_file, deepmd_type_map, ptypes):
def _get_ntype(conf):
- with open(conf, "r") as fp:
+ with open(conf) as fp:
lines = fp.read().split("\n")
for ii in lines:
if "atom types" in ii:
@@ -94,7 +89,7 @@ def _get_ntype(conf):
def _get_conf_natom(conf):
- with open(conf, "r") as fp:
+ with open(conf) as fp:
lines = fp.read().split("\n")
for ii in lines:
if "atoms" in ii:
@@ -194,7 +189,9 @@ def make_lammps_eval(conf, type_map, interaction, param):
ret += (
"thermo_style custom step pe pxx pyy pzz pxy pxz pyz lx ly lz vol c_mype\n"
)
- ret += "dump 1 all custom 100 dump.relax id type xs ys zs fx fy fz\n" # 06/09 give dump.relax
+ ret += (
+ "dump 1 all custom 100 dump.relax id type xs ys zs fx fy fz\n"
+ ) # 06/09 give dump.relax
ret += "run 0\n"
ret += "variable N equal count(all)\n"
ret += "variable V equal vol\n"
@@ -357,9 +354,7 @@ def make_lammps_press_relax(
ret += "variable bp equal %f\n" % bp
ret += "variable xx equal %f\n" % scale2equi
ret += "variable yeta equal 1.5*(${bp}-1)\n"
- ret += (
- "variable Px0 equal 3*${B0}*(1-${xx})/${xx}^2*exp(${yeta}*(1-${xx}))\n"
- )
+ ret += "variable Px0 equal 3*${B0}*(1-${xx})/${xx}^2*exp(${yeta}*(1-${xx}))\n"
ret += "variable Px equal ${Px0}*${GPa2bar}\n"
ret += "units metal\n"
ret += "dimension 3\n"
@@ -405,9 +400,7 @@ def make_lammps_press_relax(
def make_lammps_phonon(
conf, masses, interaction, param, etol=0, ftol=1e-10, maxiter=5000, maxeval=500000
):
- """
- make lammps input for elastic calculation
- """
+ """Make lammps input for elastic calculation."""
ret = ""
ret += "clear\n"
ret += "units metal\n"
@@ -426,7 +419,7 @@ def make_lammps_phonon(
def _get_epa(lines):
for ii in lines:
- if ("Final energy per atoms" in ii) and (not "print" in ii):
+ if ("Final energy per atoms" in ii) and ("print" not in ii):
return float(ii.split("=")[1].split()[0])
raise RuntimeError(
'cannot find key "Final energy per atoms" in lines, something wrong'
@@ -435,7 +428,7 @@ def _get_epa(lines):
def _get_vpa(lines):
for ii in lines:
- if ("Final volume per atoms" in ii) and (not "print" in ii):
+ if ("Final volume per atoms" in ii) and ("print" not in ii):
return float(ii.split("=")[1].split()[0])
raise RuntimeError(
'cannot find key "Final volume per atoms" in lines, something wrong'
@@ -444,7 +437,7 @@ def _get_vpa(lines):
def _get_natoms(lines):
for ii in lines:
- if ("Total number of atoms" in ii) and (not "print" in ii):
+ if ("Total number of atoms" in ii) and ("print" not in ii):
return int(ii.split("=")[1].split()[0])
raise RuntimeError(
'cannot find key "Total number of atoms" in lines, something wrong'
@@ -452,10 +445,8 @@ def _get_natoms(lines):
def get_nev(log):
- """
- get natoms, energy_per_atom and volume_per_atom from lammps log
- """
- with open(log, "r") as fp:
+ """Get natoms, energy_per_atom and volume_per_atom from lammps log."""
+ with open(log) as fp:
lines = fp.read().split("\n")
epa = _get_epa(lines)
vpa = _get_vpa(lines)
@@ -464,34 +455,28 @@ def get_nev(log):
def get_base_area(log):
- """
- get base area
- """
- with open(log, "r") as fp:
+ """Get base area."""
+ with open(log) as fp:
lines = fp.read().split("\n")
for ii in lines:
- if ("Final Base area" in ii) and (not "print" in ii):
+ if ("Final Base area" in ii) and ("print" not in ii):
return float(ii.split("=")[1].split()[0])
def get_stress(log):
- """
- get stress from lammps log
- """
- with open(log, "r") as fp:
+ """Get stress from lammps log."""
+ with open(log) as fp:
lines = fp.read().split("\n")
for ii in lines:
- if ("Final Stress" in ii) and (not "print" in ii):
+ if ("Final Stress" in ii) and ("print" not in ii):
vstress = [float(jj) for jj in ii.split("=")[1].split()]
stress = util.voigt_to_stress(vstress)
return stress
def poscar_from_last_dump(dump, poscar_out, deepmd_type_map):
- """
- get poscar from the last frame of a lammps MD traj (dump format)
- """
- with open(dump, "r") as fp:
+ """Get poscar from the last frame of a lammps MD traj (dump format)."""
+ with open(dump) as fp:
lines = fp.read().split("\n")
step_idx = -1
for idx, ii in enumerate(lines):
@@ -503,7 +488,7 @@ def poscar_from_last_dump(dump, poscar_out, deepmd_type_map):
fp.write("\n".join(lines[step_idx:]))
cvt_lammps_conf("tmp_dump", poscar_out, ofmt="vasp")
os.remove("tmp_dump")
- with open(poscar_out, "r") as fp:
+ with open(poscar_out) as fp:
lines = fp.read().split("\n")
types = [deepmd_type_map[int(ii.split("_")[1])] for ii in lines[5].split()]
lines[5] = " ".join(types)
@@ -512,15 +497,15 @@ def poscar_from_last_dump(dump, poscar_out, deepmd_type_map):
def check_finished_new(fname, keyword):
- with open(fname, "r") as fp:
+ with open(fname) as fp:
lines = fp.read().split("\n")
flag = False
for jj in lines:
- if (keyword in jj) and (not "print" in jj):
+ if (keyword in jj) and ("print" not in jj):
flag = True
return flag
def check_finished(fname):
- with open(fname, "r") as fp:
+ with open(fname) as fp:
return "Total wall time:" in fp.read()
diff --git a/dpgen/auto_test/lib/lmp.py b/dpgen/auto_test/lib/lmp.py
index 15705ec8a..e0894398a 100644
--- a/dpgen/auto_test/lib/lmp.py
+++ b/dpgen/auto_test/lib/lmp.py
@@ -170,7 +170,7 @@ def from_system_data(system):
ret += "0 %f xlo xhi\n" % system["cell"][0][0]
ret += "0 %f ylo yhi\n" % system["cell"][1][1]
ret += "0 %f zlo zhi\n" % system["cell"][2][2]
- ret += "%f %f %f xy xz yz\n" % (
+ ret += "{:f} {:f} {:f} xy xz yz\n".format(
system["cell"][1][0],
system["cell"][2][0],
system["cell"][2][1],
diff --git a/dpgen/auto_test/lib/mfp_eosfit.py b/dpgen/auto_test/lib/mfp_eosfit.py
index 148c9b5f8..c28b5651f 100755
--- a/dpgen/auto_test/lib/mfp_eosfit.py
+++ b/dpgen/auto_test/lib/mfp_eosfit.py
@@ -1,17 +1,13 @@
#!/usr/bin/env python3
-from __future__ import division
import argparse
import os
-import sys
import matplotlib.pyplot as plt
import numpy as np
-import scipy.integrate as INT
-from scipy.interpolate import *
-from scipy.misc import derivative
-from scipy.optimize import curve_fit, fsolve, leastsq, minimize, root
+from scipy.interpolate import BPoly, LSQUnivariateSpline, UnivariateSpline, interp1d
+from scipy.optimize import fsolve, leastsq
kb = 1.3806488e-23 # J K^-1
kb_ev = 8.6173324e-05 # eV K^-1
@@ -81,9 +77,8 @@ def res_murnaghan(pars, y, x):
def murnaghan(vol, pars):
- """
- Four-parameters murnaghan EOS.
- From PRB 28,5480 (1983)
+ """Four-parameters murnaghan EOS.
+ From PRB 28,5480 (1983).
"""
e0 = pars[0]
b0 = pars[1]
@@ -108,10 +103,9 @@ def res_birch(pars, y, x):
def birch(v, parameters):
- """
- From Intermetallic compounds: Principles and Practice, Vol. I: Princples
+ """From Intermetallic compounds: Principles and Practice, Vol. I: Princples
Chapter 9 pages 195-210 by M. Mehl. B. Klein, D. Papaconstantopoulos
- paper downloaded from Web
+ paper downloaded from Web.
case where n=0
"""
@@ -146,9 +140,7 @@ def calc_props_mBM4(pars):
def mBM4(vol, pars):
- """
- Birch-Murnaghan 4 pars equation from PRB 70, 224107, 3-order BM
- """
+ """Birch-Murnaghan 4 pars equation from PRB 70, 224107, 3-order BM."""
e0 = pars[0]
b0 = pars[1]
bp = pars[2]
@@ -171,9 +163,7 @@ def res_mBM5(pars, y, x):
def mBM5(vol, pars):
- """
- modified BM5 EOS, Shang SL comput mater sci, 2010: 1040-1048
- """
+ """Modified BM5 EOS, Shang SL comput mater sci, 2010: 1040-1048."""
e0 = pars[0]
b0 = pars[1]
bp = pars[2]
@@ -207,9 +197,7 @@ def res_mBM4poly(pars, y, x):
def mBM4poly(vol, parameters):
- """
- modified BM5 EOS, Shang SL comput mater sci, 2010: 1040-1048, original expressions.
- """
+ """Modified BM5 EOS, Shang SL comput mater sci, 2010: 1040-1048, original expressions."""
a = parameters[0]
b = parameters[1]
c = parameters[2]
@@ -283,9 +271,7 @@ def res_mBM5poly(pars, y, x):
def mBM5poly(vol, pars):
- """
- modified BM5 EOS, Shang SL comput mater sci, 2010: 1040-1048, original expressions.
- """
+ """Modified BM5 EOS, Shang SL comput mater sci, 2010: 1040-1048, original expressions."""
a = pars[0]
b = pars[1]
c = pars[2]
@@ -395,9 +381,7 @@ def calc_props_BM4(pars):
def BM4(vol, pars):
- """
- Birch-Murnaghan 4 pars equation from PRB 70, 224107, 3-order
- """
+ """Birch-Murnaghan 4 pars equation from PRB 70, 224107, 3-order."""
e0 = pars[0]
b0 = pars[1]
bp = pars[2]
@@ -416,9 +400,7 @@ def res_BM5(pars, y, x):
def BM5(vol, pars):
- """
- Birch-Murnaghan 5 pars equation from PRB 70, 224107, 4-Order
- """
+ """Birch-Murnaghan 5 pars equation from PRB 70, 224107, 4-Order."""
e0 = pars[0]
b0 = pars[1]
b0p = pars[2]
@@ -445,9 +427,8 @@ def BM5(vol, pars):
def rBM4(vol, pars):
- """
- Implementions as Alberto Otero-de-la-Roza, i.e. rBM4 is used here
- Comput Physics Comm, 2011, 182: 1708-1720
+ """Implementions as Alberto Otero-de-la-Roza, i.e. rBM4 is used here
+ Comput Physics Comm, 2011, 182: 1708-1720.
"""
e0 = pars[0]
b0 = pars[1]
@@ -466,10 +447,9 @@ def res_rBM4(pars, y, x):
def rBM4_pv(vol, pars):
- """
- Implementions as Alberto Otero-de-la-Roza, i.e. rBM4 is used here
+ """Implementions as Alberto Otero-de-la-Roza, i.e. rBM4 is used here
Comput Physics Comm, 2011, 182: 1708-1720
- Fit for V-P relations
+ Fit for V-P relations.
"""
e0 = pars[0]
b0 = pars[1]
@@ -482,15 +462,14 @@ def rBM4_pv(vol, pars):
return P
-def res_rBM4_pv(par, y, x):
+def res_rBM4_pv(pars, y, x):
res = y - rBM4_pv(x, pars)
return res
def rBM5(vol, pars):
- """
- Implementions as Alberto Otero-de-la-Roza, i.e. rBM5 is used here
- Comput Physics Comm, 2011, 182: 1708-1720
+ """Implementions as Alberto Otero-de-la-Roza, i.e. rBM5 is used here
+ Comput Physics Comm, 2011, 182: 1708-1720.
"""
e0 = pars[0]
b0 = pars[1]
@@ -514,10 +493,9 @@ def res_rBM5(pars, y, x):
def rBM5_pv(vol, pars):
- """
- Implementions as Alberto Otero-de-la-Roza, i.e. rBM5 is used here
+ """Implementions as Alberto Otero-de-la-Roza, i.e. rBM5 is used here
Comput Physics Comm, 2011, 182: 1708-1720
- Fit for V-P relations
+ Fit for V-P relations.
"""
e0 = pars[0]
b0 = pars[1]
@@ -538,7 +516,7 @@ def rBM5_pv(vol, pars):
return P
-def res_rBM5_pv(par, y, x):
+def res_rBM5_pv(pars, y, x):
res = y - rBM5_pv(x, pars)
return res
@@ -551,9 +529,7 @@ def res_universal(pars, y, x):
def universal(vol, parameters):
- """
- Universal equation of state(Vinet P et al., J. Phys.: Condens. Matter 1, p1941 (1989))
- """
+ """Universal equation of state(Vinet P et al., J. Phys.: Condens. Matter 1, p1941 (1989))."""
e0 = parameters[0]
b0 = parameters[1]
bp = parameters[2]
@@ -580,8 +556,7 @@ def res_LOG4(pars, y, x):
def LOG4(vol, pars):
- """
- Natrual strain (Poirier-Tarantola)EOS with 4 paramters
+ """Natrual strain (Poirier-Tarantola)EOS with 4 paramters
Seems only work in near-equillibrium range.
"""
e0 = pars[0]
@@ -622,8 +597,7 @@ def calc_props_LOG4(pars):
def rPT4(vol, pars):
- """
- Natrual strain EOS with 4 paramters
+ """Natrual strain EOS with 4 paramters
Seems only work in near-equillibrium range.
Implementions as Alberto Otero-de-la-Roza, i.e. rPT4 is used here
Comput Physics Comm, 2011, 182: 1708-1720,
@@ -647,8 +621,7 @@ def res_rPT4(pars, y, x):
def rPT4_pv(vol, pars):
- """
- Natrual strain (Poirier-Tarantola)EOS with 4 paramters
+ """Natrual strain (Poirier-Tarantola)EOS with 4 paramters
Seems only work in near-equillibrium range.
Implementions as Alberto Otero-de-la-Roza, i.e. rPT4 is used here
Comput Physics Comm, 2011, 182: 1708-1720,
@@ -677,9 +650,7 @@ def res_LOG5(pars, y, x):
def LOG5(vol, parameters):
- """
- Natrual strain (Poirier-Tarantola)EOS with 5 paramters
- """
+ """Natrual strain (Poirier-Tarantola)EOS with 5 paramters."""
e0 = parameters[0]
b0 = parameters[1]
b0p = parameters[2]
@@ -708,8 +679,7 @@ def LOG5(vol, parameters):
def rPT5(vol, pars):
- """
- Natrual strain EOS with 4 paramters
+ """Natrual strain EOS with 4 paramters
Seems only work in near-equillibrium range.
Implementions as Alberto Otero-de-la-Roza, i.e. rPT5 is used here
Comput Physics Comm, 2011, 182: 1708-1720,
@@ -738,8 +708,7 @@ def res_rPT5(pars, y, x):
def rPT5_pv(vol, pars):
- """
- Natrual strain (Poirier-Tarantola)EOS with 5 paramters
+ """Natrual strain (Poirier-Tarantola)EOS with 5 paramters
Implementions as Alberto Otero-de-la-Roza, i.e. rPT5 is used here
Comput Physics Comm, 2011, 182: 1708-1720,
in their article, labeled as PT3 (3-order), however, we mention it as
@@ -788,8 +757,7 @@ def calc_props_vinet(pars):
def vinet(vol, pars):
- """
- Vinet equation from PRB 70, 224107
+ """Vinet equation from PRB 70, 224107
Following, Shang Shunli et al., comput mater sci, 2010: 1040-1048, original expressions.
"""
e0 = pars[0]
@@ -816,14 +784,14 @@ def vinet_pv(vol, pars):
return P
-def res_vinet_pv(par, y, x):
+def res_vinet_pv(pars, y, x):
res = y - vinet(x, pars)
return res
# ----------------------------------------------------------------------------------------
def Li4p(V, parameters):
- """Li JH, APL, 87, 194111 (2005)"""
+ """Li JH, APL, 87, 194111 (2005)."""
E0 = parameters[0]
B0 = parameters[1]
BP = parameters[2]
@@ -884,9 +852,7 @@ def res_morse(p, en, volume):
def morse_AB(volume, p):
- """
- morse_AB EOS formula from Song's FVT souces
- """
+ """morse_AB EOS formula from Song's FVT souces."""
# p0 = [e0, b0, bp, v0, bpp]
E0 = p[0]
A = p[1]
@@ -909,9 +875,8 @@ def res_morse_AB(p, en, volume):
def morse_3p(volume, p):
- """
- morse_AB EOS formula from Song's FVT souces
- A= 0.5*B
+ """morse_AB EOS formula from Song's FVT souces
+ A= 0.5*B.
"""
# p0 = [e0, b0, bp, v0, bpp]
E0 = p[0]
@@ -935,8 +900,7 @@ def res_morse_3p(p, en, volume):
def morse_6p(vol, par):
- """
- Generalized Morse EOS proposed by Qin, see:
+ """Generalized Morse EOS proposed by Qin, see:
Qin et al. Phys Rev B, 2008, 78, 214108.
Qin et al. Phys Rev B, 2008, 77, 220103(R).
"""
@@ -985,9 +949,7 @@ def res_morse_6p(p, en, volume):
# ----------------------------------------------------------------------------------------
def mie(v, p):
- """
- Mie model for song's FVT
- """
+ """Mie model for song's FVT."""
# p0 = [e0, b0, bp, v0, bpp]
E0 = p[0]
m = p[1]
@@ -1006,9 +968,7 @@ def res_mie(p, e, v):
def mie_simple(v, p):
- """
- Mie_simple model for song's FVT
- """
+ """Mie_simple model for song's FVT."""
# p0 = [e0, b0, bp, v0, bpp]
E0 = p[0]
m = 4
@@ -1028,9 +988,8 @@ def res_mie_simple(p, e, v):
# ----------------------------------------------------------------------------------------
def TEOS(v, par):
- """
- Holland, et al, Journal of Metamorphic Geology, 2011, 29(3): 333-383
- Modified Tait equation of Huang & Chow
+ """Holland, et al, Journal of Metamorphic Geology, 2011, 29(3): 333-383
+ Modified Tait equation of Huang & Chow.
"""
e0 = par[0]
b0 = par[1]
@@ -1056,8 +1015,7 @@ def res_TEOS(p, e, v):
# ----------------------------------------------------------------------------------------
def SJX_v2(vol, par):
- """
- Sun Jiuxun, et al. J phys Chem Solids, 2005, 66: 773-782.
+ """Sun Jiuxun, et al. J phys Chem Solids, 2005, 66: 773-782.
They said it is satified for the limiting condition at high pressure.
"""
e0 = par[0]
@@ -1087,9 +1045,7 @@ def res_SJX_v2(p, e, v):
def SJX_5p(vol, par):
- """
- SJX_5p's five parameters EOS, Physica B: Condens Mater, 2011, 406: 1276-1282
- """
+ """SJX_5p's five parameters EOS, Physica B: Condens Mater, 2011, 406: 1276-1282."""
e0 = par[0]
a = par[1]
b = par[2]
@@ -1188,7 +1144,7 @@ def read_vlp(fin, fstart, fend):
cellc.append(c)
cellba.append(ba)
cellca.append(ca)
- print("\n** Vmin = %f, Vmax = %f" % (min(vol), max(vol)))
+ print(f"\n** Vmin = {min(vol):f}, Vmax = {max(vol):f}")
# some special conditions
if fstart <= 0:
@@ -1268,7 +1224,7 @@ def read_velp(fin, fstart, fend):
cellc.append(c)
cellba.append(ba)
cellca.append(ca)
- print("\n** Vmin = %f, Vmax = %f" % (min(vol), max(vol)))
+ print(f"\n** Vmin = {min(vol):f}, Vmax = {max(vol):f}")
# some special conditions
if fstart <= 0:
@@ -1351,8 +1307,7 @@ def repro_vp(func, vol_i, pars):
def ext_vec(
func, fin, p0, fs, fe, vols=None, vole=None, ndata=101, refit=0, show_fig=False
):
- """
- extrapolate the data points for E-V based on the fitted parameters in small or
+ """Extrapolate the data points for E-V based on the fitted parameters in small or
very large volume range.
"""
# read fitted-parameters
@@ -1381,7 +1336,7 @@ def ext_vec(
cax = cellca[-1]
else:
cax = sca(vx)
- fw.write("%f\t%f\t%f\n" % (vx, ex, cax))
+ fw.write(f"{vx:f}\t{ex:f}\t{cax:f}\n")
fw.flush()
fw.close()
@@ -1406,7 +1361,7 @@ def ext_splint(xp, yp, order=3, method="unispl"):
SPLINT = interp1d
return SPLINT(xp, yp, order, bounds_error=False)
elif method == "piecepoly":
- SPLINT = PiecewisePolynomial
+ SPLINT = BPoly.from_derivatives
return SPLINT(xp, yp, order)
else:
if method == "unispl":
@@ -1429,9 +1384,7 @@ def ext_velp(
fout="ext_velp.dat",
show_fig=False,
):
- """
- extrapolate the lattice parameters based on input data
- """
+ """Extrapolate the lattice parameters based on input data."""
# read file
vol, eng, cella, cellb, cellc, cellba, cellca = read_velp(fin, fstart, fend)
@@ -1488,8 +1441,7 @@ def ext_velp(
)
for i in range(ndata):
fw.write(
- "%12.6f\t%12.6f\t%12.6f\t%12.6f\t%12.6f\t%12.6f\t%12.6f\t%12.6f\n"
- % (
+ "{:12.6f}\t{:12.6f}\t{:12.6f}\t{:12.6f}\t{:12.6f}\t{:12.6f}\t{:12.6f}\t{:12.6f}\n".format(
vv[i],
ee[i],
cellaa[i],
@@ -1612,16 +1564,16 @@ def lsqfit_eos(
if func == "morse_AB":
e0, A, B, v0 = popt
print("%12s\t%12s\t%12s\t%12s" % ("V0(A**3)", "A", "B", "E0(eV)"))
- print("%12f\t%12f\t%12f\t%12f\n" % (v0, A, B, e0))
+ print(f"{v0:12f}\t{A:12f}\t{B:12f}\t{e0:12f}\n")
elif func == "morse_3p":
e0, A, v0 = popt
B = 0.5 * A
print("%12s\t%12s\t%12s\t%12s" % ("V0(A**3)", "A", "B", "E0(eV)"))
- print("%12f\t%12f\t%12f\t%12f\n" % (v0, A, B, e0))
+ print(f"{v0:12f}\t{A:12f}\t{B:12f}\t{e0:12f}\n")
elif func in ["mie", "mie_simple"]:
e0, m, n, v0 = popt
print("%12s\t%12s\t%12s\t%12s" % ("V0(A**3)", "m", "n", "E0(eV)"))
- print("%12f\t%12f\t%12f\t%12f\n" % (v0, m, n, e0))
+ print(f"{v0:12f}\t{m:12f}\t{n:12f}\t{e0:12f}\n")
elif func == "morse_6p":
e0, b0, bp, v0, bpp, m, n = calc_props_morse_6p(popt)
b0 = eV2GPa * b0
@@ -1630,9 +1582,7 @@ def lsqfit_eos(
"%12s\t%12s\t%12s\t%12s\t%12s\t%12s\t%12s"
% ("V0(A**3)", "B0(GPa)", "Bp", "E0(eV)", "Bpp(1/GPa)", "m", "n")
)
- print(
- "%12f\t%12f\t%12f\t%12f\t%12f\t%12f\t%12f\n" % (v0, b0, bp, e0, bpp, m, n)
- )
+ print(f"{v0:12f}\t{b0:12f}\t{bp:12f}\t{e0:12f}\t{bpp:12f}\t{m:12f}\t{n:12f}\n")
elif func == "SJX_5p":
e0, b0, bp, v0, n = calc_props_SJX_5p(popt)
b0 = eV2GPa * b0
@@ -1640,7 +1590,7 @@ def lsqfit_eos(
"%12s\t%12s\t%12s\t%12s\t%12s"
% ("V0(A**3)", "B0(GPa)", "Bp", "E0(eV)", "n")
)
- print("%12f\t%12f\t%12f\t%12f\t%12f\n" % (v0, b0, bp, e0, n))
+ print(f"{v0:12f}\t{b0:12f}\t{bp:12f}\t{e0:12f}\t{n:12f}\n")
elif func in ["mBM4poly", "mBM5poly", "mBM4", "LOG4", "vinet", "morse", "BM4"]:
prop_func = eval("calc_props_" + func)
e0, b0, bp, v0, bpp = prop_func(popt)
@@ -1650,7 +1600,7 @@ def lsqfit_eos(
"%12s\t%12s\t%12s\t%12s\t%12s"
% ("V0(A**3)", "B0(GPa)", "Bp", "E0(eV)", "Bpp(1/GPa)")
)
- print("%12f\t%12f\t%12f\t%12f\t%12f\n" % (v0, b0, bp, e0, bpp))
+ print(f"{v0:12f}\t{b0:12f}\t{bp:12f}\t{e0:12f}\t{bpp:12f}\n")
else:
e0, b0, bp, v0, bpp = popt
b0 = eV2GPa * b0
@@ -1659,7 +1609,7 @@ def lsqfit_eos(
"%12s\t%12s\t%12s\t%12s\t%12s"
% ("V0(A**3)", "B0(GPa)", "Bp", "E0(eV)", "Bpp(1/GPa)")
)
- print("%12f\t%12f\t%12f\t%12f\t%12f\n" % (v0, b0, bp, e0, bpp))
+ print(f"{v0:12f}\t{b0:12f}\t{bp:12f}\t{e0:12f}\t{bpp:12f}\n")
# write the fitted results in fit.out
fw = open(fout, "w+")
@@ -1712,12 +1662,13 @@ def lsqfit_eos(
)
for i in range(len(vol)):
fve.write(
- "%20f\t%20f\t%20f\t%20f\n"
- % (vol[i], repro_en[i], en[i], 100 * np.abs((en[i] - repro_en[i]) / en[i]))
+ "{:20f}\t{:20f}\t{:20f}\t{:20f}\n".format(
+ vol[i], repro_en[i], en[i], 100 * np.abs((en[i] - repro_en[i]) / en[i])
+ )
)
fve.flush()
p_tmp = repro_press[i]
- fvp.write("%20f\t%20f\t%20f\t%20f\n" % (vol[i], p_tmp, p_tmp / 100, p_tmp * 10))
+ fvp.write(f"{vol[i]:20f}\t{p_tmp:20f}\t{p_tmp / 100:20f}\t{p_tmp * 10:20f}\n")
fvp.flush()
fve.close()
fvp.close()
diff --git a/dpgen/auto_test/lib/pwscf.py b/dpgen/auto_test/lib/pwscf.py
index d3844497b..eb3efddcd 100644
--- a/dpgen/auto_test/lib/pwscf.py
+++ b/dpgen/auto_test/lib/pwscf.py
@@ -72,7 +72,7 @@ def _make_pwscf_03_config(sys_data):
cc = 0
for ii in range(ntypes):
for jj in range(atom_numbs[ii]):
- ret += "%s %f %f %f\n" % (
+ ret += "{} {:f} {:f} {:f}\n".format(
atom_names[ii],
coordinates[cc][0],
coordinates[cc][1],
@@ -116,7 +116,7 @@ def _make_smearing(fp_params):
degauss = fp_params["sigma"]
if (smearing is not None) and (smearing.split(":")[0] == "mp"):
smearing = "mp"
- if not (smearing in [None, "gauss", "mp", "fd"]):
+ if smearing not in [None, "gauss", "mp", "fd"]:
raise RuntimeError("unknow smearing method " + smearing)
return smearing, degauss
diff --git a/dpgen/auto_test/lib/util.py b/dpgen/auto_test/lib/util.py
index 62d5285a0..4e355fbd1 100644
--- a/dpgen/auto_test/lib/util.py
+++ b/dpgen/auto_test/lib/util.py
@@ -4,7 +4,6 @@
import numpy as np
import requests
-from dpgen import dlog
from dpgen.auto_test.lib import abacus, lammps, vasp
from dpgen.auto_test.lib.utils import cmd_append_log
@@ -28,16 +27,12 @@ def voigt_to_stress(inpt):
def insert_data(task, task_type, username, file_name):
assert task in ["eos", "elastic", "surf"]
assert task_type in ["vasp", "deepmd"]
- url = (
- "http://115.27.161.2:5000/insert_test_data?username=%s&expr_type=%s&data_type=%s"
- % (username, task_type, task)
- )
+ url = f"http://115.27.161.2:5000/insert_test_data?username={username}&expr_type={task_type}&data_type={task}"
res = requests.post(url, data=open(file_name).read())
print("Successful upload!")
def make_work_path(jdata, task, reprod_opt, static, user):
-
task_type = jdata["task_type"]
conf_dir = jdata["conf_dir"]
conf_path = os.path.abspath(conf_dir)
@@ -94,7 +89,6 @@ def get_machine_info(mdata, task_type):
def collect_task(all_task, task_type):
-
if task_type == "vasp":
output_file = "OUTCAR"
check_finished = vasp.check_finished
diff --git a/dpgen/auto_test/lib/utils.py b/dpgen/auto_test/lib/utils.py
index cba2f25fc..1fd4f7af7 100644
--- a/dpgen/auto_test/lib/utils.py
+++ b/dpgen/auto_test/lib/utils.py
@@ -29,7 +29,7 @@ def create_path(path):
def replace(file_name, pattern, subst):
- file_handel = open(file_name, "r")
+ file_handel = open(file_name)
file_string = file_handel.read()
file_handel.close()
file_string = re.sub(pattern, subst, file_string)
@@ -71,4 +71,4 @@ def log_task(message):
def record_iter(record, confs, ii, jj):
with open(record, "a") as frec:
- frec.write("%s %s %s\n" % (confs, ii, jj))
+ frec.write(f"{confs} {ii} {jj}\n")
diff --git a/dpgen/auto_test/lib/vasp.py b/dpgen/auto_test/lib/vasp.py
index 1aa0793b7..1cf72f47e 100644
--- a/dpgen/auto_test/lib/vasp.py
+++ b/dpgen/auto_test/lib/vasp.py
@@ -3,9 +3,8 @@
import warnings
import numpy as np
-from pymatgen.io.vasp import Incar, Kpoints, Potcar
+from pymatgen.io.vasp import Incar, Kpoints
-import dpgen.auto_test.lib.lammps as lammps
import dpgen.auto_test.lib.util as util
from dpgen.generator.lib.vasp import incar_upper
@@ -30,14 +29,14 @@ class OutcarItemError(Exception):
def regulate_poscar(poscar_in, poscar_out):
- with open(poscar_in, "r") as fp:
+ with open(poscar_in) as fp:
lines = fp.read().split("\n")
names = lines[5].split()
counts = [int(ii) for ii in lines[6].split()]
assert len(names) == len(counts)
uniq_name = []
for ii in names:
- if not (ii in uniq_name):
+ if ii not in uniq_name:
uniq_name.append(ii)
uniq_count = np.zeros(len(uniq_name), dtype=int)
for nn, cc in zip(names, counts):
@@ -63,7 +62,7 @@ def regulate_poscar(poscar_in, poscar_out):
def sort_poscar(poscar_in, poscar_out, new_names):
- with open(poscar_in, "r") as fp:
+ with open(poscar_in) as fp:
lines = fp.read().split("\n")
names = lines[5].split()
counts = [int(ii) for ii in lines[6].split()]
@@ -91,7 +90,7 @@ def sort_poscar(poscar_in, poscar_out, new_names):
def perturb_xz(poscar_in, poscar_out, pert=0.01):
- with open(poscar_in, "r") as fp:
+ with open(poscar_in) as fp:
lines = fp.read().split("\n")
zz = lines[4]
az = [float(ii) for ii in zz.split()]
@@ -113,9 +112,9 @@ def reciprocal_box(box):
def make_kspacing_kpoints(poscar, kspacing, kgamma):
- if type(kspacing) is not list:
+ if not isinstance(kspacing, list):
kspacing = [kspacing, kspacing, kspacing]
- with open(poscar, "r") as fp:
+ with open(poscar) as fp:
lines = fp.read().split("\n")
scale = float(lines[1])
box = []
@@ -135,7 +134,7 @@ def make_kspacing_kpoints(poscar, kspacing, kgamma):
def get_energies(fname):
if not check_finished(fname):
warnings.warn("incomplete outcar: " + fname)
- with open(fname, "r") as fp:
+ with open(fname) as fp:
lines = fp.read().split("\n")
try:
ener = _get_energies(lines)
@@ -147,7 +146,7 @@ def get_energies(fname):
def get_boxes(fname):
if not check_finished(fname):
warnings.warn("incomplete outcar: " + fname)
- with open(fname, "r") as fp:
+ with open(fname) as fp:
lines = fp.read().split("\n")
try:
ener = _get_boxes(lines)
@@ -159,7 +158,7 @@ def get_boxes(fname):
def get_nev(fname):
if not check_finished(fname):
warnings.warn("incomplete outcar: " + fname)
- with open(fname, "r") as fp:
+ with open(fname) as fp:
lines = fp.read().split("\n")
try:
natoms = _get_natoms(lines)
@@ -174,7 +173,7 @@ def get_nev(fname):
def get_stress(fname):
if not check_finished(fname):
warnings.warn("incomplete outcar: " + fname)
- with open(fname, "r") as fp:
+ with open(fname) as fp:
lines = fp.read().split("\n")
try:
stress = _get_stress(lines)[-1]
@@ -184,7 +183,7 @@ def get_stress(fname):
def check_finished(fname):
- with open(fname, "r") as fp:
+ with open(fname) as fp:
return "Elapsed time (sec):" in fp.read()
@@ -397,13 +396,13 @@ def make_vasp_phonon_incar(
def get_poscar_types(fname):
- with open(fname, "r") as fp:
+ with open(fname) as fp:
lines = fp.read().split("\n")
return lines[5].split()
def get_poscar_natoms(fname):
- with open(fname, "r") as fp:
+ with open(fname) as fp:
lines = fp.read().split("\n")
return [int(ii) for ii in lines[6].split()]
@@ -432,24 +431,24 @@ def _poscar_scale_cartesian(str_in, scale):
boxl = lines[ii].split()
boxv = [float(ii) for ii in boxl]
boxv = np.array(boxv) * scale
- lines[ii] = "%.16e %.16e %.16e\n" % (boxv[0], boxv[1], boxv[2])
+ lines[ii] = f"{boxv[0]:.16e} {boxv[1]:.16e} {boxv[2]:.16e}\n"
# scale coord
for ii in range(8, 8 + numb_atoms):
cl = lines[ii].split()
cv = [float(ii) for ii in cl]
cv = np.array(cv) * scale
- lines[ii] = "%.16e %.16e %.16e\n" % (cv[0], cv[1], cv[2])
+ lines[ii] = f"{cv[0]:.16e} {cv[1]:.16e} {cv[2]:.16e}\n"
return lines
def poscar_natoms(poscar_in):
- with open(poscar_in, "r") as fin:
+ with open(poscar_in) as fin:
lines = list(fin)
return _poscar_natoms(lines)
def poscar_scale(poscar_in, poscar_out, scale):
- with open(poscar_in, "r") as fin:
+ with open(poscar_in) as fin:
lines = list(fin)
if "D" == lines[7][0] or "d" == lines[7][0]:
lines = _poscar_scale_direct(lines, scale)
@@ -462,7 +461,7 @@ def poscar_scale(poscar_in, poscar_out, scale):
def poscar_vol(poscar_in):
- with open(poscar_in, "r") as fin:
+ with open(poscar_in) as fin:
lines = list(fin)
box = []
for ii in range(2, 5):
@@ -511,7 +510,10 @@ def make_vasp_kpoints_from_incar(work_dir, jdata):
assert os.path.exists("INCAR")
with open("INCAR") as fp:
incar = fp.read()
- standard_incar = incar_upper(Incar.from_string(incar))
+ try:
+ standard_incar = incar_upper(Incar.from_string(incar))
+ except AttributeError:
+ standard_incar = incar_upper(Incar.from_str(incar))
if fp_aniso_kspacing is None:
try:
kspacing = standard_incar["KSPACING"]
@@ -534,6 +536,9 @@ def make_vasp_kpoints_from_incar(work_dir, jdata):
assert os.path.exists("POSCAR")
# make kpoints
ret = make_kspacing_kpoints("POSCAR", kspacing, gamma)
- kp = Kpoints.from_string(ret)
+ try:
+ kp = Kpoints.from_string(ret)
+ except AttributeError:
+ kp = Kpoints.from_str(ret)
kp.write_file("KPOINTS")
os.chdir(cwd)
diff --git a/dpgen/auto_test/mpdb.py b/dpgen/auto_test/mpdb.py
index c6409013a..db1121e41 100644
--- a/dpgen/auto_test/mpdb.py
+++ b/dpgen/auto_test/mpdb.py
@@ -1,6 +1,5 @@
import os
-from pymatgen.core import Structure
from pymatgen.ext.matproj import MPRester, MPRestError
from dpgen import dlog
diff --git a/dpgen/auto_test/refine.py b/dpgen/auto_test/refine.py
index d44bd15d7..cd0fcd8f0 100644
--- a/dpgen/auto_test/refine.py
+++ b/dpgen/auto_test/refine.py
@@ -58,7 +58,7 @@ def make_refine(init_from_suffix, output_suffix, path_to_work):
os.symlink(os.path.relpath(init_poscar), POSCAR)
else:
raise FileNotFoundError(
- "no %s or %s in the init_from directory" % (CONTCAR, POSCAR)
+ f"no {CONTCAR} or {POSCAR} in the init_from directory"
)
os.chdir(cwd)
diff --git a/dpgen/auto_test/reproduce.py b/dpgen/auto_test/reproduce.py
index ce4c7483c..ada3102fb 100644
--- a/dpgen/auto_test/reproduce.py
+++ b/dpgen/auto_test/reproduce.py
@@ -46,7 +46,7 @@ def make_repro(
if os.path.exists(os.path.join(path_to_work, "element.out")):
os.remove(os.path.join(path_to_work, "element.out"))
fout_element = open(os.path.join(path_to_work, "element.out"), "a+")
- fin_element = open(os.path.join(init_data_path_todo, "element.out"), "r")
+ fin_element = open(os.path.join(init_data_path_todo, "element.out"))
for ii in init_data_task_todo:
# get frame number
@@ -153,7 +153,7 @@ def post_repro(
output_ener_tot.extend(output_task_result["energies"])
init_epa = init_ener[jj - idid] / natoms
- ptr_data += "%s %7.3f %7.3f %7.3f\n" % (
+ ptr_data += "{} {:7.3f} {:7.3f} {:7.3f}\n".format(
ii,
init_epa,
output_epa,
diff --git a/dpgen/collect/collect.py b/dpgen/collect/collect.py
index faadf6336..808341e6f 100644
--- a/dpgen/collect/collect.py
+++ b/dpgen/collect/collect.py
@@ -4,10 +4,8 @@
import glob
import json
import os
-import sys
import dpdata
-import numpy as np
from dpgen.generator.run import data_system_fmt
diff --git a/dpgen/data/arginfo.py b/dpgen/data/arginfo.py
index 6bbcd3fa1..37c9b1fa9 100644
--- a/dpgen/data/arginfo.py
+++ b/dpgen/data/arginfo.py
@@ -1,6 +1,4 @@
-from typing import Dict, List
-
-from dargs import Argument, ArgumentEncoder, Variant
+from dargs import Argument, Variant
from dpgen.arginfo import general_mdata_arginfo
@@ -38,22 +36,22 @@ def init_reaction_mdata_arginfo() -> Argument:
return general_mdata_arginfo("init_reaction_mdata", ("reaxff", "build", "fp"))
-def init_bulk_vasp_args() -> List[Argument]:
+def init_bulk_vasp_args() -> list[Argument]:
return []
-def init_bulk_abacus_args() -> List[Argument]:
+def init_bulk_abacus_args() -> list[Argument]:
doc_relax_kpt = 'Path of `KPT` file for relaxation in stage 1. Only useful if `init_fp_style` is "ABACUS".'
doc_md_kpt = 'Path of `KPT` file for MD simulations in stage 3. Only useful if `init_fp_style` is "ABACUS".'
doc_atom_masses = 'List of atomic masses of elements. The order should be the same as `Elements`. Only useful if `init_fp_style` is "ABACUS".'
return [
Argument("relax_kpt", str, optional=True, doc=doc_relax_kpt),
Argument("md_kpt", str, optional=True, doc=doc_md_kpt),
- Argument("atom_masses", list, optional=True, doc=doc_atom_masses),
+ Argument("atom_masses", list[float], optional=True, doc=doc_atom_masses),
]
-def init_bulk_variant_type_args() -> List[Variant]:
+def init_bulk_variant_type_args() -> list[Variant]:
doc_init_fp_style = "First-principle software. If this key is absent."
return [
Variant(
@@ -107,25 +105,25 @@ def init_bulk_jdata_arginfo() -> Argument:
"init_bulk_jdata",
dict,
[
- Argument("stages", list, optional=False, doc=doc_stages),
- Argument("elements", list, optional=False, doc=doc_elements),
- Argument("potcars", list, optional=True, doc=doc_potcars),
+ Argument("stages", list[int], optional=False, doc=doc_stages),
+ Argument("elements", list[str], optional=False, doc=doc_elements),
+ Argument("potcars", list[str], optional=True, doc=doc_potcars),
Argument("cell_type", str, optional=True, doc=doc_cell_type),
- Argument("super_cell", list, optional=False, doc=doc_super_cell),
+ Argument("super_cell", list[int], optional=False, doc=doc_super_cell),
Argument(
"from_poscar", bool, optional=True, default=False, doc=doc_from_poscar
),
Argument("from_poscar_path", str, optional=True, doc=doc_from_poscar_path),
Argument("relax_incar", str, optional=True, doc=doc_relax_incar),
Argument("md_incar", str, optional=True, doc=doc_md_incar),
- Argument("scale", list, optional=False, doc=doc_scale),
+ Argument("scale", list[float], optional=False, doc=doc_scale),
Argument("skip_relax", bool, optional=False, doc=doc_skip_relax),
Argument("pert_numb", int, optional=False, doc=doc_pert_numb),
Argument("pert_box", float, optional=False, doc=doc_pert_box),
Argument("pert_atom", float, optional=False, doc=doc_pert_atom),
Argument("md_nstep", int, optional=False, doc=doc_md_nstep),
Argument("coll_ndata", int, optional=False, doc=doc_coll_ndata),
- Argument("type_map", list, optional=True, doc=doc_type_map),
+ Argument("type_map", list[str], optional=True, doc=doc_type_map),
],
sub_variants=init_bulk_variant_type_args(),
doc=doc_init_bulk,
@@ -173,11 +171,11 @@ def init_surf_jdata_arginfo() -> Argument:
"init_surf_jdata",
dict,
[
- Argument("stages", list, optional=False, doc=doc_stages),
- Argument("elements", list, optional=False, doc=doc_elements),
- Argument("potcars", list, optional=True, doc=doc_potcars),
+ Argument("stages", list[int], optional=False, doc=doc_stages),
+ Argument("elements", list[str], optional=False, doc=doc_elements),
+ Argument("potcars", list[str], optional=True, doc=doc_potcars),
Argument("cell_type", str, optional=True, doc=doc_cell_type),
- Argument("super_cell", list, optional=False, doc=doc_super_cell),
+ Argument("super_cell", list[int], optional=False, doc=doc_super_cell),
Argument(
"from_poscar", bool, optional=True, default=False, doc=doc_from_poscar
),
@@ -187,13 +185,13 @@ def init_surf_jdata_arginfo() -> Argument:
Argument("z_min", int, optional=True, doc=doc_z_min),
Argument("vacuum_max", float, optional=False, doc=doc_vacuum_max),
Argument("vacuum_min", float, optional=True, doc=doc_vacuum_min),
- Argument("vacuum_resol", list, optional=False, doc=doc_vacuum_resol),
+ Argument("vacuum_resol", list[float], optional=False, doc=doc_vacuum_resol),
Argument("vacuum_numb", int, optional=True, doc=doc_vacuum_numb),
Argument("mid_point", float, optional=True, doc=doc_mid_point),
Argument("head_ratio", float, optional=True, doc=doc_head_ratio),
- Argument("millers", list, optional=False, doc=doc_millers),
+ Argument("millers", list[list[int]], optional=False, doc=doc_millers),
Argument("relax_incar", str, optional=True, doc=doc_relax_incar),
- Argument("scale", list, optional=False, doc=doc_scale),
+ Argument("scale", list[float], optional=False, doc=doc_scale),
Argument("skip_relax", bool, optional=False, doc=doc_skip_relax),
Argument("pert_numb", int, optional=False, doc=doc_pert_numb),
Argument("pert_box", float, optional=False, doc=doc_pert_box),
@@ -235,7 +233,7 @@ def init_reaction_jdata_arginfo() -> Argument:
"init_reaction_jdata",
dict,
[
- Argument("type_map", list, doc=doc_type_map),
+ Argument("type_map", list[str], doc=doc_type_map),
Argument(
"reaxff",
dict,
diff --git a/dpgen/data/gen.py b/dpgen/data/gen.py
index 14314ada8..27134ef64 100644
--- a/dpgen/data/gen.py
+++ b/dpgen/data/gen.py
@@ -2,16 +2,11 @@
import argparse
import glob
-import json
-import logging
import os
-import random
import re
import shutil
import subprocess as sp
import sys
-import time
-import warnings
import dpdata
import numpy as np
@@ -31,12 +26,12 @@
get_abacus_STRU,
make_abacus_scf_kpt,
make_abacus_scf_stru,
- make_kspacing_kpoints_stru,
make_supercell_abacus,
)
from dpgen.generator.lib.utils import symlink_user_forward_files
from dpgen.generator.lib.vasp import incar_upper
from dpgen.remote.decide_machine import convert_mdata
+from dpgen.util import load_file
def create_path(path, back=False):
@@ -62,7 +57,7 @@ def create_path(path, back=False):
def replace(file_name, pattern, subst):
- file_handel = open(file_name, "r")
+ file_handel = open(file_name)
file_string = file_handel.read()
file_handel.close()
file_string = re.sub(pattern, subst, file_string)
@@ -130,7 +125,7 @@ def poscar_ele(poscar_in, poscar_out, eles, natoms):
ele_line += str(ii) + " "
for ii in natoms:
natom_line += str(ii) + " "
- with open(poscar_in, "r") as fin:
+ with open(poscar_in) as fin:
lines = list(fin)
lines[5] = ele_line + "\n"
lines[6] = natom_line + "\n"
@@ -188,7 +183,7 @@ def poscar_natoms(lines):
def poscar_shuffle(poscar_in, poscar_out):
- with open(poscar_in, "r") as fin:
+ with open(poscar_in) as fin:
lines = list(fin)
numb_atoms = poscar_natoms(lines)
idx = np.arange(8, 8 + numb_atoms)
@@ -229,18 +224,18 @@ def poscar_scale_cartesian(str_in, scale):
boxl = lines[ii].split()
boxv = [float(ii) for ii in boxl]
boxv = np.array(boxv) * scale
- lines[ii] = "%.16e %.16e %.16e\n" % (boxv[0], boxv[1], boxv[2])
+ lines[ii] = f"{boxv[0]:.16e} {boxv[1]:.16e} {boxv[2]:.16e}\n"
# scale coord
for ii in range(8, 8 + numb_atoms):
cl = lines[ii].split()
cv = [float(ii) for ii in cl]
cv = np.array(cv) * scale
- lines[ii] = "%.16e %.16e %.16e\n" % (cv[0], cv[1], cv[2])
+ lines[ii] = f"{cv[0]:.16e} {cv[1]:.16e} {cv[2]:.16e}\n"
return lines
def poscar_scale(poscar_in, poscar_out, scale):
- with open(poscar_in, "r") as fin:
+ with open(poscar_in) as fin:
lines = list(fin)
if "D" == lines[7][0] or "d" == lines[7][0]:
lines = poscar_scale_direct(lines, scale)
@@ -366,7 +361,7 @@ def make_super_cell_poscar(jdata):
from_struct.to(to_file, "poscar")
# make system dir (copy)
- lines = open(to_file, "r").read().split("\n")
+ lines = open(to_file).read().split("\n")
natoms_str = lines[6]
natoms_list = [int(ii) for ii in natoms_str.split()]
dlog.info(natoms_list)
@@ -581,7 +576,7 @@ def make_abacus_relax(jdata, mdata):
) # a dictionary in which all of the values are strings
if "kspacing" not in standard_incar:
if "gamma_only" in standard_incar:
- if type(standard_incar["gamma_only"]) == str:
+ if isinstance(standard_incar["gamma_only"], str):
standard_incar["gamma_only"] = int(eval(standard_incar["gamma_only"]))
if standard_incar["gamma_only"] == 0:
if "relax_kpt" not in jdata:
@@ -715,13 +710,16 @@ def make_scale_ABACUS(jdata):
assert os.path.isfile(pos_src)
else:
try:
- pos_src = os.path.join(
- os.path.join(init_path, ii), "OUT.ABACUS/STRU_ION_D"
+ from dpgen.auto_test.lib.abacus import (
+ final_stru as abacus_final_stru,
)
+
+ pos_src = abacus_final_stru(os.path.join(init_path, ii))
+ pos_src = os.path.join(init_path, ii, pos_src)
assert os.path.isfile(pos_src)
except Exception:
raise RuntimeError(
- "not file %s, vasp relaxation should be run before scale poscar"
+ "Can not find STRU_ION_D in OUT.ABACUS!!!\nABACUS relaxation should be run before scale poscar"
)
scale_path = os.path.join(work_path, ii)
scale_path = os.path.join(scale_path, "scale-%.3f" % jj)
@@ -922,7 +920,7 @@ def make_abacus_md(jdata, mdata):
# "Cannot find any k-points information."
if "kspacing" not in standard_incar:
if "gamma_only" in standard_incar:
- if type(standard_incar["gamma_only"]) == str:
+ if isinstance(standard_incar["gamma_only"], str):
standard_incar["gamma_only"] = int(eval(standard_incar["gamma_only"]))
if standard_incar["gamma_only"] == 0:
if "md_kpt" not in jdata:
@@ -1079,7 +1077,7 @@ def coll_vasp_md(jdata):
# dlog.info("OUTCAR",outcar)
if os.path.isfile(outcar):
# dlog.info("*"*40)
- with open(outcar, "r") as fin:
+ with open(outcar) as fin:
nforce = fin.read().count("TOTAL-FORCE")
# dlog.info("nforce is", nforce)
# dlog.info("md_nstep", md_nstep)
@@ -1095,8 +1093,8 @@ def coll_vasp_md(jdata):
arg_cvt = " "
if len(valid_outcars) == 0:
raise RuntimeError(
- "MD dir: %s: find no valid outcar in sys %s, "
- "check if your vasp md simulation is correctly done" % (path_md, ii)
+ f"MD dir: {path_md}: find no valid outcar in sys {ii}, "
+ "check if your vasp md simulation is correctly done"
)
flag = True
@@ -1127,7 +1125,7 @@ def coll_vasp_md(jdata):
def _vasp_check_fin(ii):
if os.path.isfile(os.path.join(ii, "OUTCAR")):
- with open(os.path.join(ii, "OUTCAR"), "r") as fp:
+ with open(os.path.join(ii, "OUTCAR")) as fp:
content = fp.read()
count = content.count("Elapse")
if count != 1:
@@ -1233,8 +1231,8 @@ def coll_abacus_md(jdata):
arg_cvt = " "
if len(valid_outcars) == 0:
raise RuntimeError(
- "MD dir: %s: find no valid OUT.ABACUS in sys %s, "
- "check if your abacus md simulation is correctly done." % (path_md, ii)
+ f"MD dir: {path_md}: find no valid OUT.ABACUS in sys {ii}, "
+ "check if your abacus md simulation is correctly done."
)
flag = True
@@ -1467,22 +1465,9 @@ def run_abacus_md(jdata, mdata):
def gen_init_bulk(args):
- try:
- import ruamel
- from monty.serialization import dumpfn, loadfn
-
- warnings.simplefilter("ignore", ruamel.yaml.error.MantissaNoDotYAML1_1Warning)
- jdata = loadfn(args.PARAM)
- if args.MACHINE is not None:
- mdata = loadfn(args.MACHINE)
- except Exception:
- with open(args.PARAM, "r") as fp:
- jdata = json.load(fp)
- if args.MACHINE is not None:
- with open(args.MACHINE, "r") as fp:
- mdata = json.load(fp)
-
+ jdata = load_file(args.PARAM)
if args.MACHINE is not None:
+ mdata = load_file(args.MACHINE)
# Selecting a proper machine
mdata = convert_mdata(mdata, ["fp"])
# disp = make_dispatcher(mdata["fp_machine"])
diff --git a/dpgen/data/jsons/al.diamond.111.json b/dpgen/data/jsons/al.diamond.111.json
index ff015329f..8fe91110c 100644
--- a/dpgen/data/jsons/al.diamond.111.json
+++ b/dpgen/data/jsons/al.diamond.111.json
@@ -1,22 +1,36 @@
{
- "cell_type": "diamond",
- "latt": 2.5,
- "super_cell": [1, 1, 1],
- "elements": ["Al"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "diamond",
+ "latt": 2.5,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/al.diamond.222.json b/dpgen/data/jsons/al.diamond.222.json
index 693390f4c..ef9ff78c7 100644
--- a/dpgen/data/jsons/al.diamond.222.json
+++ b/dpgen/data/jsons/al.diamond.222.json
@@ -1,22 +1,36 @@
{
- "cell_type": "diamond",
- "latt": 2.5,
- "super_cell": [2, 2, 2],
- "elements": ["Al"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "diamond",
+ "latt": 2.5,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/al.fcc.111.json b/dpgen/data/jsons/al.fcc.111.json
index 4b0649d03..64ec32688 100644
--- a/dpgen/data/jsons/al.fcc.111.json
+++ b/dpgen/data/jsons/al.fcc.111.json
@@ -1,22 +1,36 @@
{
- "cell_type": "fcc",
- "latt": 4.04,
- "super_cell": [1, 1, 1],
- "elements": ["Al"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": true,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 4.04,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": true,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/al.fcc.222.json b/dpgen/data/jsons/al.fcc.222.json
index c23f6ebe6..901a43156 100644
--- a/dpgen/data/jsons/al.fcc.222.json
+++ b/dpgen/data/jsons/al.fcc.222.json
@@ -1,22 +1,36 @@
{
- "cell_type": "fcc",
- "latt": 4.04,
- "super_cell": [2, 2, 2],
- "elements": ["Al"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": true,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 4.04,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": true,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/al.hcp.111.json b/dpgen/data/jsons/al.hcp.111.json
index 493fed54e..b9aa495f8 100644
--- a/dpgen/data/jsons/al.hcp.111.json
+++ b/dpgen/data/jsons/al.hcp.111.json
@@ -1,22 +1,36 @@
{
- "cell_type": "hcp",
- "latt": 4.04,
- "super_cell": [1, 1, 1],
- "elements": ["Al"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.04,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/al.hcp.222.json b/dpgen/data/jsons/al.hcp.222.json
index ce057c5ef..85ecc8b9d 100644
--- a/dpgen/data/jsons/al.hcp.222.json
+++ b/dpgen/data/jsons/al.hcp.222.json
@@ -1,22 +1,36 @@
{
- "cell_type": "hcp",
- "latt": 4.04,
- "super_cell": [2, 2, 2],
- "elements": ["Al"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.04,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/al.hcp.332.json b/dpgen/data/jsons/al.hcp.332.json
index d16c2f1cc..990e13e4e 100644
--- a/dpgen/data/jsons/al.hcp.332.json
+++ b/dpgen/data/jsons/al.hcp.332.json
@@ -1,22 +1,36 @@
{
- "cell_type": "hcp",
- "latt": 4.04,
- "super_cell": [3, 3, 2],
- "elements": ["Al"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.04,
+ "super_cell": [
+ 3,
+ 3,
+ 2
+ ],
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/al.sc.222.json b/dpgen/data/jsons/al.sc.222.json
index 6ab46dd98..9b7d0ee1e 100644
--- a/dpgen/data/jsons/al.sc.222.json
+++ b/dpgen/data/jsons/al.sc.222.json
@@ -1,22 +1,36 @@
{
- "cell_type": "sc",
- "latt": 2.5,
- "super_cell": [2, 2, 2],
- "elements": ["Al"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "sc",
+ "latt": 2.5,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/almg.diamond.111.json b/dpgen/data/jsons/almg.diamond.111.json
index c41b905be..d6800a15e 100644
--- a/dpgen/data/jsons/almg.diamond.111.json
+++ b/dpgen/data/jsons/almg.diamond.111.json
@@ -1,23 +1,38 @@
{
- "cell_type": "diamond",
- "latt": 2.5,
- "super_cell": [1, 1, 1],
- "elements": ["Al", "Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
- "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 10,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "diamond",
+ "latt": 2.5,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 10,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/almg.diamond.222.json b/dpgen/data/jsons/almg.diamond.222.json
index b94c24b06..968f7a781 100644
--- a/dpgen/data/jsons/almg.diamond.222.json
+++ b/dpgen/data/jsons/almg.diamond.222.json
@@ -1,23 +1,38 @@
{
- "cell_type": "diamond",
- "latt": 2.5,
- "super_cell": [2, 2, 2],
- "elements": ["Al", "Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
- "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 10,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "diamond",
+ "latt": 2.5,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 10,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/almg.fcc.111.json b/dpgen/data/jsons/almg.fcc.111.json
index e6fb8d951..7a81d8f7a 100644
--- a/dpgen/data/jsons/almg.fcc.111.json
+++ b/dpgen/data/jsons/almg.fcc.111.json
@@ -1,23 +1,38 @@
{
- "cell_type": "fcc",
- "latt": 4.3,
- "super_cell": [1, 1, 1],
- "elements": ["Al", "Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
- "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 4.3,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/almg.fcc.222.json b/dpgen/data/jsons/almg.fcc.222.json
index dab0caf8f..526296e14 100644
--- a/dpgen/data/jsons/almg.fcc.222.json
+++ b/dpgen/data/jsons/almg.fcc.222.json
@@ -1,23 +1,38 @@
{
- "cell_type": "fcc",
- "latt": 4.3,
- "super_cell": [2, 2, 2],
- "elements": ["Al", "Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
- "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 10,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 4.3,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 10,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/almg.hcp.111.json b/dpgen/data/jsons/almg.hcp.111.json
index 9ef72bd4c..c3e6f959b 100644
--- a/dpgen/data/jsons/almg.hcp.111.json
+++ b/dpgen/data/jsons/almg.hcp.111.json
@@ -1,23 +1,38 @@
{
- "cell_type": "hcp",
- "latt": 4.3,
- "super_cell": [1, 1, 1],
- "elements": ["Al", "Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
- "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.3,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/almg.hcp.222.json b/dpgen/data/jsons/almg.hcp.222.json
index 1abe49cc5..bd294960e 100644
--- a/dpgen/data/jsons/almg.hcp.222.json
+++ b/dpgen/data/jsons/almg.hcp.222.json
@@ -1,23 +1,38 @@
{
- "cell_type": "hcp",
- "latt": 4.3,
- "super_cell": [2, 2, 2],
- "elements": ["Al", "Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
- "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 10,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.3,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 10,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/almg.hcp.332.json b/dpgen/data/jsons/almg.hcp.332.json
index 024c1eb21..a42c819d2 100644
--- a/dpgen/data/jsons/almg.hcp.332.json
+++ b/dpgen/data/jsons/almg.hcp.332.json
@@ -1,23 +1,38 @@
{
- "cell_type": "hcp",
- "latt": 4.3,
- "super_cell": [3, 3, 2],
- "elements": ["Al", "Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
- "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 10,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.3,
+ "super_cell": [
+ 3,
+ 3,
+ 2
+ ],
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 10,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/almg.sc.222.json b/dpgen/data/jsons/almg.sc.222.json
index c27f9fd82..f13f31309 100644
--- a/dpgen/data/jsons/almg.sc.222.json
+++ b/dpgen/data/jsons/almg.sc.222.json
@@ -1,23 +1,38 @@
{
- "cell_type": "sc",
- "latt": 2.5,
- "super_cell": [2, 2, 2],
- "elements": ["Al", "Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
- "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 10,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "sc",
+ "latt": 2.5,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 10,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/almg.sc.333.json b/dpgen/data/jsons/almg.sc.333.json
index 31bf2e42c..48434e6e9 100644
--- a/dpgen/data/jsons/almg.sc.333.json
+++ b/dpgen/data/jsons/almg.sc.333.json
@@ -1,23 +1,38 @@
{
- "cell_type": "sc",
- "latt": 2.5,
- "super_cell": [3, 3, 3],
- "elements": ["Al", "Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
- "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 10,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "sc",
+ "latt": 2.5,
+ "super_cell": [
+ 3,
+ 3,
+ 3
+ ],
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 10,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/mg.diamond.111.json b/dpgen/data/jsons/mg.diamond.111.json
index 27e9cf944..9cf5929cd 100644
--- a/dpgen/data/jsons/mg.diamond.111.json
+++ b/dpgen/data/jsons/mg.diamond.111.json
@@ -1,22 +1,36 @@
{
- "cell_type": "diamond",
- "latt": 3.3,
- "super_cell": [1, 1, 1],
- "elements": ["Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "diamond",
+ "latt": 3.3,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/mg.diamond.222.json b/dpgen/data/jsons/mg.diamond.222.json
index 91e371b20..3e57d89fb 100644
--- a/dpgen/data/jsons/mg.diamond.222.json
+++ b/dpgen/data/jsons/mg.diamond.222.json
@@ -1,22 +1,36 @@
{
- "cell_type": "diamond",
- "latt": 3.3,
- "super_cell": [2, 2, 2],
- "elements": ["Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "diamond",
+ "latt": 3.3,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/mg.fcc.111.json b/dpgen/data/jsons/mg.fcc.111.json
index aee62759b..4b410025d 100644
--- a/dpgen/data/jsons/mg.fcc.111.json
+++ b/dpgen/data/jsons/mg.fcc.111.json
@@ -1,22 +1,36 @@
{
- "cell_type": "fcc",
- "latt": 4.48,
- "super_cell": [1, 1, 1],
- "elements": ["Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": true,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 4.48,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": true,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/mg.fcc.222.json b/dpgen/data/jsons/mg.fcc.222.json
index dd42387a1..1c336433a 100644
--- a/dpgen/data/jsons/mg.fcc.222.json
+++ b/dpgen/data/jsons/mg.fcc.222.json
@@ -1,22 +1,36 @@
{
- "cell_type": "fcc",
- "latt": 4.48,
- "super_cell": [2, 2, 2],
- "elements": ["Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": true,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 4.48,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": true,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/mg.hcp.111.json b/dpgen/data/jsons/mg.hcp.111.json
index cc36f847f..de791a650 100644
--- a/dpgen/data/jsons/mg.hcp.111.json
+++ b/dpgen/data/jsons/mg.hcp.111.json
@@ -1,22 +1,36 @@
{
- "cell_type": "hcp",
- "latt": 4.48,
- "super_cell": [1, 1, 1],
- "elements": ["Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.48,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/mg.hcp.222.json b/dpgen/data/jsons/mg.hcp.222.json
index 54b06974a..228085b5e 100644
--- a/dpgen/data/jsons/mg.hcp.222.json
+++ b/dpgen/data/jsons/mg.hcp.222.json
@@ -1,20 +1,34 @@
{
- "cell_type": "hcp",
- "latt": 4.48,
- "super_cell": [2, 2, 2],
- "elements": ["Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.48,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/mg.hcp.332.json b/dpgen/data/jsons/mg.hcp.332.json
index d81ce2bfe..c072c16e3 100644
--- a/dpgen/data/jsons/mg.hcp.332.json
+++ b/dpgen/data/jsons/mg.hcp.332.json
@@ -1,20 +1,34 @@
{
- "cell_type": "hcp",
- "latt": 4.48,
- "super_cell": [3, 3, 2],
- "elements": ["Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.48,
+ "super_cell": [
+ 3,
+ 3,
+ 2
+ ],
+ "elements": [
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/mg.sc.222.json b/dpgen/data/jsons/mg.sc.222.json
index 137b39104..b05669cc3 100644
--- a/dpgen/data/jsons/mg.sc.222.json
+++ b/dpgen/data/jsons/mg.sc.222.json
@@ -1,22 +1,36 @@
{
- "cell_type": "sc",
- "latt": 2.7,
- "super_cell": [2, 2, 2],
- "elements": ["Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "sc",
+ "latt": 2.7,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/param.json b/dpgen/data/jsons/param.json
index 70eb96ea1..5527819e0 100644
--- a/dpgen/data/jsons/param.json
+++ b/dpgen/data/jsons/param.json
@@ -1,22 +1,40 @@
{
- "cell_type": "hcp",
- "latt": 4.03,
- "super_cell": [2, 1, 1],
- "elements": ["Al", "Mg"],
- "potcars": ["/gpfs/share/home/1600017784/start/data/POTCAR/Al/POTCAR",
- "/gpfs/share/home/1600017784/start/data/POTCAR/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": true,
- "relax_incar": "INCAR",
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 20,
- "_comment": "that's all",
- "stages":[1,2]
+ "cell_type": "hcp",
+ "latt": 4.03,
+ "super_cell": [
+ 2,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "potcars": [
+ "/gpfs/share/home/1600017784/start/data/POTCAR/Al/POTCAR",
+ "/gpfs/share/home/1600017784/start/data/POTCAR/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": true,
+ "relax_incar": "INCAR",
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 20,
+ "_comment1": "that's all",
+ "stages": [
+ 1,
+ 2
+ ]
}
diff --git a/dpgen/data/jsons/si.diamond.111.json b/dpgen/data/jsons/si.diamond.111.json
index b9c63547c..153435fec 100644
--- a/dpgen/data/jsons/si.diamond.111.json
+++ b/dpgen/data/jsons/si.diamond.111.json
@@ -1,22 +1,36 @@
{
- "cell_type": "diamond",
- "latt": 2.5,
- "super_cell": [1, 1, 1],
- "elements": ["Si"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "diamond",
+ "latt": 2.5,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Si"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/si.diamond.222.json b/dpgen/data/jsons/si.diamond.222.json
index a7dc5a8c6..8d648cad7 100644
--- a/dpgen/data/jsons/si.diamond.222.json
+++ b/dpgen/data/jsons/si.diamond.222.json
@@ -1,22 +1,36 @@
{
- "cell_type": "diamond",
- "latt": 2.5,
- "super_cell": [2, 2, 2],
- "elements": ["Si"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "diamond",
+ "latt": 2.5,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Si"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/si.fcc.111.json b/dpgen/data/jsons/si.fcc.111.json
index 2f13eda55..a63cbcc37 100644
--- a/dpgen/data/jsons/si.fcc.111.json
+++ b/dpgen/data/jsons/si.fcc.111.json
@@ -1,22 +1,36 @@
{
- "cell_type": "fcc",
- "latt": 4.04,
- "super_cell": [1, 1, 1],
- "elements": ["Si"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 4.04,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Si"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/si.fcc.222.json b/dpgen/data/jsons/si.fcc.222.json
index f0c1a620e..4c1a48548 100644
--- a/dpgen/data/jsons/si.fcc.222.json
+++ b/dpgen/data/jsons/si.fcc.222.json
@@ -1,22 +1,36 @@
{
- "cell_type": "fcc",
- "latt": 4.04,
- "super_cell": [2, 2, 2],
- "elements": ["Si"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 4.04,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Si"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/si.hcp.111.json b/dpgen/data/jsons/si.hcp.111.json
index fd65bd6e3..b3a66a6cd 100644
--- a/dpgen/data/jsons/si.hcp.111.json
+++ b/dpgen/data/jsons/si.hcp.111.json
@@ -1,22 +1,36 @@
{
- "cell_type": "hcp",
- "latt": 4.04,
- "super_cell": [1, 1, 1],
- "elements": ["Si"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.04,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Si"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/si.hcp.222.json b/dpgen/data/jsons/si.hcp.222.json
index b7dcd70d3..a6f7e2157 100644
--- a/dpgen/data/jsons/si.hcp.222.json
+++ b/dpgen/data/jsons/si.hcp.222.json
@@ -1,22 +1,36 @@
{
- "cell_type": "hcp",
- "latt": 4.04,
- "super_cell": [2, 2, 2],
- "elements": ["Si"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.04,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Si"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/si.sc.222.json b/dpgen/data/jsons/si.sc.222.json
index c1d015060..a136c51f8 100644
--- a/dpgen/data/jsons/si.sc.222.json
+++ b/dpgen/data/jsons/si.sc.222.json
@@ -1,22 +1,36 @@
{
- "cell_type": "sc",
- "latt": 2.5,
- "super_cell": [2, 2, 2],
- "elements": ["Si"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "sc",
+ "latt": 2.5,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "Si"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/surf.al.fcc.json b/dpgen/data/jsons/surf.al.fcc.json
index 17787a5bc..30efd029a 100644
--- a/dpgen/data/jsons/surf.al.fcc.json
+++ b/dpgen/data/jsons/surf.al.fcc.json
@@ -1,26 +1,40 @@
{
- "cell_type": "fcc",
- "latt": 4.04,
- "super_cell": [1, 1, 1],
- "z_min": 12,
- "vacuum_max": 9,
- "vacuum_resol": 0.2,
- "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
- "elements": ["Al"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 5,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 4.04,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "z_min": 12,
+ "vacuum_max": 9,
+ "vacuum_resol": 0.2,
+ "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 5,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/surf.al.hcp.json b/dpgen/data/jsons/surf.al.hcp.json
index 9bc1971ea..4c28934e7 100644
--- a/dpgen/data/jsons/surf.al.hcp.json
+++ b/dpgen/data/jsons/surf.al.hcp.json
@@ -1,26 +1,40 @@
{
- "cell_type": "hcp",
- "latt": 4.04,
- "super_cell": [1, 1, 1],
- "z_min": 12,
- "vacuum_max": 9,
- "vacuum_resol": 0.2,
- "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
- "elements": ["Al"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 5,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.04,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "z_min": 12,
+ "vacuum_max": 9,
+ "vacuum_resol": 0.2,
+ "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 5,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/surf.almg.fcc.json b/dpgen/data/jsons/surf.almg.fcc.json
index c1cc480cb..cda94f5ae 100644
--- a/dpgen/data/jsons/surf.almg.fcc.json
+++ b/dpgen/data/jsons/surf.almg.fcc.json
@@ -1,27 +1,42 @@
{
- "cell_type": "fcc",
- "latt": 4.04,
- "super_cell": [1, 1, 1],
- "z_min": 12,
- "vacuum_max": 9,
- "vacuum_resol": 0.2,
- "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
- "elements": ["Al", "Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
- "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 5,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 4.04,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "z_min": 12,
+ "vacuum_max": 9,
+ "vacuum_resol": 0.2,
+ "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 5,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/surf.almg.hcp.json b/dpgen/data/jsons/surf.almg.hcp.json
index bb83686a5..59fba4af5 100644
--- a/dpgen/data/jsons/surf.almg.hcp.json
+++ b/dpgen/data/jsons/surf.almg.hcp.json
@@ -1,27 +1,42 @@
{
- "cell_type": "hcp",
- "latt": 4.04,
- "super_cell": [1, 1, 1],
- "z_min": 12,
- "vacuum_max": 9,
- "vacuum_resol": 0.2,
- "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
- "elements": ["Al", "Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
- "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 5,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.04,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "z_min": 12,
+ "vacuum_max": 9,
+ "vacuum_resol": 0.2,
+ "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR",
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 5,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/surf.mg.fcc.json b/dpgen/data/jsons/surf.mg.fcc.json
index d6353e3e0..43a55b0af 100644
--- a/dpgen/data/jsons/surf.mg.fcc.json
+++ b/dpgen/data/jsons/surf.mg.fcc.json
@@ -1,26 +1,40 @@
{
- "cell_type": "fcc",
- "latt": 4.48,
- "super_cell": [1, 1, 1],
- "z_min": 12,
- "vacuum_max": 9,
- "vacuum_resol": 0.2,
- "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
- "elements": ["Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 5,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 4.48,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "z_min": 12,
+ "vacuum_max": 9,
+ "vacuum_resol": 0.2,
+ "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
+ "elements": [
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 5,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/surf.mg.hcp.json b/dpgen/data/jsons/surf.mg.hcp.json
index b18e8c365..c7c91d2df 100644
--- a/dpgen/data/jsons/surf.mg.hcp.json
+++ b/dpgen/data/jsons/surf.mg.hcp.json
@@ -1,26 +1,40 @@
{
- "cell_type": "hcp",
- "latt": 4.48,
- "super_cell": [1, 1, 1],
- "z_min": 12,
- "vacuum_max": 9,
- "vacuum_resol": 0.2,
- "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
- "elements": ["Mg"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 5,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.48,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "z_min": 12,
+ "vacuum_max": 9,
+ "vacuum_resol": 0.2,
+ "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
+ "elements": [
+ "Mg"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Mg/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 5,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/surf.si.diamond.json b/dpgen/data/jsons/surf.si.diamond.json
index fc374346d..725a9b90f 100644
--- a/dpgen/data/jsons/surf.si.diamond.json
+++ b/dpgen/data/jsons/surf.si.diamond.json
@@ -1,28 +1,58 @@
{
- "cell_type": "diamond",
- "latt": 2.5,
- "super_cell": [1, 1, 1],
- "z_min": 12,
- "vacuum_max": 9,
- "vacuum_resol": 0.2,
- "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
- "pymatgen_surf": true,
- "millers": [[0,0,1], [1,1,0], [1,1,1]],
- "elements": ["Si"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.06,
- "kgamma": false,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 5,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "diamond",
+ "latt": 2.5,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "z_min": 12,
+ "vacuum_max": 9,
+ "vacuum_resol": 0.2,
+ "lmp_cmd": "/home/wanghan/Soft/lammps/lammps-16Mar18/src/lmp_mpi",
+ "pymatgen_surf": true,
+ "millers": [
+ [
+ 0,
+ 0,
+ 1
+ ],
+ [
+ 1,
+ 1,
+ 0
+ ],
+ [
+ 1,
+ 1,
+ 1
+ ]
+ ],
+ "elements": [
+ "Si"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Si/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.06,
+ "kgamma": false,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 5,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/w.bcc.111.json b/dpgen/data/jsons/w.bcc.111.json
index 7d18285bd..210514e6c 100644
--- a/dpgen/data/jsons/w.bcc.111.json
+++ b/dpgen/data/jsons/w.bcc.111.json
@@ -1,24 +1,38 @@
{
- "cell_type": "bcc",
- "latt": 3.2,
- "super_cell": [1, 1, 1],
- "elements": ["W"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/W/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "ismear": 1,
- "sigma": 0.2,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 30,
- "pert_box": 0.005,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "bcc",
+ "latt": 3.2,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "W"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/W/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "ismear": 1,
+ "sigma": 0.2,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 30,
+ "pert_box": 0.005,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/w.bcc.222.json b/dpgen/data/jsons/w.bcc.222.json
index 6a3b223e1..0fa54012e 100644
--- a/dpgen/data/jsons/w.bcc.222.json
+++ b/dpgen/data/jsons/w.bcc.222.json
@@ -1,24 +1,38 @@
{
- "cell_type": "bcc",
- "latt": 3.173,
- "super_cell": [2, 2, 2],
- "elements": ["W"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/W/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "ismear": 1,
- "sigma": 0.2,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": true,
- "pert_numb": 100,
- "pert_box": 0.005,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "bcc",
+ "latt": 3.173,
+ "super_cell": [
+ 2,
+ 2,
+ 2
+ ],
+ "elements": [
+ "W"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/W/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "ismear": 1,
+ "sigma": 0.2,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": true,
+ "pert_numb": 100,
+ "pert_box": 0.005,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/w.diamond.111.json b/dpgen/data/jsons/w.diamond.111.json
index a0d04fc83..89ce0e8af 100644
--- a/dpgen/data/jsons/w.diamond.111.json
+++ b/dpgen/data/jsons/w.diamond.111.json
@@ -1,24 +1,38 @@
{
- "cell_type": "diamond",
- "latt": 2.5,
- "super_cell": [1, 1, 1],
- "elements": ["W"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/W/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "ismear": 1,
- "sigma": 0.2,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 30,
- "pert_box": 0.005,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "diamond",
+ "latt": 2.5,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "W"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/W/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "ismear": 1,
+ "sigma": 0.2,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 30,
+ "pert_box": 0.005,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/w.fcc.111.json b/dpgen/data/jsons/w.fcc.111.json
index e94ecaa56..705181620 100644
--- a/dpgen/data/jsons/w.fcc.111.json
+++ b/dpgen/data/jsons/w.fcc.111.json
@@ -1,24 +1,38 @@
{
- "cell_type": "fcc",
- "latt": 4.04,
- "super_cell": [1, 1, 1],
- "elements": ["W"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/W/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "ismear": 1,
- "sigma": 0.2,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 30,
- "pert_box": 0.005,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 4.04,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "W"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/W/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "ismear": 1,
+ "sigma": 0.2,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 30,
+ "pert_box": 0.005,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/w.hcp.111.json b/dpgen/data/jsons/w.hcp.111.json
index 033bd13b6..dc8093a63 100644
--- a/dpgen/data/jsons/w.hcp.111.json
+++ b/dpgen/data/jsons/w.hcp.111.json
@@ -1,24 +1,38 @@
{
- "cell_type": "hcp",
- "latt": 4.04,
- "super_cell": [1, 1, 1],
- "elements": ["W"],
- "potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/W/POTCAR"
- ],
- "encut": 600,
- "kspacing_relax": 0.16,
- "kspacing_md": 0.08,
- "kgamma": false,
- "ismear": 1,
- "sigma": 0.2,
- "scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06],
- "skip_relax": false,
- "pert_numb": 30,
- "pert_box": 0.005,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "cell_type": "hcp",
+ "latt": 4.04,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "W"
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/W/POTCAR"
+ ],
+ "encut": 600,
+ "kspacing_relax": 0.16,
+ "kspacing_md": 0.08,
+ "kgamma": false,
+ "ismear": 1,
+ "sigma": 0.2,
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 30,
+ "pert_box": 0.005,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/dpgen/data/jsons/water.111.json b/dpgen/data/jsons/water.111.json
index 4f5733a90..6cd01b135 100644
--- a/dpgen/data/jsons/water.111.json
+++ b/dpgen/data/jsons/water.111.json
@@ -1,29 +1,37 @@
{
- "_comment": "init poscars form a crystal structure",
- "cell_type": "diamond",
- "latt": 2.5,
- "elements": ["Si"],
- "_comment": "if set from poscar, the options above will be ignored",
- "from_poscar": true,
- "from_poscar_path": "ice6.POSCAR",
-
- "_comment": "",
- "super_cell": [1, 1, 1],
- "potcars": [ "/home/wanghan/Soft/vasp/potcar.52/potpaw_PBE.52/O/POTCAR",
- "/home/wanghan/Soft/vasp/potcar.52/potpaw_PBE.52/H/POTCAR"
- ],
- "encut": 900,
- "kspacing_relax": 0.75,
- "kspacing_md": 0.75,
- "kgamma": false,
- "scale": [1.0],
- "skip_relax": true,
- "pert_numb": 100,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "md_temp": 100,
- "md_nstep": 10,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "_comment1": "init poscars form a crystal structure",
+ "cell_type": "diamond",
+ "latt": 2.5,
+ "elements": [
+ "Si"
+ ],
+ "_comment2": "if set from poscar, the options above will be ignored",
+ "from_poscar": true,
+ "from_poscar_path": "ice6.POSCAR",
+ "_comment3": "",
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "potcars": [
+ "/home/wanghan/Soft/vasp/potcar.52/potpaw_PBE.52/O/POTCAR",
+ "/home/wanghan/Soft/vasp/potcar.52/potpaw_PBE.52/H/POTCAR"
+ ],
+ "encut": 900,
+ "kspacing_relax": 0.75,
+ "kspacing_md": 0.75,
+ "kgamma": false,
+ "scale": [
+ 1.0
+ ],
+ "skip_relax": true,
+ "pert_numb": 100,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "md_temp": 100,
+ "md_nstep": 10,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment4": "that's all"
}
diff --git a/dpgen/data/reaction.py b/dpgen/data/reaction.py
index 2df183796..f1d38bccd 100644
--- a/dpgen/data/reaction.py
+++ b/dpgen/data/reaction.py
@@ -1,17 +1,14 @@
-"""
-input: trajectory
+"""input: trajectory
00: ReaxFF MD (lammps)
01: build dataset (mddatasetbuilder)
02: fp (gaussian)
03: convert to deepmd data
-output: data
+output: data.
"""
import glob
-import json
import os
import random
-import warnings
import dpdata
@@ -19,7 +16,7 @@
from dpgen.dispatcher.Dispatcher import make_submission_compat
from dpgen.generator.run import create_path, make_fp_task_name
from dpgen.remote.decide_machine import convert_mdata
-from dpgen.util import normalize, sepline
+from dpgen.util import load_file, normalize, sepline
from .arginfo import init_reaction_jdata_arginfo
@@ -106,7 +103,7 @@ def run_reaxff(jdata, mdata, log_file="reaxff_log"):
def link_trj(jdata):
- """link lammpstrj"""
+ """Link lammpstrj."""
create_path(build_path)
task_path = os.path.join(build_path, "task.000")
create_path(task_path)
@@ -119,13 +116,9 @@ def link_trj(jdata):
def run_build_dataset(jdata, mdata, log_file="build_log"):
work_path = build_path
- # compatible with new dpdispatcher and old dpgen.dispatcher
- build_ntasks = mdata["build_resources"].get(
- "cpu_per_node", mdata["build_resources"]["task_per_node"]
- )
- fp_ntasks = mdata["fp_resources"].get(
- "cpu_per_node", mdata["fp_resources"]["task_per_node"]
- )
+ # only compatible with new dpdispatcher
+ build_ntasks = mdata["build_resources"]["cpu_per_node"]
+ fp_ntasks = mdata["fp_resources"]["cpu_per_node"]
build_command = '{cmd} -n {dataset_name} -a {type_map} -d {lammpstrj} -c {cutoff} -s {dataset_size} -k "{qmkeywords}" --nprocjob {nprocjob} --nproc {nproc}'.format(
cmd=mdata["build_command"],
type_map=" ".join(jdata["type_map"]),
@@ -215,20 +208,8 @@ def convert_data(jdata):
def gen_init_reaction(args):
- try:
- import ruamel
- from monty.serialization import dumpfn, loadfn
-
- warnings.simplefilter("ignore", ruamel.yaml.error.MantissaNoDotYAML1_1Warning)
- jdata = loadfn(args.PARAM)
- if args.MACHINE is not None:
- mdata = loadfn(args.MACHINE)
- except Exception:
- with open(args.PARAM, "r") as fp:
- jdata = json.load(fp)
- if args.MACHINE is not None:
- with open(args.MACHINE, "r") as fp:
- mdata = json.load(fp)
+ jdata = load_file(args.PARAM)
+ mdata = load_file(args.MACHINE)
jdata_arginfo = init_reaction_jdata_arginfo()
jdata = normalize(jdata_arginfo, jdata)
diff --git a/dpgen/data/surf.py b/dpgen/data/surf.py
index da1042bba..5194af5b3 100644
--- a/dpgen/data/surf.py
+++ b/dpgen/data/surf.py
@@ -2,19 +2,16 @@
import argparse
import glob
-import json
import os
import re
import shutil
import subprocess as sp
import sys
-import warnings
import numpy as np
from ase.build import general_surface
# -----ASE-------
-from ase.io import read
from pymatgen.core import Element, Structure
from pymatgen.io.ase import AseAtomsAdaptor
@@ -30,6 +27,7 @@
from dpgen.dispatcher.Dispatcher import make_submission_compat
from dpgen.generator.lib.utils import symlink_user_forward_files
from dpgen.remote.decide_machine import convert_mdata
+from dpgen.util import load_file
def create_path(path):
@@ -48,7 +46,7 @@ def create_path(path):
def replace(file_name, pattern, subst):
- file_handel = open(file_name, "r")
+ file_handel = open(file_name)
file_string = file_handel.read()
file_handel.close()
file_string = re.sub(pattern, subst, file_string)
@@ -126,7 +124,7 @@ def poscar_ele(poscar_in, poscar_out, eles, natoms):
ele_line += str(ii) + " "
for ii in natoms:
natom_line += str(ii) + " "
- with open(poscar_in, "r") as fin:
+ with open(poscar_in) as fin:
lines = list(fin)
lines[5] = ele_line + "\n"
lines[6] = natom_line + "\n"
@@ -142,13 +140,13 @@ def _poscar_natoms(lines):
def poscar_natoms(poscar_in):
- with open(poscar_in, "r") as fin:
+ with open(poscar_in) as fin:
lines = list(fin)
return _poscar_natoms(lines)
def poscar_shuffle(poscar_in, poscar_out):
- with open(poscar_in, "r") as fin:
+ with open(poscar_in) as fin:
lines = list(fin)
numb_atoms = _poscar_natoms(lines)
idx = np.arange(8, 8 + numb_atoms)
@@ -169,39 +167,8 @@ def poscar_scale_direct(str_in, scale):
return lines
-def poscar_scale_cartesian(str_in, scale):
- lines = str_in.copy()
- numb_atoms = _poscar_natoms(lines)
- # scale box
- for ii in range(2, 5):
- boxl = lines[ii].split()
- boxv = [float(ii) for ii in boxl]
- boxv = np.array(boxv) * scale
- lines[ii] = "%.16e %.16e %.16e\n" % (boxv[0], boxv[1], boxv[2])
- # scale coord
- for ii in range(8, 8 + numb_atoms):
- cl = lines[ii].split()
- cv = [float(ii) for ii in cl]
- cv = np.array(cv) * scale
- lines[ii] = "%.16e %.16e %.16e\n" % (cv[0], cv[1], cv[2])
- return lines
-
-
-def poscar_scale(poscar_in, poscar_out, scale):
- with open(poscar_in, "r") as fin:
- lines = list(fin)
- if "D" == lines[7][0] or "d" == lines[7][0]:
- lines = poscar_scale_direct(lines, scale)
- elif "C" == lines[7][0] or "c" == lines[7][0]:
- lines = poscar_scale_cartesian(lines, scale)
- else:
- raise RuntimeError("Unknow poscar style at line 7: %s" % lines[7])
- with open(poscar_out, "w") as fout:
- fout.write("".join(lines))
-
-
def poscar_elong(poscar_in, poscar_out, elong, shift_center=True):
- with open(poscar_in, "r") as fin:
+ with open(poscar_in) as fin:
lines = list(fin)
if lines[7][0].upper() != "C":
raise RuntimeError("only works for Cartesian POSCAR")
@@ -210,7 +177,7 @@ def poscar_elong(poscar_in, poscar_out, elong, shift_center=True):
boxzl = np.linalg.norm(boxz)
elong_ratio = elong / boxzl
boxz = boxz * (1.0 + elong_ratio)
- lines[4] = "%.16e %.16e %.16e\n" % (boxz[0], boxz[1], boxz[2])
+ lines[4] = f"{boxz[0]:.16e} {boxz[1]:.16e} {boxz[2]:.16e}\n"
if shift_center:
poscar_str = "".join(lines)
st = Structure.from_str(poscar_str, fmt="poscar")
@@ -228,7 +195,6 @@ def poscar_elong(poscar_in, poscar_out, elong, shift_center=True):
def make_unit_cell(jdata):
-
from_poscar = jdata.get("from_poscar", False)
if not from_poscar:
latt = jdata["latt"]
@@ -249,7 +215,6 @@ def make_unit_cell(jdata):
def make_super_cell_pymatgen(jdata):
-
make_unit_cell(jdata)
out_dir = jdata["out_dir"]
path_uc = os.path.join(out_dir, global_dirname_02)
@@ -417,15 +382,6 @@ def make_vasp_relax(jdata):
os.chdir(cwd)
-def poscar_scale_direct(str_in, scale):
- lines = str_in.copy()
- numb_atoms = _poscar_natoms(lines)
- pscale = float(lines[1])
- pscale = pscale * scale
- lines[1] = str(pscale) + "\n"
- return lines
-
-
def poscar_scale_cartesian(str_in, scale):
lines = str_in.copy()
numb_atoms = _poscar_natoms(lines)
@@ -434,18 +390,18 @@ def poscar_scale_cartesian(str_in, scale):
boxl = lines[ii].split()
boxv = [float(ii) for ii in boxl]
boxv = np.array(boxv) * scale
- lines[ii] = "%.16e %.16e %.16e\n" % (boxv[0], boxv[1], boxv[2])
+ lines[ii] = f"{boxv[0]:.16e} {boxv[1]:.16e} {boxv[2]:.16e}\n"
# scale coord
for ii in range(8, 8 + numb_atoms):
cl = lines[ii].split()
cv = [float(ii) for ii in cl]
cv = np.array(cv) * scale
- lines[ii] = "%.16e %.16e %.16e\n" % (cv[0], cv[1], cv[2])
+ lines[ii] = f"{cv[0]:.16e} {cv[1]:.16e} {cv[2]:.16e}\n"
return lines
def poscar_scale(poscar_in, poscar_out, scale):
- with open(poscar_in, "r") as fin:
+ with open(poscar_in) as fin:
lines = list(fin)
if "D" == lines[7][0] or "d" == lines[7][0]:
lines = poscar_scale_direct(lines, scale)
@@ -454,7 +410,10 @@ def poscar_scale(poscar_in, poscar_out, scale):
else:
raise RuntimeError("Unknow poscar style at line 7: %s" % lines[7])
- poscar = Poscar.from_string("".join(lines))
+ try:
+ poscar = Poscar.from_string("".join(lines))
+ except AttributeError:
+ poscar = Poscar.from_str("".join(lines))
with open(poscar_out, "w") as fout:
fout.write(poscar.get_string(direct=False))
@@ -584,7 +543,7 @@ def pert_scaled(jdata):
def _vasp_check_fin(ii):
if os.path.isfile(os.path.join(ii, "OUTCAR")):
- with open(os.path.join(ii, "OUTCAR"), "r") as fp:
+ with open(os.path.join(ii, "OUTCAR")) as fp:
content = fp.read()
count = content.count("Elapse")
if count != 1:
@@ -645,26 +604,14 @@ def run_vasp_relax(jdata, mdata):
def gen_init_surf(args):
- try:
- import ruamel
- from monty.serialization import dumpfn, loadfn
-
- warnings.simplefilter("ignore", ruamel.yaml.error.MantissaNoDotYAML1_1Warning)
- jdata = loadfn(args.PARAM)
- if args.MACHINE is not None:
- mdata = loadfn(args.MACHINE)
- except Exception:
- with open(args.PARAM, "r") as fp:
- jdata = json.load(fp)
- if args.MACHINE is not None:
- with open(args.MACHINE, "r") as fp:
- mdata = json.load(fp)
+ jdata = load_file(args.PARAM)
out_dir = out_dir_name(jdata)
jdata["out_dir"] = out_dir
dlog.info("# working dir %s" % out_dir)
if args.MACHINE is not None:
+ mdata = load_file(args.MACHINE)
# Decide a proper machine
mdata = convert_mdata(mdata, ["fp"])
# disp = make_dispatcher(mdata["fp_machine"])
diff --git a/dpgen/data/tools/bcc.py b/dpgen/data/tools/bcc.py
index a48baef07..9c471e36b 100644
--- a/dpgen/data/tools/bcc.py
+++ b/dpgen/data/tools/bcc.py
@@ -14,12 +14,12 @@ def poscar_unit(latt):
ret = ""
ret += "BCC : a = %f \n" % latt
ret += "%.16f\n" % (latt)
- ret += "%.16f %.16f %.16f\n" % (box[0][0], box[0][1], box[0][2])
- ret += "%.16f %.16f %.16f\n" % (box[1][0], box[1][1], box[1][2])
- ret += "%.16f %.16f %.16f\n" % (box[2][0], box[2][1], box[2][2])
+ ret += f"{box[0][0]:.16f} {box[0][1]:.16f} {box[0][2]:.16f}\n"
+ ret += f"{box[1][0]:.16f} {box[1][1]:.16f} {box[1][2]:.16f}\n"
+ ret += f"{box[2][0]:.16f} {box[2][1]:.16f} {box[2][2]:.16f}\n"
ret += "Type\n"
ret += "%d\n" % numb_atoms()
ret += "Direct\n"
- ret += "%.16f %.16f %.16f\n" % (0.0, 0.0, 0.0)
- ret += "%.16f %.16f %.16f\n" % (0.5, 0.5, 0.5)
+ ret += f"{0.0:.16f} {0.0:.16f} {0.0:.16f}\n"
+ ret += f"{0.5:.16f} {0.5:.16f} {0.5:.16f}\n"
return ret
diff --git a/dpgen/data/tools/cessp2force_lin.py b/dpgen/data/tools/cessp2force_lin.py
index aa6c91c3a..2a034247b 100755
--- a/dpgen/data/tools/cessp2force_lin.py
+++ b/dpgen/data/tools/cessp2force_lin.py
@@ -102,7 +102,7 @@ def scan_outcar_file(file_handle):
elif potcar:
return [configs, potcar, ipt]
else:
- sys.stderr.write("Could not determine atom types in file %s.\n" % filename)
+ sys.stderr.write("Could not determine atom types in file.\n")
sys.exit()
@@ -121,12 +121,12 @@ def process_outcar_file_v5_dev(
if outcars[i].endswith(".gz"):
f = gzip.open(outcars[i], "rb")
else:
- f = open(outcars[i], "r")
+ f = open(outcars[i])
# Writing current OUTCAR's information into potfit format files.
nconfs = data[i][0]
natoms = sum(data[i][2]) # ipt
- if windex == None:
+ if windex is None:
windex = range(nconfs)
if windex == "final":
windex = [nconfs - 1]
@@ -165,15 +165,9 @@ def process_outcar_file_v5_dev(
"## force file generated from file %s config %d\n"
% (outcars[i], count)
)
- fw.write(
- "#X %13.8f %13.8f %13.8f\n" % (box_x[0], box_x[1], box_x[2])
- )
- fw.write(
- "#Y %13.8f %13.8f %13.8f\n" % (box_y[0], box_y[1], box_y[2])
- )
- fw.write(
- "#Z %13.8f %13.8f %13.8f\n" % (box_z[0], box_z[1], box_z[2])
- )
+ fw.write(f"#X {box_x[0]:13.8f} {box_x[1]:13.8f} {box_x[2]:13.8f}\n")
+ fw.write(f"#Y {box_y[0]:13.8f} {box_y[1]:13.8f} {box_y[2]:13.8f}\n")
+ fw.write(f"#Z {box_z[0]:13.8f} {box_z[1]:13.8f} {box_z[2]:13.8f}\n")
fw.write("#W %f\n" % (args.weight))
fw.write("#E %.10f\n" % (energy))
if stress:
@@ -303,7 +297,7 @@ def Parser():
if item.endswith(".gz"):
f = gzip.open(item, "rb")
else:
- f = open(item, "r")
+ f = open(item)
data.append(scan_outcar_file(f))
f.close()
max_types = max(max_types, len(data[-1][1]))
@@ -350,7 +344,7 @@ def Parser():
# process all the outcar files
sr = args.configs_range
- if sr == None:
+ if sr is None:
windex = None
else:
sr = sr.split()
diff --git a/dpgen/data/tools/create_random_disturb.py b/dpgen/data/tools/create_random_disturb.py
index b8fb47dfa..8814c7ff9 100755
--- a/dpgen/data/tools/create_random_disturb.py
+++ b/dpgen/data/tools/create_random_disturb.py
@@ -3,8 +3,6 @@
import argparse
import glob
import os
-import shutil
-import sys
import ase.io
import numpy as np
@@ -56,7 +54,7 @@ def create_disturbs_ase(
# read-in by ase
atoms = ase.io.read(fin)
- natoms = atoms.get_number_of_atoms()
+ natoms = atoms.get_global_number_of_atoms()
pos0 = atoms.get_positions()
# creat nfile ofmt files.
@@ -121,7 +119,7 @@ def create_disturbs_ase_dev(
# read-in by ase
atoms = ase.io.read(fin)
- natoms = atoms.get_number_of_atoms()
+ natoms = atoms.get_global_number_of_atoms()
cell0 = atoms.get_cell()
# creat nfile ofmt files.
@@ -188,7 +186,7 @@ def create_disturbs_abacus_dev(
# read-in by ase
# atoms = ase.io.read(fin)
- # natoms = atoms.get_number_of_atoms()
+ # natoms = atoms.get_global_number_of_atoms()
# cell0 = atoms.get_cell()
stru = get_abacus_STRU(fin)
@@ -244,9 +242,7 @@ def create_disturbs_abacus_dev(
def create_random_alloys(fin, alloy_dist, ifmt="vasp", ofmt="vasp"):
- """
- In fact, atomsk also gives us the convinient tool to do this
- """
+ """In fact, atomsk also gives us the convinient tool to do this."""
# alloy_dist = {'Zr': 0.80, 'Nb': 0.20}
atomic_symbols = alloy_dist.keys()
atomic_ratios = alloy_dist.values()
diff --git a/dpgen/data/tools/diamond.py b/dpgen/data/tools/diamond.py
index 312872851..f4a2b52a3 100644
--- a/dpgen/data/tools/diamond.py
+++ b/dpgen/data/tools/diamond.py
@@ -19,20 +19,12 @@ def poscar_unit(latt):
ret = ""
ret += "DIAMOND\n"
ret += "%.16f\n" % (latt)
- ret += "%.16f %.16f %.16f\n" % (box[0][0], box[0][1], box[0][2])
- ret += "%.16f %.16f %.16f\n" % (box[1][0], box[1][1], box[1][2])
- ret += "%.16f %.16f %.16f\n" % (box[2][0], box[2][1], box[2][2])
+ ret += f"{box[0][0]:.16f} {box[0][1]:.16f} {box[0][2]:.16f}\n"
+ ret += f"{box[1][0]:.16f} {box[1][1]:.16f} {box[1][2]:.16f}\n"
+ ret += f"{box[2][0]:.16f} {box[2][1]:.16f} {box[2][2]:.16f}\n"
ret += "Type\n"
ret += "%d\n" % numb_atoms()
ret += "Direct\n"
- ret += "%.16f %.16f %.16f\n" % (
- 0.12500000000000,
- 0.12500000000000,
- 0.12500000000000,
- )
- ret += "%.16f %.16f %.16f\n" % (
- 0.87500000000000,
- 0.87500000000000,
- 0.87500000000000,
- )
+ ret += f"{0.12500000000000:.16f} {0.12500000000000:.16f} {0.12500000000000:.16f}\n"
+ ret += f"{0.87500000000000:.16f} {0.87500000000000:.16f} {0.87500000000000:.16f}\n"
return ret
diff --git a/dpgen/data/tools/fcc.py b/dpgen/data/tools/fcc.py
index f4576e3c4..80f0b476b 100644
--- a/dpgen/data/tools/fcc.py
+++ b/dpgen/data/tools/fcc.py
@@ -14,14 +14,14 @@ def poscar_unit(latt):
ret = ""
ret += "FCC : a = %f \n" % latt
ret += "%.16f\n" % (latt)
- ret += "%.16f %.16f %.16f\n" % (box[0][0], box[0][1], box[0][2])
- ret += "%.16f %.16f %.16f\n" % (box[1][0], box[1][1], box[1][2])
- ret += "%.16f %.16f %.16f\n" % (box[2][0], box[2][1], box[2][2])
+ ret += f"{box[0][0]:.16f} {box[0][1]:.16f} {box[0][2]:.16f}\n"
+ ret += f"{box[1][0]:.16f} {box[1][1]:.16f} {box[1][2]:.16f}\n"
+ ret += f"{box[2][0]:.16f} {box[2][1]:.16f} {box[2][2]:.16f}\n"
ret += "Type\n"
ret += "%d\n" % numb_atoms()
ret += "Direct\n"
- ret += "%.16f %.16f %.16f\n" % (0.0, 0.0, 0.0)
- ret += "%.16f %.16f %.16f\n" % (0.5, 0.5, 0.0)
- ret += "%.16f %.16f %.16f\n" % (0.5, 0.0, 0.5)
- ret += "%.16f %.16f %.16f\n" % (0.0, 0.5, 0.5)
+ ret += f"{0.0:.16f} {0.0:.16f} {0.0:.16f}\n"
+ ret += f"{0.5:.16f} {0.5:.16f} {0.0:.16f}\n"
+ ret += f"{0.5:.16f} {0.0:.16f} {0.5:.16f}\n"
+ ret += f"{0.0:.16f} {0.5:.16f} {0.5:.16f}\n"
return ret
diff --git a/dpgen/data/tools/hcp.py b/dpgen/data/tools/hcp.py
index 60c15f8aa..aeea4afc3 100644
--- a/dpgen/data/tools/hcp.py
+++ b/dpgen/data/tools/hcp.py
@@ -17,12 +17,12 @@ def poscar_unit(latt):
ret = ""
ret += "HCP : a = %f / sqrt(2)\n" % latt
ret += "%.16f\n" % (latt / np.sqrt(2))
- ret += "%.16f %.16f %.16f\n" % (box[0][0], box[0][1], box[0][2])
- ret += "%.16f %.16f %.16f\n" % (box[1][0], box[1][1], box[1][2])
- ret += "%.16f %.16f %.16f\n" % (box[2][0], box[2][1], box[2][2])
+ ret += f"{box[0][0]:.16f} {box[0][1]:.16f} {box[0][2]:.16f}\n"
+ ret += f"{box[1][0]:.16f} {box[1][1]:.16f} {box[1][2]:.16f}\n"
+ ret += f"{box[2][0]:.16f} {box[2][1]:.16f} {box[2][2]:.16f}\n"
ret += "Type\n"
ret += "%d\n" % numb_atoms()
ret += "Direct\n"
- ret += "%.16f %.16f %.16f\n" % (0, 0, 0)
- ret += "%.16f %.16f %.16f\n" % (1.0 / 3, 1.0 / 3, 1.0 / 2)
+ ret += f"{0:.16f} {0:.16f} {0:.16f}\n"
+ ret += f"{1.0 / 3:.16f} {1.0 / 3:.16f} {1.0 / 2:.16f}\n"
return ret
diff --git a/dpgen/data/tools/io_lammps.py b/dpgen/data/tools/io_lammps.py
index 35223c68b..f23045905 100755
--- a/dpgen/data/tools/io_lammps.py
+++ b/dpgen/data/tools/io_lammps.py
@@ -1,9 +1,7 @@
#!/usr/bin/env python3
-"""
-
-ASE Atoms convert to LAMMPS configuration
-Some functions are adapted from ASE lammpsrun.py
+"""ASE Atoms convert to LAMMPS configuration
+Some functions are adapted from ASE lammpsrun.py.
"""
@@ -13,12 +11,12 @@
def dir2car(v, A):
- """Direct to cartesian coordinates"""
+ """Direct to cartesian coordinates."""
return np.dot(v, A)
def car2dir(v, Ainv):
- """Cartesian to direct coordinates"""
+ """Cartesian to direct coordinates."""
return np.dot(v, Ainv)
@@ -44,25 +42,22 @@ def stress6_to_stress9(s6):
def is_upper_triangular(mat):
- """
- test if 3x3 matrix is upper triangular
- LAMMPS has a rule for cell matrix definition
+ """Test if 3x3 matrix is upper triangular
+ LAMMPS has a rule for cell matrix definition.
"""
def near0(x):
- """Test if a float is within .00001 of 0"""
+ """Test if a float is within .00001 of 0."""
return abs(x) < 0.00001
return near0(mat[1, 0]) and near0(mat[2, 0]) and near0(mat[2, 1])
def convert_cell(ase_cell):
- """
- Convert a parallel piped (forming right hand basis)
+ """Convert a parallel piped (forming right hand basis)
to lower triangular matrix LAMMPS can accept. This
- function transposes cell matrix so the bases are column vectors
+ function transposes cell matrix so the bases are column vectors.
"""
-
# if ase_cell is lower triangular, cell is upper tri-angular
cell = np.matrix.transpose(ase_cell)
@@ -168,7 +163,7 @@ def ase2lammpsdata(atoms, typeids=None, fout="out.lmp"):
fw.write("\n")
# write number of atoms
- natoms = atoms.get_number_of_atoms()
+ natoms = atoms.get_global_number_of_atoms()
fw.write("%d atoms\n" % natoms)
fw.write("\n")
@@ -190,10 +185,10 @@ def ase2lammpsdata(atoms, typeids=None, fout="out.lmp"):
xz = cell[2, 0]
yz = cell[2, 1]
- fw.write("%f\t%f\t xlo xhi\n" % (0, xhi))
- fw.write("%f\t%f\t ylo yhi\n" % (0, yhi))
- fw.write("%f\t%f\t zlo zhi\n" % (0, zhi))
- fw.write("%f\t%f\t%f\t xy xz yz\n" % (xy, xz, yz))
+ fw.write(f"{0:f}\t{xhi:f}\t xlo xhi\n")
+ fw.write(f"{0:f}\t{yhi:f}\t ylo yhi\n")
+ fw.write(f"{0:f}\t{zhi:f}\t zlo zhi\n")
+ fw.write(f"{xy:f}\t{xz:f}\t{yz:f}\t xy xz yz\n")
fw.write("\n")
# write mases
diff --git a/dpgen/data/tools/ovito_file_convert.py b/dpgen/data/tools/ovito_file_convert.py
index 5b3f19c7c..252b70b22 100755
--- a/dpgen/data/tools/ovito_file_convert.py
+++ b/dpgen/data/tools/ovito_file_convert.py
@@ -1,14 +1,10 @@
#!/usr/bin/env ovitos
-"""
-This Script is adapted from Alexander Stukowski, the author of OVITO.
+"""This Script is adapted from Alexander Stukowski, the author of OVITO.
See: http://forum.ovito.org/index.php?topic=131.0 for details.
"""
import argparse
-import os
-import sys
-import numpy as np
-from ovito.io import *
+from ovito.io import export_file, import_file
supp_ofmt = ["lammps_dump", "lammps_data", "vasp"]
supp_exts = ["dump", "lmp", "poscar/POSCAR"]
@@ -35,7 +31,7 @@
ofmt = "lammps_data"
elif ext == "poscar" or ext == "POSCAR":
ofmt = "vasp"
-if not ofmt in supp_ofmt:
+if ofmt not in supp_ofmt:
raise RuntimeError(
"output format " + ofmt + " is not supported. use one of " + str(supp_ofmt)
)
diff --git a/dpgen/data/tools/poscar_copy.py b/dpgen/data/tools/poscar_copy.py
index 24aab403b..fcae43ffe 100755
--- a/dpgen/data/tools/poscar_copy.py
+++ b/dpgen/data/tools/poscar_copy.py
@@ -2,9 +2,8 @@
import argparse
-import numpy as np
-from ovito.io import *
-from ovito.modifiers import *
+from ovito.io import export_file, import_file
+from ovito.modifiers import ShowPeriodicImagesModifier
def copy_system(ncopy, fin, fout):
diff --git a/dpgen/data/tools/sc.py b/dpgen/data/tools/sc.py
index 2c2c0671a..fff019d6d 100644
--- a/dpgen/data/tools/sc.py
+++ b/dpgen/data/tools/sc.py
@@ -14,11 +14,11 @@ def poscar_unit(latt):
ret = ""
ret += "SC : a = %f \n" % latt
ret += "%.16f\n" % (latt)
- ret += "%.16f %.16f %.16f\n" % (box[0][0], box[0][1], box[0][2])
- ret += "%.16f %.16f %.16f\n" % (box[1][0], box[1][1], box[1][2])
- ret += "%.16f %.16f %.16f\n" % (box[2][0], box[2][1], box[2][2])
+ ret += f"{box[0][0]:.16f} {box[0][1]:.16f} {box[0][2]:.16f}\n"
+ ret += f"{box[1][0]:.16f} {box[1][1]:.16f} {box[1][2]:.16f}\n"
+ ret += f"{box[2][0]:.16f} {box[2][1]:.16f} {box[2][2]:.16f}\n"
ret += "Type\n"
ret += "%d\n" % numb_atoms()
ret += "Direct\n"
- ret += "%.16f %.16f %.16f\n" % (0.0, 0.0, 0.0)
+ ret += f"{0.0:.16f} {0.0:.16f} {0.0:.16f}\n"
return ret
diff --git a/dpgen/database/__init__.py b/dpgen/database/__init__.py
index fadd65267..8352dda9b 100644
--- a/dpgen/database/__init__.py
+++ b/dpgen/database/__init__.py
@@ -1,2 +1,4 @@
from .entry import Entry
from .vasp import DPPotcar, VaspInput
+
+__all__ = ["Entry", "DPPotcar", "VaspInput"]
diff --git a/dpgen/database/entry.py b/dpgen/database/entry.py
index 41da89320..95563af9c 100644
--- a/dpgen/database/entry.py
+++ b/dpgen/database/entry.py
@@ -1,17 +1,11 @@
# /usr/bin/env python
-# coding: utf-8
# Copyright (c) The Dpmodeling Team.
import json
-import warnings
-from uuid import uuid4
-from dpdata import LabeledSystem, System
from monty.json import MontyDecoder, MontyEncoder, MSONable
from pymatgen.core.composition import Composition
-from dpgen.database.vasp import VaspInput
-
"""
This module implements equivalents of the basic Entry objects, which
is the basic entity that can be used to perform many analyses. Entries
@@ -21,10 +15,30 @@
class Entry(MSONable):
- """
- An lightweight Entry object containing key computed data
+ """An lightweight Entry object containing key computed data
for storing purpose.
+ Parameters
+ ----------
+ composition : Composition
+ Composition of the entry. For
+ flexibility, this can take the form of all the typical input
+ taken by a Composition, including a {symbol: amt} dict,
+ a string formula, and others.
+ inputs : dict
+ An dict of parameters associated with
+ the entry. Defaults to None.
+ data : dict
+ An dict of any additional data associated
+ with the entry. Defaults to None.
+ entry_id : obj
+ An optional id to uniquely identify the entry.
+ attribute :
+ Optional attribute of the entry. This can be used to
+ specify that the entry is a newly found compound, or to specify
+ a particular label for the entry, or else ... Used for further
+ analysis and plotting purposes. An attribute can be anything
+ but must be MSONable.
"""
def __init__(
@@ -37,25 +51,7 @@ def __init__(
attribute=None,
tag=None,
):
- """
- Initializes a Entry.
-
- Args:
- composition (Composition): Composition of the entry. For
- flexibility, this can take the form of all the typical input
- taken by a Composition, including a {symbol: amt} dict,
- a string formula, and others.
- inputs (dict): An dict of parameters associated with
- the entry. Defaults to None.
- data (dict): An dict of any additional data associated
- with the entry. Defaults to None.
- entry_id (obj): An optional id to uniquely identify the entry.
- attribute: Optional attribute of the entry. This can be used to
- specify that the entry is a newly found compound, or to specify
- a particular label for the entry, or else ... Used for further
- analysis and plotting purposes. An attribute can be anything
- but must be MSONable.
- """
+ """Initializes a Entry."""
self.composition = Composition(composition)
self.calculator = calculator
self.inputs = inputs
@@ -88,8 +84,8 @@ def number_element(self):
def __repr__(self):
output = [
- "Entry {} - {}".format(self.entry_id, self.composition.formula),
- "calculator: {}".format(self.calculator),
+ f"Entry {self.entry_id} - {self.composition.formula}",
+ f"calculator: {self.calculator}",
]
return "\n".join(output)
diff --git a/dpgen/database/run.py b/dpgen/database/run.py
index 722028b10..2930d3f70 100644
--- a/dpgen/database/run.py
+++ b/dpgen/database/run.py
@@ -1,17 +1,12 @@
# /usr/bin/env python
-# coding: utf-8
# Copyright (c) The Dpmodeling Team.
import json
import os
-import time
-import traceback
from glob import glob
-from threading import Thread
from uuid import uuid4
-import numpy as np
-from dpdata import LabeledSystem, System
+from dpdata import LabeledSystem
from monty.serialization import dumpfn, loadfn
from dpgen import SHORT_CMD, dlog
@@ -32,7 +27,7 @@ def db_run(args):
def _main(param):
- with open(param, "r") as fp:
+ with open(param) as fp:
jdata = json.load(fp)
calculator = jdata["calculator"]
path = jdata["path"]
@@ -55,7 +50,6 @@ def _main(param):
def parsing_vasp(path, config_info_dict, skip_init, output=OUTPUT, id_prefix=None):
-
fp_iters = os.path.join(path, ITERS_PAT)
dlog.debug(fp_iters)
f_fp_iters = glob(fp_iters)
@@ -83,7 +77,7 @@ def _parsing_vasp(paths, config_info_dict, id_prefix, iters=True):
iter_record = []
iter_record_new = []
try:
- with open("record.database", "r") as f_record:
+ with open("record.database") as f_record:
iter_record = [i.split()[0] for i in f_record.readlines()]
iter_record.sort()
dlog.info("iter_record")
@@ -114,14 +108,14 @@ def _parsing_vasp(paths, config_info_dict, id_prefix, iters=True):
iter_info = tmp_iter.split(".")[-1]
sys_info = path.split("/")[-4]
config_info_int = int(tmp_.split(".")[1])
- for (key, value) in config_info_dict.items():
+ for key, value in config_info_dict.items():
if config_info_int in value:
config_info = key
attrib["config_info"] = config_info
attrib["task_info"] = task_info
attrib["iter_info"] = iter_info
attrib["sys_info"] = sys_info
- with open(f_outcar, "r") as fin_outcar:
+ with open(f_outcar) as fin_outcar:
infile_outcar = fin_outcar.readlines()
for line in infile_outcar:
if "running on" in line:
diff --git a/dpgen/database/vasp.py b/dpgen/database/vasp.py
index dcbef299d..7b4f94d6a 100644
--- a/dpgen/database/vasp.py
+++ b/dpgen/database/vasp.py
@@ -1,5 +1,4 @@
# /usr/bin/env python
-# coding: utf-8
# Copyright (c) PThe Dpmodeling Team.
@@ -19,13 +18,13 @@
class DPPotcar(MSONable):
def __init__(self, symbols=None, functional="PBE", pp_file=None, pp_lists=None):
- if pp_lists and pp_file is None:
+ if pp_lists is not None and pp_file is None:
for pp in pp_lists:
assert isinstance(pp, PotcarSingle)
self.potcars = pp_lists
- elif pp_file and pp_list is None:
+ elif pp_file is not None and pp_lists is None:
self.potcars = Potcar.from_file(pp_file)
- elif pp_file and pp_list:
+ elif pp_file is not None and pp_lists is not None:
self.potcars = Potcar.from_file(pp_file)
else:
try:
@@ -84,7 +83,7 @@ def from_file(cls, filename):
potcars = Potcar.from_file(filename)
return cls(pp_lists=potcars)
except Exception:
- with open(filename, "r") as f:
+ with open(filename) as f:
content = f.readlines()
functional = content[0].strip().split(":")[-1].strip()
symbols = content[1].strip().split()
@@ -96,10 +95,10 @@ def write_file(self, filename):
class VaspInput(dict, MSONable):
- """
- Class to contain a set of vasp input objects corresponding to a run.
+ """Class to contain a set of vasp input objects corresponding to a run.
Args:
+ ----
incar: Incar object.
kpoints: Kpoints object.
poscar: Poscar object.
@@ -146,14 +145,16 @@ def from_dict(cls, d):
return cls(**sub_d)
def write_input(self, output_dir=".", make_dir_if_not_present=True):
- """
- Write VASP input to a directory.
-
- Args:
- output_dir (str): Directory to write to. Defaults to current
- directory (".").
- make_dir_if_not_present (bool): Create the directory if not
- present. Defaults to True.
+ """Write VASP input to a directory.
+
+ Parameters
+ ----------
+ output_dir : str
+ Directory to write to. Defaults to current
+ directory (".").
+ make_dir_if_not_present : bool
+ Create the directory if not
+ present. Defaults to True.
"""
if make_dir_if_not_present and not os.path.exists(output_dir):
os.makedirs(output_dir)
@@ -163,16 +164,18 @@ def write_input(self, output_dir=".", make_dir_if_not_present=True):
@staticmethod
def from_directory(input_dir, optional_files=None):
- """
- Read in a set of VASP input from a directory. Note that only the
+ """Read in a set of VASP input from a directory. Note that only the
standard INCAR, POSCAR, POTCAR and KPOINTS files are read unless
optional_filenames is specified.
- Args:
- input_dir (str): Directory to read VASP input from.
- optional_files (dict): Optional files to read in as well as a
- dict of {filename: Object type}. Object type must have a
- static method from_file.
+ Parameters
+ ----------
+ input_dir : str
+ Directory to read VASP input from.
+ optional_files : dict
+ Optional files to read in as well as a
+ dict of {filename: Object type}. Object type must have a
+ static method from_file.
"""
sub_d = {}
try:
diff --git a/dpgen/dispatcher/Dispatcher.py b/dpgen/dispatcher/Dispatcher.py
index c15c1f498..aad6ba6f8 100644
--- a/dpgen/dispatcher/Dispatcher.py
+++ b/dpgen/dispatcher/Dispatcher.py
@@ -1,10 +1,9 @@
import os
-from distutils.version import LooseVersion
-from typing import List
# import dargs
from dargs.dargs import Argument
from dpdispatcher import Machine, Resources, Submission, Task
+from packaging.version import Version
def make_submission(
@@ -20,9 +19,8 @@ def make_submission(
outlog,
errlog,
):
-
- if mdata_machine["local_root"] != "./":
- raise RuntimeError(f"local_root must be './' in dpgen's machine.json.")
+ if mdata_machine.get("local_root", "./") != "./":
+ raise RuntimeError("local_root must be './' in dpgen's machine.json.")
abs_local_root = os.path.abspath("./")
@@ -57,7 +55,7 @@ def make_submission(
return submission
-def mdata_arginfo() -> List[Argument]:
+def mdata_arginfo() -> list[Argument]:
"""This method generates arginfo for a single mdata.
A submission requires the following keys: command, machine,
@@ -95,13 +93,13 @@ def mdata_arginfo() -> List[Argument]:
def make_submission_compat(
machine: dict,
resources: dict,
- commands: List[str],
+ commands: list[str],
work_path: str,
- run_tasks: List[str],
+ run_tasks: list[str],
group_size: int,
- forward_common_files: List[str],
- forward_files: List[str],
- backward_files: List[str],
+ forward_common_files: list[str],
+ forward_files: list[str],
+ backward_files: list[str],
outlog: str = "log",
errlog: str = "err",
api_version: str = "1.0",
@@ -138,12 +136,12 @@ def make_submission_compat(
api_version : str, default=1.0
API version. 1.0 is required
"""
- if LooseVersion(api_version) < LooseVersion("1.0"):
+ if Version(api_version) < Version("1.0"):
raise RuntimeError(
"API version %s has been removed. Please upgrade to 1.0." % api_version
)
- elif LooseVersion(api_version) >= LooseVersion("1.0"):
+ elif Version(api_version) >= Version("1.0"):
submission = make_submission(
machine,
resources,
diff --git a/dpgen/generator/arginfo.py b/dpgen/generator/arginfo.py
index 45c148d0d..e1d220e42 100644
--- a/dpgen/generator/arginfo.py
+++ b/dpgen/generator/arginfo.py
@@ -1,4 +1,5 @@
-from typing import Dict, List
+import textwrap
+from typing import Union
from dargs import Argument, Variant
@@ -17,7 +18,7 @@ def run_mdata_arginfo() -> Argument:
# basics
-def basic_args() -> List[Argument]:
+def basic_args() -> list[Argument]:
doc_type_map = "Atom types. Reminder: The elements in param.json, type.raw and data.lmp(when using lammps) should be in the same order."
doc_mass_map = 'Standard atomic weights (default: "auto"). if one want to use isotopes, or non-standard element names, chemical symbols, or atomic number in the type_map list, please customize the mass_map list instead of using "auto".'
doc_use_ele_temp = "Currently only support fp_style vasp. \n\n\
@@ -26,42 +27,59 @@ def basic_args() -> List[Argument]:
- 2: electron temperature as atom parameter."
return [
- Argument("type_map", list, optional=False, doc=doc_type_map),
+ Argument("type_map", list[str], optional=False, doc=doc_type_map),
Argument(
- "mass_map", [list, str], optional=True, default="auto", doc=doc_mass_map
+ "mass_map",
+ [list[float], str],
+ optional=True,
+ default="auto",
+ doc=doc_mass_map,
),
Argument("use_ele_temp", int, optional=True, default=0, doc=doc_use_ele_temp),
]
-def data_args() -> List[Argument]:
+def data_args() -> list[Argument]:
doc_init_data_prefix = "Prefix of initial data directories."
doc_init_data_sys = "Paths of initial data. The path can be either a system diretory containing NumPy files or an HDF5 file. You may use either absolute or relative path here. Systems will be detected recursively in the directories or the HDF5 file."
doc_sys_format = "Format of sys_configs."
- doc_init_batch_size = "Each number is the batch_size of corresponding system for training in init_data_sys. One recommended rule for setting the sys_batch_size and init_batch_size is that batch_size mutiply number of atoms ot the stucture should be larger than 32. If set to auto, batch size will be 32 divided by number of atoms."
+ doc_init_batch_size = "Each number is the batch_size of corresponding system for training in init_data_sys. One recommended rule for setting the sys_batch_size and init_batch_size is that batch_size mutiply number of atoms ot the stucture should be larger than 32. If set to auto, batch size will be 32 divided by number of atoms. This argument will not override the mixed batch size in `default_training_param`."
doc_sys_configs_prefix = "Prefix of sys_configs."
- doc_sys_configs = "Containing directories of structures to be explored in iterations.Wildcard characters are supported here."
- doc_sys_batch_size = "Each number is the batch_size for training of corresponding system in sys_configs. If set to auto, batch size will be 32 divided by number of atoms."
+ doc_sys_configs = "2D list. Containing directories of structures to be explored in iterations for each system. Wildcard characters are supported here."
+ doc_sys_batch_size = "Each number is the batch_size for training of corresponding system in sys_configs. If set to auto, batch size will be 32 divided by number of atoms. This argument will not override the mixed batch size in `default_training_param`."
return [
Argument("init_data_prefix", str, optional=True, doc=doc_init_data_prefix),
- Argument("init_data_sys", list, optional=False, doc=doc_init_data_sys),
+ Argument("init_data_sys", list[str], optional=False, doc=doc_init_data_sys),
Argument(
"sys_format", str, optional=True, default="vasp/poscar", doc=doc_sys_format
),
Argument(
- "init_batch_size", [list, str], optional=True, doc=doc_init_batch_size
+ "init_batch_size",
+ [list[Union[int, str]], str],
+ optional=True,
+ doc=doc_init_batch_size,
),
Argument("sys_configs_prefix", str, optional=True, doc=doc_sys_configs_prefix),
- Argument("sys_configs", list, optional=False, doc=doc_sys_configs),
- Argument("sys_batch_size", list, optional=True, doc=doc_sys_batch_size),
+ Argument(
+ "sys_configs",
+ list[list[str]],
+ optional=False,
+ doc=doc_sys_configs,
+ ),
+ Argument(
+ "sys_batch_size",
+ list[Union[int, str]],
+ optional=True,
+ doc=doc_sys_batch_size,
+ ),
]
# Training
-def training_args() -> List[Argument]:
+def training_args() -> list[Argument]:
"""Traning arguments.
Returns
@@ -73,11 +91,20 @@ def training_args() -> List[Argument]:
doc_training_iter0_model_path = "The model used to init the first iter training. Number of element should be equal to numb_models."
doc_training_init_model = "Iteration > 0, the model parameters will be initilized from the model trained at the previous iteration. Iteration == 0, the model parameters will be initialized from training_iter0_model_path."
doc_default_training_param = "Training parameters for deepmd-kit in 00.train. You can find instructions from here: (https://github.com/deepmodeling/deepmd-kit)."
+ doc_dp_train_skip_neighbor_stat = "Append --skip-neighbor-stat flag to dp train."
doc_dp_compress = "Use dp compress to compress the model."
doc_training_reuse_iter = "The minimal index of iteration that continues training models from old models of last iteration."
doc_reusing = " This option is only adopted when continuing training models from old models. This option will override default parameters."
doc_training_reuse_old_ratio = (
- "The probability proportion of old data during training." + doc_reusing
+ textwrap.dedent(
+ """\
+ The probability proportion of old data during training. It can be:\n
+ - float: directly assign the probability of old data;
+ - `auto:f`: automatic probability, where f is the new-to-old ratio;
+ - `auto`: equivalent to `auto:10`.
+ """
+ )
+ + doc_reusing
)
doc_training_reuse_numb_steps = "Number of training batch." + doc_reusing
doc_training_reuse_start_lr = (
@@ -91,15 +118,15 @@ def training_args() -> List[Argument]:
)
doc_model_devi_activation_func = "The activation function in the model. The shape of list should be (N_models, 2), where 2 represents the embedding and fitting network. This option will override default parameters."
doc_srtab_file_path = "The path of the table for the short-range pairwise interaction which is needed when using DP-ZBL potential"
- doc_one_h5 = (
- "Before training, all of the training data will be merged into one HDF5 file."
- )
+ doc_one_h5 = "When using DeePMD-kit, all of the input data will be merged into one HDF5 file."
+ doc_training_init_frozen_model = "At interation 0, initilize the model parameters from the given frozen models. Number of element should be equal to numb_models."
+ doc_training_finetune_model = "At interation 0, finetune the model parameters from the given frozen models. Number of element should be equal to numb_models."
return [
Argument("numb_models", int, optional=False, doc=doc_numb_models),
Argument(
"training_iter0_model_path",
- list,
+ list[str],
optional=True,
doc=doc_training_iter0_model_path,
),
@@ -112,6 +139,13 @@ def training_args() -> List[Argument]:
optional=False,
doc=doc_default_training_param,
),
+ Argument(
+ "dp_train_skip_neighbor_stat",
+ bool,
+ optional=True,
+ default=False,
+ doc=doc_dp_train_skip_neighbor_stat,
+ ),
Argument(
"dp_compress", bool, optional=True, default=False, doc=doc_dp_compress
),
@@ -123,7 +157,8 @@ def training_args() -> List[Argument]:
),
Argument(
"training_reuse_old_ratio",
- [None, float],
+ [str, float],
+ default="auto",
optional=True,
doc=doc_training_reuse_old_ratio,
),
@@ -132,38 +167,50 @@ def training_args() -> List[Argument]:
[None, int],
alias=["training_reuse_stop_batch"],
optional=True,
- default=400000,
+ default=None,
doc=doc_training_reuse_numb_steps,
),
Argument(
"training_reuse_start_lr",
[None, float],
optional=True,
- default=1e-4,
+ default=None,
doc=doc_training_reuse_start_lr,
),
Argument(
"training_reuse_start_pref_e",
[None, float, int],
optional=True,
- default=0.1,
+ default=None,
doc=doc_training_reuse_start_pref_e,
),
Argument(
"training_reuse_start_pref_f",
[None, float, int],
optional=True,
- default=100,
+ default=None,
doc=doc_training_reuse_start_pref_f,
),
Argument(
"model_devi_activation_func",
- [None, list],
+ [None, list[list[str]]],
optional=True,
doc=doc_model_devi_activation_func,
),
Argument("srtab_file_path", str, optional=True, doc=doc_srtab_file_path),
Argument("one_h5", bool, optional=True, default=False, doc=doc_one_h5),
+ Argument(
+ "training_init_frozen_model",
+ list[str],
+ optional=True,
+ doc=doc_training_init_frozen_model,
+ ),
+ Argument(
+ "training_finetune_model",
+ list[str],
+ optional=True,
+ doc=doc_training_finetune_model,
+ ),
]
@@ -182,7 +229,7 @@ def model_devi_jobs_template_args() -> Argument:
Argument("plm", str, optional=True, doc=doc_template_plm),
]
return Argument(
- "template", list, args, [], optional=True, repeat=False, doc=doc_template
+ "template", dict, args, [], optional=True, repeat=False, doc=doc_template
)
@@ -199,11 +246,11 @@ def model_devi_jobs_rev_mat_args() -> Argument:
Argument("plm", dict, optional=True, doc=doc_rev_mat_plm),
]
return Argument(
- "rev_mat", list, args, [], optional=True, repeat=False, doc=doc_rev_mat
+ "rev_mat", dict, args, [], optional=True, repeat=False, doc=doc_rev_mat
)
-def model_devi_jobs_args() -> List[Argument]:
+def model_devi_jobs_args() -> list[Argument]:
# this may be not correct
doc_sys_rev_mat = (
"system-resolved revise matrix for revising variable(s) defined in the template into specific values. "
@@ -215,6 +262,7 @@ def model_devi_jobs_args() -> List[Argument]:
doc_press = "Pressure (Bar) in MD. Required when ensemble is npt."
doc_trj_freq = "Frequecy of trajectory saved in MD."
doc_nsteps = "Running steps of MD. It is not optional when not using a template."
+ doc_nbeads = "Number of beads in PIMD. If not given, classical MD will be performed. Only supported for LAMMPS version >= 20230615."
doc_ensemble = "Determining which ensemble used in MD, options include “npt” and “nvt”. It is not optional when not using a template."
doc_neidelay = "delay building until this many steps since last build."
doc_taut = "Coupling time of thermostat (ps)."
@@ -228,11 +276,12 @@ def model_devi_jobs_args() -> List[Argument]:
model_devi_jobs_template_args(),
model_devi_jobs_rev_mat_args(),
Argument("sys_rev_mat", dict, optional=True, doc=doc_sys_rev_mat),
- Argument("sys_idx", list, optional=False, doc=doc_sys_idx),
- Argument("temps", list, optional=True, doc=doc_temps),
- Argument("press", list, optional=True, doc=doc_press),
+ Argument("sys_idx", list[int], optional=False, doc=doc_sys_idx),
+ Argument("temps", list[float], optional=True, doc=doc_temps),
+ Argument("press", list[float], optional=True, doc=doc_press),
Argument("trj_freq", int, optional=False, doc=doc_trj_freq),
Argument("nsteps", int, optional=True, doc=doc_nsteps),
+ Argument("nbeads", int, optional=True, doc=doc_nbeads),
Argument("ensemble", str, optional=True, doc=doc_ensemble),
Argument("neidelay", int, optional=True, doc=doc_neidelay),
Argument("taut", float, optional=True, doc=doc_taut),
@@ -269,7 +318,7 @@ def model_devi_jobs_args() -> List[Argument]:
)
-def model_devi_lmp_args() -> List[Argument]:
+def model_devi_lmp_args() -> list[Argument]:
doc_model_devi_dt = "Timestep for MD. 0.002 is recommend."
doc_model_devi_skip = "Number of structures skipped for fp in each MD."
doc_model_devi_f_trust_lo = "Lower bound of forces for the selection. If list or dict, should be set for each index in sys_configs, respectively."
@@ -306,26 +355,26 @@ def model_devi_lmp_args() -> List[Argument]:
Argument("model_devi_skip", int, optional=False, doc=doc_model_devi_skip),
Argument(
"model_devi_f_trust_lo",
- [float, list, dict],
+ [float, list[float], dict],
optional=False,
doc=doc_model_devi_f_trust_lo,
),
Argument(
"model_devi_f_trust_hi",
- [float, list, dict],
+ [float, list[float], dict],
optional=False,
doc=doc_model_devi_f_trust_hi,
),
Argument(
"model_devi_v_trust_lo",
- [float, list, dict],
+ [float, list[float], dict],
optional=True,
default=1e10,
doc=doc_model_devi_v_trust_lo,
),
Argument(
"model_devi_v_trust_hi",
- [float, list, dict],
+ [float, list[float], dict],
optional=True,
default=1e10,
doc=doc_model_devi_v_trust_hi,
@@ -415,7 +464,7 @@ def model_devi_lmp_args() -> List[Argument]:
]
-def model_devi_amber_args() -> List[Argument]:
+def model_devi_amber_args() -> list[Argument]:
"""Amber engine arguments."""
doc_model_devi_jobs = (
"List of dicts. The list including the dict for information of each cycle."
@@ -450,7 +499,7 @@ def model_devi_amber_args() -> List[Argument]:
"List of ints. The number of steps to run. Each number maps to a system."
)
doc_r = (
- "3D or 4D list of floats. Constrict values for the enhanced sampling. "
+ "2D or 3D list of floats. Constrict values for the enhanced sampling. "
"The first dimension maps to systems. "
"The second dimension maps to confs in each system. The third dimension is the "
"constrict value. It can be a single float for 1D or list of floats for nD."
@@ -463,6 +512,7 @@ def model_devi_amber_args() -> List[Argument]:
)
doc_model_devi_f_trust_lo = "Lower bound of forces for the selection. If dict, should be set for each index in sys_idx, respectively."
doc_model_devi_f_trust_hi = "Upper bound of forces for the selection. If dict, should be set for each index in sys_idx, respectively."
+ doc_restart_from_iter = "The iteration index to restart the simulation from. If not given, the simulation is restarted from `sys_configs`."
return [
# make model devi args
@@ -473,39 +523,47 @@ def model_devi_amber_args() -> List[Argument]:
repeat=True,
doc=doc_model_devi_jobs,
sub_fields=[
- Argument("sys_idx", list, optional=False, doc=doc_sys_idx),
+ Argument("sys_idx", list[int], optional=False, doc=doc_sys_idx),
Argument("trj_freq", int, optional=False, doc=doc_trj_freq),
+ Argument(
+ "restart_from_iter", int, optional=True, doc=doc_restart_from_iter
+ ),
],
),
Argument("low_level", str, optional=False, doc=doc_low_level),
Argument("cutoff", float, optional=False, doc=doc_cutoff),
Argument("parm7_prefix", str, optional=True, doc=doc_parm7_prefix),
- Argument("parm7", list, optional=False, doc=doc_parm7),
+ Argument("parm7", list[str], optional=False, doc=doc_parm7),
Argument("mdin_prefix", str, optional=True, doc=doc_mdin_prefix),
- Argument("mdin", list, optional=False, doc=doc_mdin),
- Argument("qm_region", list, optional=False, doc=doc_qm_region),
- Argument("qm_charge", list, optional=False, doc=doc_qm_charge),
- Argument("nsteps", list, optional=False, doc=doc_nsteps),
- Argument("r", list, optional=False, doc=doc_r),
+ Argument("mdin", list[str], optional=False, doc=doc_mdin),
+ Argument("qm_region", list[str], optional=False, doc=doc_qm_region),
+ Argument("qm_charge", list[int], optional=False, doc=doc_qm_charge),
+ Argument("nsteps", list[int], optional=False, doc=doc_nsteps),
+ Argument(
+ "r",
+ list[list[Union[float, list[float]]]],
+ optional=False,
+ doc=doc_r,
+ ),
Argument("disang_prefix", str, optional=True, doc=doc_disang_prefix),
- Argument("disang", list, optional=False, doc=doc_disang),
+ Argument("disang", list[str], optional=False, doc=doc_disang),
# post model devi args
Argument(
"model_devi_f_trust_lo",
- [float, list, dict],
+ [float, list[float], dict],
optional=False,
doc=doc_model_devi_f_trust_lo,
),
Argument(
"model_devi_f_trust_hi",
- [float, list, dict],
+ [float, list[float], dict],
optional=False,
doc=doc_model_devi_f_trust_hi,
),
]
-def model_devi_args() -> List[Variant]:
+def model_devi_args() -> list[Variant]:
doc_model_devi_engine = "Engine for the model deviation task."
doc_amber = "Amber DPRc engine. The command argument in the machine file should be path to sander."
return [
@@ -526,7 +584,7 @@ def model_devi_args() -> List[Variant]:
# Labeling
# vasp
-def fp_style_vasp_args() -> List[Argument]:
+def fp_style_vasp_args() -> list[Argument]:
doc_fp_pp_path = "Directory of psuedo-potential file to be used for 02.fp exists."
doc_fp_pp_files = "Psuedo-potential file to be used for 02.fp. Note that the order of elements should correspond to the order in type_map."
doc_fp_incar = "Input file for VASP. INCAR must specify KSPACING and KGAMMA."
@@ -534,24 +592,24 @@ def fp_style_vasp_args() -> List[Argument]:
doc_cvasp = (
"If cvasp is true, DP-GEN will use Custodian to help control VASP calculation."
)
- doc_ratio_failed = "Check the ratio of unsuccessfully terminated jobs. If too many FP tasks are not converged, RuntimeError will be raised."
doc_fp_skip_bad_box = (
"Skip the configurations that are obviously unreasonable before 02.fp"
)
return [
Argument("fp_pp_path", str, optional=False, doc=doc_fp_pp_path),
- Argument("fp_pp_files", list, optional=False, doc=doc_fp_pp_files),
+ Argument("fp_pp_files", list[str], optional=False, doc=doc_fp_pp_files),
Argument("fp_incar", str, optional=False, doc=doc_fp_incar),
- Argument("fp_aniso_kspacing", list, optional=True, doc=doc_fp_aniso_kspacing),
+ Argument(
+ "fp_aniso_kspacing", list[float], optional=True, doc=doc_fp_aniso_kspacing
+ ),
Argument("cvasp", bool, optional=True, doc=doc_cvasp),
- Argument("ratio_failed", float, optional=True, doc=doc_ratio_failed),
Argument("fp_skip_bad_box", str, optional=True, doc=doc_fp_skip_bad_box),
]
# abacus
-def fp_style_abacus_args() -> List[Argument]:
+def fp_style_abacus_args() -> list[Argument]:
doc_fp_pp_path = "Directory of psuedo-potential or numerical orbital files to be used for 02.fp exists."
doc_fp_pp_files = "Psuedo-potential file to be used for 02.fp. Note that the order of elements should correspond to the order in type_map."
doc_fp_orb_files = "numerical orbital file to be used for 02.fp when using LCAO basis. Note that the order of elements should correspond to the order in type_map."
@@ -565,18 +623,18 @@ def fp_style_abacus_args() -> List[Argument]:
return [
Argument("fp_pp_path", str, optional=False, doc=doc_fp_pp_path),
- Argument("fp_pp_files", list, optional=False, doc=doc_fp_pp_files),
- Argument("fp_orb_files", list, optional=True, doc=doc_fp_orb_files),
+ Argument("fp_pp_files", list[str], optional=False, doc=doc_fp_pp_files),
+ Argument("fp_orb_files", list[str], optional=True, doc=doc_fp_orb_files),
Argument("fp_incar", str, optional=True, doc=doc_fp_incar),
Argument("fp_kpt_file", str, optional=True, doc=doc_fp_kpt_file),
Argument("fp_dpks_descriptor", str, optional=True, doc=doc_fp_dpks_descriptor),
Argument("user_fp_params", dict, optional=True, doc=doc_user_fp_params),
- Argument("k_points", list, optional=True, doc=doc_k_points),
+ Argument("k_points", list[int], optional=True, doc=doc_k_points),
]
# gaussian
-def fp_style_gaussian_args() -> List[Argument]:
+def fp_style_gaussian_args() -> list[Argument]:
"""Gaussian fp style arguments.
Returns
@@ -601,7 +659,7 @@ def fp_style_gaussian_args() -> List[Argument]:
)
args = [
- Argument("keywords", [str, list], optional=False, doc=doc_keywords),
+ Argument("keywords", [str, list[str]], optional=False, doc=doc_keywords),
Argument(
"multiplicity",
[int, str],
@@ -646,7 +704,6 @@ def fp_style_gaussian_args() -> List[Argument]:
"kept. In this case, other atoms out of the soft cutoff radius will be removed."
)
doc_fp_params_gaussian = "Parameters for Gaussian calculation."
- doc_ratio_failed = "Check the ratio of unsuccessfully terminated jobs. If too many FP tasks are not converged, RuntimeError will be raised."
return [
Argument(
@@ -662,12 +719,11 @@ def fp_style_gaussian_args() -> List[Argument]:
Argument(
"fp_params", dict, args, [], optional=False, doc=doc_fp_params_gaussian
),
- Argument("ratio_failed", float, optional=True, doc=doc_ratio_failed),
]
# siesta
-def fp_style_siesta_args() -> List[Argument]:
+def fp_style_siesta_args() -> list[Argument]:
doc_ecut = "Define the plane wave cutoff for grid."
doc_ediff = "Tolerance of Density Matrix."
doc_kspacing = "Sample factor in Brillouin zones."
@@ -693,17 +749,32 @@ def fp_style_siesta_args() -> List[Argument]:
Argument("cluster_cutoff", float, optional=True, doc=doc_cluster_cutoff),
Argument("fp_params", dict, args, [], optional=False, doc=doc_fp_params_siesta),
Argument("fp_pp_path", str, optional=False, doc=doc_fp_pp_path),
- Argument("fp_pp_files", list, optional=False, doc=doc_fp_pp_files),
+ Argument("fp_pp_files", list[str], optional=False, doc=doc_fp_pp_files),
]
# cp2k
-def fp_style_cp2k_args() -> List[Argument]:
+def fp_style_cp2k_args() -> list[Argument]:
doc_user_fp_params = "Parameters for cp2k calculation. find detail in manual.cp2k.org. only the kind section must be set before use. we assume that you have basic knowledge for cp2k input."
- doc_external_input_path = "Conflict with key:user_fp_params, use the template input provided by user, some rules should be followed, read the following text in detail."
- doc_ratio_failed = "Check the ratio of unsuccessfully terminated jobs. If too many FP tasks are not converged, RuntimeError will be raised."
+ doc_external_input_path = (
+ "Conflict with key:user_fp_params.\n"
+ "enable the template input provided by user.\n"
+ "some rules should be followed, read the following text in detail: \n"
+ "\n"
+ "1. One must present a KEYWORD ABC in the section CELL so that the DP-GEN can replace the cell on-the-fly. \n"
+ "2. One need to add these lines under FORCE_EVAL section to print forces and stresses::\n"
+ "\n"
+ " STRESS_TENSOR ANALYTICAL\n"
+ " &PRINT\n"
+ " &FORCES ON\n"
+ " &END FORCES\n"
+ " &STRESS_TENSOR ON\n"
+ " &END STRESS_TENSOR\n"
+ " &END PRINT\n"
+ "\n"
+ )
return [
Argument(
@@ -716,11 +787,10 @@ def fp_style_cp2k_args() -> List[Argument]:
Argument(
"external_input_path", str, optional=True, doc=doc_external_input_path
),
- Argument("ratio_failed", float, optional=True, doc=doc_ratio_failed),
]
-def fp_style_amber_diff_args() -> List[Argument]:
+def fp_style_amber_diff_args() -> list[Argument]:
"""Arguments for FP style amber/diff.
Returns
@@ -757,6 +827,35 @@ def fp_style_amber_diff_args() -> List[Argument]:
]
+def fp_style_custom_args() -> list[Argument]:
+ """Arguments for FP style custom.
+
+ Returns
+ -------
+ list[dargs.Argument]
+ list of Gaussian fp style arguments
+ """
+ doc_fp_params_custom = "Parameters for FP calculation."
+ doc_input_fmt = "Input dpdata format of the custom FP code. Such format should only need the first argument as the file name."
+ doc_output_fmt = "Output dpata format of the custom FP code. Such format should only need the first argument as the file name."
+ doc_input_fn = "Input file name of the custom FP code."
+ doc_output_fn = "Output file name of the custom FP code."
+ return [
+ Argument(
+ "fp_params",
+ dict,
+ optional=False,
+ doc=doc_fp_params_custom,
+ sub_fields=[
+ Argument("input_fmt", str, optional=False, doc=doc_input_fmt),
+ Argument("input_fn", str, optional=False, doc=doc_input_fn),
+ Argument("output_fmt", str, optional=False, doc=doc_output_fmt),
+ Argument("output_fn", str, optional=False, doc=doc_output_fn),
+ ],
+ ),
+ ]
+
+
def fp_style_variant_type_args() -> Variant:
doc_fp_style = "Software for First Principles."
doc_amber_diff = (
@@ -766,6 +865,11 @@ def fp_style_variant_type_args() -> Variant:
"The command argument in the machine file should be path to sander. "
"One should also install dpamber and make it visible in the PATH."
)
+ doc_custom = (
+ "Custom FP code. You need to provide the input and output file format and name. "
+ "The command argument in the machine file should be the script to run custom FP codes. "
+ "The extra forward and backward files can be defined in the machine file."
+ )
return Variant(
"fp_style",
@@ -780,21 +884,23 @@ def fp_style_variant_type_args() -> Variant:
),
Argument("pwmat", dict, [], doc="TODO: add doc"),
Argument("pwscf", dict, [], doc="TODO: add doc"),
+ Argument("custom", dict, fp_style_custom_args(), doc=doc_custom),
],
optional=False,
doc=doc_fp_style,
)
-def fp_args() -> List[Argument]:
- doc_fp_task_max = "Maximum number of structures to be calculated in each system in 02.fp of each iteration."
- doc_fp_task_min = "Minimum number of structures to be calculated in each system in 02.fp of each iteration."
+def fp_args() -> list[Argument]:
+ doc_fp_task_max = "Maximum number of structures to be calculated in each system in 02.fp of each iteration. If the number of candidate structures exceeds `fp_task_max`, `fp_task_max` structures will be randomly picked from the candidates and labeled."
+ doc_fp_task_min = "Skip the training in the next iteration if the number of structures is no more than `fp_task_min`."
doc_fp_accurate_threshold = "If the accurate ratio is larger than this number, no fp calculation will be performed, i.e. fp_task_max = 0."
doc_fp_accurate_soft_threshold = "If the accurate ratio is between this number and fp_accurate_threshold, the fp_task_max linearly decays to zero."
- doc_fp_cluster_vacuum = "If the vacuum size is smaller than this value, this cluster will not be choosen for labeling."
+ doc_fp_cluster_vacuum = "If the vacuum size is smaller than this value, this cluster will not be chosen for labeling."
doc_detailed_report_make_fp = (
- "If set to true, detailed report will be generated for each iteration."
+ "If set to true, a detailed report will be generated for each iteration."
)
+ doc_ratio_failed = "Check the ratio of unsuccessfully terminated jobs. If too many FP tasks are not converged, RuntimeError will be raised."
return [
Argument("fp_task_max", int, optional=False, doc=doc_fp_task_max),
@@ -816,6 +922,7 @@ def fp_args() -> List[Argument]:
default=True,
doc=doc_detailed_report_make_fp,
),
+ Argument("ratio_failed", float, optional=True, doc=doc_ratio_failed),
]
diff --git a/dpgen/generator/lib/abacus_scf.py b/dpgen/generator/lib/abacus_scf.py
index c307c0ad5..561d84500 100644
--- a/dpgen/generator/lib/abacus_scf.py
+++ b/dpgen/generator/lib/abacus_scf.py
@@ -1,4 +1,6 @@
+import copy
import os
+import re
import numpy as np
from dpdata.abacus.scf import get_cell, get_coords, get_nele_from_stru
@@ -24,8 +26,9 @@ def make_abacus_scf_kpt(fp_params):
return ret
-def make_abacus_scf_input(fp_params):
+def make_abacus_scf_input(fp_params, extra_file_path=""):
# Make INPUT file for abacus pw scf calculation.
+ # put extra files (such as: deepks_model) to extra_file_path folder
ret = "INPUT_PARAMETERS\n"
ret += "calculation scf\n"
for key in fp_params:
@@ -34,16 +37,33 @@ def make_abacus_scf_input(fp_params):
assert fp_params["ecutwfc"] >= 0, "'ecutwfc' should be non-negative."
ret += "ecutwfc %f\n" % fp_params["ecutwfc"]
elif key == "kspacing":
- fp_params["kspacing"] = float(fp_params["kspacing"])
- assert fp_params["kspacing"] >= 0, "'kspacing' should be non-negative."
- ret += "kspacing %f\n" % fp_params["kspacing"]
+ if isinstance(fp_params["kspacing"], (int, float)):
+ fp_params["kspacing"] = [float(fp_params["kspacing"])]
+ elif isinstance(fp_params["kspacing"], (list, tuple)):
+ fp_params["kspacing"] = list(fp_params["kspacing"])
+ elif isinstance(fp_params["kspacing"], str):
+ fp_params["kspacing"] = [
+ float(i) for i in fp_params["kspacing"].split()
+ ]
+ assert (
+ len(fp_params["kspacing"])
+ in [
+ 1,
+ 3,
+ ]
+ ), "'kspacing' only accept a float, or a list of one or three float, or a string of one or three float"
+ ret += "kspacing "
+ for ikspacing in fp_params["kspacing"]:
+ assert ikspacing >= 0, "'kspacing' should be non-negative."
+ ret += "%f " % ikspacing
+ ret += "\n"
elif key == "scf_thr":
fp_params["scf_thr"] = float(fp_params["scf_thr"])
ret += "scf_thr %e\n" % fp_params["scf_thr"]
elif key == "scf_nmax":
fp_params["scf_nmax"] = int(fp_params["scf_nmax"])
- assert (
- fp_params["scf_nmax"] >= 0 and type(fp_params["scf_nmax"]) == int
+ assert fp_params["scf_nmax"] >= 0 and isinstance(
+ fp_params["scf_nmax"], int
), "'scf_nmax' should be a positive integer."
ret += "scf_nmax %d\n" % fp_params["scf_nmax"]
elif key == "basis_type":
@@ -56,7 +76,7 @@ def make_abacus_scf_input(fp_params):
elif key == "dft_functional":
ret += "dft_functional %s\n" % fp_params["dft_functional"]
elif key == "gamma_only":
- if type(fp_params["gamma_only"]) == str:
+ if isinstance(fp_params["gamma_only"], str):
fp_params["gamma_only"] = int(eval(fp_params["gamma_only"]))
assert (
fp_params["gamma_only"] == 0 or fp_params["gamma_only"] == 1
@@ -78,7 +98,7 @@ def make_abacus_scf_input(fp_params):
), "'mixing_beta' should between 0 and 1."
ret += "mixing_beta %f\n" % fp_params["mixing_beta"]
elif key == "symmetry":
- if type(fp_params["symmetry"]) == str:
+ if isinstance(fp_params["symmetry"], str):
fp_params["symmetry"] = int(eval(fp_params["symmetry"]))
assert (
fp_params["symmetry"] == 0 or fp_params["symmetry"] == 1
@@ -86,8 +106,8 @@ def make_abacus_scf_input(fp_params):
ret += "symmetry %d\n" % fp_params["symmetry"]
elif key == "nbands":
fp_params["nbands"] = int(fp_params["nbands"])
- assert (
- fp_params["nbands"] > 0 and type(fp_params["nbands"]) == int
+ assert fp_params["nbands"] > 0 and isinstance(
+ fp_params["nbands"], int
), "'nbands' should be a positive integer."
ret += "nbands %d\n" % fp_params["nbands"]
elif key == "nspin":
@@ -99,25 +119,31 @@ def make_abacus_scf_input(fp_params):
), "'nspin' can anly take 1, 2 or 4"
ret += "nspin %d\n" % fp_params["nspin"]
elif key == "ks_solver":
- assert fp_params["ks_solver"] in [
- "cg",
- "dav",
- "lapack",
- "genelpa",
- "hpseps",
- "scalapack_gvx",
- ], "'ks_sover' should in 'cgx', 'dav', 'lapack', 'genelpa', 'hpseps', 'scalapack_gvx'."
+ assert (
+ fp_params["ks_solver"]
+ in [
+ "cg",
+ "dav",
+ "lapack",
+ "genelpa",
+ "hpseps",
+ "scalapack_gvx",
+ ]
+ ), "'ks_sover' should in 'cgx', 'dav', 'lapack', 'genelpa', 'hpseps', 'scalapack_gvx'."
ret += "ks_solver %s\n" % fp_params["ks_solver"]
elif key == "smearing_method":
- assert fp_params["smearing_method"] in [
- "gauss",
- "gaussian",
- "fd",
- "fixed",
- "mp",
- "mp2",
- "mv",
- ], "'smearing_method' should in 'gauss', 'gaussian', 'fd', 'fixed', 'mp', 'mp2', 'mv'. "
+ assert (
+ fp_params["smearing_method"]
+ in [
+ "gauss",
+ "gaussian",
+ "fd",
+ "fixed",
+ "mp",
+ "mp2",
+ "mv",
+ ]
+ ), "'smearing_method' should in 'gauss', 'gaussian', 'fd', 'fixed', 'mp', 'mp2', 'mv'. "
ret += "smearing_method %s\n" % fp_params["smearing_method"]
elif key == "smearing_sigma":
fp_params["smearing_sigma"] = float(fp_params["smearing_sigma"])
@@ -126,14 +152,14 @@ def make_abacus_scf_input(fp_params):
), "'smearing_sigma' should be non-negative."
ret += "smearing_sigma %f\n" % fp_params["smearing_sigma"]
elif key == "cal_force":
- if type(fp_params["cal_force"]) == str:
+ if isinstance(fp_params["cal_force"], str):
fp_params["cal_force"] = int(eval(fp_params["cal_force"]))
assert (
fp_params["cal_force"] == 0 or fp_params["cal_force"] == 1
), "'cal_force' should be either 0 or 1."
ret += "cal_force %d\n" % fp_params["cal_force"]
elif key == "cal_stress":
- if type(fp_params["cal_stress"]) == str:
+ if isinstance(fp_params["cal_stress"], str):
fp_params["cal_stress"] = int(eval(fp_params["cal_stress"]))
assert (
fp_params["cal_stress"] == 0 or fp_params["cal_stress"] == 1
@@ -141,7 +167,7 @@ def make_abacus_scf_input(fp_params):
ret += "cal_stress %d\n" % fp_params["cal_stress"]
# paras for deepks
elif key == "deepks_out_labels":
- if type(fp_params["deepks_out_labels"]) == str:
+ if isinstance(fp_params["deepks_out_labels"], str):
fp_params["deepks_out_labels"] = int(
eval(fp_params["deepks_out_labels"])
)
@@ -159,20 +185,22 @@ def make_abacus_scf_input(fp_params):
), "'deepks_descriptor_lmax' should be a positive integer."
ret += "deepks_descriptor_lmax %d\n" % fp_params["deepks_descriptor_lmax"]
elif key == "deepks_scf":
- if type(fp_params["deepks_scf"]) == str:
+ if isinstance(fp_params["deepks_scf"], str):
fp_params["deepks_scf"] = int(eval(fp_params["deepks_scf"]))
assert (
fp_params["deepks_scf"] == 0 or fp_params["deepks_scf"] == 1
), "'deepks_scf' should be either 0 or 1."
ret += "deepks_scf %d\n" % fp_params["deepks_scf"]
elif key == "deepks_model":
- ret += "deepks_model %s\n" % fp_params["deepks_model"]
+ ret += "deepks_model %s\n" % os.path.join(
+ extra_file_path, os.path.split(fp_params["deepks_model"])[1]
+ )
elif key[0] == "_":
pass
elif key == "calculation":
pass
else:
- ret += "%s %s\n" % (key, str(fp_params[key]))
+ ret += f"{key} {str(fp_params[key])}\n"
return ret
@@ -183,10 +211,11 @@ def make_abacus_scf_stru(
fp_dpks_descriptor=None,
fp_params=None,
type_map=None,
+ pporb="", # pull all pp orb dpks files to pporb folder
):
atom_names = sys_data["atom_names"]
atom_numbs = sys_data["atom_numbs"]
- if type_map == None:
+ if type_map is None:
type_map = atom_names
assert len(atom_names) == len(atom_numbs), "Please check the name of atoms. "
@@ -202,12 +231,17 @@ def make_abacus_scf_stru(
)
idx = type_map.index(atom_names[iatom])
if "atom_masses" not in sys_data:
- ret += atom_names[iatom] + " 1.00 " + fp_pp_files[idx] + "\n"
+ ret += (
+ atom_names[iatom]
+ + " 1.00 "
+ + os.path.join(pporb, fp_pp_files[idx])
+ + "\n"
+ )
else:
ret += (
atom_names[iatom]
+ " %.3f " % sys_data["atom_masses"][iatom]
- + fp_pp_files[idx]
+ + os.path.join(pporb, fp_pp_files[idx])
+ "\n"
)
@@ -252,11 +286,11 @@ def make_abacus_scf_stru(
assert len(fp_orb_files) == len(type_map)
for iatom in range(len(atom_names)):
idx = type_map.index(atom_names[iatom])
- ret += fp_orb_files[idx] + "\n"
+ ret += os.path.join(pporb, fp_orb_files[idx]) + "\n"
if fp_dpks_descriptor is not None:
ret += "\nNUMERICAL_DESCRIPTOR\n"
- ret += "%s\n" % fp_dpks_descriptor
+ ret += os.path.join(pporb, fp_dpks_descriptor) + "\n"
return ret
@@ -266,11 +300,9 @@ def get_abacus_input_parameters(INPUT):
inlines = fp.read().split("\n")
input_parameters = {}
for line in inlines:
- if line.split() == [] or len(line.split()) < 2 or line[0] in ["#"]:
- continue
- parameter_name = line.split()[0]
- parameter_value = line.split()[1]
- input_parameters[parameter_name] = parameter_value
+ sline = re.split("[ \t]", line.split("#")[0].strip(), maxsplit=1)
+ if len(sline) == 2:
+ input_parameters[sline[0].strip()] = sline[1].strip()
fp.close()
return input_parameters
@@ -353,7 +385,7 @@ def get_additional_from_STRU(geometry_inlines, nele):
def get_abacus_STRU(STRU, INPUT=None, n_ele=None):
# read in geometry from STRU file. n_ele is the number of elements.
# Either n_ele or INPUT should be provided.
- with open(STRU, "r") as fp:
+ with open(STRU) as fp:
geometry_inlines = fp.read().split("\n")
for iline, line in enumerate(geometry_inlines):
if line.split() == [] or len(line) == 0:
@@ -379,36 +411,52 @@ def get_abacus_STRU(STRU, INPUT=None, n_ele=None):
def make_supercell_abacus(from_struct, super_cell):
- if "types" in from_struct:
- from_struct["types"] = (
- from_struct["types"] * super_cell[0] * super_cell[1] * super_cell[2]
- )
- for ix in range(super_cell[0]):
- for iy in range(super_cell[1]):
- for iz in range(super_cell[2]):
- if ix == 0 and iy == 0 and iz == 0:
- continue
- for ia in range(sum(from_struct["atom_numbs"])):
+ to_struct = copy.deepcopy(from_struct)
+
+ if "atom_types" in from_struct:
+ new_types = []
+ # to_struct["atom_types"] = (
+ # from_struct["atom_types"] * super_cell[0] * super_cell[1] * super_cell[2]
+ # )
+ for idx_atm in from_struct["atom_types"]:
+ new_types += [idx_atm] * super_cell[0] * super_cell[1] * super_cell[2]
+ to_struct["atom_types"] = new_types
+ to_atom_num = (
+ sum(from_struct["atom_numbs"]) * super_cell[0] * super_cell[1] * super_cell[2]
+ )
+ new_coord = np.zeros((to_atom_num, 3))
+ idx_atm = 0
+ for ia in range(sum(from_struct["atom_numbs"])):
+ for ix in range(super_cell[0]):
+ for iy in range(super_cell[1]):
+ for iz in range(super_cell[2]):
+ # if ix == 0 and iy == 0 and iz == 0:
+ # continue
+
coord = (
from_struct["coords"][ia]
+ from_struct["cells"][0] * ix
+ from_struct["cells"][1] * iy
+ from_struct["cells"][2] * iz
)
- from_struct["coords"] = np.vstack([from_struct["coords"], coord])
- from_struct["atom_numbs"] = [
+ new_coord[idx_atm] = coord
+ idx_atm += 1
+
+ to_struct["coords"] = new_coord
+ new_numbs = [
i * super_cell[0] * super_cell[1] * super_cell[2]
for i in from_struct["atom_numbs"]
]
- from_struct["cells"][0] *= super_cell[0]
- from_struct["cells"][1] *= super_cell[1]
- from_struct["cells"][2] *= super_cell[2]
- return from_struct
+ to_struct["atom_numbs"] = new_numbs
+ to_struct["cells"][0] *= super_cell[0]
+ to_struct["cells"][1] *= super_cell[1]
+ to_struct["cells"][2] *= super_cell[2]
+ return to_struct
def make_kspacing_kpoints_stru(stru, kspacing):
# adapted from dpgen.autotest.lib.vasp.make_kspacing_kpoints
- if type(kspacing) is not list:
+ if not isinstance(kspacing, list):
kspacing = [kspacing, kspacing, kspacing]
box = stru["cells"]
rbox = vasp.reciprocal_box(box)
diff --git a/dpgen/generator/lib/calypso_check_outcar.py b/dpgen/generator/lib/calypso_check_outcar.py
index 148e3a5af..668131669 100644
--- a/dpgen/generator/lib/calypso_check_outcar.py
+++ b/dpgen/generator/lib/calypso_check_outcar.py
@@ -1,14 +1,8 @@
#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-import glob
import os
-import sys
-import time
import numpy as np
-from ase.io import read
-from deepmd.calculator import DP
"""
check if structure optimization worked well
@@ -17,7 +11,7 @@
def Get_Element_Num(elements):
- """Using the Atoms.symples to Know Element&Num"""
+ """Using the Atoms.symples to Know Element&Num."""
element = []
ele = {}
element.append(elements[0])
@@ -30,12 +24,12 @@ def Get_Element_Num(elements):
def Write_Contcar(element, ele, lat, pos):
- """Write CONTCAR"""
+ """Write CONTCAR."""
f = open("CONTCAR", "w")
f.write("ASE-DPKit-FAILED-nan\n")
f.write("1.0\n")
for i in range(3):
- f.write("%15.10f %15.10f %15.10f\n" % tuple(lat[i]))
+ f.write("{:15.10f} {:15.10f} {:15.10f}\n".format(*tuple(lat[i])))
for x in element:
f.write(x + " ")
f.write("\n")
@@ -46,11 +40,11 @@ def Write_Contcar(element, ele, lat, pos):
na = sum(ele.values())
dpos = np.dot(pos, np.linalg.inv(lat))
for i in range(na):
- f.write("%15.10f %15.10f %15.10f\n" % tuple(dpos[i]))
+ f.write("{:15.10f} {:15.10f} {:15.10f}\n".format(*tuple(dpos[i])))
def Write_Outcar(element, ele, volume, lat, pos, ene, force, stress, pstress):
- """Write OUTCAR"""
+ """Write OUTCAR."""
f = open("OUTCAR", "w")
for x in element:
f.write("VRHFIN =" + str(x) + "\n")
@@ -70,27 +64,25 @@ def Write_Outcar(element, ele, volume, lat, pos, ene, force, stress, pstress):
f.write("\n")
ext_pressure = np.sum(stress[0] + stress[1] + stress[2]) / 3.0 - pstress
f.write(
- "external pressure = %20.6f kB Pullay stress = %20.6f kB\n"
- % (ext_pressure, pstress)
+ f"external pressure = {ext_pressure:20.6f} kB Pullay stress = {pstress:20.6f} kB\n"
)
f.write("volume of cell : %20.6f\n" % volume)
f.write("direct lattice vectors\n")
for i in range(3):
- f.write("%10.6f %10.6f %10.6f\n" % tuple(lat[i]))
+ f.write("{:10.6f} {:10.6f} {:10.6f}\n".format(*tuple(lat[i])))
f.write("POSITION TOTAL-FORCE(eV/Angst)\n")
f.write("-------------------------------------------------------------------\n")
na = sum(ele.values())
for i in range(na):
- f.write("%15.6f %15.6f %15.6f" % tuple(pos[i]))
- f.write("%15.6f %15.6f %15.6f\n" % tuple(force[i]))
+ f.write("{:15.6f} {:15.6f} {:15.6f}".format(*tuple(pos[i])))
+ f.write("{:15.6f} {:15.6f} {:15.6f}\n".format(*tuple(force[i])))
f.write("-------------------------------------------------------------------\n")
- f.write("energy without entropy= %20.6f %20.6f\n" % (ene, ene))
+ f.write(f"energy without entropy= {ene:20.6f} {ene:20.6f}\n")
enthalpy = ene + pstress * volume / 1602.17733
- f.write("enthalpy is TOTEN = %20.6f %20.6f\n" % (enthalpy, enthalpy))
+ f.write(f"enthalpy is TOTEN = {enthalpy:20.6f} {enthalpy:20.6f}\n")
def check():
-
from ase.io import read
from deepmd.calculator import DP
diff --git a/dpgen/generator/lib/calypso_run_model_devi.py b/dpgen/generator/lib/calypso_run_model_devi.py
index f3ed62a36..5ad3f70bb 100644
--- a/dpgen/generator/lib/calypso_run_model_devi.py
+++ b/dpgen/generator/lib/calypso_run_model_devi.py
@@ -4,7 +4,6 @@
import math
import os
import shutil
-import sys
import dpdata
import numpy as np
@@ -22,7 +21,7 @@ def write_model_devi_out(devi, fname):
f"min_devi_{item}",
f"avg_devi_{item}",
)
- header += "%16s" % str("min_dis")
+ header += "%16s" % "min_dis"
np.savetxt(
fname,
devi,
@@ -34,7 +33,6 @@ def write_model_devi_out(devi, fname):
def Modd(all_models, type_map):
-
# Model Devi
cwd = os.getcwd()
@@ -44,7 +42,6 @@ def Modd(all_models, type_map):
pcount = 0
strus_lists = glob.glob(os.path.join(cwd, "*.structures"))
for num, strus_path in enumerate(strus_lists):
-
structures_data = dpdata.System(strus_path, "deepmd/npy", type_map=type_map)
# every 500 confs in one task dir
@@ -115,7 +112,6 @@ def Modd(all_models, type_map):
if __name__ == "__main__":
-
cwd = os.getcwd()
model_path = os.path.join(
os.path.abspath(os.path.join(cwd, os.pardir)), "gen_stru_analy"
diff --git a/dpgen/generator/lib/calypso_run_opt.py b/dpgen/generator/lib/calypso_run_opt.py
index 99c0fec80..b87abe726 100644
--- a/dpgen/generator/lib/calypso_run_opt.py
+++ b/dpgen/generator/lib/calypso_run_opt.py
@@ -1,15 +1,12 @@
#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-import glob
import os
-import sys
import time
import numpy as np
-from ase.constraints import ExpCellFilter, UnitCellFilter
+from ase.constraints import UnitCellFilter
from ase.io import read
-from ase.optimize import BFGS, LBFGS, QuasiNewton
+from ase.optimize import LBFGS
from deepmd.calculator import DP
"""
@@ -19,7 +16,7 @@
def Get_Element_Num(elements):
- """Using the Atoms.symples to Know Element&Num"""
+ """Using the Atoms.symples to Know Element&Num."""
element = []
ele = {}
element.append(elements[0])
@@ -32,12 +29,12 @@ def Get_Element_Num(elements):
def Write_Contcar(element, ele, lat, pos):
- """Write CONTCAR"""
+ """Write CONTCAR."""
f = open("CONTCAR", "w")
f.write("ASE-DPKit-Optimization\n")
f.write("1.0\n")
for i in range(3):
- f.write("%15.10f %15.10f %15.10f\n" % tuple(lat[i]))
+ f.write("{:15.10f} {:15.10f} {:15.10f}\n".format(*tuple(lat[i])))
for x in element:
f.write(x + " ")
f.write("\n")
@@ -48,11 +45,11 @@ def Write_Contcar(element, ele, lat, pos):
na = sum(ele.values())
dpos = np.dot(pos, np.linalg.inv(lat))
for i in range(na):
- f.write("%15.10f %15.10f %15.10f\n" % tuple(dpos[i]))
+ f.write("{:15.10f} {:15.10f} {:15.10f}\n".format(*tuple(dpos[i])))
def Write_Outcar(element, ele, volume, lat, pos, ene, force, stress, pstress):
- """Write OUTCAR"""
+ """Write OUTCAR."""
f = open("OUTCAR", "w")
for x in element:
f.write("VRHFIN =" + str(x) + "\n")
@@ -72,23 +69,22 @@ def Write_Outcar(element, ele, volume, lat, pos, ene, force, stress, pstress):
f.write("\n")
ext_pressure = np.sum(stress[0] + stress[1] + stress[2]) / 3.0 - pstress
f.write(
- "external pressure = %20.6f kB Pullay stress = %20.6f kB\n"
- % (ext_pressure, pstress)
+ f"external pressure = {ext_pressure:20.6f} kB Pullay stress = {pstress:20.6f} kB\n"
)
f.write("volume of cell : %20.6f\n" % volume)
f.write("direct lattice vectors\n")
for i in range(3):
- f.write("%10.6f %10.6f %10.6f\n" % tuple(lat[i]))
+ f.write("{:10.6f} {:10.6f} {:10.6f}\n".format(*tuple(lat[i])))
f.write("POSITION TOTAL-FORCE(eV/Angst)\n")
f.write("-------------------------------------------------------------------\n")
na = sum(ele.values())
for i in range(na):
- f.write("%15.6f %15.6f %15.6f" % tuple(pos[i]))
- f.write("%15.6f %15.6f %15.6f\n" % tuple(force[i]))
+ f.write("{:15.6f} {:15.6f} {:15.6f}".format(*tuple(pos[i])))
+ f.write("{:15.6f} {:15.6f} {:15.6f}\n".format(*tuple(force[i])))
f.write("-------------------------------------------------------------------\n")
- f.write("energy without entropy= %20.6f %20.6f\n" % (ene, ene / na))
+ f.write(f"energy without entropy= {ene:20.6f} {ene / na:20.6f}\n")
enthalpy = ene + pstress * volume / 1602.17733
- f.write("enthalpy is TOTEN = %20.6f %20.6f\n" % (enthalpy, enthalpy / na))
+ f.write(f"enthalpy is TOTEN = {enthalpy:20.6f} {enthalpy / na:20.6f}\n")
def read_stress_fmax():
@@ -96,12 +92,12 @@ def read_stress_fmax():
fmax = 0.01
# assert os.path.exists('./input.dat'), 'input.dat does not exist!'
try:
- f = open("input.dat", "r")
- except:
- assert os.path.exists(
- "../input.dat"
- ), " now we are in %s, do not find ../input.dat" % (os.getcwd())
- f = open("../input.dat", "r")
+ f = open("input.dat")
+ except Exception:
+ assert os.path.exists("../input.dat"), (
+ " now we are in %s, do not find ../input.dat" % (os.getcwd())
+ )
+ f = open("../input.dat")
lines = f.readlines()
f.close()
for line in lines:
@@ -115,8 +111,7 @@ def read_stress_fmax():
def run_opt(fmax, stress):
- """Using the ASE&DP to Optimize Configures"""
-
+ """Using the ASE&DP to Optimize Configures."""
calc = DP(model="../graph.000.pb") # init the model before iteration
os.system("mv OUTCAR OUTCAR-last")
@@ -165,7 +160,7 @@ def run_opt(fmax, stress):
stop = time.time()
_cwd = os.getcwd()
_cwd = os.path.basename(_cwd)
- print("%s is done, time: %s" % (_cwd, stop - start))
+ print(f"{_cwd} is done, time: {stop - start}")
def run():
diff --git a/dpgen/generator/lib/cp2k.py b/dpgen/generator/lib/cp2k.py
index 2bfede252..4ab9ae4c5 100644
--- a/dpgen/generator/lib/cp2k.py
+++ b/dpgen/generator/lib/cp2k.py
@@ -1,4 +1,3 @@
-import dpdata
import numpy as np
default_config = {
@@ -32,10 +31,9 @@
def update_dict(old_d, update_d):
- """
- a method to recursive update dict
+ """A method to recursive update dict
:old_d: old dictionary
- :update_d: some update value written in dictionary form
+ :update_d: some update value written in dictionary form.
"""
import collections.abc
@@ -51,8 +49,7 @@ def update_dict(old_d, update_d):
def iterdict(d, out_list, flag=None):
- """
- :doc: a recursive expansion of dictionary into cp2k input
+ """:doc: a recursive expansion of dictionary into cp2k input
:k: current key
:v: current value
:d: current dictionary under expansion
@@ -64,7 +61,7 @@ def iterdict(d, out_list, flag=None):
# if value is dictionary
if isinstance(v, dict):
# flag == None, it is now in top level section of cp2k
- if flag == None:
+ if flag is None:
out_list.append("&" + k)
out_list.append("&END " + k)
iterdict(v, out_list, k)
@@ -98,7 +95,7 @@ def iterdict(d, out_list, flag=None):
else:
v = str(v)
- if flag == None:
+ if flag is None:
out_list.append(k + " " + v)
print(k, ":", v)
else:
@@ -154,7 +151,7 @@ def make_cp2k_xyz(sys_data):
def make_cp2k_input_from_external(sys_data, exinput_path):
# read the input content as string
- with open(exinput_path, "r") as f:
+ with open(exinput_path) as f:
exinput = f.readlines()
# find the ABC cell string
diff --git a/dpgen/generator/lib/cvasp.py b/dpgen/generator/lib/cvasp.py
index d98d549d4..d4d98f770 100644
--- a/dpgen/generator/lib/cvasp.py
+++ b/dpgen/generator/lib/cvasp.py
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
import argparse
@@ -37,9 +36,8 @@ def runvasp(
auto_npar=False,
ediffg=-0.05,
):
- """
- cmd example:
- cmd=['mpirun', '-np', '32' , '-machinefile', 'hosts','vasp_std']
+ """Cmd example:
+ cmd=['mpirun', '-np', '32' , '-machinefile', 'hosts','vasp_std'].
"""
if opt:
jobs = cvj.full_opt_run(
diff --git a/dpgen/generator/lib/ele_temp.py b/dpgen/generator/lib/ele_temp.py
index e2396b6fe..9f9f2c014 100644
--- a/dpgen/generator/lib/ele_temp.py
+++ b/dpgen/generator/lib/ele_temp.py
@@ -1,4 +1,3 @@
-import json
import os
import dpdata
@@ -7,9 +6,9 @@
from pymatgen.io.vasp.inputs import Incar
-class NBandsEsti(object):
+class NBandsEsti:
def __init__(self, test_list):
- if type(test_list) is list:
+ if isinstance(test_list, list):
ele_t = []
vol = []
d_nbd = []
@@ -29,7 +28,7 @@ def __init__(self, test_list):
self.pref = np.average(alpha)
# print(np.average(alpha), np.std(alpha), self.err/self.pref)
# print((ele_t), vol, d_nbd, nbd, alpha)
- elif type(test_list) is str:
+ elif isinstance(test_list, str):
with open(test_list) as fp:
self.pref = float(fp.readline())
self.err = float(fp.readline())
diff --git a/dpgen/generator/lib/gaussian.py b/dpgen/generator/lib/gaussian.py
index eb4c919f2..421f15b84 100644
--- a/dpgen/generator/lib/gaussian.py
+++ b/dpgen/generator/lib/gaussian.py
@@ -72,7 +72,7 @@ def _crd2mul(symbols, crds):
f"{atomnumber}\nDPGEN\n",
"\n".join(
[
- "{:2s} {:22.15f} {:22.15f} {:22.15f}".format(s, x, y, z)
+ f"{s:2s} {x:22.15f} {y:22.15f} {z:22.15f}"
for s, (x, y, z) in zip(symbols, crds)
]
),
@@ -115,7 +115,7 @@ def make_gaussian_input(sys_data, fp_params):
else:
keywords = fp_params["keywords"]
- if type(keywords) == str:
+ if isinstance(keywords, str):
keywords = [keywords]
else:
keywords = keywords.copy()
@@ -128,7 +128,7 @@ def make_gaussian_input(sys_data, fp_params):
use_fragment_guesses = False
multiplicity = fp_params.get("multiplicity", "auto")
- if type(multiplicity) == int:
+ if isinstance(multiplicity, int):
multiplicity = fp_params["multiplicity"]
mult_auto = False
elif multiplicity == "auto":
@@ -167,20 +167,20 @@ def make_gaussian_input(sys_data, fp_params):
buff = []
# keywords, e.g., force b3lyp/6-31g**
if use_fragment_guesses:
- keywords[0] = "{} guess=fragment={}".format(keywords[0], frag_numb)
+ keywords[0] = f"{keywords[0]} guess=fragment={frag_numb}"
chkkeywords = []
if len(keywords) > 1:
- chkkeywords.append("%chk={}.chk".format(str(uuid.uuid1())))
+ chkkeywords.append(f"%chk={str(uuid.uuid1())}.chk")
- nprockeywords = "%nproc={:d}".format(nproc)
+ nprockeywords = f"%nproc={nproc:d}"
titlekeywords = "DPGEN"
- chargekeywords = "{} {}".format(charge, multiplicity)
+ chargekeywords = f"{charge} {multiplicity}"
buff = [
*chkkeywords,
nprockeywords,
- "#{}".format(keywords[0]),
+ f"#{keywords[0]}",
"",
titlekeywords,
"",
@@ -193,7 +193,7 @@ def make_gaussian_input(sys_data, fp_params):
"%s(Fragment=%d) %f %f %f" % (symbol, frag_index[ii] + 1, *coordinate)
)
else:
- buff.append("%s %f %f %f" % (symbol, *coordinate))
+ buff.append("{} {:f} {:f} {:f}".format(symbol, *coordinate))
if "basis_set" in fp_params:
# custom basis set
buff.extend(["", fp_params["basis_set"], ""])
@@ -203,7 +203,7 @@ def make_gaussian_input(sys_data, fp_params):
"\n--link1--",
*chkkeywords,
nprockeywords,
- "#{}".format(kw),
+ f"#{kw}",
"",
titlekeywords,
"",
diff --git a/dpgen/generator/lib/lammps.py b/dpgen/generator/lib/lammps.py
index e03ed7def..d9ff4a493 100644
--- a/dpgen/generator/lib/lammps.py
+++ b/dpgen/generator/lib/lammps.py
@@ -1,9 +1,6 @@
#!/usr/bin/env python3
-import os
import random
-import subprocess as sp
-import sys
import dpdata
import numpy as np
@@ -40,6 +37,7 @@ def make_lammps_input(
max_seed=1000000,
nopbc=False,
deepmd_version="0.1",
+ nbeads=None,
):
if (ele_temp_f is not None or ele_temp_a is not None) and Version(
deepmd_version
@@ -52,9 +50,22 @@ def make_lammps_input(
"the frame style ele_temp and atom style ele_temp should not be set at the same time"
)
ret = "variable NSTEPS equal %d\n" % nsteps
+ if nbeads is not None:
+ if nbeads <= 0:
+ raise ValueError(
+ "The number of beads should be positive. Check your nbeads setting."
+ )
+ power = 1
+ while power < nbeads:
+ power *= 10
+ ret += "variable ibead uloop %d pad\n" % (power - 1)
+ if nbeads is not None:
+ ret += "atom_modify map yes\n"
ret += "variable THERMO_FREQ equal %d\n" % trj_freq
ret += "variable DUMP_FREQ equal %d\n" % trj_freq
ret += "variable TEMP equal %f\n" % temp
+ if nbeads is not None:
+ ret += "variable TEMP_NBEADS equal %f\n" % (temp * nbeads)
if ele_temp_f is not None:
ret += "variable ELE_TEMP equal %f\n" % ele_temp_f
if ele_temp_a is not None:
@@ -75,10 +86,16 @@ def make_lammps_input(
ret += "neigh_modify delay %d\n" % neidelay
ret += "\n"
ret += "box tilt large\n"
- ret += (
- 'if "${restart} > 0" then "read_restart dpgen.restart.*" else "read_data %s"\n'
- % conf_file
- )
+ if nbeads is None:
+ ret += (
+ 'if "${restart} > 0" then "read_restart dpgen.restart.*" else "read_data %s"\n'
+ % conf_file
+ )
+ else:
+ ret += (
+ 'if "${restart} > 0" then "read_restart dpgen.restart${ibead}.*" else "read_data %s"\n'
+ % conf_file
+ )
ret += "change_box all triclinic\n"
for jj in range(len(mass_map)):
ret += "mass %d %f\n" % (jj + 1, mass_map[jj])
@@ -101,26 +118,43 @@ def make_lammps_input(
keywords += "fparam ${ELE_TEMP}"
if ele_temp_a is not None:
keywords += "aparam ${ELE_TEMP}"
- ret += (
- "pair_style deepmd %s out_freq ${THERMO_FREQ} out_file model_devi.out %s\n"
- % (graph_list, keywords)
- )
+ if nbeads is None:
+ ret += f"pair_style deepmd {graph_list} out_freq ${{THERMO_FREQ}} out_file model_devi.out {keywords}\n"
+ else:
+ ret += f"pair_style deepmd {graph_list} out_freq ${{THERMO_FREQ}} out_file model_devi${{ibead}}.out {keywords}\n"
ret += "pair_coeff * *\n"
ret += "\n"
ret += "thermo_style custom step temp pe ke etotal press vol lx ly lz xy xz yz\n"
ret += "thermo ${THERMO_FREQ}\n"
model_devi_merge_traj = jdata.get("model_devi_merge_traj", False)
- if model_devi_merge_traj is True:
- ret += "dump 1 all custom ${DUMP_FREQ} all.lammpstrj id type x y z fx fy fz\n"
- ret += 'if "${restart} > 0" then "dump_modify 1 append yes"\n'
+ if nbeads is None:
+ if model_devi_merge_traj is True:
+ ret += "dump 1 all custom ${DUMP_FREQ} all.lammpstrj id type x y z fx fy fz\n"
+ ret += 'if "${restart} > 0" then "dump_modify 1 append yes"\n'
+ else:
+ ret += "dump 1 all custom ${DUMP_FREQ} traj/*.lammpstrj id type x y z fx fy fz\n"
+ else:
+ if model_devi_merge_traj is True:
+ ret += "dump 1 all custom ${DUMP_FREQ} all.lammpstrj${ibead} id type x y z fx fy fz\n"
+ ret += 'if "${restart} > 0" then "dump_modify 1 append yes"\n'
+ else:
+ ret += "dump 1 all custom ${DUMP_FREQ} traj/*.lammpstrj${ibead} id type x y z fx fy fz\n"
+ if nbeads is None:
+ ret += "restart 10000 dpgen.restart\n"
else:
- ret += "dump 1 all custom ${DUMP_FREQ} traj/*.lammpstrj id type x y z fx fy fz\n"
- ret += "restart 10000 dpgen.restart\n"
+ ret += "restart 10000 dpgen.restart${ibead}\n"
ret += "\n"
if pka_e is None:
- ret += 'if "${restart} == 0" then "velocity all create ${TEMP} %d"' % (
- random.randrange(max_seed - 1) + 1
- )
+ if nbeads is None:
+ ret += (
+ 'if "${restart} == 0" then "velocity all create ${TEMP} %d"'
+ % (random.randrange(max_seed - 1) + 1)
+ )
+ else:
+ ret += (
+ 'if "${restart} == 0" then "velocity all create ${TEMP_NBEADS} %d"'
+ % (random.randrange(max_seed - 1) + 1)
+ )
else:
sys = dpdata.System(conf_file, fmt="lammps/lmp")
sys_data = sys.data
@@ -135,7 +169,7 @@ def make_lammps_input(
pka_vec = _sample_sphere()
pka_vec *= pka_vn
ret += "group first id 1\n"
- ret += 'if "${restart} == 0" then "velocity first set %f %f %f"\n' % (
+ ret += 'if "${{restart}} == 0" then "velocity first set {:f} {:f} {:f}"\n'.format(
pka_vec[0],
pka_vec[1],
pka_vec[2],
@@ -146,18 +180,34 @@ def make_lammps_input(
assert pres is not None
if nopbc:
raise RuntimeError("ensemble %s is conflicting with nopbc" % ensemble)
- if ensemble == "npt" or ensemble == "npt-i" or ensemble == "npt-iso":
- ret += "fix 1 all npt temp ${TEMP} ${TEMP} ${TAU_T} iso ${PRES} ${PRES} ${TAU_P}\n"
- elif ensemble == "npt-a" or ensemble == "npt-aniso":
- ret += "fix 1 all npt temp ${TEMP} ${TEMP} ${TAU_T} aniso ${PRES} ${PRES} ${TAU_P}\n"
- elif ensemble == "npt-t" or ensemble == "npt-tri":
- ret += "fix 1 all npt temp ${TEMP} ${TEMP} ${TAU_T} tri ${PRES} ${PRES} ${TAU_P}\n"
- elif ensemble == "nvt":
- ret += "fix 1 all nvt temp ${TEMP} ${TEMP} ${TAU_T}\n"
- elif ensemble == "nve":
- ret += "fix 1 all nve\n"
+ if nbeads is None:
+ if ensemble == "npt" or ensemble == "npt-i" or ensemble == "npt-iso":
+ ret += "fix 1 all npt temp ${TEMP} ${TEMP} ${TAU_T} iso ${PRES} ${PRES} ${TAU_P}\n"
+ elif ensemble == "npt-a" or ensemble == "npt-aniso":
+ ret += "fix 1 all npt temp ${TEMP} ${TEMP} ${TAU_T} aniso ${PRES} ${PRES} ${TAU_P}\n"
+ elif ensemble == "npt-t" or ensemble == "npt-tri":
+ ret += "fix 1 all npt temp ${TEMP} ${TEMP} ${TAU_T} tri ${PRES} ${PRES} ${TAU_P}\n"
+ elif ensemble == "nvt":
+ ret += "fix 1 all nvt temp ${TEMP} ${TEMP} ${TAU_T}\n"
+ elif ensemble == "nve":
+ ret += "fix 1 all nve\n"
+ else:
+ raise RuntimeError("unknown emsemble " + ensemble)
else:
- raise RuntimeError("unknown emsemble " + ensemble)
+ if ensemble == "npt" or ensemble == "npt-i" or ensemble == "npt-iso":
+ ret += "fix 1 all pimd/langevin fmmode physical ensemble npt integrator obabo thermostat PILE_L ${ibead} temp ${TEMP} tau ${TAU_T} scale 1.0 barostat BZP iso ${PRES} taup ${TAU_P}\n"
+ elif ensemble == "npt-a" or ensemble == "npt-aniso":
+ ret += "fix 1 all pimd/langevin fmmode physical ensemble npt integrator obabo thermostat PILE_L ${ibead} temp ${TEMP} tau ${TAU_T} scale 1.0 barostat BZP aniso ${PRES} taup ${TAU_P}\n"
+ elif ensemble == "nvt":
+ ret += "fix 1 all pimd/langevin fmmode physical ensemble nvt integrator obabo thermostat PILE_L ${ibead} temp ${TEMP} tau ${TAU_T} scale 1.0\n"
+ elif ensemble == "nve":
+ ret += "fix 1 all pimd/langevin fmmode physical ensemble nve integrator obabo temp ${TEMP}\n"
+ else:
+ raise RuntimeError(
+ "unknown emsemble "
+ + ensemble
+ + " for fix pimd/langevin\nrefer to https://docs.lammps.org/fix_pimd.html for more information"
+ )
if nopbc:
ret += "velocity all zero linear\n"
ret += "fix fm all momentum 1 linear 1 1 1\n"
@@ -213,7 +263,6 @@ def get_all_dumped_forces(file_name):
exist_atoms = False
for idx, ii in enumerate(lines):
-
if "ITEM: NUMBER OF ATOMS" in ii:
natoms = int(lines[idx + 1])
exist_natoms = True
diff --git a/dpgen/generator/lib/make_calypso.py b/dpgen/generator/lib/make_calypso.py
index 00c1412de..c96e2e960 100644
--- a/dpgen/generator/lib/make_calypso.py
+++ b/dpgen/generator/lib/make_calypso.py
@@ -6,8 +6,6 @@
import numpy as np
-from dpgen.generator.lib.utils import create_path
-
def make_calypso_input(
nameofatoms,
@@ -41,7 +39,7 @@ def make_calypso_input(
assert (
numberofformula is not None
and len(numberofformula) == 2
- and type(numberofformula) is list
+ and isinstance(numberofformula, list)
)
ret += "NumberOfFormula = %s\n" % (" ".join(list(map(str, numberofformula))))
ret += "# The volume per formula unit. Unit is in angstrom^3.\n"
@@ -68,9 +66,9 @@ def make_calypso_input(
ret += (
"# The population size. Normally, it has a larger number for larger systems.\n"
)
- assert popsize is not None and type(popsize) is int
+ assert popsize is not None and isinstance(popsize, int)
ret += "PopSize = %d\n" % (popsize)
- assert maxstep is not None and type(maxstep) is int
+ assert maxstep is not None and isinstance(maxstep, int)
ret += "# The Max step for iteration\n"
ret += "MaxStep = %d\n" % (maxstep)
ret += "#It determines which method should be adopted in generation the random structure. \n"
@@ -81,7 +79,7 @@ def make_calypso_input(
ret += "# 0 combination of all method\n"
ret += "# If GenType=3 or 4, it determined the small unit to grow the whole structure\n"
ret += "# It determines which local optimization method should be interfaced in the simulation.\n"
- assert icode is not None and type(icode) is int
+ assert icode is not None and isinstance(icode, int)
ret += "ICode= %d\n" % (icode)
ret += "# ICode= 1 interfaced with VASP\n"
ret += "# ICode= 2 interfaced with SIESTA\n"
@@ -103,9 +101,11 @@ def make_calypso_input(
ret += "NumberOfParallel = 4\n"
assert split is not None
ret += "Split = %s\n" % (split)
- assert pstress is not None and (type(pstress) is int or type(pstress) is float)
+ assert pstress is not None and (
+ isinstance(pstress, int) or isinstance(pstress, float)
+ )
ret += "PSTRESS = %f\n" % (pstress)
- assert fmax is not None or type(fmax) is float
+ assert fmax is not None or isinstance(fmax, float)
ret += "fmax = %f\n" % (fmax)
ret += "################################ End of The Basic Parameters of CALYPSO #######################\n"
if vsc == "T":
@@ -129,7 +129,6 @@ def make_calypso_input(
def _make_model_devi_buffet(jdata, calypso_run_opt_path):
-
calypso_input_path = jdata.get("calypso_input_path")
if jdata.get("vsc", False):
# [input.dat.Li.250, input.dat.Li.300]
@@ -164,7 +163,6 @@ def _make_model_devi_buffet(jdata, calypso_run_opt_path):
def _make_model_devi_native_calypso(iter_index, model_devi_jobs, calypso_run_opt_path):
-
for iiidx, jobbs in enumerate(model_devi_jobs):
if iter_index in jobbs.get("times"):
cur_job = model_devi_jobs[iiidx]
@@ -235,7 +233,7 @@ def write_model_devi_out(devi, fname):
f"min_devi_{item}",
f"avg_devi_{item}",
)
- header += "%16s" % str("min_dis")
+ header += "%16s" % "min_dis"
np.savetxt(
fname,
devi,
diff --git a/dpgen/generator/lib/parse_calypso.py b/dpgen/generator/lib/parse_calypso.py
index 7bd3d7d50..460d478b6 100644
--- a/dpgen/generator/lib/parse_calypso.py
+++ b/dpgen/generator/lib/parse_calypso.py
@@ -4,13 +4,12 @@
def _parse_calypso_input(var, input_path):
-
if os.path.basename(input_path) != "input.dat":
input_path = os.path.join(input_path, "input.dat")
if not os.path.exists(input_path):
raise FileNotFoundError(input_path)
- f = open(input_path, "r")
+ f = open(input_path)
lines = f.readlines()
f.close()
@@ -22,9 +21,9 @@ def _parse_calypso_input(var, input_path):
def _parse_calypso_dis_mtx(numberofspecies, input_path):
try:
- f = open(input_path, "r")
- except:
- f = open(os.path.join(input_path, "input.dat"), "r")
+ f = open(input_path)
+ except Exception:
+ f = open(os.path.join(input_path, "input.dat"))
while True:
line = f.readline()
if len(line) == 0:
diff --git a/dpgen/generator/lib/pwmat.py b/dpgen/generator/lib/pwmat.py
index 06ef0ddf3..6e3e10805 100644
--- a/dpgen/generator/lib/pwmat.py
+++ b/dpgen/generator/lib/pwmat.py
@@ -1,6 +1,5 @@
#!/usr/bin/python3
-import os
import numpy as np
@@ -18,7 +17,7 @@ def _make_pwmat_kp_mp(kpoints):
def _make_kspacing_kpoints(config, kspacing):
- with open(config, "r") as fp:
+ with open(config) as fp:
lines = fp.read().split("\n")
box = []
for idx, ii in enumerate(lines):
@@ -63,8 +62,8 @@ def make_pwmat_input_dict(
"94 4 3 " + str(icmix) + " " + str(sigma) + " " + str(smearing)
)
else:
- SCF_ITER0_1 = "6 4 3 0.0000 " + str(simga) + " 2"
- SCF_ITER0_2 = "94 4 3 " + str(icmix) + " " + str(simga) + " 2"
+ SCF_ITER0_1 = "6 4 3 0.0000 " + str(sigma) + " 2"
+ SCF_ITER0_2 = "94 4 3 " + str(icmix) + " " + str(sigma) + " 2"
else:
if smearing is not None:
@@ -107,21 +106,21 @@ def _update_input_dict(input_dict_, user_dict):
return input_dict_
input_dict = input_dict_
for ii in user_dict:
- input_dict[ci] = user_dict[ii]
+ input_dict[ii] = user_dict[ii]
return input_dict
def write_input_dict(input_dict):
lines = []
for key in input_dict:
- if type(input_dict[key]) == bool:
+ if isinstance(input_dict[key], bool):
if input_dict[key]:
rs = "T"
else:
rs = "F"
else:
rs = str(input_dict[key])
- lines.append("%s=%s" % (key, rs))
+ lines.append(f"{key}={rs}")
return "\n".join(lines)
@@ -135,25 +134,25 @@ def _make_smearing(fp_params):
smearing = fp_params["smearing"]
if "sigma" in fp_params:
sigma = fp_params["sigma"]
- if icmix == None:
- if smearing == None:
- if sigma == None:
+ if icmix is None:
+ if smearing is None:
+ if sigma is None:
return None, None, None
else:
return None, None, sigma
else:
- if sigma == None:
+ if sigma is None:
return None, smearing, None
else:
return None, smearing, sigma
else:
- if smearing == None:
- if sigma == None:
+ if smearing is None:
+ if sigma is None:
return icmix, None, None
else:
return icmix, None, sigma
else:
- if sigma == None:
+ if sigma is None:
return icmix, smearing, None
else:
return icmix, smearing, sigma
@@ -206,4 +205,5 @@ def input_upper(dinput):
standard_input = {}
for key, val in dinput.items():
standard_input[key.upper()] = val
- return Input(standard_input)
+ # return Input(standard_input)
+ return standard_input
diff --git a/dpgen/generator/lib/pwscf.py b/dpgen/generator/lib/pwscf.py
index bc3c6bab3..c4a86fc80 100644
--- a/dpgen/generator/lib/pwscf.py
+++ b/dpgen/generator/lib/pwscf.py
@@ -8,16 +8,16 @@
def _convert_dict(idict):
lines = []
for key in idict.keys():
- if type(idict[key]) == bool:
+ if isinstance(idict[key], bool):
if idict[key]:
ws = ".TRUE."
else:
ws = ".FALSE."
- elif type(idict[key]) == str:
+ elif isinstance(idict[key], str):
ws = "'" + idict[key] + "'"
else:
ws = str(idict[key])
- lines.append("%s=%s," % (key, ws))
+ lines.append(f"{key}={ws},")
return lines
@@ -110,7 +110,7 @@ def _make_pwscf_03_config(sys_data):
cc = 0
for ii in range(ntypes):
for jj in range(atom_numbs[ii]):
- ret += "%s %f %f %f\n" % (
+ ret += "{} {:f} {:f} {:f}\n".format(
atom_names[ii],
coordinates[cc][0],
coordinates[cc][1],
@@ -157,7 +157,7 @@ def _make_smearing(fp_params):
degauss = fp_params["sigma"]
if (smearing is not None) and (smearing.split(":")[0] == "mp"):
smearing = "mp"
- if not (smearing in [None, "gauss", "mp", "fd"]):
+ if smearing not in [None, "gauss", "mp", "fd"]:
raise RuntimeError("unknow smearing method " + smearing)
return smearing, degauss
diff --git a/dpgen/generator/lib/run_calypso.py b/dpgen/generator/lib/run_calypso.py
index 289f63266..6af12008d 100644
--- a/dpgen/generator/lib/run_calypso.py
+++ b/dpgen/generator/lib/run_calypso.py
@@ -1,23 +1,18 @@
-"""
-calypso as model devi engine:
- 1. gen_structures
- 2. analysis
- 3. model devi
+"""calypso as model devi engine:
+1. gen_structures
+2. analysis
+3. model devi.
"""
-import copy
import glob
-import math
import os
import random
-import re
import shutil
import sys
from itertools import combinations
from pathlib import Path
import dpdata
-import numpy as np
from ase.io.trajectory import Trajectory
from ase.io.vasp import write_vasp
from packaging.version import Version
@@ -37,7 +32,6 @@
def gen_structures(
iter_index, jdata, mdata, caly_run_path, current_idx, length_of_caly_runopt_list
):
-
# run calypso
# vsc means generate elemental, binary and ternary at the same time
vsc = jdata.get("vsc", False) # take CALYPSO as confs generator
@@ -92,7 +86,7 @@ def gen_structures(
PickUpStep = 1
try:
os.mkdir("opt")
- except:
+ except Exception:
pass
popsize = int(_parse_calypso_input("PopSize", "."))
@@ -110,7 +104,7 @@ def gen_structures(
for pop in range(ii * int(popsize), (ii + 1) * int(popsize)):
try:
os.mkdir("task.%03d" % pop)
- except:
+ except Exception:
shutil.rmtree("task.%03d" % pop)
os.mkdir("task.%03d" % pop)
shutil.copyfile(
@@ -242,7 +236,7 @@ def gen_structures(
shutil.copyfile(name, "POSCAR_%s" % (idx + 1))
try:
os.mkdir("task.%04d" % (idx + 1))
- except:
+ except Exception:
shutil.rmtree("task.%04d" % (idx + 1))
os.mkdir("task.%04d" % (idx + 1))
shutil.copyfile(
@@ -343,7 +337,6 @@ def gen_structures(
def gen_main(iter_index, jdata, mdata, caly_run_opt_list, gen_idx):
-
iter_name = make_iter_name(iter_index)
work_path = os.path.join(iter_name, model_devi_name)
@@ -456,7 +449,6 @@ def analysis(iter_index, jdata, calypso_model_devi_path):
def run_calypso_model_devi(iter_index, jdata, mdata):
-
dlog.info("start running CALYPSO")
iter_name = make_iter_name(iter_index)
@@ -484,7 +476,7 @@ def run_calypso_model_devi(iter_index, jdata, mdata):
lines = ["1 0\n"]
f.close()
else:
- f = open(record_calypso_path, "r")
+ f = open(record_calypso_path)
lines = f.readlines()
f.close()
diff --git a/dpgen/generator/lib/utils.py b/dpgen/generator/lib/utils.py
index 10c1ae360..4eaf4ad87 100644
--- a/dpgen/generator/lib/utils.py
+++ b/dpgen/generator/lib/utils.py
@@ -30,7 +30,7 @@ def create_path(path):
def replace(file_name, pattern, subst):
- file_handel = open(file_name, "r")
+ file_handel = open(file_name)
file_string = file_handel.read()
file_handel.close()
file_string = re.sub(pattern, subst, file_string)
@@ -76,18 +76,20 @@ def record_iter(record, ii, jj):
def symlink_user_forward_files(mdata, task_type, work_path, task_format=None):
- """
- Symlink user-defined forward_common_files
- Current path should be work_path, such as 00.train
+ """Symlink user-defined forward_common_files
+ Current path should be work_path, such as 00.train.
Parameters
- ---------
+ ----------
mdata : dict
machine parameters
- task_type: str
+ task_type : str
task_type, such as "train"
work_path : str
work_path, such as "iter.000001/00.train"
+ task_format : dict
+ formats of tasks
+
Returns
-------
None
@@ -100,7 +102,7 @@ def symlink_user_forward_files(mdata, task_type, work_path, task_format=None):
for file in user_forward_files:
assert os.path.isfile(
file
- ), "user_forward_file %s of %s stage doesn't exist. " % (file, task_type)
+ ), f"user_forward_file {file} of {task_type} stage doesn't exist. "
tasks = glob.glob(os.path.join(work_path, task_format[task_type]))
for task in tasks:
if os.path.isfile(os.path.join(task, os.path.basename(file))):
diff --git a/dpgen/generator/lib/vasp.py b/dpgen/generator/lib/vasp.py
index dcfbf0e43..a5f1e7aee 100644
--- a/dpgen/generator/lib/vasp.py
+++ b/dpgen/generator/lib/vasp.py
@@ -1,8 +1,6 @@
#!/usr/bin/python3
-import os
-import numpy as np
from pymatgen.io.vasp import Incar
@@ -61,14 +59,14 @@ def _update_incar_dict(incar_dict_, user_dict):
def write_incar_dict(incar_dict):
lines = []
for key in incar_dict:
- if type(incar_dict[key]) == bool:
+ if isinstance(incar_dict[key], bool):
if incar_dict[key]:
rs = "T"
else:
rs = "F"
else:
rs = str(incar_dict[key])
- lines.append("%s=%s" % (key, rs))
+ lines.append(f"{key}={rs}")
return "\n".join(lines)
@@ -79,7 +77,7 @@ def _make_smearing(fp_params):
smearing = fp_params["smearing"]
if "sigma" in fp_params:
sigma = fp_params["sigma"]
- if smearing == None:
+ if smearing is None:
return None, sigma
smearing_method = (smearing.split(":")[0]).lower()
if smearing_method == "mp":
diff --git a/dpgen/generator/run.py b/dpgen/generator/run.py
index 9984d058e..034918efc 100644
--- a/dpgen/generator/run.py
+++ b/dpgen/generator/run.py
@@ -1,12 +1,11 @@
#!/usr/bin/env python3
-"""
-init: data
+"""init: data
iter:
00.train
01.model_devi
02.vasp
- 03.data
+ 03.data.
"""
import argparse
@@ -19,20 +18,21 @@
import os
import queue
import random
+import re
import shutil
-import subprocess as sp
import sys
import warnings
from collections import Counter
from collections.abc import Iterable
-from typing import List
+from pathlib import Path
+from typing import Optional
import dpdata
import numpy as np
import scipy.constants as pc
from numpy.linalg import norm
from packaging.version import Version
-from pymatgen.io.vasp import Incar, Kpoints, Potcar
+from pymatgen.io.vasp import Incar, Kpoints
from dpgen import ROOT_PATH, SHORT_CMD, dlog
from dpgen.auto_test.lib.vasp import make_kspacing_kpoints
@@ -67,26 +67,21 @@
# from dpgen.generator.lib.pwscf import cvt_1frame
from dpgen.generator.lib.pwmat import (
- input_upper,
make_pwmat_input_dict,
make_pwmat_input_user_dict,
write_input_dict,
)
from dpgen.generator.lib.pwscf import make_pwscf_input
from dpgen.generator.lib.run_calypso import (
- analysis,
- gen_structures,
run_calypso_model_devi,
)
from dpgen.generator.lib.siesta import make_siesta_input
from dpgen.generator.lib.utils import (
- copy_file_list,
create_path,
log_iter,
log_task,
make_iter_name,
record_iter,
- replace,
symlink_user_forward_files,
)
from dpgen.generator.lib.vasp import (
@@ -95,7 +90,15 @@
write_incar_dict,
)
from dpgen.remote.decide_machine import convert_mdata
-from dpgen.util import convert_training_data_to_hdf5, expand_sys_str, normalize, sepline
+from dpgen.util import (
+ convert_training_data_to_hdf5,
+ expand_sys_str,
+ load_file,
+ normalize,
+ sepline,
+ set_directory,
+ setup_ele_temp,
+)
from .arginfo import run_jdata_arginfo
@@ -195,7 +198,7 @@ def poscar_natoms(lines):
def poscar_shuffle(poscar_in, poscar_out):
- with open(poscar_in, "r") as fin:
+ with open(poscar_in) as fin:
lines = list(fin)
numb_atoms = poscar_natoms(lines)
idx = np.arange(8, 8 + numb_atoms)
@@ -210,9 +213,9 @@ def poscar_shuffle(poscar_in, poscar_out):
def expand_idx(in_list):
ret = []
for ii in in_list:
- if type(ii) == int:
+ if isinstance(ii, int):
ret.append(ii)
- elif type(ii) == str:
+ elif isinstance(ii, str):
step_str = ii.split(":")
if len(step_str) > 1:
step = int(step_str[1])
@@ -264,7 +267,7 @@ def make_train(iter_index, jdata, mdata):
training_iter0_model = jdata.get("training_iter0_model_path", [])
training_init_model = jdata.get("training_init_model", False)
training_reuse_iter = jdata.get("training_reuse_iter")
- training_reuse_old_ratio = jdata.get("training_reuse_old_ratio", None)
+ training_reuse_old_ratio = jdata.get("training_reuse_old_ratio", "auto")
# if you want to use DP-ZBL potential , you have to give the path of your energy potential file
if "srtab_file_path" in jdata.keys():
@@ -275,22 +278,42 @@ def make_train(iter_index, jdata, mdata):
elif "training_reuse_numb_steps" in jdata.keys():
training_reuse_stop_batch = jdata["training_reuse_numb_steps"]
else:
- training_reuse_stop_batch = 400000
+ training_reuse_stop_batch = None
- training_reuse_start_lr = jdata.get("training_reuse_start_lr", 1e-4)
- training_reuse_start_pref_e = jdata.get("training_reuse_start_pref_e", 0.1)
- training_reuse_start_pref_f = jdata.get("training_reuse_start_pref_f", 100)
+ training_reuse_start_lr = jdata.get("training_reuse_start_lr")
+ training_reuse_start_pref_e = jdata.get("training_reuse_start_pref_e")
+ training_reuse_start_pref_f = jdata.get("training_reuse_start_pref_f")
model_devi_activation_func = jdata.get("model_devi_activation_func", None)
+ training_init_frozen_model = (
+ jdata.get("training_init_frozen_model") if iter_index == 0 else None
+ )
+ training_finetune_model = (
+ jdata.get("training_finetune_model") if iter_index == 0 else None
+ )
- if training_reuse_iter is not None and training_reuse_old_ratio is None:
- raise RuntimeError(
- "training_reuse_old_ratio not found but is mandatory when using init-model (training_reuse_iter is detected in param).\n"
- "It defines the ratio of the old-data picking probability to the all-data(old-data plus new-data) picking probability in training after training_reuse_iter.\n"
- "Denoting the index of the current iter as N (N >= training_reuse_iter ), old-data refers to those existed before the N-1 iter, and new-data refers to that obtained by the N-1 iter.\n"
- "A recommended strategy is making the new-to-old ratio close to 10 times of the default value, to reasonably increase the sensitivity of the model to the new-data.\n"
- "By default, the picking probability of data from one system or one iter is proportional to the number of batches (the number of frames divided by batch_size) of that systems or iter.\n"
- "Detailed discussion about init-model (in Chinese) please see https://mp.weixin.qq.com/s/qsKMZ0j270YhQKvwXUiFvQ"
+ auto_ratio = False
+ if (
+ training_reuse_iter is not None
+ and isinstance(training_reuse_old_ratio, str)
+ and training_reuse_old_ratio.startswith("auto")
+ ):
+ s = training_reuse_old_ratio.split(":")
+ if len(s) == 1:
+ new_to_old_ratio = 10.0
+ elif len(s) == 2:
+ new_to_old_ratio = float(s[1])
+ else:
+ raise ValueError(
+ "training_reuse_old_ratio is not correct, got %s"
+ % training_reuse_old_ratio
+ )
+ dlog.info(
+ "Use automatic training_reuse_old_ratio to make new-to-old ratio close to %d times of the default value.",
+ new_to_old_ratio,
)
+ auto_ratio = True
+ number_old_frames = 0
+ number_new_frames = 0
model_devi_engine = jdata.get("model_devi_engine", "lammps")
if iter_index > 0 and _check_empty_iter(iter_index - 1, fp_task_min):
@@ -363,6 +386,8 @@ def make_train(iter_index, jdata, mdata):
)
)
init_batch_size.append(detect_batch_size(ss, single_sys))
+ if auto_ratio:
+ number_old_frames += get_nframes(single_sys)
old_range = None
if iter_index > 0:
for ii in range(iter_index):
@@ -384,6 +409,11 @@ def make_train(iter_index, jdata, mdata):
nframes += dpdata.LabeledSystem(
sys_single, fmt="deepmd/npy"
).get_nframes()
+ if auto_ratio:
+ if ii == iter_index - 1:
+ number_new_frames += nframes
+ else:
+ number_old_frames += nframes
if nframes < fp_task_min:
log_task(
"nframes (%d) in data sys %s is too small, skip" % (nframes, jj)
@@ -393,9 +423,12 @@ def make_train(iter_index, jdata, mdata):
init_data_sys.append(
os.path.normpath(os.path.join("..", "data.iters", sys_single))
)
- init_batch_size.append(
- detect_batch_size(sys_batch_size[sys_idx], sys_single)
+ batch_size = (
+ sys_batch_size[sys_idx]
+ if sys_idx < len(sys_batch_size)
+ else "auto"
)
+ init_batch_size.append(detect_batch_size(batch_size, sys_single))
# establish tasks
jinput = jdata["default_training_param"]
try:
@@ -425,9 +458,13 @@ def make_train(iter_index, jdata, mdata):
mdata["deepmd_version"]
) < Version("3"):
# 2.x
- jinput["training"]["training_data"] = {}
+ jinput["training"].setdefault("training_data", {})
jinput["training"]["training_data"]["systems"] = init_data_sys
- jinput["training"]["training_data"]["batch_size"] = init_batch_size
+ old_batch_size = jinput["training"]["training_data"].get("batch_size", "")
+ if not (
+ isinstance(old_batch_size, str) and old_batch_size.startswith("mixed:")
+ ):
+ jinput["training"]["training_data"]["batch_size"] = init_batch_size
jinput["model"]["type_map"] = jdata["type_map"]
# electron temperature
if use_ele_temp == 0:
@@ -445,6 +482,10 @@ def make_train(iter_index, jdata, mdata):
"DP-GEN currently only supports for DeePMD-kit 1.x or 2.x version!"
)
# set training reuse model
+ if auto_ratio:
+ training_reuse_old_ratio = number_old_frames / (
+ number_old_frames + number_new_frames * new_to_old_ratio
+ )
if training_reuse_iter is not None and iter_index >= training_reuse_iter:
if "numb_steps" in jinput["training"] and training_reuse_stop_batch is not None:
jinput["training"]["numb_steps"] = training_reuse_stop_batch
@@ -453,34 +494,43 @@ def make_train(iter_index, jdata, mdata):
):
jinput["training"]["stop_batch"] = training_reuse_stop_batch
if Version("1") <= Version(mdata["deepmd_version"]) < Version("2"):
- jinput["training"][
- "auto_prob_style"
- ] = "prob_sys_size; 0:%d:%f; %d:%d:%f" % (
- old_range,
- training_reuse_old_ratio,
- old_range,
- len(init_data_sys),
- 1.0 - training_reuse_old_ratio,
+ jinput["training"]["auto_prob_style"] = (
+ "prob_sys_size; 0:%d:%f; %d:%d:%f"
+ % (
+ old_range,
+ training_reuse_old_ratio,
+ old_range,
+ len(init_data_sys),
+ 1.0 - training_reuse_old_ratio,
+ )
)
elif Version("2") <= Version(mdata["deepmd_version"]) < Version("3"):
- jinput["training"]["training_data"][
- "auto_prob"
- ] = "prob_sys_size; 0:%d:%f; %d:%d:%f" % (
- old_range,
- training_reuse_old_ratio,
- old_range,
- len(init_data_sys),
- 1.0 - training_reuse_old_ratio,
+ jinput["training"]["training_data"]["auto_prob"] = (
+ "prob_sys_size; 0:%d:%f; %d:%d:%f"
+ % (
+ old_range,
+ training_reuse_old_ratio,
+ old_range,
+ len(init_data_sys),
+ 1.0 - training_reuse_old_ratio,
+ )
)
else:
raise RuntimeError(
"Unsupported DeePMD-kit version: %s" % mdata["deepmd_version"]
)
- if jinput["loss"].get("start_pref_e") is not None:
+ if (
+ jinput["loss"].get("start_pref_e") is not None
+ and training_reuse_start_pref_e is not None
+ ):
jinput["loss"]["start_pref_e"] = training_reuse_start_pref_e
- if jinput["loss"].get("start_pref_f") is not None:
+ if (
+ jinput["loss"].get("start_pref_f") is not None
+ and training_reuse_start_pref_f is not None
+ ):
jinput["loss"]["start_pref_f"] = training_reuse_start_pref_f
- jinput["learning_rate"]["start_lr"] = training_reuse_start_lr
+ if training_reuse_start_lr is not None:
+ jinput["learning_rate"]["start_lr"] = training_reuse_start_lr
input_files = []
for ii in range(numb_models):
@@ -497,7 +547,7 @@ def make_train(iter_index, jdata, mdata):
os.path.isdir(jj) if "#" not in jj else os.path.isfile(jj.split("#")[0])
):
raise RuntimeError(
- "data sys %s does not exists, cwd is %s" % (jj, os.getcwd())
+ f"data sys {jj} does not exists, cwd is {os.getcwd()}"
)
os.chdir(cwd)
# set random seed for each model
@@ -534,7 +584,7 @@ def make_train(iter_index, jdata, mdata):
mdata["deepmd_version"],
)
assert (
- type(model_devi_activation_func) is list
+ isinstance(model_devi_activation_func, list)
and len(model_devi_activation_func) == numb_models
)
if (
@@ -569,7 +619,7 @@ def make_train(iter_index, jdata, mdata):
old_model_files = glob.glob(os.path.join(prev_task_path, "model.ckpt*"))
_link_old_models(work_path, old_model_files, ii)
else:
- if type(training_iter0_model) == str:
+ if isinstance(training_iter0_model, str):
training_iter0_model = [training_iter0_model]
iter0_models = []
for ii in training_iter0_model:
@@ -584,6 +634,17 @@ def make_train(iter_index, jdata, mdata):
for ii in range(len(iter0_models)):
old_model_files = glob.glob(os.path.join(iter0_models[ii], "model.ckpt*"))
_link_old_models(work_path, old_model_files, ii)
+ copied_models = next(
+ (
+ item
+ for item in (training_init_frozen_model, training_finetune_model)
+ if item is not None
+ ),
+ None,
+ )
+ if copied_models is not None:
+ for ii in range(len(copied_models)):
+ _link_old_models(work_path, [copied_models[ii]], ii, basename="init.pb")
# Copy user defined forward files
symlink_user_forward_files(mdata=mdata, task_type="train", work_path=work_path)
# HDF5 format for training data
@@ -591,10 +652,9 @@ def make_train(iter_index, jdata, mdata):
convert_training_data_to_hdf5(input_files, os.path.join(work_path, "data.hdf5"))
-def _link_old_models(work_path, old_model_files, ii):
- """
- link the `ii`th old model given by `old_model_files` to
- the `ii`th training task in `work_path`
+def _link_old_models(work_path, old_model_files, ii, basename: Optional[str] = None):
+ """Link the `ii`th old model given by `old_model_files` to
+ the `ii`th training task in `work_path`.
"""
task_path = os.path.join(work_path, train_task_fmt % ii)
task_old_path = os.path.join(task_path, "old")
@@ -602,14 +662,17 @@ def _link_old_models(work_path, old_model_files, ii):
cwd = os.getcwd()
for jj in old_model_files:
absjj = os.path.abspath(jj)
- basejj = os.path.basename(jj)
+ if basename is None:
+ basejj = os.path.basename(jj)
+ else:
+ basejj = basename
os.chdir(task_old_path)
os.symlink(os.path.relpath(absjj), basejj)
os.chdir(cwd)
def detect_batch_size(batch_size, system=None):
- if type(batch_size) == int:
+ if isinstance(batch_size, int):
return batch_size
elif batch_size == "auto":
# automaticcaly set batch size, batch_size = 32 // atom_numb (>=1, <=fram_numb)
@@ -623,6 +686,12 @@ def detect_batch_size(batch_size, system=None):
raise RuntimeError("Unsupported batch size")
+def get_nframes(system):
+ format = "deepmd/npy" if "#" not in system else "deepmd/hdf5"
+ s = dpdata.LabeledSystem(system, fmt=format)
+ return s.get_nframes()
+
+
def run_train(iter_index, jdata, mdata):
# print("debug:run_train:mdata", mdata)
# load json param
@@ -631,6 +700,12 @@ def run_train(iter_index, jdata, mdata):
train_input_file = default_train_input_file
training_reuse_iter = jdata.get("training_reuse_iter")
training_init_model = jdata.get("training_init_model", False)
+ training_init_frozen_model = (
+ jdata.get("training_init_frozen_model") if iter_index == 0 else None
+ )
+ training_finetune_model = (
+ jdata.get("training_finetune_model") if iter_index == 0 else None
+ )
if "srtab_file_path" in jdata.keys():
zbl_file = os.path.basename(jdata.get("srtab_file_path", None))
@@ -642,6 +717,16 @@ def run_train(iter_index, jdata, mdata):
except KeyError:
mdata = set_version(mdata)
+ if (
+ training_init_model
+ + (training_init_frozen_model is not None)
+ + (training_finetune_model is not None)
+ > 1
+ ):
+ raise RuntimeError(
+ "training_init_model, training_init_frozen_model, and training_finetune_model are mutually exclusive."
+ )
+
train_command = mdata.get("train_command", "dp")
train_resources = mdata["train_resources"]
@@ -662,22 +747,22 @@ def run_train(iter_index, jdata, mdata):
if Version(mdata["deepmd_version"]) >= Version("1") and Version(
mdata["deepmd_version"]
) < Version("3"):
-
# 1.x
## Commands are like `dp train` and `dp freeze`
## train_command should not be None
assert train_command
- command = "%s train %s" % (train_command, train_input_file)
+ extra_flags = ""
+ init_flag = ""
+ if jdata.get("dp_train_skip_neighbor_stat", False):
+ extra_flags += " --skip-neighbor-stat"
if training_init_model:
- command = (
- "{ if [ ! -f model.ckpt.index ]; then %s --init-model old/model.ckpt; else %s --restart model.ckpt; fi }"
- % (command, command)
- )
- else:
- command = (
- "{ if [ ! -f model.ckpt.index ]; then %s; else %s --restart model.ckpt; fi }"
- % (command, command)
- )
+ init_flag = " --init-model old/model.ckpt"
+ elif training_init_frozen_model is not None:
+ init_flag = " --init-frz-model old/init.pb"
+ elif training_finetune_model is not None:
+ init_flag = " --finetune old/init.pb"
+ command = f"{train_command} train {train_input_file}{extra_flags}"
+ command = f"{{ if [ ! -f model.ckpt.index ]; then {command}{init_flag}; else {command} --restart model.ckpt; fi }}"
command = "/bin/sh -c '%s'" % command
commands.append(command)
command = "%s freeze" % train_command
@@ -709,6 +794,9 @@ def run_train(iter_index, jdata, mdata):
os.path.join("old", "model.ckpt.index"),
os.path.join("old", "model.ckpt.data-00000-of-00001"),
]
+ elif training_init_frozen_model is not None or training_finetune_model is not None:
+ forward_files.append(os.path.join("old", "init.pb"))
+
backward_files = ["frozen_model.pb", "lcurve.out", "train.log"]
backward_files += [
"model.ckpt.meta",
@@ -805,8 +893,7 @@ def _get_param_alias(jdata, names):
if ii in jdata:
return jdata[ii]
raise ValueError(
- "one of the keys %s should be in jdata %s"
- % (str(names), (json.dumps(jdata, indent=4)))
+ f"one of the keys {str(names)} should be in jdata {json.dumps(jdata, indent=4)}"
)
@@ -829,7 +916,11 @@ def parse_cur_job(cur_job):
dt = _get_param_alias(cur_job, ["dt"])
else:
dt = None
- return ensemble, nsteps, trj_freq, temps, press, pka_e, dt
+ if "nbeads" in cur_job:
+ nbeads = _get_param_alias(cur_job, ["nbeads"])
+ else:
+ nbeads = None
+ return ensemble, nsteps, trj_freq, temps, press, pka_e, dt, nbeads
def expand_matrix_values(target_list, cur_idx=0):
@@ -919,11 +1010,12 @@ def revise_lmp_input_model(lmp_lines, task_model_list, trj_freq, deepmd_version=
trj_freq,
)
else:
- lmp_lines[
- idx
- ] = "pair_style deepmd %s out_freq %d out_file model_devi.out\n" % (
- graph_list,
- trj_freq,
+ lmp_lines[idx] = (
+ "pair_style deepmd %s out_freq %d out_file model_devi.out\n"
+ % (
+ graph_list,
+ trj_freq,
+ )
)
return lmp_lines
@@ -948,10 +1040,7 @@ def revise_lmp_input_plm(lmp_lines, in_plm, out_plm="output.plumed"):
idx = find_only_one_key(lmp_lines, ["fix", "dpgen_plm"])
lmp_lines[
idx
- ] = "fix dpgen_plm all plumed plumedfile %s outfile %s\n" % (
- in_plm,
- out_plm,
- )
+ ] = f"fix dpgen_plm all plumed plumedfile {in_plm} outfile {out_plm}\n"
return lmp_lines
@@ -1373,7 +1462,21 @@ def _make_model_devi_native(iter_index, jdata, mdata, conf_systems):
if iter_index >= len(model_devi_jobs):
return False
cur_job = model_devi_jobs[iter_index]
- ensemble, nsteps, trj_freq, temps, press, pka_e, dt = parse_cur_job(cur_job)
+ ensemble, nsteps, trj_freq, temps, press, pka_e, dt, nbeads = parse_cur_job(cur_job)
+ model_devi_f_avg_relative = jdata.get("model_devi_f_avg_relative", False)
+ model_devi_merge_traj = jdata.get("model_devi_merge_traj", False)
+ if (nbeads is not None) and model_devi_f_avg_relative:
+ raise RuntimeError(
+ "model_devi_f_avg_relative has not been supported for pimd. Set model_devi_f_avg_relative to False."
+ )
+ if (nbeads is not None) and (model_devi_merge_traj):
+ raise RuntimeError(
+ "model_devi_merge_traj has not been supported for pimd. Set model_devi_merge_traj to False."
+ )
+ if (nbeads is not None) and (not (nsteps % trj_freq == 0)):
+ raise RuntimeError(
+ "trj_freq should be a factor of nsteps for pimd. Please check your input."
+ )
if dt is not None:
model_devi_dt = dt
sys_idx = expand_idx(cur_job["sys_idx"])
@@ -1410,7 +1513,7 @@ def _make_model_devi_native(iter_index, jdata, mdata, conf_systems):
for cc in ss:
for tt_ in temps:
if use_ele_temp:
- if type(tt_) == list:
+ if isinstance(tt_, list):
tt = tt_[0]
if use_ele_temp == 1:
te_f = tt_[1]
@@ -1419,7 +1522,7 @@ def _make_model_devi_native(iter_index, jdata, mdata, conf_systems):
te_f = None
te_a = tt_[1]
else:
- assert type(tt_) == float or type(tt_) == int
+ assert isinstance(tt_, (float, int))
tt = float(tt_)
if use_ele_temp == 1:
te_f = tt
@@ -1476,6 +1579,7 @@ def _make_model_devi_native(iter_index, jdata, mdata, conf_systems):
ele_temp_a=te_a,
nopbc=nopbc,
deepmd_version=deepmd_version,
+ nbeads=nbeads,
)
job = {}
job["ensemble"] = ensemble
@@ -1746,10 +1850,23 @@ def _make_model_devi_amber(
create_path(task_path)
# link restart file
loc_conf_name = "init.rst7"
- os.symlink(
- os.path.join(os.path.join("..", "confs"), conf_name + ".rst7"),
- os.path.join(task_path, loc_conf_name),
- )
+ if cur_job.get("restart_from_iter") is None:
+ os.symlink(
+ os.path.join(os.path.join("..", "confs"), conf_name + ".rst7"),
+ os.path.join(task_path, loc_conf_name),
+ )
+ else:
+ restart_from_iter = cur_job["restart_from_iter"]
+ restart_iter_name = make_iter_name(restart_from_iter)
+ os.symlink(
+ os.path.relpath(
+ os.path.join(
+ restart_iter_name, model_devi_name, task_name, "rc.rst7"
+ ),
+ task_path,
+ ),
+ os.path.join(task_path, loc_conf_name),
+ )
cwd_ = os.getcwd()
# chdir to task path
os.chdir(task_path)
@@ -1783,7 +1900,6 @@ def _make_model_devi_amber(
def run_md_model_devi(iter_index, jdata, mdata):
-
# rmdlog.info("This module has been run !")
model_devi_exec = mdata["model_devi_command"]
@@ -1799,7 +1915,7 @@ def run_md_model_devi(iter_index, jdata, mdata):
all_task = glob.glob(os.path.join(work_path, "task.*"))
all_task.sort()
- fp = open(os.path.join(work_path, "cur_job.json"), "r")
+ fp = open(os.path.join(work_path, "cur_job.json"))
cur_job = json.load(fp)
run_tasks_ = all_task
@@ -1820,15 +1936,23 @@ def run_md_model_devi(iter_index, jdata, mdata):
model_devi_engine = jdata.get("model_devi_engine", "lammps")
if model_devi_engine == "lammps":
- command = (
- "{ if [ ! -f dpgen.restart.10000 ]; then %s -i input.lammps -v restart 0; else %s -i input.lammps -v restart 1; fi }"
- % (model_devi_exec, model_devi_exec)
- )
- command = "/bin/sh -c '%s'" % command
+ nbeads = jdata["model_devi_jobs"][iter_index].get("nbeads")
+ if nbeads is None:
+ command = f"{{ if [ ! -f dpgen.restart.10000 ]; then {model_devi_exec} -i input.lammps -v restart 0; else {model_devi_exec} -i input.lammps -v restart 1; fi }}"
+ else:
+ command = f"{{ all_exist=true; for i in $(seq -w 1 {nbeads}); do [[ ! -f dpgen.restart${{i}}.10000 ]] && {{ all_exist=false; break; }}; done; $all_exist && {{ {model_devi_exec} -p {nbeads}x1 -i input.lammps -v restart 1; }} || {{ {model_devi_exec} -p {nbeads}x1 -i input.lammps -v restart 0; }} }}"
+ command = "/bin/bash -c '%s'" % command
commands = [command]
forward_files = ["conf.lmp", "input.lammps"]
- backward_files = ["model_devi.out", "model_devi.log"]
+ backward_files = ["model_devi.log"]
+ if nbeads is None:
+ backward_files += ["model_devi.out"]
+ else:
+ num_digits = np.ceil(np.log10(nbeads + 1)).astype(int)
+ backward_files += [
+ f"model_devi{i+1:0{num_digits}d}.out" for i in range(nbeads)
+ ]
if model_devi_merge_traj:
backward_files += ["all.lammpstrj"]
else:
@@ -1842,7 +1966,6 @@ def run_md_model_devi(iter_index, jdata, mdata):
if use_plm_path:
forward_files += ["plmpath.pdb"]
elif model_devi_engine == "gromacs":
-
gromacs_settings = jdata.get("gromacs_settings", {})
mdp_filename = gromacs_settings.get("mdp_filename", "md.mdp")
topol_filename = gromacs_settings.get("topol_filename", "processed.top")
@@ -1867,20 +1990,17 @@ def run_md_model_devi(iter_index, jdata, mdata):
deffnm,
maxwarn,
)
- command += "&& %s mdrun -deffnm %s -cpi" % (model_devi_exec, deffnm)
+ command += f"&& {model_devi_exec} mdrun -deffnm {deffnm} -cpi"
if ndx_filename:
command += f'&& echo -e "{grp_name}\\n{grp_name}\\n" | {model_devi_exec} trjconv -s {ref_filename} -f {deffnm}.trr -n {ndx_filename} -o {traj_filename} -pbc mol -ur compact -center'
else:
- command += (
- '&& echo -e "%s\\n%s\\n" | %s trjconv -s %s -f %s.trr -o %s -pbc mol -ur compact -center'
- % (
- grp_name,
- grp_name,
- model_devi_exec,
- ref_filename,
- deffnm,
- traj_filename,
- )
+ command += '&& echo -e "{}\\n{}\\n" | {} trjconv -s {} -f {}.trr -o {} -pbc mol -ur compact -center'.format(
+ grp_name,
+ grp_name,
+ model_devi_exec,
+ ref_filename,
+ deffnm,
+ traj_filename,
)
command += "&& if [ ! -d traj ]; then \n mkdir traj; fi\n"
command += f"python -c \"import dpdata;system = dpdata.System('{traj_filename}', fmt='gromacs/gro'); [system.to_gromacs_gro('traj/%d.gromacstrj' % (i * {trj_freq}), frame_idx=i) for i in range(system.get_nframes())]; system.to_deepmd_npy('traj_deepmd')\""
@@ -1956,7 +2076,6 @@ def run_md_model_devi(iter_index, jdata, mdata):
def run_model_devi(iter_index, jdata, mdata):
-
model_devi_engine = jdata.get("model_devi_engine", "lammps")
if model_devi_engine != "calypso":
run_md_model_devi(iter_index, jdata, mdata)
@@ -2043,6 +2162,75 @@ def _read_model_devi_file(
model_devi_f_avg_relative: bool = False,
model_devi_merge_traj: bool = False,
):
+ model_devi_files = glob.glob(os.path.join(task_path, "model_devi*.out"))
+ model_devi_files_sorted = sorted(
+ model_devi_files, key=lambda x: int(re.search(r"(\d+)", x).group(1))
+ )
+ if len(model_devi_files_sorted) > 1:
+ with open(model_devi_files_sorted[0]) as f:
+ first_line = f.readline()
+ if not (first_line.startswith("#")):
+ first_line = "#"
+ num_beads = len(model_devi_files_sorted)
+ model_devi_contents = []
+ for file in model_devi_files_sorted:
+ model_devi_contents.append(np.loadtxt(file))
+ assert all(
+ model_devi_content.shape[0] == model_devi_contents[0].shape[0]
+ for model_devi_content in model_devi_contents
+ ), "Not all beads generated the same number of lines in the model_devi$\{ibead\}.out file. Check your pimd task carefully."
+ for file in model_devi_files_sorted:
+ os.remove(file)
+ last_step = model_devi_contents[0][-1, 0]
+ for ibead in range(1, num_beads):
+ model_devi_contents[ibead][:, 0] = model_devi_contents[ibead][
+ :, 0
+ ] + ibead * (last_step + 1)
+ model_devi = np.concatenate(model_devi_contents, axis=0)
+ num_columns = model_devi.shape[1]
+ formats = ["%12d"] + ["%22.6e"] * (num_columns - 1)
+ np.savetxt(
+ os.path.join(task_path, "model_devi.out"),
+ model_devi,
+ fmt=formats,
+ header=first_line.rstrip(),
+ comments="",
+ )
+
+ if not model_devi_merge_traj:
+ num_digits = np.ceil(np.log10(num_beads + 1)).astype(int)
+ traj_files_sorted = []
+ for ibead in range(num_beads):
+ traj_files = glob.glob(
+ os.path.join(
+ task_path, "traj", f"*lammpstrj{ibead+1:0{num_digits}d}"
+ )
+ )
+ traj_files_sorted.append(
+ sorted(
+ traj_files,
+ key=lambda x: int(
+ re.search(r"^(\d+)\.lammpstrj", os.path.basename(x)).group(
+ 1
+ )
+ ),
+ )
+ )
+ assert all(
+ len(traj_list) == len(traj_files_sorted[0])
+ for traj_list in traj_files_sorted
+ ), "Not all beads generated the same number of frames. Check your pimd task carefully."
+ for ibead in range(num_beads):
+ for itraj in range(len(traj_files_sorted[0])):
+ base_path, original_filename = os.path.split(
+ traj_files_sorted[ibead][itraj]
+ )
+ frame_number = int(original_filename.split(".")[0])
+ new_filename = os.path.join(
+ base_path,
+ f"{frame_number + ibead * (int(last_step)+1):d}.lammpstrj",
+ )
+ os.rename(traj_files_sorted[ibead][itraj], new_filename)
model_devi = np.loadtxt(os.path.join(task_path, "model_devi.out"))
if model_devi_f_avg_relative:
if model_devi_merge_traj is True:
@@ -2065,7 +2253,7 @@ def _read_model_devi_file(
def _select_by_model_devi_standard(
- modd_system_task: List[str],
+ modd_system_task: list[str],
f_trust_lo: float,
f_trust_hi: float,
v_trust_lo: float,
@@ -2081,9 +2269,7 @@ def _select_by_model_devi_standard(
iter_name = modd_system_task[0].split("/")[0]
_work_path = os.path.join(iter_name, model_devi_name)
# calypso_run_opt_path = os.path.join(_work_path,calypso_run_opt_name)
- calypso_run_opt_path = glob.glob(
- "%s/%s.*" % (_work_path, calypso_run_opt_name)
- )[0]
+ calypso_run_opt_path = glob.glob(f"{_work_path}/{calypso_run_opt_name}.*")[0]
numofspecies = _parse_calypso_input("NumberOfSpecies", calypso_run_opt_path)
min_dis = _parse_calypso_dis_mtx(numofspecies, calypso_run_opt_path)
fp_candidate = []
@@ -2170,7 +2356,7 @@ def _select_by_model_devi_standard(
def _select_by_model_devi_adaptive_trust_low(
- modd_system_task: List[str],
+ modd_system_task: list[str],
f_trust_hi: float,
numb_candi_f: int,
perc_candi_f: float,
@@ -2181,17 +2367,17 @@ def _select_by_model_devi_adaptive_trust_low(
model_devi_f_avg_relative: bool = False,
model_devi_merge_traj: bool = False,
):
- """
- modd_system_task model deviation tasks belonging to one system
+ """modd_system_task model deviation tasks belonging to one system
f_trust_hi
numb_candi_f number of candidate due to the f model deviation
perc_candi_f percentage of candidate due to the f model deviation
v_trust_hi
numb_candi_v number of candidate due to the v model deviation
perc_candi_v percentage of candidate due to the v model deviation
- model_devi_skip
+ model_devi_skip.
- returns
+ Returns
+ -------
accur the accurate set
candi the candidate set
failed the failed set
@@ -2284,31 +2470,27 @@ def _make_fp_vasp_inner(
type_map,
jdata,
):
- """
- iter_index int iter index
+ """iter_index int iter index
modd_path string path of model devi
work_path string path of fp
fp_task_max int max number of tasks
fp_link_files [string] linked files for fp, POTCAR for example
- fp_params map parameters for fp
+ fp_params map parameters for fp.
"""
-
# --------------------------------------------------------------------------------------------------------------------------------------
model_devi_engine = jdata.get("model_devi_engine", "lammps")
if model_devi_engine == "calypso":
iter_name = work_path.split("/")[0]
_work_path = os.path.join(iter_name, model_devi_name)
# calypso_run_opt_path = os.path.join(_work_path,calypso_run_opt_name)
- calypso_run_opt_path = glob.glob(
- "%s/%s.*" % (_work_path, calypso_run_opt_name)
- )[0]
+ calypso_run_opt_path = glob.glob(f"{_work_path}/{calypso_run_opt_name}.*")[0]
numofspecies = _parse_calypso_input("NumberOfSpecies", calypso_run_opt_path)
min_dis = _parse_calypso_dis_mtx(numofspecies, calypso_run_opt_path)
calypso_total_fp_num = 300
modd_path = os.path.join(modd_path, calypso_model_devi_name)
model_devi_skip = -1
- with open(os.path.join(modd_path, "Model_Devi.out"), "r") as summfile:
+ with open(os.path.join(modd_path, "Model_Devi.out")) as summfile:
summary = np.loadtxt(summfile)
summaryfmax = summary[:, -4]
dis = summary[:, -1]
@@ -2322,7 +2504,7 @@ def _make_fp_vasp_inner(
tot = len(summaryfmax) - nan_num
candi_num = tot - acc_num - fail_num
dlog.info(
- "summary accurate_ratio: {0:8.4f}% candidata_ratio: {1:8.4f}% failed_ratio: {2:8.4f}% in {3:d} structures".format(
+ "summary accurate_ratio: {:8.4f}% candidata_ratio: {:8.4f}% failed_ratio: {:8.4f}% in {:d} structures".format(
acc_num * 100 / tot, candi_num * 100 / tot, fail_num * 100 / tot, tot
)
)
@@ -2419,7 +2601,7 @@ def _trust_limitation_check(sys_idx, lim):
model_devi_merge_traj=model_devi_merge_traj,
)
dlog.info(
- "system {0:s} {1:9s} : f_trust_lo {2:6.3f} v_trust_lo {3:6.3f}".format(
+ "system {:s} {:9s} : f_trust_lo {:6.3f} v_trust_lo {:6.3f}".format(
ss, "adapted", f_trust_lo_ad, v_trust_lo_ad
)
)
@@ -2472,13 +2654,11 @@ def _trust_limitation_check(sys_idx, lim):
fp_sum = sum(counter.values())
if fp_sum == 0:
- dlog.info(
- "system {0:s} has no fp task, maybe the model devi is nan %".format(ss)
- )
+ dlog.info(f"system {ss:s} has no fp task, maybe the model devi is nan %")
continue
for cc_key, cc_value in counter.items():
dlog.info(
- "system {0:s} {1:9s} : {2:6d} in {3:6d} {4:6.2f} %".format(
+ "system {:s} {:9s} : {:6d} in {:6d} {:6.2f} %".format(
ss, cc_key, cc_value, fp_sum, cc_value / fp_sum * 100
)
)
@@ -2554,7 +2734,7 @@ def _trust_limitation_check(sys_idx, lim):
numb_task = 0
# ----------------------------------------------------------------------------
dlog.info(
- "system {0:s} accurate_ratio: {1:8.4f} thresholds: {2:6.4f} and {3:6.4f} eff. task min and max {4:4d} {5:4d} number of fp tasks: {6:6d}".format(
+ "system {:s} accurate_ratio: {:8.4f} thresholds: {:6.4f} and {:6.4f} eff. task min and max {:4d} {:4d} number of fp tasks: {:6d}".format(
ss,
accurate_ratio,
fp_accurate_soft_threshold,
@@ -2569,6 +2749,7 @@ def _trust_limitation_check(sys_idx, lim):
# read all.lammpstrj, save in all_sys for each system_index
all_sys = []
trj_freq = None
+ netcdftraj = None
if model_devi_merge_traj:
for ii in modd_system_task:
all_traj = os.path.join(ii, "all.lammpstrj")
@@ -2633,7 +2814,7 @@ def _trust_limitation_check(sys_idx, lim):
if cluster_cutoff is not None:
# take clusters
jj = fp_candidate[cc][2]
- poscar_name = "{}.cluster.{}.POSCAR".format(conf_name, jj)
+ poscar_name = f"{conf_name}.cluster.{jj}.POSCAR"
new_system = take_cluster(conf_name, type_map, jj, jdata)
new_system.to_vasp_poscar(poscar_name)
fp_task_name = make_fp_task_name(int(ss), cc)
@@ -2693,19 +2874,19 @@ def _trust_limitation_check(sys_idx, lim):
os.chdir(cwd)
if count_bad_box > 0:
dlog.info(
- "system {0:s} skipped {1:6d} confs with bad box, {2:6d} remains".format(
+ "system {:s} skipped {:6d} confs with bad box, {:6d} remains".format(
ss, count_bad_box, numb_task - count_bad_box
)
)
if count_bad_cluster > 0:
dlog.info(
- "system {0:s} skipped {1:6d} confs with bad cluster, {2:6d} remains".format(
+ "system {:s} skipped {:6d} confs with bad cluster, {:6d} remains".format(
ss, count_bad_cluster, numb_task - count_bad_cluster
)
)
if model_devi_engine == "calypso":
dlog.info(
- "summary accurate_ratio: {0:8.4f}% candidata_ratio: {1:8.4f}% failed_ratio: {2:8.4f}% in {3:d} structures".format(
+ "summary accurate_ratio: {:8.4f}% candidata_ratio: {:8.4f}% failed_ratio: {:8.4f}% in {:d} structures".format(
acc_num * 100 / tot, candi_num * 100 / tot, fail_num * 100 / tot, tot
)
)
@@ -2846,14 +3027,20 @@ def make_pwmat_input(jdata, filename):
def make_vasp_incar_ele_temp(jdata, filename, ele_temp, nbands_esti=None):
with open(filename) as fp:
incar = fp.read()
- incar = incar_upper(Incar.from_string(incar))
+ try:
+ incar = incar_upper(Incar.from_string(incar))
+ except AttributeError:
+ incar = incar_upper(Incar.from_str(incar))
incar["ISMEAR"] = -1
incar["SIGMA"] = ele_temp * pc.Boltzmann / pc.electron_volt
incar.write_file("INCAR")
if nbands_esti is not None:
nbands = nbands_esti.predict(".")
with open(filename) as fp:
- incar = Incar.from_string(fp.read())
+ try:
+ incar = Incar.from_string(fp.read())
+ except AttributeError:
+ incar = Incar.from_str(fp.read())
incar["NBANDS"] = nbands
incar.write_file("INCAR")
@@ -2896,7 +3083,7 @@ def _make_fp_pwmat_input(iter_index, jdata):
def make_fp_vasp_cp_cvasp(iter_index, jdata):
# Move cvasp interface to jdata
- if ("cvasp" in jdata) and (jdata["cvasp"] == True):
+ if ("cvasp" in jdata) and (jdata["cvasp"] is True):
pass
else:
return
@@ -2930,7 +3117,10 @@ def make_fp_vasp_kp(iter_index, jdata):
assert os.path.exists("INCAR")
with open("INCAR") as fp:
incar = fp.read()
- standard_incar = incar_upper(Incar.from_string(incar))
+ try:
+ standard_incar = incar_upper(Incar.from_string(incar))
+ except AttributeError:
+ standard_incar = incar_upper(Incar.from_str(incar))
if fp_aniso_kspacing is None:
try:
kspacing = standard_incar["KSPACING"]
@@ -2953,7 +3143,10 @@ def make_fp_vasp_kp(iter_index, jdata):
assert os.path.exists("POSCAR")
# make kpoints
ret = make_kspacing_kpoints("POSCAR", kspacing, gamma)
- kp = Kpoints.from_string(ret)
+ try:
+ kp = Kpoints.from_string(ret)
+ except AttributeError:
+ kp = Kpoints.from_str(ret)
kp.write_file("KPOINTS")
os.chdir(cwd)
@@ -3025,6 +3218,7 @@ def sys_link_fp_vasp_pp(iter_index, jdata):
def _link_fp_abacus_pporb_descript(iter_index, jdata):
# assume pp orbital files, numerical descrptors and model for dpks are all in fp_pp_path.
fp_pp_path = os.path.abspath(jdata["fp_pp_path"])
+ type_map = jdata["type_map"]
iter_name = make_iter_name(iter_index)
work_path = os.path.join(iter_name, fp_name)
@@ -3040,51 +3234,78 @@ def _link_fp_abacus_pporb_descript(iter_index, jdata):
# get value of 'deepks_model' from INPUT
input_param = get_abacus_input_parameters("INPUT")
fp_dpks_model = input_param.get("deepks_model", None)
- if fp_dpks_model != None:
- model_file = os.path.join(fp_pp_path, fp_dpks_model)
- assert os.path.isfile(model_file), (
- "Can not find the deepks model file %s, which is defined in %s/INPUT"
- % (model_file, ii)
- )
- os.symlink(model_file, fp_dpks_model)
+ if fp_dpks_model is not None:
+ model_file = os.path.join(
+ fp_pp_path, os.path.split(fp_dpks_model)[1]
+ ) # only the filename
+ assert os.path.isfile(
+ model_file
+ ), f"Can not find the deepks model file {model_file}, which is defined in {ii}/INPUT"
+ os.symlink(model_file, fp_dpks_model) # link to the model file
# get pp, orb, descriptor filenames from STRU
stru_param = get_abacus_STRU("STRU")
- pp_files = stru_param.get("pp_files", [])
- orb_files = stru_param.get("orb_files", [])
- descriptor_file = stru_param.get("dpks_descriptor", None)
- pp_files = [] if pp_files == None else pp_files
- orb_files = [] if orb_files == None else orb_files
-
- for jj in pp_files:
- ifile = os.path.join(fp_pp_path, jj)
- assert os.path.isfile(ifile), (
- "Can not find the pseudopotential file %s, which is defined in %s/STRU"
- % (ifile, ii)
- )
- os.symlink(ifile, jj)
+ atom_names = stru_param["atom_names"]
+ pp_files_stru = stru_param.get("pp_files", None)
+ orb_files_stru = stru_param.get("orb_files", None)
+ descriptor_file_stru = stru_param.get("dpks_descriptor", None)
+
+ if pp_files_stru:
+ assert "fp_pp_files" in jdata, "need to define fp_pp_files in jdata"
+ if orb_files_stru:
+ assert "fp_orb_files" in jdata, "need to define fp_orb_files in jdata"
+ if descriptor_file_stru:
+ assert (
+ "fp_dpks_descriptor" in jdata
+ ), "need to define fp_dpks_descriptor in jdata"
- for jj in orb_files:
- ifile = os.path.join(fp_pp_path, jj)
+ for idx, iatom in enumerate(atom_names):
+ type_map_idx = type_map.index(iatom)
+ if iatom not in type_map:
+ raise RuntimeError(
+ "atom name %s in STRU is not defined in type_map" % (iatom)
+ )
+ if pp_files_stru:
+ src_file = os.path.join(fp_pp_path, jdata["fp_pp_files"][type_map_idx])
+ assert os.path.isfile(
+ src_file
+ ), f"Can not find the pseudopotential file {src_file}"
+ os.symlink(src_file, pp_files_stru[idx])
+ if orb_files_stru:
+ src_file = os.path.join(fp_pp_path, jdata["fp_orb_files"][type_map_idx])
+ assert os.path.isfile(
+ src_file
+ ), f"Can not find the orbital file {src_file}"
+ os.symlink(src_file, orb_files_stru[idx])
+ if descriptor_file_stru:
+ src_file = os.path.join(fp_pp_path, jdata["fp_dpks_descriptor"])
assert os.path.isfile(
- ifile
- ), "Can not find the orbital file %s, which is defined in %s/STRU" % (
- ifile,
- ii,
- )
- os.symlink(ifile, jj)
+ src_file
+ ), f"Can not find the descriptor file {src_file}"
+ os.symlink(src_file, descriptor_file_stru)
- if descriptor_file != None:
- ifile = os.path.join(fp_pp_path, descriptor_file)
- assert os.path.isfile(ifile), (
- "Can not find the deepks descriptor file %s, which is defined in %s/STRU"
- % (ifile, ii)
- )
- os.symlink(ifile, descriptor_file)
os.chdir(cwd)
-def _make_fp_vasp_configs(iter_index, jdata):
+def _make_fp_vasp_configs(iter_index: int, jdata: dict):
+ """Read the model deviation from model_devi step, and then generate the candidated structures
+ in 02.fp directory.
+
+ Currently, the formats of generated structures are decided by model_devi_eigne.
+
+ Parameters
+ ----------
+ iter_index : int
+ The index of iteration.
+ jdata : dict
+ The json data.
+
+ Returns
+ -------
+ int
+ The number of the candidated structures.
+ """
+ # TODO: we need to unify different data formats
fp_task_max = jdata["fp_task_max"]
model_devi_skip = jdata["model_devi_skip"]
type_map = jdata["type_map"]
@@ -3095,7 +3316,7 @@ def _make_fp_vasp_configs(iter_index, jdata):
modd_path = os.path.join(iter_name, model_devi_name)
task_min = -1
if os.path.isfile(os.path.join(modd_path, "cur_job.json")):
- cur_job = json.load(open(os.path.join(modd_path, "cur_job.json"), "r"))
+ cur_job = json.load(open(os.path.join(modd_path, "cur_job.json")))
if "task_min" in cur_job:
task_min = cur_job["task_min"]
else:
@@ -3136,10 +3357,6 @@ def _make_fp_vasp_configs(iter_index, jdata):
def make_fp_vasp(iter_index, jdata):
- # make config
- fp_tasks = _make_fp_vasp_configs(iter_index, jdata)
- if len(fp_tasks) == 0:
- return
# abs path for fp_incar if it exists
if "fp_incar" in jdata:
jdata["fp_incar"] = os.path.abspath(jdata["fp_incar"])
@@ -3160,10 +3377,8 @@ def make_fp_vasp(iter_index, jdata):
def make_fp_pwscf(iter_index, jdata):
- # make config
- fp_tasks = _make_fp_vasp_configs(iter_index, jdata)
- if len(fp_tasks) == 0:
- return
+ work_path = os.path.join(make_iter_name(iter_index), fp_name)
+ fp_tasks = glob.glob(os.path.join(work_path, "task.*"))
# make pwscf input
iter_name = make_iter_name(iter_index)
work_path = os.path.join(iter_name, fp_name)
@@ -3194,10 +3409,9 @@ def make_fp_pwscf(iter_index, jdata):
def make_fp_abacus_scf(iter_index, jdata):
- # make config
- fp_tasks = _make_fp_vasp_configs(iter_index, jdata)
- if len(fp_tasks) == 0:
- return
+ work_path = os.path.join(make_iter_name(iter_index), fp_name)
+ fp_tasks = glob.glob(os.path.join(work_path, "task.*"))
+ pporb_path = "pporb"
# make abacus/pw/scf input
iter_name = make_iter_name(iter_index)
work_path = os.path.join(iter_name, fp_name)
@@ -3217,22 +3431,22 @@ def make_fp_abacus_scf(iter_index, jdata):
raise RuntimeError(
"Set 'user_fp_params' or 'fp_incar' in json file to make INPUT of ABACUS"
)
- ret_input = make_abacus_scf_input(fp_params)
+ ret_input = make_abacus_scf_input(fp_params, extra_file_path=pporb_path)
# Get orbital and deepks setting
if "basis_type" in fp_params:
if fp_params["basis_type"] == "lcao":
assert (
"fp_orb_files" in jdata
- and type(jdata["fp_orb_files"]) == list
+ and isinstance(jdata["fp_orb_files"], list)
and len(jdata["fp_orb_files"]) == len(fp_pp_files)
)
fp_orb_files = jdata["fp_orb_files"]
dpks_out_labels = fp_params.get("deepks_out_labels", 0)
dpks_scf = fp_params.get("deepks_scf", 0)
if dpks_out_labels or dpks_scf:
- assert (
- "fp_dpks_descriptor" in jdata and type(jdata["fp_dpks_descriptor"]) == str
+ assert "fp_dpks_descriptor" in jdata and isinstance(
+ jdata["fp_dpks_descriptor"], str
)
fp_dpks_descriptor = jdata["fp_dpks_descriptor"]
@@ -3289,20 +3503,22 @@ def make_fp_abacus_scf(iter_index, jdata):
fp_dpks_descriptor,
fp_params,
type_map=jdata["type_map"],
+ pporb=pporb_path,
)
with open("STRU", "w") as fp:
fp.write(ret_stru)
+ if not os.path.isdir(pporb_path):
+ os.makedirs(pporb_path)
+
os.chdir(cwd)
# link pp and orbital files
_link_fp_abacus_pporb_descript(iter_index, jdata)
def make_fp_siesta(iter_index, jdata):
- # make config
- fp_tasks = _make_fp_vasp_configs(iter_index, jdata)
- if len(fp_tasks) == 0:
- return
+ work_path = os.path.join(make_iter_name(iter_index), fp_name)
+ fp_tasks = glob.glob(os.path.join(work_path, "task.*"))
# make siesta input
iter_name = make_iter_name(iter_index)
work_path = os.path.join(iter_name, fp_name)
@@ -3326,10 +3542,8 @@ def make_fp_siesta(iter_index, jdata):
def make_fp_gaussian(iter_index, jdata):
- # make config
- fp_tasks = _make_fp_vasp_configs(iter_index, jdata)
- if len(fp_tasks) == 0:
- return
+ work_path = os.path.join(make_iter_name(iter_index), fp_name)
+ fp_tasks = glob.glob(os.path.join(work_path, "task.*"))
# make gaussian gjf file
iter_name = make_iter_name(iter_index)
work_path = os.path.join(iter_name, fp_name)
@@ -3355,10 +3569,8 @@ def make_fp_gaussian(iter_index, jdata):
def make_fp_cp2k(iter_index, jdata):
- # make config
- fp_tasks = _make_fp_vasp_configs(iter_index, jdata)
- if len(fp_tasks) == 0:
- return
+ work_path = os.path.join(make_iter_name(iter_index), fp_name)
+ fp_tasks = glob.glob(os.path.join(work_path, "task.*"))
# make cp2k input
iter_name = make_iter_name(iter_index)
work_path = os.path.join(iter_name, fp_name)
@@ -3397,10 +3609,6 @@ def make_fp_cp2k(iter_index, jdata):
def make_fp_pwmat(iter_index, jdata):
- # make config
- fp_tasks = _make_fp_vasp_configs(iter_index, jdata)
- if len(fp_tasks) == 0:
- return
# abs path for fp_incar if it exists
if "fp_incar" in jdata:
jdata["fp_incar"] = os.path.abspath(jdata["fp_incar"])
@@ -3456,8 +3664,9 @@ def make_fp_amber_diff(iter_index: int, jdata: dict):
Jinzhe Zeng, Timothy J. Giese, Şölen Ekesan, and Darrin M. York, Journal of Chemical
Theory and Computation 2021 17 (11), 6993-7009
"""
- # make config
- fp_tasks = _make_fp_vasp_configs(iter_index, jdata)
+ assert jdata["model_devi_engine"] == "amber"
+ work_path = os.path.join(make_iter_name(iter_index), fp_name)
+ fp_tasks = glob.glob(os.path.join(work_path, "task.*"))
# make amber input
cwd = os.getcwd()
# link two mdin files and param7
@@ -3509,9 +3718,61 @@ def make_fp_amber_diff(iter_index: int, jdata: dict):
os.chdir(cwd)
+def make_fp_custom(iter_index, jdata):
+ """Make input file for customized FP style.
+
+ Convert the POSCAR file to custom format.
+
+ Parameters
+ ----------
+ iter_index : int
+ iter index
+ jdata : dict
+ Run parameters.
+ """
+ work_path = os.path.join(make_iter_name(iter_index), fp_name)
+ fp_tasks = glob.glob(os.path.join(work_path, "task.*"))
+ fp_params = jdata["fp_params"]
+ input_fn = fp_params["input_fn"]
+ input_fmt = fp_params["input_fmt"]
+
+ for ii in fp_tasks:
+ with set_directory(Path(ii)):
+ system = dpdata.System("POSCAR", fmt="vasp/poscar")
+ system.to(input_fmt, input_fn)
+
+
def make_fp(iter_index, jdata, mdata):
- fp_style = jdata["fp_style"]
+ """Select the candidate strutures and make the input file of FP calculation.
+
+ Parameters
+ ----------
+ iter_index : int
+ iter index
+ jdata : dict
+ Run parameters.
+ mdata : dict
+ Machine parameters.
+ """
+ fp_tasks = _make_fp_vasp_configs(iter_index, jdata)
+ if len(fp_tasks) == 0:
+ return
+ make_fp_calculation(iter_index, jdata, mdata)
+
+def make_fp_calculation(iter_index, jdata, mdata):
+ """Make the input file of FP calculation.
+
+ Parameters
+ ----------
+ iter_index : int
+ iter index
+ jdata : dict
+ Run parameters.
+ mdata : dict
+ Machine parameters.
+ """
+ fp_style = jdata["fp_style"]
if fp_style == "vasp":
make_fp_vasp(iter_index, jdata)
elif fp_style == "pwscf":
@@ -3528,6 +3789,8 @@ def make_fp(iter_index, jdata, mdata):
make_fp_pwmat(iter_index, jdata)
elif fp_style == "amber/diff":
make_fp_amber_diff(iter_index, jdata)
+ elif fp_style == "custom":
+ make_fp_custom(iter_index, jdata)
else:
raise RuntimeError("unsupported fp style")
# Copy user defined forward_files
@@ -3538,7 +3801,7 @@ def make_fp(iter_index, jdata, mdata):
def _vasp_check_fin(ii):
if os.path.isfile(os.path.join(ii, "OUTCAR")):
- with open(os.path.join(ii, "OUTCAR"), "r") as fp:
+ with open(os.path.join(ii, "OUTCAR")) as fp:
content = fp.read()
count = content.count("Elapse")
if count != 1:
@@ -3550,7 +3813,7 @@ def _vasp_check_fin(ii):
def _qe_check_fin(ii):
if os.path.isfile(os.path.join(ii, "output")):
- with open(os.path.join(ii, "output"), "r") as fp:
+ with open(os.path.join(ii, "output")) as fp:
content = fp.read()
count = content.count("JOB DONE")
if count != 1:
@@ -3562,7 +3825,7 @@ def _qe_check_fin(ii):
def _abacus_scf_check_fin(ii):
if os.path.isfile(os.path.join(ii, "OUT.ABACUS/running_scf.log")):
- with open(os.path.join(ii, "OUT.ABACUS/running_scf.log"), "r") as fp:
+ with open(os.path.join(ii, "OUT.ABACUS/running_scf.log")) as fp:
content = fp.read()
count = content.count("!FINAL_ETOT_IS")
if count != 1:
@@ -3574,7 +3837,7 @@ def _abacus_scf_check_fin(ii):
def _siesta_check_fin(ii):
if os.path.isfile(os.path.join(ii, "output")):
- with open(os.path.join(ii, "output"), "r") as fp:
+ with open(os.path.join(ii, "output")) as fp:
content = fp.read()
count = content.count("End of run")
if count != 1:
@@ -3586,7 +3849,7 @@ def _siesta_check_fin(ii):
def _gaussian_check_fin(ii):
if os.path.isfile(os.path.join(ii, "output")):
- with open(os.path.join(ii, "output"), "r") as fp:
+ with open(os.path.join(ii, "output")) as fp:
content = fp.read()
count = content.count("termination")
if count == 0:
@@ -3598,7 +3861,7 @@ def _gaussian_check_fin(ii):
def _cp2k_check_fin(ii):
if os.path.isfile(os.path.join(ii, "output")):
- with open(os.path.join(ii, "output"), "r") as fp:
+ with open(os.path.join(ii, "output")) as fp:
content = fp.read()
count = content.count("SCF run converged")
if count == 0:
@@ -3610,7 +3873,7 @@ def _cp2k_check_fin(ii):
def _pwmat_check_fin(ii):
if os.path.isfile(os.path.join(ii, "REPORT")):
- with open(os.path.join(ii, "REPORT"), "r") as fp:
+ with open(os.path.join(ii, "REPORT")) as fp:
content = fp.read()
count = content.count("time")
if count != 1:
@@ -3664,9 +3927,8 @@ def run_fp_inner(
"-x high_level.nc -y rc.nc -frc high_level.mdfrc -inf high_level.mdinfo && "
)
+ (
- 'dpamber corr --cutoff %f --parm7_file ../qmmm$SYS.parm7 --nc rc.nc --hl high_level --ll low_level --qm_region "$QM_REGION"'
- )
- % (jdata["cutoff"],)
+ 'dpamber corr --cutoff {:f} --parm7_file ../qmmm$SYS.parm7 --nc rc.nc --hl high_level --ll low_level --qm_region "$QM_REGION"'
+ ).format(jdata["cutoff"])
)
fp_run_tasks = fp_tasks
@@ -3710,10 +3972,10 @@ def run_fp(iter_index, jdata, mdata):
forward_files = ["POSCAR", "INCAR", "POTCAR", "KPOINTS"]
backward_files = ["fp.log", "OUTCAR", "vasprun.xml"]
# Move cvasp interface to jdata
- if ("cvasp" in jdata) and (jdata["cvasp"] == True):
+ if ("cvasp" in jdata) and (jdata["cvasp"] is True):
mdata["fp_resources"]["cvasp"] = True
if ("cvasp" in mdata["fp_resources"]) and (
- mdata["fp_resources"]["cvasp"] == True
+ mdata["fp_resources"]["cvasp"] is True
):
dlog.info("cvasp is on !")
forward_files.append("cvasp.py")
@@ -3750,17 +4012,9 @@ def run_fp(iter_index, jdata, mdata):
assert os.path.exists(fp_input_path)
fp_input_path = os.path.abspath(fp_input_path)
fp_params = get_abacus_input_parameters(fp_input_path)
- forward_files = ["INPUT", "STRU"]
+ forward_files = ["INPUT", "STRU", "pporb"]
if "kspacing" not in fp_params.keys():
- forward_files = ["INPUT", "STRU", "KPT"]
- forward_files += fp_pp_files
- if "fp_orb_files" in jdata:
- forward_files += jdata["fp_orb_files"]
- if "fp_dpks_descriptor" in jdata:
- forward_files.append(jdata["fp_dpks_descriptor"])
- if "user_fp_params" in jdata:
- if "deepks_model" in jdata["user_fp_params"]:
- forward_files.append(jdata["user_fp_params"]["deepks_model"])
+ forward_files.append("KPT")
backward_files = ["output", "OUT.ABACUS"]
run_fp_inner(
iter_index,
@@ -3846,12 +4100,24 @@ def run_fp(iter_index, jdata, mdata):
log_file="output",
forward_common_files=forward_common_files,
)
+ elif fp_style == "custom":
+ fp_params = jdata["fp_params"]
+ forward_files = [fp_params["input_fn"]]
+ backward_files = [fp_params["output_fn"]]
+ run_fp_inner(
+ iter_index,
+ jdata,
+ mdata,
+ forward_files,
+ backward_files,
+ None,
+ log_file="output",
+ )
else:
raise RuntimeError("unsupported fp style")
def post_fp_check_fail(iter_index, jdata, rfailed=None):
-
ratio_failed = rfailed if rfailed else jdata.get("ratio_failed", 0.05)
iter_name = make_iter_name(iter_index)
work_path = os.path.join(iter_name, fp_name)
@@ -3880,7 +4146,6 @@ def post_fp_check_fail(iter_index, jdata, rfailed=None):
def post_fp_vasp(iter_index, jdata, rfailed=None):
-
ratio_failed = rfailed if rfailed else jdata.get("ratio_failed", 0.05)
model_devi_engine = jdata.get("model_devi_engine", "lammps")
if model_devi_engine != "calypso":
@@ -3926,10 +4191,6 @@ def post_fp_vasp(iter_index, jdata, rfailed=None):
_sys = dpdata.LabeledSystem()
dlog.info("Failed fp path: %s" % oo.replace("OUTCAR", ""))
if len(_sys) == 1:
- if all_sys is None:
- all_sys = _sys
- else:
- all_sys.append(_sys)
# save ele_temp, if any
if os.path.exists(oo.replace("OUTCAR", "job.json")):
with open(oo.replace("OUTCAR", "job.json")) as fp:
@@ -3938,6 +4199,27 @@ def post_fp_vasp(iter_index, jdata, rfailed=None):
assert use_ele_temp
ele_temp = job_data["ele_temp"]
all_te.append(ele_temp)
+ if use_ele_temp == 0:
+ raise RuntimeError(
+ "should not get ele temp at setting: use_ele_temp == 0"
+ )
+ elif use_ele_temp == 1:
+ _sys.data["fparam"] = np.array(ele_temp).reshape(1, 1)
+ elif use_ele_temp == 2:
+ tile_te = np.tile(ele_temp, [_sys.get_natoms()])
+ _sys.data["aparam"] = tile_te.reshape(
+ 1, _sys.get_natoms(), 1
+ )
+ else:
+ raise RuntimeError(
+ "invalid setting of use_ele_temp " + str(use_ele_temp)
+ )
+ # check if ele_temp shape is correct
+ _sys.check_data()
+ if all_sys is None:
+ all_sys = _sys
+ else:
+ all_sys.append(_sys)
elif len(_sys) >= 2:
raise RuntimeError("The vasp parameter NSW should be set as 1")
else:
@@ -3947,29 +4229,6 @@ def post_fp_vasp(iter_index, jdata, rfailed=None):
sys_data_path = os.path.join(work_path, "data.%s" % ss)
all_sys.to_deepmd_raw(sys_data_path)
all_sys.to_deepmd_npy(sys_data_path, set_size=len(sys_outcars))
- if all_te.size > 0:
- assert len(all_sys) == all_sys.get_nframes()
- assert len(all_sys) == all_te.size
- all_te = np.reshape(all_te, [-1, 1])
- if use_ele_temp == 0:
- raise RuntimeError(
- "should not get ele temp at setting: use_ele_temp == 0"
- )
- elif use_ele_temp == 1:
- np.savetxt(os.path.join(sys_data_path, "fparam.raw"), all_te)
- np.save(
- os.path.join(sys_data_path, "set.000", "fparam.npy"), all_te
- )
- elif use_ele_temp == 2:
- tile_te = np.tile(all_te, [1, all_sys.get_natoms()])
- np.savetxt(os.path.join(sys_data_path, "aparam.raw"), tile_te)
- np.save(
- os.path.join(sys_data_path, "set.000", "aparam.npy"), tile_te
- )
- else:
- raise RuntimeError(
- "invalid setting of use_ele_temp " + str(use_ele_temp)
- )
if tcount == 0:
rfail = 0.0
@@ -4067,12 +4326,12 @@ def post_fp_abacus_scf(iter_index, jdata):
oo, fmt="abacus/scf", type_map=jdata["type_map"]
)
if len(_sys) > 0:
- if all_sys == None:
+ if all_sys is None:
all_sys = _sys
else:
all_sys.append(_sys)
- if all_sys != None:
+ if all_sys is not None:
sys_data_path = os.path.join(work_path, "data.%s" % ss)
all_sys.to_deepmd_raw(sys_data_path)
all_sys.to_deepmd_npy(sys_data_path, set_size=len(sys_output))
@@ -4169,7 +4428,6 @@ def post_fp_gaussian(iter_index, jdata):
def post_fp_cp2k(iter_index, jdata, rfailed=None):
-
ratio_failed = rfailed if rfailed else jdata.get("ratio_failed", 0.10)
model_devi_jobs = jdata["model_devi_jobs"]
assert iter_index < len(model_devi_jobs)
@@ -4208,7 +4466,7 @@ def post_fp_cp2k(iter_index, jdata, rfailed=None):
all_sys.append(_sys)
icount += len(all_sys)
- if all_sys is not None:
+ if (all_sys is not None) and (len(all_sys) > 0):
sys_data_path = os.path.join(work_path, "data.%s" % ss)
all_sys.to_deepmd_raw(sys_data_path)
all_sys.to_deepmd_npy(sys_data_path, set_size=len(sys_output))
@@ -4230,7 +4488,6 @@ def post_fp_cp2k(iter_index, jdata, rfailed=None):
def post_fp_pwmat(iter_index, jdata, rfailed=None):
-
ratio_failed = rfailed if rfailed else jdata.get("ratio_failed", 0.05)
model_devi_jobs = jdata["model_devi_jobs"]
assert iter_index < len(model_devi_jobs)
@@ -4275,7 +4532,7 @@ def post_fp_pwmat(iter_index, jdata, rfailed=None):
dlog.info("failed frame number: %s " % icount)
dlog.info("total frame number: %s " % tcount)
reff = icount / tcount
- dlog.info("ratio of failed frame: {:.2%}".format(reff))
+ dlog.info(f"ratio of failed frame: {reff:.2%}")
if reff > ratio_failed:
raise RuntimeError("find too many unsuccessfully terminated jobs")
@@ -4314,6 +4571,51 @@ def post_fp_amber_diff(iter_index, jdata):
all_sys.to_deepmd_npy(sys_data_path, set_size=len(sys_output), prec=np.float64)
+def post_fp_custom(iter_index, jdata):
+ """Post fp for custom fp. Collect data from user-defined `output_fn`.
+
+ Parameters
+ ----------
+ iter_index : int
+ The index of the current iteration.
+ jdata : dict
+ The parameter data.
+ """
+ model_devi_jobs = jdata["model_devi_jobs"]
+ assert iter_index < len(model_devi_jobs)
+
+ iter_name = make_iter_name(iter_index)
+ work_path = os.path.join(iter_name, fp_name)
+ fp_tasks = glob.glob(os.path.join(work_path, "task.*"))
+ fp_tasks.sort()
+ if len(fp_tasks) == 0:
+ return
+
+ system_index = []
+ for ii in fp_tasks:
+ system_index.append(os.path.basename(ii).split(".")[1])
+ system_index.sort()
+ set_tmp = set(system_index)
+ system_index = list(set_tmp)
+ system_index.sort()
+
+ fp_params = jdata["fp_params"]
+ output_fn = fp_params["output_fn"]
+ output_fmt = fp_params["output_fmt"]
+
+ for ss in system_index:
+ sys_output = glob.glob(os.path.join(work_path, "task.%s.*" % ss))
+ sys_output.sort()
+ all_sys = dpdata.MultiSystems(type_map=jdata["type_map"])
+ for oo in sys_output:
+ if os.path.exists(os.path.join(oo, output_fn)):
+ sys = dpdata.LabeledSystem(os.path.join(oo, output_fn), fmt=output_fmt)
+ all_sys.append(sys)
+ sys_data_path = os.path.join(work_path, "data.%s" % ss)
+ all_sys.to_deepmd_raw(sys_data_path)
+ all_sys.to_deepmd_npy(sys_data_path, set_size=len(sys_output), prec=np.float64)
+
+
def post_fp(iter_index, jdata):
fp_style = jdata["fp_style"]
if fp_style == "vasp":
@@ -4332,6 +4634,8 @@ def post_fp(iter_index, jdata):
post_fp_pwmat(iter_index, jdata)
elif fp_style == "amber/diff":
post_fp_amber_diff(iter_index, jdata)
+ elif fp_style == "custom":
+ post_fp_custom(iter_index, jdata)
else:
raise RuntimeError("unsupported fp style")
post_fp_check_fail(iter_index, jdata)
@@ -4355,32 +4659,30 @@ def post_fp(iter_index, jdata):
def set_version(mdata):
-
deepmd_version = "1"
mdata["deepmd_version"] = deepmd_version
return mdata
def run_iter(param_file, machine_file):
- try:
- import ruamel
- from monty.serialization import dumpfn, loadfn
-
- warnings.simplefilter("ignore", ruamel.yaml.error.MantissaNoDotYAML1_1Warning)
- jdata = loadfn(param_file)
- mdata = loadfn(machine_file)
- except Exception:
- with open(param_file, "r") as fp:
- jdata = json.load(fp)
- with open(machine_file, "r") as fp:
- mdata = json.load(fp)
+ jdata = load_file(param_file)
+ mdata = load_file(machine_file)
jdata_arginfo = run_jdata_arginfo()
jdata = normalize(jdata_arginfo, jdata, strict_check=False)
update_mass_map(jdata)
+ # set up electron temperature
+ use_ele_temp = jdata.get("use_ele_temp", 0)
+ if use_ele_temp == 1:
+ setup_ele_temp(False)
+ elif use_ele_temp == 2:
+ setup_ele_temp(True)
+
if jdata.get("pretty_print", False):
+ from monty.serialization import dumpfn
+
# assert(jdata["pretty_format"] in ['json','yaml'])
fparam = (
SHORT_CMD
@@ -4431,7 +4733,7 @@ def run_iter(param_file, machine_file):
if ii * max_tasks + jj <= iter_rec[0] * max_tasks + iter_rec[1]:
continue
task_name = "task %02d" % jj
- sepline("{} {}".format(iter_name, task_name), "-")
+ sepline(f"{iter_name} {task_name}", "-")
if jj == 0:
log_iter("make_train", ii, jj)
make_train(ii, jdata, mdata)
diff --git a/dpgen/gui.py b/dpgen/gui.py
new file mode 100644
index 000000000..f116ee246
--- /dev/null
+++ b/dpgen/gui.py
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: LGPL-3.0-or-later
+"""DP-GUI entrypoint."""
+import argparse
+
+
+def start_dpgui(args: argparse.Namespace):
+ """Host DP-GUI server.
+
+ Parameters
+ ----------
+ args : argparse.Namespace
+ Arguments from argparse.
+
+ Raises
+ ------
+ ModuleNotFoundError
+ The dpgui package is not installed
+ """
+ try:
+ from dpgui import (
+ start_dpgui,
+ )
+ except ModuleNotFoundError as e:
+ raise ModuleNotFoundError(
+ "To use DP-GUI, please install the dpgui package:\npip install dpgui"
+ ) from e
+ start_dpgui(port=args.port, bind_all=args.bind_all)
diff --git a/dpgen/main.py b/dpgen/main.py
index c0a94803d..a0ac004e5 100644
--- a/dpgen/main.py
+++ b/dpgen/main.py
@@ -1,13 +1,11 @@
#!/usr/bin/env python
-# coding: utf-8
# Copyright (c) DeepGenerator Development Team.
import argparse
-import itertools
import sys
-from dpgen import __version__, info
+from dpgen import info
from dpgen.auto_test.run import gen_test
from dpgen.collect.collect import gen_collect
from dpgen.data.gen import gen_init_bulk
@@ -15,6 +13,7 @@
from dpgen.data.surf import gen_init_surf
from dpgen.database.run import db_run
from dpgen.generator.run import gen_run
+from dpgen.gui import start_dpgui
from dpgen.simplify.simplify import gen_simplify
from dpgen.tools.auto_gen_param import auto_gen_param
from dpgen.tools.run_report import run_report
@@ -208,6 +207,29 @@ def main_parser() -> argparse.ArgumentParser:
parser_db.add_argument("PARAM", type=str, help="parameter file, json format")
parser_db.set_defaults(func=db_run)
+
+ # gui
+ parser_gui = subparsers.add_parser(
+ "gui",
+ help="Serve DP-GUI.",
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+ )
+ parser_gui.add_argument(
+ "-p",
+ "--port",
+ type=int,
+ default=6042,
+ help="The port to serve DP-GUI on.",
+ )
+ parser_gui.add_argument(
+ "--bind_all",
+ action="store_true",
+ help=(
+ "Serve on all public interfaces. This will expose your DP-GUI instance "
+ "to the network on both IPv4 and IPv6 (where available)."
+ ),
+ )
+ parser_gui.set_defaults(func=start_dpgui)
return parser
diff --git a/dpgen/remote/decide_machine.py b/dpgen/remote/decide_machine.py
index ced049ef0..e76c61e2d 100644
--- a/dpgen/remote/decide_machine.py
+++ b/dpgen/remote/decide_machine.py
@@ -1,12 +1,10 @@
#!/usr/bin/env python
-# coding: utf-8
def convert_mdata(mdata, task_types=["train", "model_devi", "fp"]):
- """
- Convert mdata for DP-GEN main process.
+ """Convert mdata for DP-GEN main process.
New convension is like mdata["fp"]["machine"],
- DP-GEN needs mdata["fp_machine"]
+ DP-GEN needs mdata["fp_machine"].
Notice that we deprecate the function which can automatically select one most avalaible machine,
since this function was only used by Angus, and only supports for Slurm.
diff --git a/dpgen/simplify/arginfo.py b/dpgen/simplify/arginfo.py
index 5b0d7175b..2fb4547f7 100644
--- a/dpgen/simplify/arginfo.py
+++ b/dpgen/simplify/arginfo.py
@@ -1,12 +1,14 @@
-from typing import List
-
from dargs import Argument, Variant
from dpgen.arginfo import general_mdata_arginfo
from dpgen.generator.arginfo import (
basic_args,
data_args,
+ fp_style_abacus_args,
+ fp_style_cp2k_args,
+ fp_style_custom_args,
fp_style_gaussian_args,
+ fp_style_siesta_args,
fp_style_vasp_args,
training_args,
)
@@ -30,10 +32,16 @@ def general_simplify_arginfo() -> Argument:
doc_model_devi_f_trust_hi = (
"The higher bound of forces for the selection for the model deviation."
)
+ doc_model_devi_e_trust_lo = "The lower bound of energy per atom for the selection for the model deviation. Requires DeePMD-kit version >=2.2.2."
+ doc_model_devi_e_trust_hi = "The higher bound of energy per atom for the selection for the model deviation. Requires DeePMD-kit version >=2.2.2."
+ doc_true_error_f_trust_lo = "The lower bound of forces for the selection for the true error. Requires DeePMD-kit version >=2.2.4."
+ doc_true_error_f_trust_hi = "The higher bound of forces for the selection for the true error. Requires DeePMD-kit version >=2.2.4."
+ doc_true_error_e_trust_lo = "The lower bound of energy per atom for the selection for the true error. Requires DeePMD-kit version >=2.2.4."
+ doc_true_error_e_trust_hi = "The higher bound of energy per atom for the selection for the true error. Requires DeePMD-kit version >=2.2.4."
return [
Argument("labeled", bool, optional=True, default=False, doc=doc_labeled),
- Argument("pick_data", [str, list], doc=doc_pick_data),
+ Argument("pick_data", [str, list[str]], doc=doc_pick_data),
Argument("init_pick_number", int, doc=doc_init_pick_number),
Argument("iter_pick_number", int, doc=doc_iter_pick_number),
Argument(
@@ -48,6 +56,48 @@ def general_simplify_arginfo() -> Argument:
optional=False,
doc=doc_model_devi_f_trust_hi,
),
+ Argument(
+ "model_devi_e_trust_lo",
+ float,
+ optional=True,
+ default=1e10,
+ doc=doc_model_devi_e_trust_lo,
+ ),
+ Argument(
+ "model_devi_e_trust_hi",
+ float,
+ optional=True,
+ default=1e10,
+ doc=doc_model_devi_e_trust_hi,
+ ),
+ Argument(
+ "true_error_f_trust_lo",
+ float,
+ optional=True,
+ default=1e10,
+ doc=doc_true_error_f_trust_lo,
+ ),
+ Argument(
+ "true_error_f_trust_hi",
+ float,
+ optional=True,
+ default=1e10,
+ doc=doc_true_error_f_trust_hi,
+ ),
+ Argument(
+ "true_error_e_trust_lo",
+ float,
+ optional=True,
+ default=1e10,
+ doc=doc_true_error_e_trust_lo,
+ ),
+ Argument(
+ "true_error_e_trust_hi",
+ float,
+ optional=True,
+ default=1e10,
+ doc=doc_true_error_e_trust_hi,
+ ),
]
@@ -59,10 +109,15 @@ def fp_style_variant_type_args() -> Variant:
Variant
variant for fp style
"""
- doc_fp_style = "Software for First Principles, if `labeled` is false. Options include “vasp”, “gaussian” up to now."
+ doc_fp_style = "Software for First Principles, if `labeled` is false."
doc_fp_style_none = "No fp."
doc_fp_style_vasp = "VASP."
doc_fp_style_gaussian = "Gaussian. The command should be set as `g16 < input`."
+ doc_custom = (
+ "Custom FP code. You need to provide the input and output file format and name. "
+ "The command argument in the machine file should be the script to run custom FP codes. "
+ "The extra forward and backward files can be defined in the machine file."
+ )
return Variant(
"fp_style",
@@ -73,6 +128,16 @@ def fp_style_variant_type_args() -> Variant:
Argument(
"gaussian", dict, fp_style_gaussian_args(), doc=doc_fp_style_gaussian
),
+ Argument("siesta", dict, fp_style_siesta_args()),
+ Argument("cp2k", dict, fp_style_cp2k_args()),
+ Argument("abacus", dict, fp_style_abacus_args()),
+ # TODO: not supported yet, as it requires model_devi_engine to be amber
+ # Argument(
+ # "amber/diff", dict, fp_style_amber_diff_args(), doc=doc_amber_diff
+ # ),
+ Argument("pwmat", dict, [], doc="TODO: add doc"),
+ Argument("pwscf", dict, [], doc="TODO: add doc"),
+ Argument("custom", dict, fp_style_custom_args(), doc=doc_custom),
],
optional=True,
default_tag="none",
@@ -80,7 +145,7 @@ def fp_style_variant_type_args() -> Variant:
)
-def fp_args() -> List[Argument]:
+def fp_args() -> list[Argument]:
"""Generate arginfo for fp.
Returns
@@ -96,6 +161,7 @@ def fp_args() -> List[Argument]:
)
doc_fp_accurate_threshold = "If the accurate ratio is larger than this number, no fp calculation will be performed, i.e. fp_task_max = 0."
doc_fp_accurate_soft_threshold = "If the accurate ratio is between this number and fp_accurate_threshold, the fp_task_max linearly decays to zero."
+ doc_ratio_failed = "Check the ratio of unsuccessfully terminated jobs. If too many FP tasks are not converged, RuntimeError will be raised."
return [
Argument("fp_task_max", int, optional=True, doc=doc_fp_task_max),
@@ -109,6 +175,7 @@ def fp_args() -> List[Argument]:
optional=True,
doc=doc_fp_accurate_soft_threshold,
),
+ Argument("ratio_failed", float, optional=True, doc=doc_ratio_failed),
]
diff --git a/dpgen/simplify/simplify.py b/dpgen/simplify/simplify.py
index 46374c6f1..98de7c5a8 100644
--- a/dpgen/simplify/simplify.py
+++ b/dpgen/simplify/simplify.py
@@ -9,12 +9,11 @@
02: fp (optional, if the original dataset do not have fp data, same as generator)
"""
import glob
-import json
import logging
import os
import queue
-import warnings
-from typing import List, Union
+from collections import defaultdict
+from typing import Union
import dpdata
import numpy as np
@@ -22,7 +21,6 @@
from dpgen import dlog
from dpgen.dispatcher.Dispatcher import make_submission
-from dpgen.generator.lib.gaussian import make_gaussian_input
# TODO: maybe the following functions can be moved to dpgen.util
from dpgen.generator.lib.utils import (
@@ -30,28 +28,23 @@
log_iter,
make_iter_name,
record_iter,
- symlink_user_forward_files,
)
from dpgen.generator.run import (
data_system_fmt,
fp_name,
fp_task_fmt,
- make_fp_vasp_cp_cvasp,
- make_fp_vasp_incar,
- make_fp_vasp_kp,
+ make_fp_calculation,
make_train,
model_devi_name,
- model_devi_task_fmt,
post_fp,
post_train,
run_fp,
run_train,
- sys_link_fp_vasp_pp,
train_name,
train_task_fmt,
)
from dpgen.remote.decide_machine import convert_mdata
-from dpgen.util import expand_sys_str, normalize, sepline
+from dpgen.util import expand_sys_str, load_file, normalize, sepline, setup_ele_temp
from .arginfo import simplify_jdata_arginfo
@@ -59,6 +52,7 @@
rest_data_name = "data.rest"
accurate_data_name = "data.accurate"
detail_file_name_prefix = "details"
+true_error_file_name = "true_error"
sys_name_fmt = "sys." + data_system_fmt
sys_name_pattern = "sys.[0-9]*[0-9]"
@@ -69,7 +63,7 @@ def get_system_cls(jdata):
return dpdata.System
-def get_multi_system(path: Union[str, List[str]], jdata: dict) -> dpdata.MultiSystems:
+def get_multi_system(path: Union[str, list[str]], jdata: dict) -> dpdata.MultiSystems:
"""Get MultiSystems from a path or list of paths.
Both NumPy and HDF5 formats are supported. For details
@@ -112,7 +106,7 @@ def init_model(iter_index, jdata, mdata):
return
iter0_models = []
training_iter0_model = jdata.get("training_iter0_model_path", [])
- if type(training_iter0_model) == str:
+ if isinstance(training_iter0_model, str):
training_iter0_model = [training_iter0_model]
for ii in training_iter0_model:
model_is = glob.glob(ii)
@@ -137,7 +131,7 @@ def init_model(iter_index, jdata, mdata):
def init_pick(iter_index, jdata, mdata):
- """pick up init data from dataset randomly"""
+ """Pick up init data from dataset randomly."""
pick_data = jdata["pick_data"]
init_pick_number = jdata["init_pick_number"]
# use MultiSystems with System
@@ -170,15 +164,20 @@ def init_pick(iter_index, jdata, mdata):
def _init_dump_selected_frames(systems, labels, selc_idx, sys_data_path, jdata):
selc_systems = dpdata.MultiSystems(type_map=jdata["type_map"])
+ sys_id_dict = defaultdict(list)
for j in selc_idx:
sys_name, sys_id = labels[j]
+ sys_id_dict[sys_name].append(sys_id)
+ for sys_name, sys_id in sys_id_dict.items():
+ # sys_id: list[int]
+ # System.append is slow; thus, we combine the idx of the same system
selc_systems.append(systems[sys_name][sys_id])
selc_systems.to_deepmd_raw(sys_data_path)
selc_systems.to_deepmd_npy(sys_data_path, set_size=selc_idx.size)
def make_model_devi(iter_index, jdata, mdata):
- """calculate the model deviation of the rest idx"""
+ """Calculate the model deviation of the rest idx."""
pick_data = jdata["pick_data"]
iter_name = make_iter_name(iter_index)
work_path = os.path.join(iter_name, model_devi_name)
@@ -203,7 +202,7 @@ def make_model_devi(iter_index, jdata, mdata):
def run_model_devi(iter_index, jdata, mdata):
- """submit dp test tasks"""
+ """Submit dp test tasks."""
iter_name = make_iter_name(iter_index)
work_path = os.path.join(iter_name, model_devi_name)
# generate command
@@ -218,19 +217,40 @@ def run_model_devi(iter_index, jdata, mdata):
# models
commands = []
detail_file_name = detail_file_name_prefix
- command = "{dp} model-devi -m {model} -s {system} -o {detail_file}".format(
+ system_file_name = rest_data_name + ".old"
+ if jdata.get("one_h5", False):
+ # convert system to one h5 file
+ system_path = os.path.join(work_path, system_file_name)
+ dpdata.MultiSystems(type_map=jdata["type_map"]).from_deepmd_npy(
+ system_path,
+ labeled=False,
+ ).to_deepmd_hdf5(system_path + ".hdf5")
+ system_file_name += ".hdf5"
+ command = "rm -f {detail_file} && {dp} model-devi -m {model} -s {system} -o {detail_file}".format(
dp=mdata.get("model_devi_command", "dp"),
model=" ".join(task_model_list),
- system=rest_data_name + ".old",
+ system=system_file_name,
detail_file=detail_file_name,
)
commands = [command]
# submit
model_devi_group_size = mdata.get("model_devi_group_size", 1)
- forward_files = [rest_data_name + ".old"]
+ forward_files = [system_file_name]
backward_files = [detail_file_name]
+ f_trust_lo_err = jdata.get("true_error_f_trust_lo", float("inf"))
+ e_trust_lo_err = jdata.get("true_error_e_trust_lo", float("inf"))
+ if f_trust_lo_err < float("inf") or e_trust_lo_err < float("inf"):
+ command_true_error = "rm -f {detail_file} && {dp} model-devi -m {model} -s {system} -o {detail_file} --real_error".format(
+ dp=mdata.get("model_devi_command", "dp"),
+ model=" ".join(task_model_list),
+ system=system_file_name,
+ detail_file=true_error_file_name,
+ )
+ commands.append(command_true_error)
+ backward_files.append(true_error_file_name)
+
api_version = mdata.get("api_version", "1.0")
if Version(api_version) < Version("1.0"):
raise RuntimeError(
@@ -255,12 +275,19 @@ def run_model_devi(iter_index, jdata, mdata):
def post_model_devi(iter_index, jdata, mdata):
- """calculate the model deviation"""
+ """Calculate the model deviation."""
iter_name = make_iter_name(iter_index)
work_path = os.path.join(iter_name, model_devi_name)
f_trust_lo = jdata["model_devi_f_trust_lo"]
f_trust_hi = jdata["model_devi_f_trust_hi"]
+ e_trust_lo = jdata["model_devi_e_trust_lo"]
+ e_trust_hi = jdata["model_devi_e_trust_hi"]
+ f_trust_lo_err = jdata.get("true_error_f_trust_lo", float("inf"))
+ f_trust_hi_err = jdata.get("true_error_f_trust_hi", float("inf"))
+ e_trust_lo_err = jdata.get("true_error_e_trust_lo", float("inf"))
+ e_trust_hi_err = jdata.get("true_error_e_trust_hi", float("inf"))
+ use_true_error = f_trust_lo_err < float("inf") or e_trust_lo_err < float("inf")
type_map = jdata.get("type_map", [])
sys_accurate = dpdata.MultiSystems(type_map=type_map)
@@ -273,24 +300,86 @@ def post_model_devi(iter_index, jdata, mdata):
)
detail_file_name = detail_file_name_prefix
- with open(os.path.join(work_path, detail_file_name)) as f:
- for line in f:
- if line.startswith("# data.rest.old"):
- name = (line.split()[1]).split("/")[-1]
- elif line.startswith("#"):
- pass
- else:
- idx = int(line.split()[0])
- f_devi = float(line.split()[4])
- subsys = sys_entire[name][idx]
- if f_trust_lo <= f_devi < f_trust_hi:
- sys_candinate.append(subsys)
- elif f_devi >= f_trust_hi:
- sys_failed.append(subsys)
- elif f_devi < f_trust_lo:
- sys_accurate.append(subsys)
+ if not use_true_error:
+ with open(os.path.join(work_path, detail_file_name)) as f:
+ for line in f:
+ if line.startswith("# data.rest.old"):
+ name = (line.split()[1]).split("/")[-1]
+ elif line.startswith("#"):
+ columns = line.split()[1:]
+ cidx_step = columns.index("step")
+ cidx_max_devi_f = columns.index("max_devi_f")
+ try:
+ cidx_devi_e = columns.index("devi_e")
+ except ValueError:
+ # DeePMD-kit < 2.2.2
+ cidx_devi_e = None
else:
- raise RuntimeError("reach a place that should NOT be reached...")
+ idx = int(line.split()[cidx_step])
+ f_devi = float(line.split()[cidx_max_devi_f])
+ if cidx_devi_e is not None:
+ e_devi = float(line.split()[cidx_devi_e])
+ else:
+ e_devi = 0.0
+ subsys = sys_entire[name][idx]
+ if f_devi >= f_trust_hi or e_devi >= e_trust_hi:
+ sys_failed.append(subsys)
+ elif (
+ f_trust_lo <= f_devi < f_trust_hi
+ or e_trust_lo <= e_devi < e_trust_hi
+ ):
+ sys_candinate.append(subsys)
+ elif f_devi < f_trust_lo and e_devi < e_trust_lo:
+ sys_accurate.append(subsys)
+ else:
+ raise RuntimeError(
+ "reach a place that should NOT be reached..."
+ )
+ else:
+ with open(os.path.join(work_path, detail_file_name)) as f, open(
+ os.path.join(work_path, true_error_file_name)
+ ) as f_err:
+ for line, line_err in zip(f, f_err):
+ if line.startswith("# data.rest.old"):
+ name = (line.split()[1]).split("/")[-1]
+ elif line.startswith("#"):
+ columns = line.split()[1:]
+ cidx_step = columns.index("step")
+ cidx_max_devi_f = columns.index("max_devi_f")
+ cidx_devi_e = columns.index("devi_e")
+ else:
+ idx = int(line.split()[cidx_step])
+ f_devi = float(line.split()[cidx_max_devi_f])
+ f_err = float(line_err.split()[cidx_max_devi_f])
+ e_devi = float(line.split()[cidx_devi_e])
+ e_err = float(line_err.split()[cidx_devi_e])
+
+ subsys = sys_entire[name][idx]
+ if (
+ f_devi >= f_trust_hi
+ or e_devi >= e_trust_hi
+ or f_err >= f_trust_hi_err
+ or e_err >= e_trust_hi_err
+ ):
+ sys_failed.append(subsys)
+ elif (
+ f_trust_lo <= f_devi < f_trust_hi
+ or e_trust_lo <= e_devi < e_trust_hi
+ or f_trust_lo_err <= f_err < f_trust_hi_err
+ or e_trust_lo_err <= e_err < e_trust_hi_err
+ ):
+ sys_candinate.append(subsys)
+ elif (
+ f_devi < f_trust_lo
+ and e_devi < e_trust_lo
+ and f_err < f_trust_lo_err
+ and e_err < e_trust_lo_err
+ ):
+ sys_accurate.append(subsys)
+ else:
+ raise RuntimeError(
+ "reach a place that should NOT be reached..."
+ )
counter = {
"candidate": sys_candinate.get_nframes(),
@@ -300,7 +389,7 @@ def post_model_devi(iter_index, jdata, mdata):
fp_sum = sum(counter.values())
for cc_key, cc_value in counter.items():
dlog.info(
- "{0:9s} : {1:6d} in {2:6d} {3:6.2f} %".format(
+ "{:9s} : {:6d} in {:6d} {:6.2f} %".format(
cc_key, cc_value, fp_sum, cc_value / fp_sum * 100
)
)
@@ -327,7 +416,7 @@ def post_model_devi(iter_index, jdata, mdata):
dlog.info("no candidate")
else:
dlog.info(
- "total candidate {0:6d} picked {1:6d} ({2:6.2f} %) rest {3:6d} ({4:6.2f} % )".format(
+ "total candidate {:6d} picked {:6d} ({:6.2f} %) rest {:6d} ({:6.2f} % )".format(
counter["candidate"],
len(pick_idx),
float(len(pick_idx)) / counter["candidate"] * 100.0,
@@ -368,14 +457,15 @@ def make_fp_labeled(iter_index, jdata):
work_path = os.path.join(iter_name, fp_name)
create_path(work_path)
picked_data_path = os.path.join(iter_name, model_devi_name, picked_data_name)
- os.symlink(
- os.path.abspath(picked_data_path),
- os.path.abspath(os.path.join(work_path, "task." + fp_task_fmt % (0, 0))),
- )
- os.symlink(
- os.path.abspath(picked_data_path),
- os.path.abspath(os.path.join(work_path, "data." + data_system_fmt % 0)),
- )
+ if os.path.exists(os.path.abspath(picked_data_path)):
+ os.symlink(
+ os.path.abspath(picked_data_path),
+ os.path.abspath(os.path.join(work_path, "task." + fp_task_fmt % (0, 0))),
+ )
+ os.symlink(
+ os.path.abspath(picked_data_path),
+ os.path.abspath(os.path.join(work_path, "data." + data_system_fmt % 0)),
+ )
def make_fp_configs(iter_index, jdata):
@@ -384,6 +474,8 @@ def make_fp_configs(iter_index, jdata):
work_path = os.path.join(iter_name, fp_name)
create_path(work_path)
picked_data_path = os.path.join(iter_name, model_devi_name, picked_data_name)
+ if not os.path.exists(os.path.abspath(picked_data_path)):
+ return
systems = get_multi_system(picked_data_path, jdata)
ii = 0
jj = 0
@@ -397,69 +489,18 @@ def make_fp_configs(iter_index, jdata):
ii += 1
-def make_fp_gaussian(iter_index, jdata):
- work_path = os.path.join(make_iter_name(iter_index), fp_name)
- fp_tasks = glob.glob(os.path.join(work_path, "task.*"))
- cwd = os.getcwd()
- if "user_fp_params" in jdata.keys():
- fp_params = jdata["user_fp_params"]
- else:
- fp_params = jdata["fp_params"]
- cwd = os.getcwd()
- for ii in fp_tasks:
- os.chdir(ii)
- sys_data = dpdata.System("POSCAR").data
- ret = make_gaussian_input(sys_data, fp_params)
- with open("input", "w") as fp:
- fp.write(ret)
- os.chdir(cwd)
-
-
-def make_fp_vasp(iter_index, jdata):
- # abs path for fp_incar if it exists
- if "fp_incar" in jdata:
- jdata["fp_incar"] = os.path.abspath(jdata["fp_incar"])
- # get nbands esti if it exists
- if "fp_nbands_esti_data" in jdata:
- nbe = NBandsEsti(jdata["fp_nbands_esti_data"])
- else:
- nbe = None
- # order is critical!
- # 1, create potcar
- sys_link_fp_vasp_pp(iter_index, jdata)
- # 2, create incar
- make_fp_vasp_incar(iter_index, jdata, nbands_esti=nbe)
- # 3, create kpoints
- make_fp_vasp_kp(iter_index, jdata)
- # 4, copy cvasp
- make_fp_vasp_cp_cvasp(iter_index, jdata)
-
-
-def make_fp_calculation(iter_index, jdata):
- fp_style = jdata["fp_style"]
- if fp_style == "vasp":
- make_fp_vasp(iter_index, jdata)
- elif fp_style == "gaussian":
- make_fp_gaussian(iter_index, jdata)
- else:
- raise RuntimeError("unsupported fp_style " + fp_style)
-
-
def make_fp(iter_index, jdata, mdata):
labeled = jdata.get("labeled", False)
if labeled:
make_fp_labeled(iter_index, jdata)
else:
make_fp_configs(iter_index, jdata)
- make_fp_calculation(iter_index, jdata)
- # Copy user defined forward_files
- iter_name = make_iter_name(iter_index)
- work_path = os.path.join(iter_name, fp_name)
- symlink_user_forward_files(mdata=mdata, task_type="fp", work_path=work_path)
+ jdata["model_devi_engine"] = "lammps"
+ make_fp_calculation(iter_index, jdata, mdata)
def run_iter(param_file, machine_file):
- """init (iter 0): init_pick
+ """Init (iter 0): init_pick.
tasks (iter > 0):
00 make_train (same as generator)
@@ -472,23 +513,19 @@ def run_iter(param_file, machine_file):
07 run_fp (same as generator)
08 post_fp (same as generator)
"""
- # TODO: function of handling input json should be combined as one function
- try:
- import ruamel
- from monty.serialization import dumpfn, loadfn
-
- warnings.simplefilter("ignore", ruamel.yaml.error.MantissaNoDotYAML1_1Warning)
- jdata = loadfn(param_file)
- mdata = loadfn(machine_file)
- except Exception:
- with open(param_file, "r") as fp:
- jdata = json.load(fp)
- with open(machine_file, "r") as fp:
- mdata = json.load(fp)
+ jdata = load_file(param_file)
+ mdata = load_file(machine_file)
jdata_arginfo = simplify_jdata_arginfo()
jdata = normalize(jdata_arginfo, jdata)
+ # set up electron temperature
+ use_ele_temp = jdata.get("use_ele_temp", 0)
+ if use_ele_temp == 1:
+ setup_ele_temp(False)
+ elif use_ele_temp == 2:
+ setup_ele_temp(True)
+
if mdata.get("handlers", None):
if mdata["handlers"].get("smtp", None):
que = queue.Queue(-1)
@@ -519,14 +556,17 @@ def run_iter(param_file, machine_file):
if ii * max_tasks + jj <= iter_rec[0] * max_tasks + iter_rec[1]:
continue
task_name = "task %02d" % jj
- sepline("{} {}".format(iter_name, task_name), "-")
+ sepline(f"{iter_name} {task_name}", "-")
jdata["model_devi_jobs"] = [{} for _ in range(ii + 1)]
- if ii == 0 and jj < 6:
+ if ii == 0 and jj < 6 and (jj >= 3 or not jdata.get("init_data_sys", [])):
if jj == 0:
- log_iter("init_pick", ii, jj)
+ log_iter("init_train", ii, jj)
init_model(ii, jdata, mdata)
+ elif jj == 3:
+ log_iter("init_pick", ii, jj)
init_pick(ii, jdata, mdata)
- dlog.info("first iter, skip step 1-5")
+ else:
+ dlog.info("first iter, skip step 1-5")
elif jj == 0:
log_iter("make_train", ii, jj)
make_train(ii, jdata, mdata)
diff --git a/dpgen/tools/auto_gen_param.py b/dpgen/tools/auto_gen_param.py
index 9b6340b20..bd6d0f79b 100755
--- a/dpgen/tools/auto_gen_param.py
+++ b/dpgen/tools/auto_gen_param.py
@@ -1,4 +1,4 @@
-#%%
+# %%
import argparse
import json
import os
@@ -6,7 +6,7 @@
from itertools import tee
-class System(object):
+class System:
current_num_of_system = 0
current_num_of_sub_systems = 0
@@ -49,7 +49,7 @@ def get_sub_system(self):
return self.sub_system_list
-class Iteration(object):
+class Iteration:
current_num_of_itearation = 0
current_num_of_sub_itearation = 0
@@ -133,8 +133,7 @@ def get_system_list(
map_iterator=None,
file_name="POSCAR",
):
- """
- :type map_iterator: Iterable use to generate sys_configs
+ """:type map_iterator: Iterable use to generate sys_configs
:Exmaple [['000000', '000001',], ['00000[2-9]',], ['00001?', '000020',],]
"""
if sub_iteration_num != len(map_list):
@@ -150,9 +149,7 @@ def get_system_list(
map_list=map_list, data_list=data_list
)
else:
- origin_one, new_map_iterator = tee(
- map_iterator
- ) # pylint: disable=unused-variable
+ origin_one, new_map_iterator = tee(map_iterator) # pylint: disable=unused-variable
# tee means copy;new_map_generator will become a copy of map_iterator
system = System(system_prefix)
for idx2 in range(sub_iteration_num):
@@ -212,7 +209,6 @@ def get_model_devi_jobs(
temps_intervel=0.1,
num_temps=5,
):
-
if temps_iterator is None:
temps_iterator = default_temps_generator(
melt_point=melt_point, temps_intervel=temps_intervel, num_temps=num_temps
@@ -243,7 +239,6 @@ def get_sys_configs(system_list):
def get_init_data_sys(scan_dir="./", init_file_name="type.raw"):
-
init_data_sys = []
for t in os.walk(scan_dir):
if init_file_name in t[2]:
@@ -272,7 +267,6 @@ def get_basic_param_json(
temps_intervel=0.1,
num_temps=5,
):
-
init_data_sys = get_init_data_sys(scan_dir=scan_dir, init_file_name=init_file_name)
print(f"length of init_data_sys: {len(init_data_sys)} {init_data_sys}")
system_dict = scan_files(scan_dir, file_name, min_allow_files_num)
@@ -336,4 +330,4 @@ def auto_gen_param(args):
raise RuntimeError("must provide melt point or PARAM")
-#%%
+# %%
diff --git a/dpgen/tools/collect_data.py b/dpgen/tools/collect_data.py
index 2a270a47e..511dacc24 100755
--- a/dpgen/tools/collect_data.py
+++ b/dpgen/tools/collect_data.py
@@ -5,9 +5,6 @@
import json
import os
import subprocess as sp
-import sys
-
-import numpy as np
def file_len(fname):
diff --git a/dpgen/tools/relabel.py b/dpgen/tools/relabel.py
index ac5196eaa..140e614fa 100755
--- a/dpgen/tools/relabel.py
+++ b/dpgen/tools/relabel.py
@@ -5,17 +5,14 @@
import json
import os
import shutil
-import subprocess as sp
import sys
-import numpy as np
-
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
import dpdata
from dpgen.generator.lib.pwscf import make_pwscf_input
from dpgen.generator.lib.siesta import make_siesta_input
-from dpgen.generator.run import make_vasp_incar, update_mass_map
+from dpgen.generator.run import update_mass_map
def get_lmp_info(input_file):
@@ -180,7 +177,7 @@ def create_tasks(
os.chdir(target_folder)
fp_pp_path = os.path.abspath(fp_pp_path)
os.chdir(cwd_)
- # fp_params = fp_jdata['fp_params']
+ fp_params = fp_jdata["fp_params"]
# collect tasks from iter dirs
sys_tasks = [[] for ii in sys]
sys_tasks_record = [[] for ii in sys]
diff --git a/dpgen/tools/run_report.py b/dpgen/tools/run_report.py
index 88b3a4b06..1bc8f3d9f 100755
--- a/dpgen/tools/run_report.py
+++ b/dpgen/tools/run_report.py
@@ -1,14 +1,5 @@
#!/usr/bin/env python3
-import argparse
-import glob
-import json
-import os
-import shutil
-import subprocess as sp
-import sys
-
-import numpy as np
from dpgen.tools.stat_iter import stat_iter
from dpgen.tools.stat_sys import stat_sys
diff --git a/dpgen/tools/stat_iter.py b/dpgen/tools/stat_iter.py
index 5a3eb8932..1f0a6747e 100644
--- a/dpgen/tools/stat_iter.py
+++ b/dpgen/tools/stat_iter.py
@@ -3,7 +3,6 @@
import json
import os
import subprocess
-import sys
from collections import defaultdict
import dpdata
@@ -27,14 +26,10 @@ def stat_iter(target_folder, param_file="param.json", verbose=True, mute=False):
num, relative_path_doc = line.strip().split(" ")
path_doc = os.path.abspath(relative_path_doc)
num = int(num)
- prefix, iter_dirname, stage, out_filename = path_doc.rsplit(
- "/", 3
- ) # pylint: disable=unused-variable
+ prefix, iter_dirname, stage, out_filename = path_doc.rsplit("/", 3) # pylint: disable=unused-variable
pk_id, out_filename = path_doc.rsplit("/", 1)
iter = int(iter_dirname.split(".")[-1]) # pylint: disable=unused-variable
- out_id = int(
- out_filename.strip().split(".")[-2]
- ) # pylint: disable=unused-variable
+ out_id = int(out_filename.strip().split(".")[-2]) # pylint: disable=unused-variable
out_type = out_filename.strip().split(".")[0]
iter_dict[pk_id][out_type] += num
# for ii in
@@ -53,9 +48,7 @@ def stat_iter(target_folder, param_file="param.json", verbose=True, mute=False):
if line:
# [/home/felix/workplace/SiC/iter.000002/02.fp/task.018.000040/OUTCAR]
path_doc = os.path.abspath(line)
- pk_id, task_dirname, OUTCAR_filename = path_doc.rsplit(
- "/", 2
- ) # pylint: disable=unused-variable
+ pk_id, task_dirname, OUTCAR_filename = path_doc.rsplit("/", 2) # pylint: disable=unused-variable
try:
_sys = dpdata.LabeledSystem(path_doc, type_map=jdata["type_map"])
except Exception:
diff --git a/dpgen/tools/stat_sys.py b/dpgen/tools/stat_sys.py
index 5a0cb6471..c2f704bb1 100644
--- a/dpgen/tools/stat_sys.py
+++ b/dpgen/tools/stat_sys.py
@@ -1,15 +1,10 @@
#!/usr/bin/env python3
-import argparse
import glob
import json
import os
-import shutil
-import subprocess as sp
import sys
-import numpy as np
-
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
from dpgen.tools.relabel import get_lmp_info
@@ -62,7 +57,7 @@ def stat_sys(target_folder, param_file="param.json", verbose=True, mute=False):
os.path.join(ii, "01.model_devi", linked_keys[-3], "input.lammps")
)
trait = [ens, temp, pres]
- if not trait in sys_tasks_trait[sys_idx]:
+ if trait not in sys_tasks_trait[sys_idx]:
sys_tasks_trait[sys_idx].append(trait)
sys_tasks_trait_count[sys_idx].append(0)
t_idx = sys_tasks_trait[sys_idx].index(trait)
@@ -103,4 +98,4 @@ def stat_sys(target_folder, param_file="param.json", verbose=True, mute=False):
def run_report(args):
- stat_tasks(args.JOB_DIR, args.param, args.verbose)
+ stat_sys(args.JOB_DIR, args.param, args.verbose)
diff --git a/dpgen/tools/stat_time.py b/dpgen/tools/stat_time.py
index 5a2e129ac..e490a39ea 100755
--- a/dpgen/tools/stat_time.py
+++ b/dpgen/tools/stat_time.py
@@ -51,9 +51,7 @@ def stat_time(target_folder, param_file="param.json", verbose=True, mute=False):
# log example :
# .//iter.000000/00.train//003/train.log:# DEEPMD: wall time: 7960.265 s
# print(log.split(':'))
- file_path, text1, text2, wall_time = log.split(
- ":"
- ) # pylint: disable=unused-variable
+ file_path, text1, text2, wall_time = log.split(":") # pylint: disable=unused-variable
abs_file_path = os.path.abspath(file_path)
# stage=='00.train'
@@ -122,9 +120,7 @@ def stat_time(target_folder, param_file="param.json", verbose=True, mute=False):
# log example:
# .//iter.000002/01.model_devi//task.018.000075/log.lammps:Total wall time: 0:00:39
# print(log)
- file_path, text1, hour, min, sec = log.split(
- ":"
- ) # pylint: disable=unused-variable
+ file_path, text1, hour, min, sec = log.split(":") # pylint: disable=unused-variable
abs_file_path = os.path.abspath(file_path)
wall_time_sec = 3600 * int(hour) + 60 * int(min) + 1 * int(sec)
total_core_sec += wall_time_sec * paral_cores
diff --git a/dpgen/util.py b/dpgen/util.py
index b4ec68010..cd38d1473 100644
--- a/dpgen/util.py
+++ b/dpgen/util.py
@@ -1,13 +1,17 @@
#!/usr/bin/env python
-# coding: utf-8
import json
import os
+from contextlib import (
+ contextmanager,
+)
from pathlib import Path
-from typing import List, Union
+from typing import Union
import dpdata
import h5py
+import numpy as np
from dargs import Argument
+from dpdata.data_type import Axis, DataType
from dpgen import dlog
@@ -20,9 +24,7 @@
def sepline(ch="-", sp="-", screen=False):
- r"""
- seperate the output by '-'
- """
+ r"""Seperate the output by '-'."""
if screen:
print(ch.center(MaxLength, sp))
else:
@@ -30,14 +32,12 @@ def sepline(ch="-", sp="-", screen=False):
def box_center(ch="", fill=" ", sp="|"):
- r"""
- put the string at the center of | |
- """
- strs = ch.center(Len, fill)
+ r"""Put the string at the center of | |."""
+ strs = ch.center(MaxLength, fill)
dlog.info(sp + strs[1 : len(strs) - 1 :] + sp)
-def expand_sys_str(root_dir: Union[str, Path]) -> List[str]:
+def expand_sys_str(root_dir: Union[str, Path]) -> list[str]:
"""Recursively iterate over directories taking those that contain `type.raw` file.
If root_dir is a file but not a directory, it will be assumed as an HDF5 file.
@@ -51,6 +51,11 @@ def expand_sys_str(root_dir: Union[str, Path]) -> List[str]:
-------
List[str]
list of string pointing to system directories
+
+ Raises
+ ------
+ RuntimeError
+ No system was found in the directory
"""
root_dir = Path(root_dir)
if root_dir.is_dir():
@@ -64,12 +69,12 @@ def expand_sys_str(root_dir: Union[str, Path]) -> List[str]:
f_keys = ["/"]
f.visit(lambda x: f_keys.append("/" + x))
matches = [
- "%s#%s" % (root_dir, d)
- for d in f_keys
- if str(Path(d) / "type.raw") in f_keys
+ f"{root_dir}#{d}" for d in f_keys if str(Path(d) / "type.raw") in f_keys
]
else:
raise OSError(f"{root_dir} does not exist.")
+ if len(matches) == 0:
+ raise RuntimeError("%s does not contain any systems!" % root_dir)
return matches
@@ -95,7 +100,7 @@ def normalize(arginfo: Argument, data: dict, strict_check: bool = True) -> dict:
return data
-def convert_training_data_to_hdf5(input_files: List[str], h5_file: str):
+def convert_training_data_to_hdf5(input_files: list[str], h5_file: str):
"""Convert training data to HDF5 format and update the input files.
Parameters
@@ -125,7 +130,7 @@ def convert_training_data_to_hdf5(input_files: List[str], h5_file: str):
p1, p2 = pp.split("#")
ff = os.path.normpath(str((dd / p1).absolute().relative_to(cwd)))
pp = ff + "#" + p2
- new_pp = os.path.normpath(os.path.relpath(ff, h5_dir)) + "/" + p2
+ new_pp = os.path.normpath(os.path.relpath(ff, h5_dir)) + p2
else:
pp = os.path.normpath(str((dd / pp).absolute().relative_to(cwd)))
new_pp = os.path.normpath(os.path.relpath(pp, h5_dir))
@@ -144,7 +149,7 @@ def convert_training_data_to_hdf5(input_files: List[str], h5_file: str):
if "#" in ii:
p1, p2 = ii.split("#")
p1 = os.path.normpath(os.path.relpath(p1, h5_dir))
- group = f.create_group(str(p1) + "/" + p2)
+ group = f.create_group(str(p1) + p2)
s = dpdata.LabeledSystem(ii, fmt="deepmd/hdf5")
s.to("deepmd/hdf5", group)
else:
@@ -152,3 +157,90 @@ def convert_training_data_to_hdf5(input_files: List[str], h5_file: str):
group = f.create_group(str(pp))
s = dpdata.LabeledSystem(ii, fmt="deepmd/npy")
s.to("deepmd/hdf5", group)
+
+
+@contextmanager
+def set_directory(path: Path):
+ """Sets the current working path within the context.
+
+ Parameters
+ ----------
+ path : Path
+ The path to the cwd
+
+ Yields
+ ------
+ None
+
+ Examples
+ --------
+ >>> with set_directory("some_path"):
+ ... do_something()
+ """
+ cwd = Path().absolute()
+ path.mkdir(exist_ok=True, parents=True)
+ try:
+ os.chdir(path)
+ yield
+ finally:
+ os.chdir(cwd)
+
+
+def load_file(filename: Union[str, os.PathLike]) -> dict:
+ """Load data from a JSON or YAML file.
+
+ Parameters
+ ----------
+ filename : str or os.PathLike
+ The filename to load data from, whose suffix should be .json, .yaml, or .yml
+
+ Returns
+ -------
+ dict
+ The data loaded from the file
+
+ Raises
+ ------
+ ValueError
+ If the file format is not supported
+ """
+ filename = str(filename)
+ if filename.endswith(".json"):
+ with open(filename) as fp:
+ data = json.load(fp)
+ elif filename.endswith(".yaml") or filename.endswith(".yml"):
+ from ruamel.yaml import YAML
+
+ yaml = YAML(typ="safe", pure=True)
+ with open(filename) as fp:
+ data = yaml.load(fp)
+ else:
+ raise ValueError(f"Unsupported file format: {filename}")
+ return data
+
+
+def setup_ele_temp(atomic: bool):
+ """Set electronic temperature as required input data.
+
+ Parameters
+ ----------
+ atomic : bool
+ Whether to use atomic temperature or frame temperature
+ """
+ if atomic:
+ ele_temp_data_type = DataType(
+ "aparam",
+ np.ndarray,
+ shape=(Axis.NFRAMES, Axis.NATOMS, 1),
+ required=False,
+ )
+ else:
+ ele_temp_data_type = DataType(
+ "fparam",
+ np.ndarray,
+ shape=(Axis.NFRAMES, 1),
+ required=False,
+ )
+
+ dpdata.System.register_data_type(ele_temp_data_type)
+ dpdata.LabeledSystem.register_data_type(ele_temp_data_type)
diff --git a/examples/CH4-refact-dpdispatcher/INCAR_methane b/examples/CH4-refact-dpdispatcher/INCAR_methane
index b946fb7e5..4d1d7d039 120000
--- a/examples/CH4-refact-dpdispatcher/INCAR_methane
+++ b/examples/CH4-refact-dpdispatcher/INCAR_methane
@@ -1 +1 @@
-../run/dp1.x-lammps-vasp/CH4/INCAR_methane
\ No newline at end of file
+../run/dp2.x-lammps-vasp/CH4/INCAR_methane
\ No newline at end of file
diff --git a/examples/CH4-refact-dpdispatcher/machine-ali-ehpc.json b/examples/CH4-refact-dpdispatcher/machine-ali-ehpc.json
index 40bf56abe..372545587 100644
--- a/examples/CH4-refact-dpdispatcher/machine-ali-ehpc.json
+++ b/examples/CH4-refact-dpdispatcher/machine-ali-ehpc.json
@@ -1,83 +1,92 @@
{
- "api_version": "1.0",
- "train":
- {
- "command": "dp",
- "machine": {
- "batch_type": "PBS",
- "context_type": "SSHContext",
- "local_root": "./",
- "remote_root": "/home/fengbo/work_path_dpdispatcher_test",
- "remote_profile": {
- "hostname": "39.xxx.xx.xx",
- "username": "fengbo"
+ "api_version": "1.0",
+ "train": {
+ "command": "dp",
+ "machine": {
+ "batch_type": "PBS",
+ "context_type": "SSHContext",
+ "local_root": "./",
+ "remote_root": "/home/fengbo/work_path_dpdispatcher_test",
+ "remote_profile": {
+ "hostname": "39.xxx.xx.xx",
+ "username": "fengbo"
+ }
+ },
+ "resources": {
+ "batch_type": "PBS",
+ "number_node": 1,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "T4_4_15",
+ "group_size": 1,
+ "custom_flags": [
+ "#SBATCH --mem=32G"
+ ],
+ "strategy": {
+ "if_cuda_multi_devices": true
+ },
+ "para_deg": 3,
+ "source_list": [
+ "/home/fengbo/deepmd.1.2.4.env"
+ ]
}
- },
- "resources": {
- "batch_type": "PBS",
- "number_node": 1,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "T4_4_15",
- "group_size": 1,
- "custom_flags":["#SBATCH --mem=32G"],
- "strategy": {"if_cuda_multi_devices": true},
- "para_deg": 3,
- "source_list": ["/home/fengbo/deepmd.1.2.4.env"]
- }
},
- "model_devi":
- {
- "command": "lmp",
- "machine":{
- "batch_type": "PBS",
- "context_type": "SSHContext",
- "local_root": "./",
- "remote_root": "/home/fengbo/work_path_dpdispatcher_test",
- "remote_profile": {
- "hostname": "39.xxx.xx.xx",
- "username": "fengbo"
- }
- },
- "resources": {
- "batch_type": "PBS",
- "number_node": 1,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "T4_4_15",
- "group_size": 5,
- "source_list": ["/home/fengbo/deepmd.1.2.4.env"]
- },
- "_comments" : "In user_forward_files, define input files to be uploaded.",
- "user_forward_files" : [],
- "_comments" : "In user_backward_files, define output files to be collected.",
- "user_backward_files" : ["HILLS"]
+ "model_devi": {
+ "command": "lmp",
+ "machine": {
+ "batch_type": "PBS",
+ "context_type": "SSHContext",
+ "local_root": "./",
+ "remote_root": "/home/fengbo/work_path_dpdispatcher_test",
+ "remote_profile": {
+ "hostname": "39.xxx.xx.xx",
+ "username": "fengbo"
+ }
+ },
+ "resources": {
+ "batch_type": "PBS",
+ "number_node": 1,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "T4_4_15",
+ "group_size": 5,
+ "source_list": [
+ "/home/fengbo/deepmd.1.2.4.env"
+ ]
+ },
+ "_comments": "In user_backward_files, define output files to be collected.",
+ "user_forward_files": [],
+ "user_backward_files": [
+ "HILLS"
+ ]
},
- "fp":
- {
- "command": "vasp_std",
- "machine":{
- "batch_type": "PBS",
- "context_type": "SSHContext",
- "local_root": "./",
- "remote_root": "/home/fengbo/work_path_dpdispatcher_test",
- "remote_profile": {
- "hostname": "39.xxx.xx.xx",
- "username": "fengbo"
- }
- },
- "resources": {
- "batch_type": "PBS",
- "number_node": 1,
- "cpu_per_node": 32,
- "gpu_per_node": 0,
- "queue_name": "G_32_128",
- "group_size": 1,
- "source_list": ["~/vasp.env"]
- },
- "_comments" : "In user_forward_files, define input files to be uploaded.",
- "user_forward_files" : ["vdw_kernel.bindat"],
- "_comments" : "In user_backward_files, define output files to be collected.",
- "user_backward_files" : []
+ "fp": {
+ "command": "vasp_std",
+ "machine": {
+ "batch_type": "PBS",
+ "context_type": "SSHContext",
+ "local_root": "./",
+ "remote_root": "/home/fengbo/work_path_dpdispatcher_test",
+ "remote_profile": {
+ "hostname": "39.xxx.xx.xx",
+ "username": "fengbo"
+ }
+ },
+ "resources": {
+ "batch_type": "PBS",
+ "number_node": 1,
+ "cpu_per_node": 32,
+ "gpu_per_node": 0,
+ "queue_name": "G_32_128",
+ "group_size": 1,
+ "source_list": [
+ "~/vasp.env"
+ ]
+ },
+ "_comments": "In user_backward_files, define output files to be collected.",
+ "user_forward_files": [
+ "vdw_kernel.bindat"
+ ],
+ "user_backward_files": []
}
}
diff --git a/examples/CH4-refact-dpdispatcher/machine-dpcloudserver.json b/examples/CH4-refact-dpdispatcher/machine-dpcloudserver.json
index b13293fe1..d3a1c9db1 100644
--- a/examples/CH4-refact-dpdispatcher/machine-dpcloudserver.json
+++ b/examples/CH4-refact-dpdispatcher/machine-dpcloudserver.json
@@ -1,131 +1,128 @@
{
- "api_version": "1.0",
- "train" :
- {
- "command": "dp",
- "machine": {
- "batch_type": "DpCloudServer",
- "context_type": "DpCloudServerContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "yfb222333",
- "password": "",
- "program_id": 0,
- "input_data":{
- "job_type": "indicate",
- "log_file": "dp_cloud_server.log",
- "command": null,
- "backward_files": [],
- "job_name": "dpgen_20210630_job",
- "machine": {
- "platform": "ali",
- "resources": {
- "gpu_type": "1 * NVIDIA P100",
- "cpu_num": 4,
- "mem_limit": 30,
- "disk_size": 100,
- "region": "cn-beijing",
- "time_limit": "2:00:00",
- "image_name": "yfb-deepmd-kit-1.2.4-cuda10"
+ "api_version": "1.0",
+ "train": {
+ "command": "dp",
+ "machine": {
+ "batch_type": "DpCloudServer",
+ "context_type": "DpCloudServerContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "yfb222333",
+ "password": "",
+ "program_id": 0,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "dp_cloud_server.log",
+ "command": null,
+ "backward_files": [],
+ "job_name": "dpgen_20210630_job",
+ "machine": {
+ "platform": "ali",
+ "resources": {
+ "gpu_type": "1 * NVIDIA P100",
+ "cpu_num": 4,
+ "mem_limit": 30,
+ "disk_size": 100,
+ "region": "cn-beijing",
+ "time_limit": "2:00:00",
+ "image_name": "yfb-deepmd-kit-1.2.4-cuda10"
}
},
- "job_resources": null
+ "job_resources": null
+ }
}
+ },
+ "resources": {
+ "batch_type": "DpCloudServer",
+ "number_node": 1,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "GPU",
+ "group_size": 1
}
- },
- "resources": {
- "batch_type": "DpCloudServer",
- "number_node": 1,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "GPU",
- "group_size": 1
- }
},
- "model_devi":
- {
- "command": "lmp -i input.lammps -v restart 0",
- "machine": {
- "batch_type": "DpCloudServer",
- "context_type": "DpCloudServerContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "yfb222333",
- "password": "",
- "program_id": 0,
- "input_data":{
- "job_type": "indicate",
- "log_file": "dp_cloud_server.log",
- "command": null,
- "backward_files": [],
- "job_name": "dpgen_20210630_job",
- "machine": {
- "platform": "ali",
- "resources": {
- "gpu_type": "1 * NVIDIA P100",
- "cpu_num": 4,
- "mem_limit": 30,
- "disk_size": 100,
- "region": "cn-beijing",
- "time_limit": "2:00:00",
- "image_name": "yfb-deepmd-kit-1.2.4-cuda10"
+ "model_devi": {
+ "command": "lmp -i input.lammps -v restart 0",
+ "machine": {
+ "batch_type": "DpCloudServer",
+ "context_type": "DpCloudServerContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "yfb222333",
+ "password": "",
+ "program_id": 0,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "dp_cloud_server.log",
+ "command": null,
+ "backward_files": [],
+ "job_name": "dpgen_20210630_job",
+ "machine": {
+ "platform": "ali",
+ "resources": {
+ "gpu_type": "1 * NVIDIA P100",
+ "cpu_num": 4,
+ "mem_limit": 30,
+ "disk_size": 100,
+ "region": "cn-beijing",
+ "time_limit": "2:00:00",
+ "image_name": "yfb-deepmd-kit-1.2.4-cuda10"
}
},
- "job_resources": null
+ "job_resources": null
+ }
}
+ },
+ "resources": {
+ "batch_type": "DpCloudServer",
+ "number_node": 1,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "GPU",
+ "group_size": 5
}
- },
- "resources": {
- "batch_type": "DpCloudServer",
- "number_node": 1,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "GPU",
- "group_size": 5
- }
},
- "fp":
- {
- "command": "mpirun -n 16 vasp_std",
- "machine": {
- "batch_type": "DpCloudServer",
- "context_type": "DpCloudServerContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "yfb222333",
- "password": "",
- "program_id": 0,
- "input_data":{
- "job_type": "indicate",
- "log_file": "dp_cloud_server.log",
- "command": null,
- "backward_files": [],
- "job_name": "dpgen_20210630_job",
- "machine": {
- "platform": "ali",
- "resources": {
- "cpu_num": 32,
- "mem_limit": 64,
- "disk_size": 200,
- "region": "cn-beijing",
- "time_limit": "2:00:00",
- "image_name": "deepmd-vasp-cloudserver-v8"
+ "fp": {
+ "command": "mpirun -n 16 vasp_std",
+ "machine": {
+ "batch_type": "DpCloudServer",
+ "context_type": "DpCloudServerContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "yfb222333",
+ "password": "",
+ "program_id": 0,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "dp_cloud_server.log",
+ "command": null,
+ "backward_files": [],
+ "job_name": "dpgen_20210630_job",
+ "machine": {
+ "platform": "ali",
+ "resources": {
+ "cpu_num": 32,
+ "mem_limit": 64,
+ "disk_size": 200,
+ "region": "cn-beijing",
+ "time_limit": "2:00:00",
+ "image_name": "deepmd-vasp-cloudserver-v8"
}
},
- "job_resources": null
+ "job_resources": null
+ }
}
+ },
+ "resources": {
+ "batch_type": "DpCloudServer",
+ "number_node": 1,
+ "cpu_per_node": 32,
+ "gpu_per_node": 0,
+ "queue_name": "CPU",
+ "group_size": 5,
+ "source_list": [
+ "/opt/intel/oneapi/setvars.sh"
+ ]
}
- },
- "resources": {
- "batch_type": "DpCloudServer",
- "number_node": 1,
- "cpu_per_node": 32,
- "gpu_per_node": 0,
- "queue_name": "CPU",
- "group_size": 5,
- "source_list": [
- "/opt/intel/oneapi/setvars.sh"
- ]
- }
}
}
diff --git a/examples/CH4-refact-dpdispatcher/param_CH4_deepmd-kit-1.1.0.json b/examples/CH4-refact-dpdispatcher/param_CH4_deepmd-kit-1.1.0.json
deleted file mode 120000
index 2916f7885..000000000
--- a/examples/CH4-refact-dpdispatcher/param_CH4_deepmd-kit-1.1.0.json
+++ /dev/null
@@ -1 +0,0 @@
-../run/dp1.x-lammps-vasp/CH4/param_CH4_deepmd-kit-1.1.0.json
\ No newline at end of file
diff --git a/examples/CH4-refact-dpdispatcher/param_CH4_deepmd-kit-2.x.json b/examples/CH4-refact-dpdispatcher/param_CH4_deepmd-kit-2.x.json
new file mode 120000
index 000000000..3f11d42a7
--- /dev/null
+++ b/examples/CH4-refact-dpdispatcher/param_CH4_deepmd-kit-2.x.json
@@ -0,0 +1 @@
+../run/dp2.x-lammps-vasp/CH4/param_CH4_deepmd-kit-2.x.json
\ No newline at end of file
diff --git a/examples/database/param_Ti.json b/examples/database/param_Ti.json
index be78af113..ed2e6b556 100644
--- a/examples/database/param_Ti.json
+++ b/examples/database/param_Ti.json
@@ -1,19 +1,100 @@
{
- "path" : "/path/to/Ti",
- "calculator" : "vasp",
- "_comment" : "Current only support VASP",
- "output" : "./db_Ti.json",
- "id_prefix" : "",
- "config_info_dict" : {
- "fcc-bulk" : [0,1,2,3,4,5,6,7],
- "hcp-bulk" : [8,9,10,11,12,13,14,15],
- "bcc-bulk" : [16,17,18,19,20,21,22,23],
- "fcc-surf-100" : [24,25,26,27,28,29,30,31],
- "fcc-surf-111" : [32,33,34,35,36,37,38,39],
- "fcc-surf-110" : [40,41,42,43,44,45,46,47],
- "hcp-surf-001" : [48,49,50,51,52,53,54,55],
- "hcp-surf-100" : [56,57,58,59,60,61,62,63],
- "hcp-surf-110" : [64,65,66,67,68,69,70,71]
- },
- "skip_init" : true
+ "path": "/path/to/Ti",
+ "calculator": "vasp",
+ "_comment1": "Current only support VASP",
+ "output": "./db_Ti.json",
+ "id_prefix": "",
+ "config_info_dict": {
+ "fcc-bulk": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7
+ ],
+ "hcp-bulk": [
+ 8,
+ 9,
+ 10,
+ 11,
+ 12,
+ 13,
+ 14,
+ 15
+ ],
+ "bcc-bulk": [
+ 16,
+ 17,
+ 18,
+ 19,
+ 20,
+ 21,
+ 22,
+ 23
+ ],
+ "fcc-surf-100": [
+ 24,
+ 25,
+ 26,
+ 27,
+ 28,
+ 29,
+ 30,
+ 31
+ ],
+ "fcc-surf-111": [
+ 32,
+ 33,
+ 34,
+ 35,
+ 36,
+ 37,
+ 38,
+ 39
+ ],
+ "fcc-surf-110": [
+ 40,
+ 41,
+ 42,
+ 43,
+ 44,
+ 45,
+ 46,
+ 47
+ ],
+ "hcp-surf-001": [
+ 48,
+ 49,
+ 50,
+ 51,
+ 52,
+ 53,
+ 54,
+ 55
+ ],
+ "hcp-surf-100": [
+ 56,
+ 57,
+ 58,
+ 59,
+ 60,
+ 61,
+ 62,
+ 63
+ ],
+ "hcp-surf-110": [
+ 64,
+ 65,
+ 66,
+ 67,
+ 68,
+ 69,
+ 70,
+ 71
+ ]
+ },
+ "skip_init": true
}
diff --git a/examples/init/abacus/CuW/CuW.json b/examples/init/abacus/CuW/CuW.json
index 9abd406ce..0703bfb21 100644
--- a/examples/init/abacus/CuW/CuW.json
+++ b/examples/init/abacus/CuW/CuW.json
@@ -1,6 +1,11 @@
{
- "init_fp_style": "ABACUS",
- "stages": [1, 2, 3, 4],
+ "init_fp_style": "ABACUS",
+ "stages": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
"cell_type": "fcc",
"latt": 3.76,
"super_cell": [
@@ -9,14 +14,18 @@
1
],
"elements": [
- "Cu", "W"
+ "Cu",
+ "W"
+ ],
+ "atom_masses": [
+ 63.55,
+ 183.8
],
- "atom_masses": [63.55, 183.8],
"potcars": [
"Cu_ONCV_PBE-1.0.upf",
- "W_ONCV_PBE-1.0.upf"
+ "W_ONCV_PBE-1.0.upf"
],
- "orb_files":[
+ "orb_files": [
"Cu_gga_9au_60Ry_4s2p2d1f.orb",
"W_gga_10au_60Ry_4s2p2d2f.orb"
],
@@ -24,8 +33,8 @@
"relax_kpt": "KPT",
"md_kpt": "KPT",
"md_incar": "INPUT.md",
- "dpks_descriptor": "jle.orb",
- "dpks_model": "model.ptg",
+ "dpks_descriptor": "jle.orb",
+ "dpks_model": "model.ptg",
"scale": [
0.99
],
@@ -39,5 +48,5 @@
"Cu",
"W"
],
- "_comment": "that's all"
+ "_comment1": "that's all"
}
diff --git a/examples/init/abacus/fcc-Al-lcao/init.json b/examples/init/abacus/fcc-Al-lcao/init.json
index fccb79da7..1095fa54b 100644
--- a/examples/init/abacus/fcc-Al-lcao/init.json
+++ b/examples/init/abacus/fcc-Al-lcao/init.json
@@ -1,24 +1,41 @@
{
- "init_fp_style": "ABACUS",
- "stages": [1,2,3,4],
- "cell_type": "diamond",
- "super_cell": [2, 1, 1],
- "elements": ["Al"],
- "from_poscar": true,
- "from_poscar_path": "./Al.STRU",
- "potcars": ["Al_ONCV_PBE-1.0.upf"],
- "orb_files": ["Al_gga_9au_100Ry_4s4p1d.orb"],
- "relax_incar": "./INPUT.rlx",
- "md_incar" : "./INPUT.md",
- "relax_kpt": "./KPT.rlx",
- "md_kpt": "./KPT.md",
- "md_nstep": 3,
- "scale": [1.00],
- "skip_relax": false,
- "pert_numb": 2,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "init_fp_style": "ABACUS",
+ "stages": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "cell_type": "diamond",
+ "super_cell": [
+ 2,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Al"
+ ],
+ "from_poscar": true,
+ "from_poscar_path": "./Al.STRU",
+ "potcars": [
+ "Al_ONCV_PBE-1.0.upf"
+ ],
+ "orb_files": [
+ "Al_gga_9au_100Ry_4s4p1d.orb"
+ ],
+ "relax_incar": "./INPUT.rlx",
+ "md_incar": "./INPUT.md",
+ "relax_kpt": "./KPT.rlx",
+ "md_kpt": "./KPT.md",
+ "md_nstep": 3,
+ "scale": [
+ 1.0
+ ],
+ "skip_relax": false,
+ "pert_numb": 2,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/examples/init/abacus/fcc-Al-lcao/machine.json b/examples/init/abacus/fcc-Al-lcao/machine.json
index ba74f0297..1a35c7107 100644
--- a/examples/init/abacus/fcc-Al-lcao/machine.json
+++ b/examples/init/abacus/fcc-Al-lcao/machine.json
@@ -1,106 +1,111 @@
{
- "api_version": "1.0",
- "deepmd_version": "2.0.1",
- "train" :[
- {
- "command": "dp",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": ,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "00*/train.log",
- "grouped":true,
- "job_name": "dpgen_train_job",
- "disk_size": 200,
- "scass_type":"",
- "checkpoint_files":["00*/checkpoint","00*/model.ckpt*"],
- "checkpoint_time":30,
- "platform": "",
- "region":"",
- "image_name":"",
- "on_demand":0,
- "job_type":""
+ "api_version": "1.0",
+ "deepmd_version": "2.0.1",
+ "train": [
+ {
+ "command": "dp",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "00*/train.log",
+ "grouped": true,
+ "job_name": "dpgen_train_job",
+ "disk_size": 200,
+ "scass_type": "",
+ "checkpoint_files": [
+ "00*/checkpoint",
+ "00*/model.ckpt*"
+ ],
+ "checkpoint_time": 30,
+ "platform": "",
+ "region": "",
+ "image_name": "",
+ "on_demand": 0
+ }
+ }
+ },
+ "resources": {
+ "local_root": "./",
+ "group_size": 1
}
}
- },
- "resources": {
- "local_root":"./",
- "group_size": 1
- }
- }],
- "model_devi":
- [{
- "command": "lmp -i input.lammps -v restart 0",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": ,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "*/model_devi.log",
- "grouped":true,
- "job_name": "dpgen_model_devi_job",
- "disk_size": 200,
- "scass_type":"",
- "platform": "",
- "region":"",
- "image_name":"",
- "checkpoint_files": "sync_files",
- "checkpoint_time":30,
- "on_demand":0,
- "job_type":""
+ ],
+ "model_devi": [
+ {
+ "command": "lmp -i input.lammps -v restart 0",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "*/model_devi.log",
+ "grouped": true,
+ "job_name": "dpgen_model_devi_job",
+ "disk_size": 200,
+ "scass_type": "",
+ "platform": "",
+ "region": "",
+ "image_name": "",
+ "checkpoint_files": "sync_files",
+ "checkpoint_time": 30,
+ "on_demand": 0
+ }
+ }
+ },
+ "resources": {
+ "local_root": "./",
+ "group_size": 50
}
}
- },
- "resources": {
- "local_root":"./",
- "group_size": 50
- }
- }],
- "fp":
- [{
- "command": "OMP_NUM_THREADS=1 mpirun -n 8 abacus",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": ,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "task*/fp.log",
- "grouped":true,
- "job_name": "dpgen_fp_job",
- "disk_size": 100,
- "checkpoint_files": "sync_files",
- "checkpoint_time":30,
- "scass_type":"",
- "platform": "",
- "image_name":"",
- "on_demand":0
+ ],
+ "fp": [
+ {
+ "command": "OMP_NUM_THREADS=1 mpirun -n 8 abacus",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "task*/fp.log",
+ "grouped": true,
+ "job_name": "dpgen_fp_job",
+ "disk_size": 100,
+ "checkpoint_files": "sync_files",
+ "checkpoint_time": 30,
+ "scass_type": "",
+ "platform": "",
+ "image_name": "",
+ "on_demand": 0
+ }
+ }
+ },
+ "resources": {
+ "group_size": 50,
+ "local_root": "./",
+ "source_list": [
+ ""
+ ]
}
}
- },
- "resources": {
- "group_size": 50,
- "local_root":"./",
- "source_list": [""]
- }
- }
- ]
+ ]
}
diff --git a/examples/init/abacus/fcc-Al-pw/init.json b/examples/init/abacus/fcc-Al-pw/init.json
index 0874040e4..d90cef3bd 100644
--- a/examples/init/abacus/fcc-Al-pw/init.json
+++ b/examples/init/abacus/fcc-Al-pw/init.json
@@ -1,23 +1,38 @@
{
"init_fp_style": "ABACUS",
- "stages": [1,2,3,4],
- "cell_type": "fcc",
- "super_cell": [2, 1, 1],
- "elements": ["Al"],
- "from_poscar": true,
- "from_poscar_path": "./Al.STRU",
- "potcars": ["Al_ONCV_PBE-1.0.upf"],
- "relax_incar": "INPUT.rlx",
- "relax_kpt": "KPT",
- "md_incar" : "INPUT.md",
- "md_kpt" : "KPT",
- "skip_relax": false,
- "scale": [1.00],
- "pert_numb": 10,
- "md_nstep" : 10,
- "pert_box": 0.01,
- "pert_atom": 0.01,
- "deepgen_templ": "../generator/template/",
- "coll_ndata": 10,
- "_comment": "that's all"
+ "stages": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "cell_type": "fcc",
+ "super_cell": [
+ 2,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Al"
+ ],
+ "from_poscar": true,
+ "from_poscar_path": "./Al.STRU",
+ "potcars": [
+ "Al_ONCV_PBE-1.0.upf"
+ ],
+ "relax_incar": "INPUT.rlx",
+ "relax_kpt": "KPT",
+ "md_incar": "INPUT.md",
+ "md_kpt": "KPT",
+ "skip_relax": false,
+ "scale": [
+ 1.0
+ ],
+ "pert_numb": 10,
+ "md_nstep": 10,
+ "pert_box": 0.01,
+ "pert_atom": 0.01,
+ "deepgen_templ": "../generator/template/",
+ "coll_ndata": 10,
+ "_comment1": "that's all"
}
diff --git a/examples/init/abacus/fcc-Al-pw/machine.json b/examples/init/abacus/fcc-Al-pw/machine.json
index ba74f0297..1a35c7107 100644
--- a/examples/init/abacus/fcc-Al-pw/machine.json
+++ b/examples/init/abacus/fcc-Al-pw/machine.json
@@ -1,106 +1,111 @@
{
- "api_version": "1.0",
- "deepmd_version": "2.0.1",
- "train" :[
- {
- "command": "dp",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": ,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "00*/train.log",
- "grouped":true,
- "job_name": "dpgen_train_job",
- "disk_size": 200,
- "scass_type":"",
- "checkpoint_files":["00*/checkpoint","00*/model.ckpt*"],
- "checkpoint_time":30,
- "platform": "",
- "region":"",
- "image_name":"",
- "on_demand":0,
- "job_type":""
+ "api_version": "1.0",
+ "deepmd_version": "2.0.1",
+ "train": [
+ {
+ "command": "dp",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "00*/train.log",
+ "grouped": true,
+ "job_name": "dpgen_train_job",
+ "disk_size": 200,
+ "scass_type": "",
+ "checkpoint_files": [
+ "00*/checkpoint",
+ "00*/model.ckpt*"
+ ],
+ "checkpoint_time": 30,
+ "platform": "",
+ "region": "",
+ "image_name": "",
+ "on_demand": 0
+ }
+ }
+ },
+ "resources": {
+ "local_root": "./",
+ "group_size": 1
}
}
- },
- "resources": {
- "local_root":"./",
- "group_size": 1
- }
- }],
- "model_devi":
- [{
- "command": "lmp -i input.lammps -v restart 0",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": ,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "*/model_devi.log",
- "grouped":true,
- "job_name": "dpgen_model_devi_job",
- "disk_size": 200,
- "scass_type":"",
- "platform": "",
- "region":"",
- "image_name":"",
- "checkpoint_files": "sync_files",
- "checkpoint_time":30,
- "on_demand":0,
- "job_type":""
+ ],
+ "model_devi": [
+ {
+ "command": "lmp -i input.lammps -v restart 0",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "*/model_devi.log",
+ "grouped": true,
+ "job_name": "dpgen_model_devi_job",
+ "disk_size": 200,
+ "scass_type": "",
+ "platform": "",
+ "region": "",
+ "image_name": "",
+ "checkpoint_files": "sync_files",
+ "checkpoint_time": 30,
+ "on_demand": 0
+ }
+ }
+ },
+ "resources": {
+ "local_root": "./",
+ "group_size": 50
}
}
- },
- "resources": {
- "local_root":"./",
- "group_size": 50
- }
- }],
- "fp":
- [{
- "command": "OMP_NUM_THREADS=1 mpirun -n 8 abacus",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": ,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "task*/fp.log",
- "grouped":true,
- "job_name": "dpgen_fp_job",
- "disk_size": 100,
- "checkpoint_files": "sync_files",
- "checkpoint_time":30,
- "scass_type":"",
- "platform": "",
- "image_name":"",
- "on_demand":0
+ ],
+ "fp": [
+ {
+ "command": "OMP_NUM_THREADS=1 mpirun -n 8 abacus",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "task*/fp.log",
+ "grouped": true,
+ "job_name": "dpgen_fp_job",
+ "disk_size": 100,
+ "checkpoint_files": "sync_files",
+ "checkpoint_time": 30,
+ "scass_type": "",
+ "platform": "",
+ "image_name": "",
+ "on_demand": 0
+ }
+ }
+ },
+ "resources": {
+ "group_size": 50,
+ "local_root": "./",
+ "source_list": [
+ ""
+ ]
}
}
- },
- "resources": {
- "group_size": 50,
- "local_root":"./",
- "source_list": [""]
- }
- }
- ]
+ ]
}
diff --git a/examples/init/al.json b/examples/init/al.json
index 41e365cad..6f1fbb2ab 100644
--- a/examples/init/al.json
+++ b/examples/init/al.json
@@ -28,5 +28,5 @@
"Mg",
"Al"
],
- "_comment": "that's all"
+ "_comment1": "that's all"
}
diff --git a/examples/init/ch4.json b/examples/init/ch4.json
index 3902c24da..622b74b5f 100644
--- a/examples/init/ch4.json
+++ b/examples/init/ch4.json
@@ -1,19 +1,36 @@
{
- "stages": [1,2,3,4],
- "cell_type": "diamond",
- "super_cell": [1, 1, 1],
- "elements": ["H","C"],
- "from_poscar": true,
- "from_poscar_path": "./CH4.POSCAR",
- "potcars": ["./POTCAR_H", "./POTCAR_C"],
- "relax_incar": "./INCAR_methane.rlx",
- "md_incar" : "./INCAR_methane.md",
- "scale": [1.00],
- "skip_relax": false,
- "pert_numb": 30,
- "md_nstep" : 10,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "stages": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "cell_type": "diamond",
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "H",
+ "C"
+ ],
+ "from_poscar": true,
+ "from_poscar_path": "./CH4.POSCAR",
+ "potcars": [
+ "./POTCAR_H",
+ "./POTCAR_C"
+ ],
+ "relax_incar": "./INCAR_methane.rlx",
+ "md_incar": "./INCAR_methane.md",
+ "scale": [
+ 1.0
+ ],
+ "skip_relax": false,
+ "pert_numb": 30,
+ "md_nstep": 10,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/examples/init/cu.surf.hcp.111.json b/examples/init/cu.surf.hcp.111.json
index 00816e09d..7ed24507f 100644
--- a/examples/init/cu.surf.hcp.111.json
+++ b/examples/init/cu.surf.hcp.111.json
@@ -1,56 +1,59 @@
{
- "_comments": "This is an example to generate Cu-hcp surface configurations.",
- "_comments": "This example is used in Computer Physics Communications, 2020, 107206.",
- "_comments" : "Last modified on 2019.8.27 by Yuzhi Zhang.",
- "stages": [
- 1,
- 2
- ],
- "cell_type": "hcp",
- "latt": 3.63,
- "super_cell": [
- 1,
- 1,
- 1
- ],
- "z_min": 10,
- "vacuum_max": 10,
- "vacuum_resol": [
- 0.5,
- 1
- ],
- "mid_point": 4.0,
- "millers": [
- [
- 1,
- 0,
- 0
+ "_comments": "Last modified on 2019.8.27 by Yuzhi Zhang.",
+ "stages": [
+ 1,
+ 2
],
- [
- 1,
- 1,
- 0
+ "cell_type": "hcp",
+ "latt": 3.63,
+ "super_cell": [
+ 1,
+ 1,
+ 1
],
- [
- 0,
- 0,
- 1
- ]
- ],
- "elements": [
- "Cu"
- ],
- "potcars": [
- "PATH/POTCAR"
- ],
- "relax_incar" : "PATH/INCAR_surf_rlx",
- "scale": [
- 0.96,0.98, 1.0,1.02, 1.04, 1.06
- ],
- "skip_relax": false,
- "pert_numb": 20,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "lmp_cmd" : "PATH/lmp_serial",
- "_comment": "that's all"
+ "z_min": 10,
+ "vacuum_max": 10,
+ "vacuum_resol": [
+ 0.5,
+ 1
+ ],
+ "mid_point": 4.0,
+ "millers": [
+ [
+ 1,
+ 0,
+ 0
+ ],
+ [
+ 1,
+ 1,
+ 0
+ ],
+ [
+ 0,
+ 0,
+ 1
+ ]
+ ],
+ "elements": [
+ "Cu"
+ ],
+ "potcars": [
+ "PATH/POTCAR"
+ ],
+ "relax_incar": "PATH/INCAR_surf_rlx",
+ "scale": [
+ 0.96,
+ 0.98,
+ 1.0,
+ 1.02,
+ 1.04,
+ 1.06
+ ],
+ "skip_relax": false,
+ "pert_numb": 20,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "lmp_cmd": "PATH/lmp_serial",
+ "_comment1": "that's all"
}
diff --git a/examples/init/surf.json b/examples/init/surf.json
index 902fc8d0b..08ec0f05a 100644
--- a/examples/init/surf.json
+++ b/examples/init/surf.json
@@ -1,56 +1,56 @@
{
- "stages": [
- 1,
- 2
- ],
- "cell_type": "fcc",
- "latt": 4.1,
- "super_cell": [
- 1,
- 1,
- 1
- ],
- "z_min": 9,
- "vacuum_max": 9.0,
- "vacuum_resol": [
- 0.5,
- 1
- ],
- "mid_point": 4.0,
- "head_ratio": 0.6,
- "vacuum_numb": 20,
- "millers": [
- [
- 1,
- 0,
- 0
+ "stages": [
+ 1,
+ 2
],
- [
- 1,
- 1,
- 0
+ "cell_type": "fcc",
+ "latt": 4.1,
+ "super_cell": [
+ 1,
+ 1,
+ 1
],
- [
- 1,
- 1,
- 1
- ]
- ],
- "elements": [
- "Al"
- ],
- "potcars": [
- "./POTCAR"
- ],
- "relax_incar" : "INCAR_metal_rlx_low",
- "scale": [
- 0.98,
- 1.0
- ],
- "skip_relax": true,
- "pert_numb": 5,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "z_min": 9,
+ "vacuum_max": 9.0,
+ "vacuum_resol": [
+ 0.5,
+ 1
+ ],
+ "mid_point": 4.0,
+ "head_ratio": 0.6,
+ "vacuum_numb": 20,
+ "millers": [
+ [
+ 1,
+ 0,
+ 0
+ ],
+ [
+ 1,
+ 1,
+ 0
+ ],
+ [
+ 1,
+ 1,
+ 1
+ ]
+ ],
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "./POTCAR"
+ ],
+ "relax_incar": "INCAR_metal_rlx_low",
+ "scale": [
+ 0.98,
+ 1.0
+ ],
+ "skip_relax": true,
+ "pert_numb": 5,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/examples/machine/DeePMD-kit-1.0/machine-local-4GPU.json b/examples/machine/DeePMD-kit-1.0/machine-local-4GPU.json
index e0e6bfca0..854ee01ba 100644
--- a/examples/machine/DeePMD-kit-1.0/machine-local-4GPU.json
+++ b/examples/machine/DeePMD-kit-1.0/machine-local-4GPU.json
@@ -1,12 +1,12 @@
{
- "_comment" : "This is an example of DP-GEN on Local device running with 4 GPUs",
- "_comment": "Last updated on 2021.5.9 for DP-GEN 0.9.2 by Ke XU",
+ "_comment1": "This is an example of DP-GEN on Local device running with 4 GPUs",
+ "_comment2": "Last updated on 2021.5.9 for DP-GEN 0.9.2 by Ke XU",
"train": {
- "_comment" : "Specify the installed path of DeePMD-kit",
+ "_comment3": "Specify the installed path of DeePMD-kit",
"command": "/home/user/anaconda3/bin/dp",
- "_comment" : "Specify machine settings",
+ "_comment4": "Specify machine settings",
"machine": {
- "_comment": "Supported batches include slurm, pbs, shell, lsf.",
+ "_comment5": "Supported batches include slurm, pbs, shell, lsf.",
"batch_type": "shell",
"context_type": "local",
"remote_root": "/tmp/dpwork",
@@ -14,22 +14,22 @@
},
"resources": {
"module_list": [],
- "_comment": "Environment to be activated. This will generate source xxx/psxevars.sh in scripts. ",
+ "_comment6": "Environment to be activated. This will generate source xxx/psxevars.sh in scripts. ",
"source_list": [
"/opt/intel/parallel_studio_xe_2020/psxevars.sh"
],
"batch_type": "shell",
- "_comment": "DP-GEN will put 4 tasks together in one submitting script.",
+ "_comment7": "DP-GEN will put 4 tasks together in one submitting script.",
"group_size": 4,
- "_comment" : "The number of nodes.",
+ "_comment8": "The number of nodes.",
"number_node": 1,
- "_comment" : "The number of CPUs.",
+ "_comment9": "The number of CPUs.",
"cpu_per_node": 4,
- "_comment" : "If you choose to run with multiple GPUs simultaneously, just ignore numb_gpu.",
+ "_comment10": "If you choose to run with multiple GPUs simultaneously, just ignore numb_gpu.",
"gpu_per_node": 0,
"kwargs": {},
"strategy": {
- "_comment" : "Allow the multi-GPU task running.",
+ "_comment11": "Allow the multi-GPU task running.",
"if_cuda_multi_devices": true
},
"para_deg": 4,
@@ -68,11 +68,11 @@
"local_root": "./"
},
"resources": {
- "_comment" : "Load the intel compiler.",
+ "_comment12": "Load the intel compiler.",
"source_list": [
"/opt/intel/parallel_studio_xe_2020/psxevars.sh"
],
- "_comment": "This will generate export PATH=/home/user/Soft/VASP/vasp.5.4.4-allbak/bin:$PATH in scripts;",
+ "_comment13": "This will generate export PATH=/home/user/Soft/VASP/vasp.5.4.4-allbak/bin:$PATH in scripts;",
"envs": {
"PATH": "/home/user/Soft/VASP/vasp.5.4.4-allbak/bin:$PATH"
},
diff --git a/examples/machine/DeePMD-kit-1.x/machine-local.json b/examples/machine/DeePMD-kit-1.x/machine-local.json
index 2eb999743..eaac4cb5d 100644
--- a/examples/machine/DeePMD-kit-1.x/machine-local.json
+++ b/examples/machine/DeePMD-kit-1.x/machine-local.json
@@ -1,7 +1,7 @@
{
"api_version": "1.0",
"train": {
- "_comment": "training on localhost",
+ "_comment1": "training on localhost",
"machine": {
"batch_type": "shell",
"context_type": "local",
@@ -21,9 +21,9 @@
"command": "/home/wanghan/local/deepmd/1.*/dp"
},
"model_devi": {
- "_comment": "model devi on localhost",
+ "_comment2": "model devi on localhost",
"machine": {
- "_comment": "If lazy_local, calculations are done directly in current folders.",
+ "_comment3": "If lazy_local, calculations are done directly in current folders.",
"batch_type": "shell",
"context_type": "lazylocal",
"local_root": "./"
@@ -40,7 +40,7 @@
"command": "/home/wanghan/local/bin/lmp_mpi_010"
},
"fp": {
- "_comment": "fp on localhost",
+ "_comment4": "fp on localhost",
"machine": {
"batch_type": "shell",
"context_type": "local",
@@ -51,7 +51,7 @@
"module_list": [
"mpi"
],
- "_comment": "that's all",
+ "_comment5": "that's all",
"batch_type": "shell",
"group_size": 2,
"cpu_per_node": 4,
diff --git a/examples/machine/DeePMD-kit-1.x/machine-slurm-qe.json b/examples/machine/DeePMD-kit-1.x/machine-slurm-qe.json
index 6f96d397d..40ed09746 100644
--- a/examples/machine/DeePMD-kit-1.x/machine-slurm-qe.json
+++ b/examples/machine/DeePMD-kit-1.x/machine-slurm-qe.json
@@ -1,39 +1,39 @@
{
- "_comment": "Last updated on 2021.4.30 for DP-GEN 0.9.2 by Yuzhi Zhang",
+ "_comment1": "Last updated on 2021.4.30 for DP-GEN 0.9.2 by Yuzhi Zhang",
"train": {
- "_comment" : "Specify the installed path of DeePMD-kit",
+ "_comment2": "Specify the installed path of DeePMD-kit",
"command": "PATH_TO_DEEPMD/dp",
- "_comment" : "Specify machine settings",
+ "_comment3": "Specify machine settings",
"machine": {
"batch_type": "slurm",
"context_type": "ssh",
"remote_profile": {
"hostname": "localhost",
- "_comment" : "The port for connection, most common settings is 22",
+ "_comment4": "The port for connection, most common settings is 22",
"port": 22,
- "_comment" : "Specify your username.",
+ "_comment5": "Specify your username.",
"username": "USERNAME"
},
- "_comment" : "You should alwasy make sure that directory of work_path exits. ",
+ "_comment6": "You should alwasy make sure that directory of work_path exits. ",
"remote_root": "PATH_TO_WORK",
"local_root": "./"
},
"resources": {
- "_comment" : "Environment to be activated. This will generate source PATH/train_new.env . ",
+ "_comment7": "Environment to be activated. This will generate source PATH/train_new.env . ",
"source_list": [
"PATH/train_new.env"
],
- "_comment" : " Module is a common tools on HPC clustes to manage softwares for multiple users.",
- "_comment" : "Modules to be loaded. This will generate module load intel",
+ "_comment8": " Module is a common tools on HPC clustes to manage softwares for multiple users.",
+ "_comment9": "Modules to be loaded. This will generate module load intel",
"module_list": [
"intel"
],
"batch_type": "slurm",
- "_comment" : "The number of nodes. This will generate #SBATCH -N 1 in your script. ",
+ "_comment10": "The number of nodes. This will generate #SBATCH -N 1 in your script. ",
"number_node": 1,
- "_comment" : "The number of CPUs. #SBATCH -n 4",
+ "_comment11": "The number of CPUs. #SBATCH -n 4",
"cpu_per_node": 4,
- "_comment" : "The number of GPU cards. #SBATCH --gres=gpu:1",
+ "_comment12": "The number of GPU cards. #SBATCH --gres=gpu:1",
"gpu_per_node": 1,
"queue_name": "all",
"custom_flags": [
@@ -63,7 +63,7 @@
],
"module_list": [],
"batch_type": "slurm",
- "_comment": "DP-GEN will put 5 tasks together in one submitting script.",
+ "_comment13": "DP-GEN will put 5 tasks together in one submitting script.",
"group_size": 5,
"number_node": 1,
"cpu_per_node": 4,
diff --git a/examples/machine/DeePMD-kit-2.x/lebesgue_v2_machine.json b/examples/machine/DeePMD-kit-2.x/lebesgue_v2_machine.json
index ae6ac31ab..8fdd1db35 100644
--- a/examples/machine/DeePMD-kit-2.x/lebesgue_v2_machine.json
+++ b/examples/machine/DeePMD-kit-2.x/lebesgue_v2_machine.json
@@ -1,107 +1,106 @@
{
- "api_version": "1.0",
- "deepmd_version": "2.0.1",
- "train" :
- {
- "command": "dp",
- "machine": {
- "batch_type": "DpCloudServer",
- "context_type": "DpCloudServerContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "your lebesgue register email",
- "password": "your lebesgue password",
- "program_id": 0,
- "input_data":{
- "api_version":2,
- "job_type": "indicate",
- "log_file": "00*/train.log",
- "grouped":true,
- "job_name": "dpgen_train_job",
- "disk_size": 100,
- "scass_type":"c8_m60_1 * NVIDIA P100",
- "platform": "ali",
- "image_name":"deepmd-kit:2.0.1",
- "on_demand":0
+ "api_version": "1.0",
+ "deepmd_version": "2.0.1",
+ "train": {
+ "command": "dp",
+ "machine": {
+ "batch_type": "DpCloudServer",
+ "context_type": "DpCloudServerContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "your lebesgue register email",
+ "password": "your lebesgue password",
+ "program_id": 0,
+ "input_data": {
+ "api_version": 2,
+ "job_type": "indicate",
+ "log_file": "00*/train.log",
+ "grouped": true,
+ "job_name": "dpgen_train_job",
+ "disk_size": 100,
+ "scass_type": "c8_m60_1 * NVIDIA P100",
+ "platform": "ali",
+ "image_name": "deepmd-kit:2.0.1",
+ "on_demand": 0
+ }
}
+ },
+ "resources": {
+ "batch_type": "DpCloudServer",
+ "number_node": 1,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "GPU",
+ "group_size": 1
}
- },
- "resources": {
- "batch_type": "DpCloudServer",
- "number_node": 1,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "GPU",
- "group_size": 1
- }
},
- "model_devi":
- {
- "command": "lmp -i input.lammps -v restart 0",
- "machine": {
- "batch_type": "DpCloudServer",
- "context_type": "DpCloudServerContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "your lebesgue register email",
- "password": "your lebesgue password",
- "program_id": 0,
- "input_data":{
- "api_version":2,
- "job_type": "indicate",
- "log_file": "*/model_devi.log",
- "grouped":true,
- "job_name": "dpgen_model_devi_job",
- "disk_size": 200,
- "scass_type":"c8_m60_1 * NVIDIA P100",
- "platform": "ali",
- "image_name":"deepmd-kit:2.0.1",
- "on_demand":0
+ "model_devi": {
+ "command": "lmp -i input.lammps -v restart 0",
+ "machine": {
+ "batch_type": "DpCloudServer",
+ "context_type": "DpCloudServerContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "your lebesgue register email",
+ "password": "your lebesgue password",
+ "program_id": 0,
+ "input_data": {
+ "api_version": 2,
+ "job_type": "indicate",
+ "log_file": "*/model_devi.log",
+ "grouped": true,
+ "job_name": "dpgen_model_devi_job",
+ "disk_size": 200,
+ "scass_type": "c8_m60_1 * NVIDIA P100",
+ "platform": "ali",
+ "image_name": "deepmd-kit:2.0.1",
+ "on_demand": 0
+ }
}
+ },
+ "resources": {
+ "batch_type": "DpCloudServer",
+ "number_node": 1,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "GPU",
+ "group_size": 5
}
- },
- "resources": {
- "batch_type": "DpCloudServer",
- "number_node": 1,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "GPU",
- "group_size": 5
- }
},
- "fp":
- {
- "command": "mpirun -n 16 vasp_std",
- "machine": {
- "batch_type": "DpCloudServer",
- "context_type": "DpCloudServerContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "your lebesgue register email",
- "password": "your lebesgue password",
- "program_id": 0,
- "input_data":{
- "api_version":2,
- "job_type": "indicate",
- "log_file": "task*/fp.log",
- "grouped":true,
- "job_name": "dpgen_fp_job",
- "disk_size": 100,
- "scass_type":"c8_m8_cpu",
- "platform": "ali",
- "image_name":"vasp:5.4.4",
- "on_demand":0
+ "fp": {
+ "command": "mpirun -n 16 vasp_std",
+ "machine": {
+ "batch_type": "DpCloudServer",
+ "context_type": "DpCloudServerContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "your lebesgue register email",
+ "password": "your lebesgue password",
+ "program_id": 0,
+ "input_data": {
+ "api_version": 2,
+ "job_type": "indicate",
+ "log_file": "task*/fp.log",
+ "grouped": true,
+ "job_name": "dpgen_fp_job",
+ "disk_size": 100,
+ "scass_type": "c8_m8_cpu",
+ "platform": "ali",
+ "image_name": "vasp:5.4.4",
+ "on_demand": 0
+ }
}
+ },
+ "resources": {
+ "batch_type": "DpCloudServer",
+ "number_node": 1,
+ "cpu_per_node": 32,
+ "gpu_per_node": 0,
+ "queue_name": "CPU",
+ "group_size": 5,
+ "source_list": [
+ "/opt/intel/oneapi/setvars.sh"
+ ]
}
- },
- "resources": {
- "batch_type": "DpCloudServer",
- "number_node": 1,
- "cpu_per_node": 32,
- "gpu_per_node": 0,
- "queue_name": "CPU",
- "group_size": 5,
- "source_list": ["/opt/intel/oneapi/setvars.sh"]
- }
}
}
diff --git a/examples/run/ch4/machine.json b/examples/run/ch4/machine.json
index 653f613d6..70b8ee67a 100644
--- a/examples/run/ch4/machine.json
+++ b/examples/run/ch4/machine.json
@@ -1,75 +1,77 @@
{
- "deepmd_path": "/sharedext4/local/deepmd-kit-0.12.4/",
- "train_machine": {
- "machine_type": "slurm",
- "hostname" : "localhost",
- "port" : 22,
- "username": "root",
- "work_path" : "/sharedext4/generator/example/deep.gen/generator/ch4/",
- "_comment" : "that's all"
+ "deepmd_path": "/sharedext4/local/deepmd-kit-0.12.4/",
+ "train_machine": {
+ "machine_type": "slurm",
+ "hostname": "localhost",
+ "port": 22,
+ "username": "root",
+ "work_path": "/sharedext4/generator/example/deep.gen/generator/ch4/",
+ "_comment1": "that's all"
},
- "train_resources": {
- "numb_node": 1,
- "numb_gpu": 1,
- "task_per_node":8,
- "partition" : "GPU-H",
- "exclude_list" : [],
- "source_list": [ "/sharedext4/local/deepmd-kit-0.12.4/bin/activate" ],
- "module_list": [ ],
- "time_limit": "23:0:0",
- "mem_limit": 32,
- "_comment": "that's all"
+ "train_resources": {
+ "numb_node": 1,
+ "numb_gpu": 1,
+ "task_per_node": 8,
+ "partition": "GPU-H",
+ "exclude_list": [],
+ "source_list": [
+ "/sharedext4/local/deepmd-kit-0.12.4/bin/activate"
+ ],
+ "module_list": [],
+ "time_limit": "23:0:0",
+ "mem_limit": 32,
+ "_comment2": "that's all"
},
-
- "model_devi_command": "/sharedext4/softwares/lammps/bin/lmp_serial",
- "model_devi_group_size": 1,
- "_comment": "model_devi on localhost",
- "model_devi_machine": {
- "machine_type": "slurm",
- "hostname" : "localhost",
- "port" : 22,
- "username": "root",
- "work_path" : "/sharedext4/generator/example/deep.gen/generator/ch4/",
- "_comment" : "that's all"
+ "model_devi_command": "/sharedext4/softwares/lammps/bin/lmp_serial",
+ "model_devi_group_size": 1,
+ "_comment3": "model_devi on localhost",
+ "model_devi_machine": {
+ "machine_type": "slurm",
+ "hostname": "localhost",
+ "port": 22,
+ "username": "root",
+ "work_path": "/sharedext4/generator/example/deep.gen/generator/ch4/",
+ "_comment4": "that's all"
},
- "_comment": " if use GPU, numb_nodes(nn) should always be 1 ",
- "_comment": " if numb_nodes(nn) = 1 multi-threading rather than mpi is assumed",
- "model_devi_resources": {
- "numb_node": 1,
- "numb_gpu": 0,
- "task_per_node":1,
- "source_list": ["/sharedext4/local/deepmd-kit-0.12.4/bin/lammps.activate" ],
- "module_list": [ ],
- "time_limit": "19:0:0",
- "mem_limit": 32,
- "partition" : "GPU-All",
- "_comment": "that's all"
+ "_comment5": " if use GPU, numb_nodes(nn) should always be 1 ",
+ "_comment6": " if numb_nodes(nn) = 1 multi-threading rather than mpi is assumed",
+ "model_devi_resources": {
+ "numb_node": 1,
+ "numb_gpu": 0,
+ "task_per_node": 1,
+ "source_list": [
+ "/sharedext4/local/deepmd-kit-0.12.4/bin/lammps.activate"
+ ],
+ "module_list": [],
+ "time_limit": "19:0:0",
+ "mem_limit": 32,
+ "partition": "GPU-All",
+ "_comment7": "that's all"
},
-
- "_comment": "fp on localhost ",
- "fp_command": "/sharedext4/vasp/vasp.5.4.4/bin/vasp_std",
- "fp_group_size": 1,
- "fp_machine": {
+ "_comment8": "fp on localhost ",
+ "fp_command": "/sharedext4/vasp/vasp.5.4.4/bin/vasp_std",
+ "fp_group_size": 1,
+ "fp_machine": {
"machine_type": "slurm",
- "hostname" : "localhost",
- "port" : 22,
- "username": "root",
- "work_path" : "/sharedext4/generator/example/deep.gen/generator/ch4/",
- "_comment" : "that's all"
+ "hostname": "localhost",
+ "port": 22,
+ "username": "root",
+ "work_path": "/sharedext4/generator/example/deep.gen/generator/ch4/",
+ "_comment9": "that's all"
},
- "fp_resources": {
- "numb_node": 1,
- "task_per_node":1,
- "numb_gpu": 0,
- "exclude_list" : [],
- "source_list": ["/sharedext4/softwares/source/vasp_cpu.activate" ],
- "module_list": [],
- "with_mpi" : 1,
- "time_limit": "1:0:0",
- "partition" : "GPU-All",
- "_comment": "that's all"
+ "fp_resources": {
+ "numb_node": 1,
+ "task_per_node": 1,
+ "numb_gpu": 0,
+ "exclude_list": [],
+ "source_list": [
+ "/sharedext4/softwares/source/vasp_cpu.activate"
+ ],
+ "module_list": [],
+ "with_mpi": 1,
+ "time_limit": "1:0:0",
+ "partition": "GPU-All",
+ "_comment10": "that's all"
},
-
-
- "_comment": " that's all "
+ "_comment11": " that's all "
}
diff --git a/examples/run/ch4/param.json b/examples/run/ch4/param.json
index 2a996e5fe..9983473b8 100644
--- a/examples/run/ch4/param.json
+++ b/examples/run/ch4/param.json
@@ -1,114 +1,193 @@
{
- "type_map": ["H","C"],
- "mass_map": [1, 12],
-
- "init_data_prefix": "/sharedext4/generator/example/deep.gen/data/",
-
- "init_data_sys": [
- "/sharedext4/generator/example/deep.gen/data/CH4.POSCAR.01x01x01/02.md/sys-0004-0001/deepmd"
- ],
- "init_batch_size": [
- 8
- ],
- "sys_configs": [
- ["/sharedext4/generator/example/deep.gen/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00000[0-4]/POSCAR"],
- ["/sharedext4/generator/example/deep.gen/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00000[5-9]/POSCAR"],
- ["/sharedext4/generator/example/deep.gen/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00001*/POSCAR"],
- ["/sharedext4/generator/example/deep.gen/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00002*/POSCAR"]
- ],
- "_comment": "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25",
- "sys_batch_size": [
- 8, 8, 8, 8
+ "type_map": [
+ "H",
+ "C"
],
-
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [16,4],
- "rcut_smth": 0.50,
- "rcut": 5,
- "filter_neuron": [10, 20, 40],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [120,120,120],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 30000,
- "batch_size": 1,
- "start_lr": 0.001,
- "decay_steps": 150,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 4,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 1,
+ 12
+ ],
+ "init_data_prefix": "/sharedext4/generator/example/deep.gen/data/",
+ "init_data_sys": [
+ "/sharedext4/generator/example/deep.gen/data/CH4.POSCAR.01x01x01/02.md/sys-0004-0001/deepmd"
+ ],
+ "init_batch_size": [
+ 8
+ ],
+ "sys_configs": [
+ [
+ "/sharedext4/generator/example/deep.gen/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00000[0-4]/POSCAR"
+ ],
+ [
+ "/sharedext4/generator/example/deep.gen/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00000[5-9]/POSCAR"
+ ],
+ [
+ "/sharedext4/generator/example/deep.gen/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00001*/POSCAR"
+ ],
+ [
+ "/sharedext4/generator/example/deep.gen/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00002*/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25",
+ "sys_batch_size": [
+ 8,
+ 8,
+ 8,
+ 8
+ ],
+ "_comment2": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 16,
+ 4
+ ],
+ "rcut": 5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 150,
+ "start_lr": 0.001,
+ "stop_lr": 3.505266624882874e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 30000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.15,
- "model_devi_clean_traj": true,
- "model_devi_jobs": [
- {"sys_idx": [0],
- "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 300, "ensemble": "npt", "_idx": "00"},
- {"sys_idx": [1],
- "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "01"},
- {"sys_idx": [2],
- "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "npt", "_idx": "02"},
- {"sys_idx": [3],
- "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "npt", "_idx": "03"}
- ],
-
-
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 30,
- "fp_task_min": 5,
- "fp_pp_path": "/sharedext4/generator/example/deep.gen/data/ch4/",
- "fp_pp_files": ["POTCAR"],
- "fp_params": {
- "_comment": "given in unit depending on the fp method",
- "ecut": 400,
- "ediff": 1e-6,
- "kspacing": 2,
- "_comment": "gauss, mp:N(methfessel-paxton:order by default order=1), fd(Fermi-Dirac)",
- "smearing": "gauss",
- "sigma": 0.05,
- "_comment": "only for vasp, can be NONE, SCAN, TPSS, RTPSS, M06L or MBJ",
- "metagga": "NONE",
- "npar": 4,
- "kpar": 1,
- "_comment": " that's all "
+ "_comment8": " 01.model_devi ",
+ "_comment9": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": true,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 300,
+ "ensemble": "npt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 2
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "npt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 3
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "npt",
+ "_idx": "03"
+ }
+ ],
+ "_comment10": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 30,
+ "fp_task_min": 5,
+ "fp_pp_path": "/sharedext4/generator/example/deep.gen/data/ch4/",
+ "fp_pp_files": [
+ "POTCAR"
+ ],
+ "fp_params": {
+ "_comment11": "given in unit depending on the fp method",
+ "ecut": 400,
+ "ediff": 1e-06,
+ "kspacing": 2,
+ "_comment12": "gauss, mp:N(methfessel-paxton:order by default order=1), fd(Fermi-Dirac)",
+ "smearing": "gauss",
+ "sigma": 0.05,
+ "_comment13": "only for vasp, can be NONE, SCAN, TPSS, RTPSS, M06L or MBJ",
+ "metagga": "NONE",
+ "npar": 4,
+ "kpar": 1,
+ "_comment14": " that's all "
},
- "_comment": " that's all "
+ "_comment15": " that's all "
}
diff --git a/examples/run/deprecated/dp0.12-lammps-cp2k/CH4/param_CH4.json b/examples/run/deprecated/dp0.12-lammps-cp2k/CH4/param_CH4.json
deleted file mode 100644
index b8163e785..000000000
--- a/examples/run/deprecated/dp0.12-lammps-cp2k/CH4/param_CH4.json
+++ /dev/null
@@ -1,136 +0,0 @@
-{
- "type_map": [
- "H",
- "C"
- ],
- "mass_map": [
- 1,
- 12
- ],
- "init_data_prefix": "/public/data/deepmd-tutorial/data/",
- "init_data_sys": [
- "deepmd"
- ],
- "init_batch_size": [
- 8
- ],
- "sys_configs": [
- [
- "/public/data/deepmd-tutorial/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000*/POSCAR"
- ],
- [
- "/public/data/deepmd-tutorial/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
- ]
- ],
- "sys_batch_size": [
- 8,
- 8,
- 8,
- 8
- ],
- "_comment": " that's all ",
- "numb_models": 4,
- "default_training_param": {
- "_comment": "that's all",
- "use_smooth": true,
- "sel_a": [
- 16,
- 4
- ],
- "rcut_smth": 0.5,
- "rcut": 5,
- "filter_neuron": [
- 10,
- 20,
- 40
- ],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [
- 120,
- 120,
- 120
- ],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
- "systems": [ ],
- "set_prefix": "set",
- "stop_batch": 40000,
- "batch_size": 1,
- "start_lr": 0.001,
- "decay_steps": 200,
- "decay_rate": 0.95,
- "seed": 0,
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0,
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 4,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json"
- },
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.15,
- "model_devi_clean_traj": true,
- "model_devi_jobs": [
- {
- "sys_idx": [
- 0
- ],
- "temps": [
- 100
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 1000,
- "ensemble": "nvt",
- "_idx": "00"
- },
- {
- "sys_idx": [
- 1
- ],
- "temps": [
- 100
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 5000,
- "ensemble": "nvt",
- "_idx": "01"
- }
- ],
- "fp_style": "cp2k",
- "shuffle_poscar": false,
- "fp_task_max": 20,
- "fp_task_min": 5,
- "fp_params": {
- "cutoff": "400",
- "rel_cutoff": "50",
- "functional": "PBE",
- "pair_potential_path": "dftd3.dat",
- "pair_ref_functional": "PBE",
- "basis_path": "BASIS_MOLOPT",
- "pp_path": "GTH_POTENTIALS",
- "element_list": ["H", "C"],
- "basis_list": ["DZVP-MOLOPT-GTH", "DZVP-MOLOPT-GTH"],
- "_comment": "elment_list, basis_list, pp_list should be one to one correspondance",
- "pp_list": ["GTH-PBE-q1", "GTH-PBE-q4"]
- }
-}
diff --git a/examples/run/deprecated/dp0.12-lammps-pwmat/machine-slurm-pwmat-single.json b/examples/run/deprecated/dp0.12-lammps-pwmat/machine-slurm-pwmat-single.json
deleted file mode 100644
index 9138f0cbf..000000000
--- a/examples/run/deprecated/dp0.12-lammps-pwmat/machine-slurm-pwmat-single.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- "train": [
- {
- "machine": {
- "machine_type": "slurm",
- "hostname": "mstation",
- "port": 22,
- "username": "test",
- "password": "PWmat2019",
- "work_path": "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/work_train"
- },
- "resources": {
- "numb_node": 1,
- "numb_gpu": 4,
- "task_per_node": 4,
- "partition": "control",
- "exclude_list": [],
- "source_list": [
- "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/train.env"
- ],
- "module_list": [],
- "time_limit": "23:0:0"
- },
- "deepmd_path" : "/home/test/anaconda2/envs/python3/"
- }
- ],
- "model_devi": [
- {
- "machine": {
- "machine_type": "slurm",
- "hostname": "mstation",
- "port": 22,
- "username": "test",
- "password": "PWmat2019",
- "work_path": "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/work_model"
- },
- "resources": {
- "numb_node": 1,
- "numb_gpu": 4,
- "task_per_node": 4,
- "partition": "control",
- "exclude_list": [],
- "source_list": [
- "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/train.env"
- ],
- "module_list": [],
- "time_limit": "23:0:0"
- },
- "command": "srun --mpi=pmi2 lmp_mpi",
- "group_size": 10
- }
- ],
- "fp": [
- {
- "machine": {
- "machine_type": "slurm",
- "hostname": "mstation",
- "port": 22,
- "username": "test",
- "password": "PWmat2019",
- "work_path": "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/work_fp"
- },
- "resources": {
- "task_per_node": 4,
- "numb_gpu": 4,
- "exclude_list": [],
- "with_mpi": false,
- "source_list": [],
- "module_list": [
- "cuda/8.0"
- ],
- "time_limit": "120:0:0",
- "partition": "control",
- "_comment": "that's All"
- },
- "command": "mpirun -np 4 PWmat",
- "group_size": 5
- }
- ]
-}
diff --git a/examples/run/deprecated/dp0.12-lammps-pwmat/param_CH4.json b/examples/run/deprecated/dp0.12-lammps-pwmat/param_CH4.json
deleted file mode 100644
index b1b3756ad..000000000
--- a/examples/run/deprecated/dp0.12-lammps-pwmat/param_CH4.json
+++ /dev/null
@@ -1,97 +0,0 @@
-{
- "type_map": ["H","C"],
- "mass_map": [1, 12],
-
- "init_data_prefix": "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/",
-
- "init_data_sys": [
- "ch4/00.data"
- ],
- "init_batch_size": [
- 8
- ],
- "sys_configs_prefix":
- "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/",
- "sys_configs": [
- ["/home/test/software/dpgen/examples/run/dp-lammps-pwmat/scale-1.000/00000*/POSCAR"],
- ["/home/test/software/dpgen/examples/run/dp-lammps-pwmat/scale-1.000/00001*/POSCAR"]
- ],
-
- "sys_batch_size": [
- 8, 8, 8, 8
- ],
-
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [16,4],
- "rcut_smth": 0.50,
- "rcut": 5,
- "filter_neuron": [10, 20, 40],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [120,120,120],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": ["./00.data/"],
- "set_prefix": "set",
- "stop_batch": 2000,
- "batch_size": 1,
- "start_lr": 0.001,
- "decay_steps": 100,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 4,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
- },
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.15,
- "model_devi_clean_traj": true,
- "model_devi_jobs": [
- {"sys_idx": [0],
- "temps": [ 300], "press": [0.0], "trj_freq": 10, "nsteps": 300, "ensemble": "nvt", "_idx": "00"},
- {"sys_idx": [1],
- "temps": [ 300], "press": [0.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "01"}
- ],
-
- "_comment": " 02.fp ",
- "fp_style": "pwmat",
- "shuffle_poscar": false,
- "fp_task_max": 20,
- "fp_task_min": 8,
- "fp_pp_path": ".",
- "fp_pp_files": ["C.SG15.PBE.UPF", "H.SG15.PBE.UPF"],
- "fp_incar" : "etot.input",
- "_comment": " that's all "
-}
diff --git a/examples/run/deprecated/dp0.12-lammps-siesta/dp-lammps-siesta/CH4/param_CH4.json b/examples/run/deprecated/dp0.12-lammps-siesta/dp-lammps-siesta/CH4/param_CH4.json
deleted file mode 100644
index 44ebced0e..000000000
--- a/examples/run/deprecated/dp0.12-lammps-siesta/dp-lammps-siesta/CH4/param_CH4.json
+++ /dev/null
@@ -1,134 +0,0 @@
-{
- "type_map": [
- "H",
- "C"
- ],
- "mass_map": [
- 1,
- 12
- ],
- "init_data_prefix": "/public/data/deepmd-tutorial/data/",
- "init_data_sys": [
- "deepmd"
- ],
- "init_batch_size": [
- 8
- ],
- "sys_configs": [
- [
- "/public/data/deepmd-tutorial/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000*/POSCAR"
- ],
- [
- "/public/data/deepmd-tutorial/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
- ]
- ],
- "sys_batch_size": [
- 8,
- 8,
- 8,
- 8
- ],
- "_comment": " that's all ",
- "numb_models": 4,
- "default_training_param": {
- "_comment": "that's all",
- "use_smooth": true,
- "sel_a": [
- 16,
- 4
- ],
- "rcut_smth": 0.5,
- "rcut": 5,
- "filter_neuron": [
- 10,
- 20,
- 40
- ],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [
- 120,
- 120,
- 120
- ],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
- "systems": [ ],
- "set_prefix": "set",
- "stop_batch": 40000,
- "batch_size": 1,
- "start_lr": 0.001,
- "decay_steps": 200,
- "decay_rate": 0.95,
- "seed": 0,
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0,
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 4,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json"
- },
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.15,
- "model_devi_clean_traj": true,
- "model_devi_jobs": [
- {
- "sys_idx": [
- 0
- ],
- "temps": [
- 100
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 1000,
- "ensemble": "nvt",
- "_idx": "00"
- },
- {
- "sys_idx": [
- 1
- ],
- "temps": [
- 100
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 5000,
- "ensemble": "nvt",
- "_idx": "01"
- }
- ],
- "fp_style": "siesta",
- "shuffle_poscar": false,
- "fp_task_max": 20,
- "fp_task_min": 5,
- "fp_pp_path": ".",
- "fp_pp_files": ["C.psf", "H.psf"],
- "fp_params": {
- "ecut": 300,
- "ediff": 1e-4,
- "kspacing": 1.0,
- "mixingWeight": 0.05,
- "NumberPulay": 5,
- "_comment": " that's all "
- },
- "_comment": " that's all "
-}
diff --git a/examples/run/deprecated/dp0.12-lammps-vasp/Al/param_al_all_gpu.json b/examples/run/deprecated/dp0.12-lammps-vasp/Al/param_al_all_gpu.json
deleted file mode 100644
index f8950dca1..000000000
--- a/examples/run/deprecated/dp0.12-lammps-vasp/Al/param_al_all_gpu.json
+++ /dev/null
@@ -1,393 +0,0 @@
-{
- "type_map": ["Al"],
- "mass_map": [27],
-
- "init_data_prefix": "/gpfs/share/home/1600017784/generator/Al/init/",
-
- "init_data_sys": [
- "al.fcc.02x02x02/02.md/sys-0032/deepmd",
- "al.hcp.02x02x02/02.md/sys-0016/deepmd",
- "al.bcc.02x02x02/02.md/sys-0016/deepmd"
- ],
- "init_batch_size": [
- 1,
- 2,
- 2
- ],
- "sys_configs": [
-
- ["/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[5-9]/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00001*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00002*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00003*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00004*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00005*/POSCAR",
- "/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00006*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00007*/POSCAR",
- "/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00008*/POSCAR"],
-
- ["/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[0-4]/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[5-9]/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00001*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00002*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00003*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00004*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00005*/POSCAR",
- "/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00006*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00007*/POSCAR",
- "/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00008*/POSCAR"],
-
- ["/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[0-4]/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[5-9]/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00001*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00002*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00003*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00004*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00005*/POSCAR",
- "/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00006*/POSCAR"],
- ["/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00007*/POSCAR",
- "/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00008*/POSCAR"]
- ],
- "sys_batch_size": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 2,
- 2,
- 2,
- 2,
- 2,
- 2,
- 2,
- 2,
- 2,
- 2,
- 2,
- 2,
- 2,
- 2,
- 2,
- 2
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [300],
- "rcut_smth": 2.00,
- "rcut": 8.00,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.001,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 4,
- "save_freq": 2000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
- },
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.20,
- "model_devi_clean_traj": false,
- "model_devi_jobs":
-[
- {
- "_idx": 0,
- "ensemble": "npt",
- "nsteps": 1000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 0,
- 8,
- 16
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 1,
- "ensemble": "npt",
- "nsteps": 1000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 1,
- 9,
- 17
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 2,
- "ensemble": "npt",
- "nsteps": 3000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 2,
- 10,
- 18
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 3,
- "ensemble": "npt",
- "nsteps": 3000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 3,
- 11,
- 19
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 4,
- "ensemble": "npt",
- "nsteps": 3000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 4,
- 12,
- 20
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 5,
- "ensemble": "npt",
- "nsteps": 3000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 5,
- 13,
- 21
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 6,
- "ensemble": "npt",
- "nsteps": 3000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 6,
- 14,
- 22
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 7,
- "ensemble": "npt",
- "nsteps": 3000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 7,
- 15,
- 23
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 8,
- "ensemble": "npt",
- "nsteps": 1000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 0,
- 8,
- 16
- ],
- "temps": [
- 330.0,
- 396.0,
- 462.0,
- 528.0,
- 594.0
- ],
- "trj_freq": 10
- }
-],
-
-
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 300,
- "fp_task_min": 5,
- "fp_pp_path": "/gpfs/share/home/1600017784/start/data/POTCAR/Al/",
- "fp_pp_files": ["POTCAR"],
- "fp_incar": "/gpfs/share/home/1600017784/start/pku_input_set/INCAR_metal_scf_gpu",
- "_comment": " that's all "
-}
diff --git a/examples/run/deprecated/dp0.12-lammps-vasp/CH4/param_CH4.json b/examples/run/deprecated/dp0.12-lammps-vasp/CH4/param_CH4.json
deleted file mode 100644
index 6af7ed649..000000000
--- a/examples/run/deprecated/dp0.12-lammps-vasp/CH4/param_CH4.json
+++ /dev/null
@@ -1,98 +0,0 @@
-{
- "type_map": ["H","C"],
- "mass_map": [1, 12],
-
- "init_data_prefix": "/gpfs/share/home/1600017784/yuzhi/methane/init/",
-
- "init_data_sys": [
- "CH4.POSCAR.01x01x01/02.md/sys-0004-0001/deepmd"
- ],
- "init_batch_size": [
- 8
- ],
- "sys_configs_prefix":
- "/gpfs/share/home/1600017784/yuzhi/methane/init/",
- "sys_configs": [
- ["CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00000*/POSCAR"],
- ["CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00001*/POSCAR"]
- ],
-
- "sys_batch_size": [
- 8, 8, 8, 8
- ],
-
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [16,4],
- "rcut_smth": 0.50,
- "rcut": 5,
- "filter_neuron": [10, 20, 40],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [120,120,120],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 2000,
- "batch_size": 1,
- "start_lr": 0.001,
- "decay_steps": 100,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 4,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
- },
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.15,
- "model_devi_clean_traj": true,
- "model_devi_jobs": [
- {"sys_idx": [0],
- "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 300, "ensemble": "nvt", "_idx": "00"},
- {"sys_idx": [1],
- "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "01"}
- ],
-
- "_comment": " 02.fp ",
- "cvasp": false,
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 20,
- "fp_task_min": 5,
- "fp_pp_path": "/gpfs/share/home/1600017784/yuzhi/methane/",
- "fp_pp_files": ["POT_H","POT_C"],
-"fp_incar" : "/gpfs/share/home/1600017784/yuzhi/methane/INCAR_methane",
- "_comment": " that's all "
-}
diff --git a/examples/run/deprecated/dp1.x-gromacs-gaussian/param.json b/examples/run/deprecated/dp1.x-gromacs-gaussian/param.json
deleted file mode 100644
index 29065b3e4..000000000
--- a/examples/run/deprecated/dp1.x-gromacs-gaussian/param.json
+++ /dev/null
@@ -1,176 +0,0 @@
-{
- "type_map": [
- "H",
- "C",
- "N",
- "O",
- "Cl"
- ],
- "mass_map": [
- 2,
- 12,
- 14,
- 16,
- 35
- ],
- "init_data_prefix": "somplace/tyk2-dpgen",
- "init_data_sys": ["init_data", "mdtraj_data"],
- "sys_configs_prefix": "somplace/tyk2-dpgen",
- "sys_configs": [
- ["model_devi/lig_ejm_31"],
- ["model_devi/lig_ejm_42"],
- ["model_devi/lig_ejm_43"],
- ["model_devi/lig_ejm_44"],
- ["model_devi/lig_ejm_45"],
- ["model_devi/lig_ejm_46"],
- ["model_devi/lig_ejm_47"],
- ["model_devi/lig_ejm_48"],
- ["model_devi/lig_ejm_49"],
- ["model_devi/lig_ejm_50"],
- ["model_devi/lig_ejm_54"],
- ["model_devi/lig_ejm_55"],
- ["model_devi/lig_jmc_27"],
- ["model_devi/lig_jmc_28"],
- ["model_devi/lig_jmc_30"]
- ],
- "sys_format": "gromacs/gro",
- "numb_models": 4,
- "training_reuse_iter": 1,
- "training_reuse_old_ratio": 0.3,
- "training_reuse_start_lr": 0.0001,
- "training_reuse_decay_steps": 500,
- "training_reuse_stop_batch": 200000,
- "training_reuse_start_pref_e": 1,
- "training_reuse_start_pref_f": 100,
- "train_param": "input.json",
- "default_training_param": {
- "model": {
- "type_map": [
- "H",
- "C",
- "N",
- "O",
- "Cl"
- ],
- "descriptor": {
- "type": "se_a",
- "sel": [
- 40,
- 48,
- 48,
- 48,
- 48
- ],
- "rcut_smth": 0.50,
- "rcut": 6.00,
- "neuron": [
- 25,
- 50,
- 100
- ],
- "resnet_dt": false,
- "axis_neuron": 16,
- "type_one_side": true
- },
- "fitting_net": {
- "neuron": [
- 60,
- 60,
- 60
- ],
- "resnet_dt": true
- }
- },
- "learning_rate": {
- "type": "exp",
- "start_lr": 0.001,
- "decay_steps": 2000,
- "decay_rate": 0.95
- },
- "loss": {
- "start_pref_e": 0.02,
- "limit_pref_e": 8,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0,
- "start_pref_pf": 0,
- "limit_pref_pf": 0
- },
- "training": {
- "set_prefix": "set",
- "stop_batch": 1000000,
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 1,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json"
- }
- },
- "model_devi_engine": "gromacs",
- "gromacs_settings": {
- "mdp_filename": "md.mdp",
- "topol_filename": "processed.top",
- "conf_filename": "npt.gro",
- "index_filename": "index.raw",
- "ref_filename": "em.tpr",
- "model_devi_script": "model_devi.py",
- "traj_filename": "deepmd_traj.gro"
- },
- "model_devi_dt": 0.001,
- "model_devi_f_trust_lo": 0.20,
- "model_devi_f_trust_hi": 0.40,
- "model_devi_clean_traj": false,
- "model_devi_skip": 0,
- "model_devi_nopbc": true,
- "model_devi_activation_func": [
- "tanh",
- "tanh",
- "gelu",
- "gelu"
- ],
- "model_devi_jobs": [
- {
- "_idx": 0,
- "ensemble": "nvt",
- "nsteps": 5000,
- "press": [],
- "sys_idx": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9,
- 10,
- 11,
- 12,
- 13,
- 14
- ],
- "temps": [],
- "trj_freq": 10,
- "_comment": "trj_freq should be consistent with nstxout in mdp"
- }
- ],
- "fp_style": "gaussian",
- "shuffle_poscar": false,
- "fp_task_max": 20,
- "fp_task_min": 1,
- "fp_pp_path": "./",
- "fp_pp_files": [],
- "fp_params": {
- "keywords": "force m062x/6-31g(d) nosymm",
- "nproc": 16,
- "multiplicity": "auto"
- }
-}
diff --git a/examples/run/deprecated/dp2.x-gromacs-gaussian/param.json b/examples/run/deprecated/dp2.x-gromacs-gaussian/param.json
new file mode 100644
index 000000000..99842df95
--- /dev/null
+++ b/examples/run/deprecated/dp2.x-gromacs-gaussian/param.json
@@ -0,0 +1,209 @@
+{
+ "type_map": [
+ "H",
+ "C",
+ "N",
+ "O",
+ "Cl"
+ ],
+ "mass_map": [
+ 2,
+ 12,
+ 14,
+ 16,
+ 35
+ ],
+ "init_data_prefix": "somplace/tyk2-dpgen",
+ "init_data_sys": [
+ "init_data",
+ "mdtraj_data"
+ ],
+ "sys_configs_prefix": "somplace/tyk2-dpgen",
+ "sys_configs": [
+ [
+ "model_devi/lig_ejm_31"
+ ],
+ [
+ "model_devi/lig_ejm_42"
+ ],
+ [
+ "model_devi/lig_ejm_43"
+ ],
+ [
+ "model_devi/lig_ejm_44"
+ ],
+ [
+ "model_devi/lig_ejm_45"
+ ],
+ [
+ "model_devi/lig_ejm_46"
+ ],
+ [
+ "model_devi/lig_ejm_47"
+ ],
+ [
+ "model_devi/lig_ejm_48"
+ ],
+ [
+ "model_devi/lig_ejm_49"
+ ],
+ [
+ "model_devi/lig_ejm_50"
+ ],
+ [
+ "model_devi/lig_ejm_54"
+ ],
+ [
+ "model_devi/lig_ejm_55"
+ ],
+ [
+ "model_devi/lig_jmc_27"
+ ],
+ [
+ "model_devi/lig_jmc_28"
+ ],
+ [
+ "model_devi/lig_jmc_30"
+ ]
+ ],
+ "sys_format": "gromacs/gro",
+ "numb_models": 4,
+ "training_reuse_iter": 1,
+ "training_reuse_old_ratio": 0.3,
+ "training_reuse_start_lr": 0.0001,
+ "training_reuse_decay_steps": 500,
+ "training_reuse_stop_batch": 200000,
+ "training_reuse_start_pref_e": 1,
+ "training_reuse_start_pref_f": 100,
+ "train_param": "input.json",
+ "default_training_param": {
+ "model": {
+ "type_map": [
+ "H",
+ "C",
+ "N",
+ "O",
+ "Cl"
+ ],
+ "descriptor": {
+ "type": "se_a",
+ "sel": [
+ 40,
+ 48,
+ 48,
+ 48,
+ 48
+ ],
+ "rcut_smth": 0.5,
+ "rcut": 6.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 16,
+ "type_one_side": true
+ },
+ "fitting_net": {
+ "neuron": [
+ 60,
+ 60,
+ 60
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "start_lr": 0.001,
+ "decay_steps": 2000,
+ "stop_lr": 7.274491561439049e-15
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 8,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0,
+ "start_pref_pf": 0,
+ "limit_pref_pf": 0
+ },
+ "training": {
+ "stop_batch": 1000000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "training_data": {
+ "set_prefix": "set"
+ }
+ }
+ },
+ "model_devi_engine": "gromacs",
+ "gromacs_settings": {
+ "mdp_filename": "md.mdp",
+ "topol_filename": "processed.top",
+ "conf_filename": "npt.gro",
+ "index_filename": "index.raw",
+ "ref_filename": "em.tpr",
+ "model_devi_script": "model_devi.py",
+ "traj_filename": "deepmd_traj.gro"
+ },
+ "model_devi_dt": 0.001,
+ "model_devi_f_trust_lo": 0.2,
+ "model_devi_f_trust_hi": 0.4,
+ "model_devi_clean_traj": false,
+ "model_devi_skip": 0,
+ "model_devi_nopbc": true,
+ "model_devi_activation_func": [
+ "tanh",
+ "tanh",
+ "gelu",
+ "gelu"
+ ],
+ "model_devi_jobs": [
+ {
+ "_idx": 0,
+ "ensemble": "nvt",
+ "nsteps": 5000,
+ "press": [],
+ "sys_idx": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+ 11,
+ 12,
+ 13,
+ 14
+ ],
+ "temps": [],
+ "trj_freq": 10,
+ "_comment1": "trj_freq should be consistent with nstxout in mdp"
+ }
+ ],
+ "fp_style": "gaussian",
+ "shuffle_poscar": false,
+ "fp_task_max": 20,
+ "fp_task_min": 1,
+ "fp_pp_path": "./",
+ "fp_pp_files": [],
+ "fp_params": {
+ "keywords": "force m062x/6-31g(d) nosymm",
+ "nproc": 16,
+ "multiplicity": "auto"
+ }
+}
diff --git a/examples/run/deprecated/dp2.x-lammps-cp2k/CH4/param_CH4.json b/examples/run/deprecated/dp2.x-lammps-cp2k/CH4/param_CH4.json
new file mode 100644
index 000000000..bc07d204a
--- /dev/null
+++ b/examples/run/deprecated/dp2.x-lammps-cp2k/CH4/param_CH4.json
@@ -0,0 +1,156 @@
+{
+ "type_map": [
+ "H",
+ "C"
+ ],
+ "mass_map": [
+ 1,
+ 12
+ ],
+ "init_data_prefix": "/public/data/deepmd-tutorial/data/",
+ "init_data_sys": [
+ "deepmd"
+ ],
+ "init_batch_size": [
+ 8
+ ],
+ "sys_configs": [
+ [
+ "/public/data/deepmd-tutorial/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000*/POSCAR"
+ ],
+ [
+ "/public/data/deepmd-tutorial/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 8,
+ 8,
+ 8,
+ 8
+ ],
+ "_comment1": " that's all ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 16,
+ 4
+ ],
+ "rcut": 5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 200,
+ "start_lr": 0.001,
+ "stop_lr": 3.505266624882874e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 40000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
+ },
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": true,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 5000,
+ "ensemble": "nvt",
+ "_idx": "01"
+ }
+ ],
+ "fp_style": "cp2k",
+ "shuffle_poscar": false,
+ "fp_task_max": 20,
+ "fp_task_min": 5,
+ "fp_params": {
+ "cutoff": "400",
+ "rel_cutoff": "50",
+ "functional": "PBE",
+ "pair_potential_path": "dftd3.dat",
+ "pair_ref_functional": "PBE",
+ "basis_path": "BASIS_MOLOPT",
+ "pp_path": "GTH_POTENTIALS",
+ "element_list": [
+ "H",
+ "C"
+ ],
+ "basis_list": [
+ "DZVP-MOLOPT-GTH",
+ "DZVP-MOLOPT-GTH"
+ ],
+ "_comment3": "elment_list, basis_list, pp_list should be one to one correspondance",
+ "pp_list": [
+ "GTH-PBE-q1",
+ "GTH-PBE-q4"
+ ]
+ }
+}
diff --git a/examples/run/deprecated/dp0.12-lammps-cp2k/CH4/param_CH4.yaml b/examples/run/deprecated/dp2.x-lammps-cp2k/CH4/param_CH4.yaml
similarity index 98%
rename from examples/run/deprecated/dp0.12-lammps-cp2k/CH4/param_CH4.yaml
rename to examples/run/deprecated/dp2.x-lammps-cp2k/CH4/param_CH4.yaml
index 8a7b83baf..358648077 100644
--- a/examples/run/deprecated/dp0.12-lammps-cp2k/CH4/param_CH4.yaml
+++ b/examples/run/deprecated/dp2.x-lammps-cp2k/CH4/param_CH4.yaml
@@ -61,7 +61,6 @@ default_training_param:
numb_test: 4
save_freq: 1000
save_ckpt: model.ckpt
- load_ckpt: model.ckpt
disp_training: true
time_training: true
profiling: false
diff --git a/examples/run/deprecated/dp2.x-lammps-pwmat/machine-slurm-pwmat-single.json b/examples/run/deprecated/dp2.x-lammps-pwmat/machine-slurm-pwmat-single.json
new file mode 100644
index 000000000..be8a6b027
--- /dev/null
+++ b/examples/run/deprecated/dp2.x-lammps-pwmat/machine-slurm-pwmat-single.json
@@ -0,0 +1,80 @@
+{
+ "train": [
+ {
+ "machine": {
+ "machine_type": "slurm",
+ "hostname": "mstation",
+ "port": 22,
+ "username": "test",
+ "password": "PWmat2019",
+ "work_path": "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/work_train"
+ },
+ "resources": {
+ "numb_node": 1,
+ "numb_gpu": 4,
+ "task_per_node": 4,
+ "partition": "control",
+ "exclude_list": [],
+ "source_list": [
+ "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/train.env"
+ ],
+ "module_list": [],
+ "time_limit": "23:0:0"
+ },
+ "deepmd_path": "/home/test/anaconda2/envs/python3/"
+ }
+ ],
+ "model_devi": [
+ {
+ "machine": {
+ "machine_type": "slurm",
+ "hostname": "mstation",
+ "port": 22,
+ "username": "test",
+ "password": "PWmat2019",
+ "work_path": "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/work_model"
+ },
+ "resources": {
+ "numb_node": 1,
+ "numb_gpu": 4,
+ "task_per_node": 4,
+ "partition": "control",
+ "exclude_list": [],
+ "source_list": [
+ "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/train.env"
+ ],
+ "module_list": [],
+ "time_limit": "23:0:0"
+ },
+ "command": "srun --mpi=pmi2 lmp_mpi",
+ "group_size": 10
+ }
+ ],
+ "fp": [
+ {
+ "machine": {
+ "machine_type": "slurm",
+ "hostname": "mstation",
+ "port": 22,
+ "username": "test",
+ "password": "PWmat2019",
+ "work_path": "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/work_fp"
+ },
+ "resources": {
+ "task_per_node": 4,
+ "numb_gpu": 4,
+ "exclude_list": [],
+ "with_mpi": false,
+ "source_list": [],
+ "module_list": [
+ "cuda/8.0"
+ ],
+ "time_limit": "120:0:0",
+ "partition": "control",
+ "_comment1": "that's All"
+ },
+ "command": "mpirun -np 4 PWmat",
+ "group_size": 5
+ }
+ ]
+}
diff --git a/examples/run/deprecated/dp2.x-lammps-pwmat/param_CH4.json b/examples/run/deprecated/dp2.x-lammps-pwmat/param_CH4.json
new file mode 100644
index 000000000..3c2ebfdef
--- /dev/null
+++ b/examples/run/deprecated/dp2.x-lammps-pwmat/param_CH4.json
@@ -0,0 +1,147 @@
+{
+ "type_map": [
+ "H",
+ "C"
+ ],
+ "mass_map": [
+ 1,
+ 12
+ ],
+ "init_data_prefix": "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/",
+ "init_data_sys": [
+ "ch4/00.data"
+ ],
+ "init_batch_size": [
+ 8
+ ],
+ "sys_configs_prefix": "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/",
+ "sys_configs": [
+ [
+ "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/scale-1.000/00000*/POSCAR"
+ ],
+ [
+ "/home/test/software/dpgen/examples/run/dp-lammps-pwmat/scale-1.000/00001*/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 8,
+ 8,
+ 8,
+ 8
+ ],
+ "_comment1": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 16,
+ 4
+ ],
+ "rcut": 5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 100,
+ "start_lr": 0.001,
+ "stop_lr": 0.0003584859224085419
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 2000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [
+ "./00.data/"
+ ],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
+ },
+ "_comment7": " 01.model_devi ",
+ "_comment8": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": true,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 300
+ ],
+ "press": [
+ 0.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 300,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1
+ ],
+ "temps": [
+ 300
+ ],
+ "press": [
+ 0.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "01"
+ }
+ ],
+ "_comment9": " 02.fp ",
+ "fp_style": "pwmat",
+ "shuffle_poscar": false,
+ "fp_task_max": 20,
+ "fp_task_min": 8,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "C.SG15.PBE.UPF",
+ "H.SG15.PBE.UPF"
+ ],
+ "fp_incar": "etot.input",
+ "_comment10": " that's all "
+}
diff --git a/examples/run/deprecated/dp2.x-lammps-siesta/dp-lammps-siesta/CH4/param_CH4.json b/examples/run/deprecated/dp2.x-lammps-siesta/dp-lammps-siesta/CH4/param_CH4.json
new file mode 100644
index 000000000..56555f0fd
--- /dev/null
+++ b/examples/run/deprecated/dp2.x-lammps-siesta/dp-lammps-siesta/CH4/param_CH4.json
@@ -0,0 +1,148 @@
+{
+ "type_map": [
+ "H",
+ "C"
+ ],
+ "mass_map": [
+ 1,
+ 12
+ ],
+ "init_data_prefix": "/public/data/deepmd-tutorial/data/",
+ "init_data_sys": [
+ "deepmd"
+ ],
+ "init_batch_size": [
+ 8
+ ],
+ "sys_configs": [
+ [
+ "/public/data/deepmd-tutorial/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000*/POSCAR"
+ ],
+ [
+ "/public/data/deepmd-tutorial/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 8,
+ 8,
+ 8,
+ 8
+ ],
+ "_comment1": " that's all ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 16,
+ 4
+ ],
+ "rcut": 5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 200,
+ "start_lr": 0.001,
+ "stop_lr": 3.505266624882874e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 40000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
+ },
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": true,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 5000,
+ "ensemble": "nvt",
+ "_idx": "01"
+ }
+ ],
+ "fp_style": "siesta",
+ "shuffle_poscar": false,
+ "fp_task_max": 20,
+ "fp_task_min": 5,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "C.psf",
+ "H.psf"
+ ],
+ "fp_params": {
+ "ecut": 300,
+ "ediff": 0.0001,
+ "kspacing": 1.0,
+ "mixingWeight": 0.05,
+ "NumberPulay": 5,
+ "_comment3": " that's all "
+ },
+ "_comment4": " that's all "
+}
diff --git a/examples/run/deprecated/dp0.12-lammps-siesta/dp-lammps-siesta/CH4/param_CH4.yaml b/examples/run/deprecated/dp2.x-lammps-siesta/dp-lammps-siesta/CH4/param_CH4.yaml
similarity index 98%
rename from examples/run/deprecated/dp0.12-lammps-siesta/dp-lammps-siesta/CH4/param_CH4.yaml
rename to examples/run/deprecated/dp2.x-lammps-siesta/dp-lammps-siesta/CH4/param_CH4.yaml
index 6a3ae9598..77b426760 100644
--- a/examples/run/deprecated/dp0.12-lammps-siesta/dp-lammps-siesta/CH4/param_CH4.yaml
+++ b/examples/run/deprecated/dp2.x-lammps-siesta/dp-lammps-siesta/CH4/param_CH4.yaml
@@ -60,7 +60,6 @@ default_training_param:
numb_test: 4
save_freq: 1000
save_ckpt: model.ckpt
- load_ckpt: model.ckpt
disp_training: true
time_training: true
profiling: false
diff --git a/examples/run/deprecated/dp2.x-lammps-vasp/Al/param_al_all_gpu.json b/examples/run/deprecated/dp2.x-lammps-vasp/Al/param_al_all_gpu.json
new file mode 100644
index 000000000..e3383a2e1
--- /dev/null
+++ b/examples/run/deprecated/dp2.x-lammps-vasp/Al/param_al_all_gpu.json
@@ -0,0 +1,450 @@
+{
+ "type_map": [
+ "Al"
+ ],
+ "mass_map": [
+ 27
+ ],
+ "init_data_prefix": "/gpfs/share/home/1600017784/generator/Al/init/",
+ "init_data_sys": [
+ "al.fcc.02x02x02/02.md/sys-0032/deepmd",
+ "al.hcp.02x02x02/02.md/sys-0016/deepmd",
+ "al.bcc.02x02x02/02.md/sys-0016/deepmd"
+ ],
+ "init_batch_size": [
+ 1,
+ 2,
+ 2
+ ],
+ "sys_configs": [
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[5-9]/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00001*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00002*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00003*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00004*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00005*/POSCAR",
+ "/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00006*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00007*/POSCAR",
+ "/gpfs/share/home/1600017784/generator/Al/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00008*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[0-4]/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[5-9]/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00001*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00002*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00003*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00004*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00005*/POSCAR",
+ "/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00006*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00007*/POSCAR",
+ "/gpfs/share/home/1600017784/generator/Al/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00008*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[0-4]/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[5-9]/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00001*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00002*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00003*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00004*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00005*/POSCAR",
+ "/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00006*/POSCAR"
+ ],
+ [
+ "/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00007*/POSCAR",
+ "/gpfs/share/home/1600017784/generator/Al/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00008*/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2
+ ],
+ "_comment1": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 300
+ ],
+ "rcut": 8.0,
+ "rcut_smth": 2.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.001,
+ "stop_lr": 3.505266624882874e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 2000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
+ },
+ "_comment7": " 01.model_devi ",
+ "_comment8": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.2,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "_idx": 0,
+ "ensemble": "npt",
+ "nsteps": 1000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 0,
+ 8,
+ 16
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 1,
+ "ensemble": "npt",
+ "nsteps": 1000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 1,
+ 9,
+ 17
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 2,
+ "ensemble": "npt",
+ "nsteps": 3000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 2,
+ 10,
+ 18
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 3,
+ "ensemble": "npt",
+ "nsteps": 3000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 3,
+ 11,
+ 19
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 4,
+ "ensemble": "npt",
+ "nsteps": 3000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 4,
+ 12,
+ 20
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 5,
+ "ensemble": "npt",
+ "nsteps": 3000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 5,
+ 13,
+ 21
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 6,
+ "ensemble": "npt",
+ "nsteps": 3000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 6,
+ 14,
+ 22
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 7,
+ "ensemble": "npt",
+ "nsteps": 3000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 7,
+ 15,
+ 23
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 8,
+ "ensemble": "npt",
+ "nsteps": 1000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 0,
+ 8,
+ 16
+ ],
+ "temps": [
+ 330.0,
+ 396.0,
+ 462.0,
+ 528.0,
+ 594.0
+ ],
+ "trj_freq": 10
+ }
+ ],
+ "_comment9": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 300,
+ "fp_task_min": 5,
+ "fp_pp_path": "/gpfs/share/home/1600017784/start/data/POTCAR/Al/",
+ "fp_pp_files": [
+ "POTCAR"
+ ],
+ "fp_incar": "/gpfs/share/home/1600017784/start/pku_input_set/INCAR_metal_scf_gpu",
+ "_comment10": " that's all "
+}
diff --git a/examples/run/deprecated/dp0.12-lammps-vasp/Al/param_al_all_gpu.yaml b/examples/run/deprecated/dp2.x-lammps-vasp/Al/param_al_all_gpu.yaml
similarity index 99%
rename from examples/run/deprecated/dp0.12-lammps-vasp/Al/param_al_all_gpu.yaml
rename to examples/run/deprecated/dp2.x-lammps-vasp/Al/param_al_all_gpu.yaml
index 37409d69a..0a8d362fb 100644
--- a/examples/run/deprecated/dp0.12-lammps-vasp/Al/param_al_all_gpu.yaml
+++ b/examples/run/deprecated/dp2.x-lammps-vasp/Al/param_al_all_gpu.yaml
@@ -109,7 +109,6 @@ default_training_param:
numb_test: 4
save_freq: 2000
save_ckpt: model.ckpt
- load_ckpt: model.ckpt
disp_training: true
time_training: true
profiling: false
diff --git a/examples/run/deprecated/dp2.x-lammps-vasp/CH4/param_CH4.json b/examples/run/deprecated/dp2.x-lammps-vasp/CH4/param_CH4.json
new file mode 100644
index 000000000..8ff640f7e
--- /dev/null
+++ b/examples/run/deprecated/dp2.x-lammps-vasp/CH4/param_CH4.json
@@ -0,0 +1,146 @@
+{
+ "type_map": [
+ "H",
+ "C"
+ ],
+ "mass_map": [
+ 1,
+ 12
+ ],
+ "init_data_prefix": "/gpfs/share/home/1600017784/yuzhi/methane/init/",
+ "init_data_sys": [
+ "CH4.POSCAR.01x01x01/02.md/sys-0004-0001/deepmd"
+ ],
+ "init_batch_size": [
+ 8
+ ],
+ "sys_configs_prefix": "/gpfs/share/home/1600017784/yuzhi/methane/init/",
+ "sys_configs": [
+ [
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00000*/POSCAR"
+ ],
+ [
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00001*/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 8,
+ 8,
+ 8,
+ 8
+ ],
+ "_comment1": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 16,
+ 4
+ ],
+ "rcut": 5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 100,
+ "start_lr": 0.001,
+ "stop_lr": 0.0003584859224085419
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 2000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
+ },
+ "_comment7": " 01.model_devi ",
+ "_comment8": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": true,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 300,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "01"
+ }
+ ],
+ "_comment9": " 02.fp ",
+ "cvasp": false,
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 20,
+ "fp_task_min": 5,
+ "fp_pp_path": "/gpfs/share/home/1600017784/yuzhi/methane/",
+ "fp_pp_files": [
+ "POT_H",
+ "POT_C"
+ ],
+ "fp_incar": "/gpfs/share/home/1600017784/yuzhi/methane/INCAR_methane",
+ "_comment10": " that's all "
+}
diff --git a/examples/run/deprecated/dp0.12-lammps-vasp/CH4/param_CH4.yaml b/examples/run/deprecated/dp2.x-lammps-vasp/CH4/param_CH4.yaml
similarity index 98%
rename from examples/run/deprecated/dp0.12-lammps-vasp/CH4/param_CH4.yaml
rename to examples/run/deprecated/dp2.x-lammps-vasp/CH4/param_CH4.yaml
index 2a77eddef..7a34e9ef9 100644
--- a/examples/run/deprecated/dp0.12-lammps-vasp/CH4/param_CH4.yaml
+++ b/examples/run/deprecated/dp2.x-lammps-vasp/CH4/param_CH4.yaml
@@ -61,7 +61,6 @@ default_training_param:
numb_test: 4
save_freq: 1000
save_ckpt: model.ckpt
- load_ckpt: model.ckpt
disp_training: true
time_training: true
profiling: false
diff --git a/examples/run/deprecated/param-h2oscan-vasp.json b/examples/run/deprecated/param-h2oscan-vasp.json
index 1ccc592b7..84e7dbb3c 100644
--- a/examples/run/deprecated/param-h2oscan-vasp.json
+++ b/examples/run/deprecated/param-h2oscan-vasp.json
@@ -1,209 +1,694 @@
{
- "type_map": ["O", "H"],
- "mass_map": [16, 2],
-
- "init_data_prefix": "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.train",
- "init_data_sys": ["ice01c",
- "ice01h",
- "ice02",
- "ice03",
- "ice04",
- "ice05",
- "ice06",
- "ice07",
- "ice08",
- "ice09",
- "ice10",
- "ice11",
- "ice12",
- "ice13",
- "ice14",
- "ice15",
- "waterliquid/nvt-330K",
- "waterliquid/nvt-360K"
- ],
- "init_batch_size": [1, 3, 3, 3, 1, 2, 3, 2, 4, 3, 2, 2, 3, 2, 3, 3, 1, 1],
- "sys_configs": [
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01c/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01c/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01c/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01c/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01h/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01h/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01h/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01h/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice02/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice02/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice02/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice02/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice03/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice03/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice03/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice03/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice04/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice04/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice04/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice04/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice05/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice05/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice05/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice05/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice06/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice06/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice06/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice06/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice07/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice07/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice07/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice07/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice08/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice08/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice08/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice08/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice09/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice09/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice09/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice09/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice10/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice10/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice10/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice10/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice11/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice11/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice11/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice11/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice12/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice12/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice12/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice12/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice13/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice13/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice13/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice13/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice14/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice14/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice14/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice14/0000[0-4]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice15/00009?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice15/0000[7-8]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice15/0000[5-6]?/POSCAR"],
- ["/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice15/0000[0-4]?/POSCAR"],
- ["/scratch/gpfs/yixiaoc/wanghan/data/water/init.md/waterliquid/009?/POSCAR"],
- ["/scratch/gpfs/yixiaoc/wanghan/data/water/init.md/waterliquid/00[7-8]?/POSCAR"],
- ["/scratch/gpfs/yixiaoc/wanghan/data/water/init.md/waterliquid/00[5-6]?/POSCAR"],
- ["/scratch/gpfs/yixiaoc/wanghan/data/water/init.md/waterliquid/00[0-4]?/POSCAR"]
+ "type_map": [
+ "O",
+ "H"
],
- "_comment": "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15",
- "_comment": "16 ....................................... 31",
- "_comment": "32 ....................................... 47",
- "_comment": "48 ....................................... 63",
- "_comment": "64 65 66 67",
- "sys_batch_size": [1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2,
- 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
- 1, 1, 1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [200, 400],
- "rcut_smth": 0.50,
- "rcut": 6.00,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 1000000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 5000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 16,
+ 2
+ ],
+ "init_data_prefix": "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.train",
+ "init_data_sys": [
+ "ice01c",
+ "ice01h",
+ "ice02",
+ "ice03",
+ "ice04",
+ "ice05",
+ "ice06",
+ "ice07",
+ "ice08",
+ "ice09",
+ "ice10",
+ "ice11",
+ "ice12",
+ "ice13",
+ "ice14",
+ "ice15",
+ "waterliquid/nvt-330K",
+ "waterliquid/nvt-360K"
+ ],
+ "init_batch_size": [
+ 1,
+ 3,
+ 3,
+ 3,
+ 1,
+ 2,
+ 3,
+ 2,
+ 4,
+ 3,
+ 2,
+ 2,
+ 3,
+ 2,
+ 3,
+ 3,
+ 1,
+ 1
+ ],
+ "sys_configs": [
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01c/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01c/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01c/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01c/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01h/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01h/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01h/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice01h/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice02/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice02/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice02/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice02/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice03/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice03/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice03/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice03/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice04/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice04/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice04/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice04/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice05/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice05/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice05/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice05/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice06/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice06/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice06/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice06/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice07/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice07/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice07/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice07/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice08/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice08/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice08/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice08/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice09/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice09/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice09/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice09/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice10/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice10/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice10/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice10/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice11/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice11/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice11/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice11/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice12/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice12/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice12/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice12/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice13/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice13/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice13/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice13/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice14/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice14/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice14/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice14/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice15/00009?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice15/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice15/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/yixiaoc/SCR/wanghan/data/water.all.phase/init.md/ice15/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/scratch/gpfs/yixiaoc/wanghan/data/water/init.md/waterliquid/009?/POSCAR"
+ ],
+ [
+ "/scratch/gpfs/yixiaoc/wanghan/data/water/init.md/waterliquid/00[7-8]?/POSCAR"
+ ],
+ [
+ "/scratch/gpfs/yixiaoc/wanghan/data/water/init.md/waterliquid/00[5-6]?/POSCAR"
+ ],
+ [
+ "/scratch/gpfs/yixiaoc/wanghan/data/water/init.md/waterliquid/00[0-4]?/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15",
+ "_comment2": "16 ....................................... 31",
+ "_comment3": "32 ....................................... 47",
+ "_comment4": "48 ....................................... 63",
+ "_comment5": "64 65 66 67",
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 1,
+ 1,
+ 1,
+ 1,
+ 2,
+ 2,
+ 2,
+ 2,
+ 3,
+ 3,
+ 3,
+ 3,
+ 2,
+ 2,
+ 2,
+ 2,
+ 4,
+ 4,
+ 4,
+ 4,
+ 3,
+ 3,
+ 3,
+ 3,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 3,
+ 3,
+ 3,
+ 3,
+ 2,
+ 2,
+ 2,
+ 2,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ "_comment6": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 200,
+ 400
+ ],
+ "rcut": 6.0,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 5000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 1000000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.001,
- "model_devi_taut": 0.1,
- "model_devi_taup": 0.5,
- "model_devi_skip": 10,
- "model_devi_f_trust_lo": 0.150,
- "model_devi_f_trust_hi": 0.250,
- "model_devi_clean_traj": true,
- "_comment": "group 1: 0,1,11,lw; group 2: 2-6,9,12-15; group 3: 7,8,lw; group 4: 10.",
- "model_devi_jobs": [
- {"sys_idx":[ 0, 4, 8, 12, 16, 20, 24, 36, 44, 48, 52, 56, 60, 64], "s_t": true,
- "Ts": [ 50], "Ps": [1e-1,5e-1,1e0,5e0,1e1,5e1,1e2,5e2,1e3,5e3,1e4,5e4], "t_freq": 20, "nsteps": 1000, "ens": "npt", "_idx": "00"},
- {"sys_idx":[ 28,32,40],
- "Ts": [ 50], "Ps": [1e1,5e1,1e2,5e2,1e3,5e3,1e4,5e4,1e5,5e5], "t_freq": 20, "nsteps": 1000, "ens": "npt", "_idx": "01"},
- {"sys_idx":[ 1, 5, 9, 13, 17, 21, 25, 37, 45, 49, 53, 57, 61, 65], "s_t": true,
- "Ts": [ 50], "Ps": [1e-1,5e-1,1e0,5e0,1e1,5e1,1e2,5e2,1e3,5e3,1e4,5e4], "t_freq": 20, "nsteps": 5000, "ens": "npt", "_idx": "02"},
- {"sys_idx":[ 29,33,41],
- "Ts": [ 50], "Ps": [1e1,5e1,1e2,5e2,1e3,5e3,1e4,5e4,1e5,5e5], "t_freq": 20, "nsteps": 5000, "ens": "npt", "_idx": "03"},
- {"sys_idx":[ 2, 6, 10, 14, 18, 22, 26, 38, 46, 50, 54, 58, 62, 66], "s_t": true,
- "Ts": [ 50], "Ps": [1e-1,5e-1,1e0,5e0,1e1,5e1,1e2,5e2,1e3,5e3,1e4,5e4], "t_freq": 20, "nsteps": 10000, "ens": "npt", "_idx": "04"},
- {"sys_idx":[ 30,34,42],
- "Ts": [ 50], "Ps": [1e1,5e1,1e2,5e2,1e3,5e3,1e4,5e4,1e5,5e5], "t_freq": 20, "nsteps": 10000, "ens": "npt", "_idx": "05"},
- {"sys_idx":[ 3, 7, 11, 13, 17, 23, 27, 39, 47, 51, 55, 59, 63, 67], "s_t": true,
- "Ts": [ 50], "Ps": [1e-1,5e-1,1e0,5e0,1e1,5e1,1e2,5e2,1e3,5e3,1e4,5e4], "t_freq": 20, "nsteps": 10000, "ens": "npt", "_idx": "06"},
- {"sys_idx":[ 31,35,44],
- "Ts": [ 50], "Ps": [1e1,5e1,1e2,5e2,1e3,5e3,1e4,5e4,1e5,5e5], "t_freq": 20, "nsteps": 10000, "ens": "npt", "_idx": "07"}
+ "_comment12": " 01.model_devi ",
+ "_comment13": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.001,
+ "model_devi_taut": 0.1,
+ "model_devi_taup": 0.5,
+ "model_devi_skip": 10,
+ "model_devi_f_trust_lo": 0.15,
+ "model_devi_f_trust_hi": 0.25,
+ "model_devi_clean_traj": true,
+ "_comment14": "group 1: 0,1,11,lw; group 2: 2-6,9,12-15; group 3: 7,8,lw; group 4: 10.",
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 4,
+ 8,
+ 12,
+ 16,
+ 20,
+ 24,
+ 36,
+ 44,
+ 48,
+ 52,
+ 56,
+ 60,
+ 64
+ ],
+ "s_t": true,
+ "Ts": [
+ 50
+ ],
+ "Ps": [
+ 0.1,
+ 0.5,
+ 1.0,
+ 5.0,
+ 10.0,
+ 50.0,
+ 100.0,
+ 500.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 50000.0
+ ],
+ "t_freq": 20,
+ "nsteps": 1000,
+ "ens": "npt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 28,
+ 32,
+ 40
+ ],
+ "Ts": [
+ 50
+ ],
+ "Ps": [
+ 10.0,
+ 50.0,
+ 100.0,
+ 500.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 50000.0,
+ 100000.0,
+ 500000.0
+ ],
+ "t_freq": 20,
+ "nsteps": 1000,
+ "ens": "npt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5,
+ 9,
+ 13,
+ 17,
+ 21,
+ 25,
+ 37,
+ 45,
+ 49,
+ 53,
+ 57,
+ 61,
+ 65
+ ],
+ "s_t": true,
+ "Ts": [
+ 50
+ ],
+ "Ps": [
+ 0.1,
+ 0.5,
+ 1.0,
+ 5.0,
+ 10.0,
+ 50.0,
+ 100.0,
+ 500.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 50000.0
+ ],
+ "t_freq": 20,
+ "nsteps": 5000,
+ "ens": "npt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 29,
+ 33,
+ 41
+ ],
+ "Ts": [
+ 50
+ ],
+ "Ps": [
+ 10.0,
+ 50.0,
+ 100.0,
+ 500.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 50000.0,
+ 100000.0,
+ 500000.0
+ ],
+ "t_freq": 20,
+ "nsteps": 5000,
+ "ens": "npt",
+ "_idx": "03"
+ },
+ {
+ "sys_idx": [
+ 2,
+ 6,
+ 10,
+ 14,
+ 18,
+ 22,
+ 26,
+ 38,
+ 46,
+ 50,
+ 54,
+ 58,
+ 62,
+ 66
+ ],
+ "s_t": true,
+ "Ts": [
+ 50
+ ],
+ "Ps": [
+ 0.1,
+ 0.5,
+ 1.0,
+ 5.0,
+ 10.0,
+ 50.0,
+ 100.0,
+ 500.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 50000.0
+ ],
+ "t_freq": 20,
+ "nsteps": 10000,
+ "ens": "npt",
+ "_idx": "04"
+ },
+ {
+ "sys_idx": [
+ 30,
+ 34,
+ 42
+ ],
+ "Ts": [
+ 50
+ ],
+ "Ps": [
+ 10.0,
+ 50.0,
+ 100.0,
+ 500.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 50000.0,
+ 100000.0,
+ 500000.0
+ ],
+ "t_freq": 20,
+ "nsteps": 10000,
+ "ens": "npt",
+ "_idx": "05"
+ },
+ {
+ "sys_idx": [
+ 3,
+ 7,
+ 11,
+ 13,
+ 17,
+ 23,
+ 27,
+ 39,
+ 47,
+ 51,
+ 55,
+ 59,
+ 63,
+ 67
+ ],
+ "s_t": true,
+ "Ts": [
+ 50
+ ],
+ "Ps": [
+ 0.1,
+ 0.5,
+ 1.0,
+ 5.0,
+ 10.0,
+ 50.0,
+ 100.0,
+ 500.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 50000.0
+ ],
+ "t_freq": 20,
+ "nsteps": 10000,
+ "ens": "npt",
+ "_idx": "06"
+ },
+ {
+ "sys_idx": [
+ 31,
+ 35,
+ 44
+ ],
+ "Ts": [
+ 50
+ ],
+ "Ps": [
+ 10.0,
+ 50.0,
+ 100.0,
+ 500.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 50000.0,
+ 100000.0,
+ 500000.0
+ ],
+ "t_freq": 20,
+ "nsteps": 10000,
+ "ens": "npt",
+ "_idx": "07"
+ }
+ ],
+ "_comment15": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": "/home/yixiaoc/SCR/wanghan/data/water.all.phase",
+ "fp_pp_files": [
+ "POTCAR"
],
-
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": "/home/yixiaoc/SCR/wanghan/data/water.all.phase",
- "fp_pp_files": ["POTCAR"],
- "fp_params": {
- "_comment": "given in unit depending on the fp method",
- "ecut": 800,
- "ediff": 1e-6,
- "kspacing": 0.5,
- "_comment": "gauss, mp:N(methfessel-paxton:order by default order=1), fd(Fermi-Dirac)",
- "smearing": "gauss",
- "sigma": 0.05,
- "_comment": "only for vasp, can be NONE, SCAN, TPSS, RTPSS, M06L or MBJ",
- "metagga": "SCAN",
- "npar": 1,
- "kpar": 1,
- "_comment": " that's all "
+ "fp_params": {
+ "_comment16": "given in unit depending on the fp method",
+ "ecut": 800,
+ "ediff": 1e-06,
+ "kspacing": 0.5,
+ "_comment17": "gauss, mp:N(methfessel-paxton:order by default order=1), fd(Fermi-Dirac)",
+ "smearing": "gauss",
+ "sigma": 0.05,
+ "_comment18": "only for vasp, can be NONE, SCAN, TPSS, RTPSS, M06L or MBJ",
+ "metagga": "SCAN",
+ "npar": 1,
+ "kpar": 1,
+ "_comment19": " that's all "
},
-
- "_comment": " that's all "
+ "_comment20": " that's all "
}
diff --git a/examples/run/deprecated/param-mg-vasp-ucloud.json b/examples/run/deprecated/param-mg-vasp-ucloud.json
index 507e79396..443242a5a 100644
--- a/examples/run/deprecated/param-mg-vasp-ucloud.json
+++ b/examples/run/deprecated/param-mg-vasp-ucloud.json
@@ -1,147 +1,467 @@
{
- "type_map": ["Mg"],
- "mass_map": [24],
-
- "init_data_prefix": "/home/ubuntu/generator/data/mgop/",
- "init_data_sys": ["mg.fcc.01x01x01/02.md/sys-0004/deepmd",
- "mg.hcp.01x01x01/02.md/sys-0002/deepmd",
- "mg.diamond.01x01x01/02.md/sys-0002/deepmd"
- ],
- "init_batch_size": [8, 16, 16],
- "sys_configs": [
- ["/home/ubuntu/generator/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/00009?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/0000[7-8]?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/0000[5-6]?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/0000[0-4]?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/00009?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/0000[7-8]?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/0000[5-6]?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/0000[0-4]?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000003/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000001/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000002/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000003/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000001/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000002/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-111/sys-0012/scale*/elong*/000003/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-111/sys-0012/scale*/elong*/000001/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-111/sys-0012/scale*/elong*/000002/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-001/sys-0012/scale*/elong*/000003/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-001/sys-0012/scale*/elong*/000001/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-001/sys-0012/scale*/elong*/000002/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000003/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000001/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000002/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000003/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000001/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000002/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/00009?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/0000[7-8]?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/0000[5-6]?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/0000[0-4]?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/00009?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/0000[7-8]?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/0000[5-6]?/POSCAR"],
- ["/home/ubuntu/generator/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/0000[0-4]?/POSCAR"]
+ "type_map": [
+ "Mg"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1, 1, 1,
- 2, 2, 2, 2,
- 3, 3, 3, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2,
- 2, 2, 2, 2,
- 4, 4, 4, 4
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [90],
- "rcut_smth": 2.00,
- "rcut": 6.00,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 24
+ ],
+ "init_data_prefix": "/home/ubuntu/generator/data/mgop/",
+ "init_data_sys": [
+ "mg.fcc.01x01x01/02.md/sys-0004/deepmd",
+ "mg.hcp.01x01x01/02.md/sys-0002/deepmd",
+ "mg.diamond.01x01x01/02.md/sys-0002/deepmd"
+ ],
+ "init_batch_size": [
+ 8,
+ 16,
+ 16
+ ],
+ "sys_configs": [
+ [
+ "/home/ubuntu/generator/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/00009?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/00009?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000003/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000001/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000002/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000003/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000001/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000002/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-111/sys-0012/scale*/elong*/000003/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-111/sys-0012/scale*/elong*/000001/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-111/sys-0012/scale*/elong*/000002/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-001/sys-0012/scale*/elong*/000003/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-001/sys-0012/scale*/elong*/000001/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-001/sys-0012/scale*/elong*/000002/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000003/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000001/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000002/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000003/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000001/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000002/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/00009?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/00009?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/ubuntu/generator/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/0000[0-4]?/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 2,
+ 2,
+ 2,
+ 2,
+ 3,
+ 3,
+ 3,
+ 2,
+ 2,
+ 2,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 4,
+ 4,
+ 4,
+ 4
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 90
+ ],
+ "rcut": 6.0,
+ "rcut_smth": 2.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
- "model_devi_clean_traj": true,
-
- "model_devi_jobs": [
- {"sys_idx": [0,4,26,30], "temps": [ 50], "press": [1.0], "trj_freq": 10, "nsteps": 1000, "ensemble": "nvt", "_idx": "00"},
- {"sys_idx": [1,5,27,31], "temps": [ 50], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "01"},
- {"sys_idx": [2,6,28,32], "temps": [ 50], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "02"},
- {"sys_idx": [3,7,29,33], "temps": [ 50], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "03"},
- {"sys_idx": [0,4,26,30], "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 1000, "ensemble": "nvt", "_idx": "04"},
- {"sys_idx": [1,5,27,31], "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "05"},
- {"sys_idx": [2,6,28,32], "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "06"},
- {"sys_idx": [3,7,29,33], "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "07"},
- {"sys_idx": [0,4,26,30], "temps": [ 300], "press": [1.0], "trj_freq": 10, "nsteps": 1000, "ensemble": "nvt", "_idx": "08"},
- {"sys_idx": [1,5,27,31], "temps": [ 300], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "09"},
- {"sys_idx": [2,6,28,32], "temps": [ 300], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "10"},
- {"sys_idx": [3,7,29,33], "temps": [ 300], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "11"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": true,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 4,
+ 26,
+ 30
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5,
+ 27,
+ 31
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 2,
+ 6,
+ 28,
+ 32
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 3,
+ 7,
+ 29,
+ 33
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "03"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4,
+ 26,
+ 30
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "nvt",
+ "_idx": "04"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5,
+ 27,
+ 31
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "05"
+ },
+ {
+ "sys_idx": [
+ 2,
+ 6,
+ 28,
+ 32
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "06"
+ },
+ {
+ "sys_idx": [
+ 3,
+ 7,
+ 29,
+ 33
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "07"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4,
+ 26,
+ 30
+ ],
+ "temps": [
+ 300
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "nvt",
+ "_idx": "08"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5,
+ 27,
+ 31
+ ],
+ "temps": [
+ 300
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "09"
+ },
+ {
+ "sys_idx": [
+ 2,
+ 6,
+ 28,
+ 32
+ ],
+ "temps": [
+ 300
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "10"
+ },
+ {
+ "sys_idx": [
+ 3,
+ 7,
+ 29,
+ 33
+ ],
+ "temps": [
+ 300
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "11"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "_comment12": "fp on localhost ",
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": "/home/ubuntu/generator/data/mgop/",
+ "fp_pp_files": [
+ "POTCAR"
],
-
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "_comment": "fp on localhost ",
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": "/home/ubuntu/generator/data/mgop/",
- "fp_pp_files": ["POTCAR"],
- "fp_params": {
- "_comment": "given in unit depending on the fp method",
- "ecut": 600,
- "ediff": 1e-6,
- "kspacing": 0.16,
- "npar": 1,
- "kpar": 1,
- "_comment": " that's all "
+ "fp_params": {
+ "_comment13": "given in unit depending on the fp method",
+ "ecut": 600,
+ "ediff": 1e-06,
+ "kspacing": 0.16,
+ "npar": 1,
+ "kpar": 1,
+ "_comment14": " that's all "
},
-
- "_comment": " that's all "
+ "_comment15": " that's all "
}
diff --git a/examples/run/deprecated/param-mg-vasp.json b/examples/run/deprecated/param-mg-vasp.json
index 126f63cc1..6c680fa31 100644
--- a/examples/run/deprecated/param-mg-vasp.json
+++ b/examples/run/deprecated/param-mg-vasp.json
@@ -1,153 +1,474 @@
{
- "type_map": ["Mg"],
- "mass_map": [24],
-
- "init_data_prefix": "/home/linfengz/SCR/wanghan/data/mgop/",
- "init_data_sys": ["mg.fcc.01x01x01/02.md/sys-0004/deepmd",
- "mg.hcp.01x01x01/02.md/sys-0002/deepmd",
- "mg.diamond.01x01x01/02.md/sys-0002/deepmd"
- ],
- "init_batch_size": [8, 16, 16],
- "sys_configs": [
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/0000[0-4]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/0000[0-4]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000003/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000001/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000002/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000003/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000001/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000002/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-111/sys-0012/scale*/elong*/000003/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-111/sys-0012/scale*/elong*/000001/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-111/sys-0012/scale*/elong*/000002/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-001/sys-0012/scale*/elong*/000003/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-001/sys-0012/scale*/elong*/000001/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-001/sys-0012/scale*/elong*/000002/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000003/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000001/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000002/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000003/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000001/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000002/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/0000[0-4]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/0000[0-4]?/POSCAR"]
+ "type_map": [
+ "Mg"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1, 1, 1,
- 2, 2, 2, 2,
- 3, 3, 3, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2,
- 2, 2, 2, 2,
- 4, 4, 4, 4
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [90],
- "rcut_smth": 2.00,
- "rcut": 6.00,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 24
+ ],
+ "init_data_prefix": "/home/linfengz/SCR/wanghan/data/mgop/",
+ "init_data_sys": [
+ "mg.fcc.01x01x01/02.md/sys-0004/deepmd",
+ "mg.hcp.01x01x01/02.md/sys-0002/deepmd",
+ "mg.diamond.01x01x01/02.md/sys-0002/deepmd"
+ ],
+ "init_batch_size": [
+ 8,
+ 16,
+ 16
+ ],
+ "sys_configs": [
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.hcp.02x02x02/01.scale_pert/sys-0016/scale*/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000003/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000001/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000002/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000003/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000001/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000002/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-111/sys-0012/scale*/elong*/000003/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-111/sys-0012/scale*/elong*/000001/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.fcc.01x01x01/01.scale_pert/surf-111/sys-0012/scale*/elong*/000002/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-001/sys-0012/scale*/elong*/000003/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-001/sys-0012/scale*/elong*/000001/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-001/sys-0012/scale*/elong*/000002/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000003/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000001/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-100/sys-0012/scale*/elong*/000002/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000003/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000001/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/surf.mg.hcp.01x01x01/01.scale_pert/surf-110/sys-0016/scale*/elong*/000002/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.diamond.02x02x02/01.scale_pert/sys-0016/scale*/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/mgop/mg.sc.02x02x02/01.scale_pert/sys-0008/scale*/0000[0-4]?/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 2,
+ 2,
+ 2,
+ 2,
+ 3,
+ 3,
+ 3,
+ 2,
+ 2,
+ 2,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 2,
+ 4,
+ 4,
+ 4,
+ 4
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 90
+ ],
+ "rcut": 6.0,
+ "rcut_smth": 2.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
- "model_devi_clean_traj": true,
- "model_devi_jobs": [
- {"sys_idx": [0,4,26,30], "temps": [ 50], "press": [1.0], "trj_freq": 10, "nsteps": 1000, "ensemble": "nvt", "_idx": "00"},
- {"sys_idx": [1,5,27,31], "temps": [ 50], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "01"},
- {"sys_idx": [2,6,28,32], "temps": [ 50], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "02"},
- {"sys_idx": [3,7,29,33], "temps": [ 50], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "03"},
- {"sys_idx": [0,4,26,30], "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 1000, "ensemble": "nvt", "_idx": "04"},
- {"sys_idx": [1,5,27,31], "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "05"},
- {"sys_idx": [2,6,28,32], "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "06"},
- {"sys_idx": [3,7,29,33], "temps": [ 100], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "07"},
- {"sys_idx": [0,4,26,30], "temps": [ 300], "press": [1.0], "trj_freq": 10, "nsteps": 1000, "ensemble": "nvt", "_idx": "08"},
- {"sys_idx": [1,5,27,31], "temps": [ 300], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "09"},
- {"sys_idx": [2,6,28,32], "temps": [ 300], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "10"},
- {"sys_idx": [3,7,29,33], "temps": [ 300], "press": [1.0], "trj_freq": 10, "nsteps": 3000, "ensemble": "nvt", "_idx": "11"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": true,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 4,
+ 26,
+ 30
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5,
+ 27,
+ 31
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 2,
+ 6,
+ 28,
+ 32
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 3,
+ 7,
+ 29,
+ 33
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "03"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4,
+ 26,
+ 30
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "nvt",
+ "_idx": "04"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5,
+ 27,
+ 31
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "05"
+ },
+ {
+ "sys_idx": [
+ 2,
+ 6,
+ 28,
+ 32
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "06"
+ },
+ {
+ "sys_idx": [
+ 3,
+ 7,
+ 29,
+ 33
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "07"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4,
+ 26,
+ 30
+ ],
+ "temps": [
+ 300
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "nvt",
+ "_idx": "08"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5,
+ 27,
+ 31
+ ],
+ "temps": [
+ 300
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "09"
+ },
+ {
+ "sys_idx": [
+ 2,
+ 6,
+ 28,
+ 32
+ ],
+ "temps": [
+ 300
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "10"
+ },
+ {
+ "sys_idx": [
+ 3,
+ 7,
+ 29,
+ 33
+ ],
+ "temps": [
+ 300
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "11"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": "/home/linfengz/SCR/wanghan/data/mgop/",
+ "fp_pp_files": [
+ "POTCAR"
],
-
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": "/home/linfengz/SCR/wanghan/data/mgop/",
- "fp_pp_files": ["POTCAR"],
- "fp_params": {
- "_comment": "given in unit depending on the fp method",
- "ecut": 600,
- "ediff": 1e-6,
- "kspacing": 0.16,
- "_comment": "gauss, mp:N(methfessel-paxton:order by default order=1), fd(Fermi-Dirac)",
- "smearing": "mp",
- "sigma": 0.25,
- "_comment": "only for vasp, can be NONE, SCAN, TPSS, RTPSS, M06L or MBJ",
- "metagga": "NONE",
- "npar": 1,
- "kpar": 1,
- "user_vasp_params": {
- "EDIFF" : 1e-5
- },
- "_comment": " that's all "
+ "fp_params": {
+ "_comment12": "given in unit depending on the fp method",
+ "ecut": 600,
+ "ediff": 1e-06,
+ "kspacing": 0.16,
+ "_comment13": "gauss, mp:N(methfessel-paxton:order by default order=1), fd(Fermi-Dirac)",
+ "smearing": "mp",
+ "sigma": 0.25,
+ "_comment14": "only for vasp, can be NONE, SCAN, TPSS, RTPSS, M06L or MBJ",
+ "metagga": "NONE",
+ "npar": 1,
+ "kpar": 1,
+ "user_vasp_params": {
+ "EDIFF": 1e-05
+ },
+ "_comment15": " that's all "
},
-
- "_comment": " that's all "
+ "_comment16": " that's all "
}
diff --git a/examples/run/deprecated/param-pyridine-pwscf.json b/examples/run/deprecated/param-pyridine-pwscf.json
index f7348c583..7529960cf 100644
--- a/examples/run/deprecated/param-pyridine-pwscf.json
+++ b/examples/run/deprecated/param-pyridine-pwscf.json
@@ -1,111 +1,328 @@
{
- "type_map": ["C", "H", "N"],
- "mass_map": [16, 2, 14],
-
- "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
- "init_data_sys": ["Pyridine-I",
- "Pyridine-II"
- ],
- "init_batch_size": [1, 1],
- "sys_configs": [
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"]
+ "type_map": [
+ "C",
+ "H",
+ "N"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1, 1, 1,
- 1, 1, 1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [81, 81, 20],
- "rcut_smth": 0.50,
- "rcut": 6.50,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 16,
+ 2,
+ 14
+ ],
+ "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
+ "init_data_sys": [
+ "Pyridine-I",
+ "Pyridine-II"
+ ],
+ "init_batch_size": [
+ 1,
+ 1
+ ],
+ "sys_configs": [
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 81,
+ 81,
+ 20
+ ],
+ "rcut": 6.5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.001,
- "model_devi_skip": 10,
- "model_devi_f_trust_lo": 0.200,
- "model_devi_f_trust_hi": 0.300,
- "model_devi_clean_traj": true,
- "model_devi_jobs": [
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "01"},
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "02"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "03"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "04"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "05"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "06"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "07"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.001,
+ "model_devi_skip": 10,
+ "model_devi_f_trust_lo": 0.2,
+ "model_devi_f_trust_hi": 0.3,
+ "model_devi_clean_traj": true,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "03"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "04"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "05"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "06"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "07"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "pwscf",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": "/home/linfengz/SCR/wanghan/deepgen.pyridine/pwscf/",
+ "fp_pp_files": [
+ "C_HSCV_PBE-1.0.UPF",
+ "H_HSCV_PBE-1.0.UPF",
+ "N_HSCV_PBE-1.0.UPF"
],
-
- "_comment": " 02.fp ",
- "fp_style": "pwscf",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": "/home/linfengz/SCR/wanghan/deepgen.pyridine/pwscf/",
- "fp_pp_files": ["C_HSCV_PBE-1.0.UPF", "H_HSCV_PBE-1.0.UPF", "N_HSCV_PBE-1.0.UPF"],
- "fp_params": {
- "_comment": "given in unit depending on the fp method",
- "ecut": 110.0,
- "ediff": 1e-8,
- "kspacing": 0.6,
- "npar": 1,
- "kpar": 1,
- "_comment": " that's all "
+ "fp_params": {
+ "_comment12": "given in unit depending on the fp method",
+ "ecut": 110.0,
+ "ediff": 1e-08,
+ "kspacing": 0.6,
+ "npar": 1,
+ "kpar": 1,
+ "_comment13": " that's all "
},
-
- "_comment": " that's all "
+ "_comment14": " that's all "
}
diff --git a/examples/run/dp-calypso-vasp/machine.json b/examples/run/dp-calypso-vasp/machine.json
index f07f2dd87..b563d27c4 100644
--- a/examples/run/dp-calypso-vasp/machine.json
+++ b/examples/run/dp-calypso-vasp/machine.json
@@ -1,70 +1,82 @@
{
- "api_version": "1.0",
- "deepmd_version": "2.0.1",
- "train" :[
- {
- "command": "dp",
- "machine": {
- "batch_type": "pbs",
- "context_type": "lazylocal",
- "local_root" : "./"
- },
- "resources": {
- "envs": {"LD_LIBRARY_PATH": "/opt/software/cuda/10.1/lib64:$LD_LIBRARY_PATH"},
- "custom_flags":["#PBS -l walltime=48:0:0"],
- "number_node": 1,
- "local_root":"./",
- "cpu_per_node": 16,
- "gpu_per_node": 1,
- "queue_name": "T4_16_62",
- "group_size": 1
- }
- }],
- "model_devi":
- [{
- "calypso_path":"/home/zhenyu/workplace/dpgen/AA-2400/debug/calypso_input",
- "deepmdkit_python":"/home/zhenyu/soft/deepmd-kit/envs/debug/bin/python",
- "_deepmdkit_python":"this python will be used to optimize structures generated by CALYPSO with ase",
- "_deepmdkit_python":"and also will be used to calculate model deviation in iter.000001/01.model_devi/model_devi_results",
- "_deepmdkit_python":"with calypso_run_model_devi.py script",
- "command": "",
- "machine": {
- "_batch_type": "pbs",
- "batch_type": "shell",
- "context_type": "lazylocal",
- "remote_root": "/home/zhenyu/workplace/dpgen/AA-2400/debug/temp",
- "local_root" : "./"
- },
- "resources": {
- "envs": {"LD_LIBRARY_PATH": "/opt/software/cuda/10.1/lib64:$LD_LIBRARY_PATH"},
- "custom_flags":["#PBS -l walltime=48:0:0"],
- "number_node": 1,
- "local_root":"./",
- "cpu_per_node": 16,
- "gpu_per_node": 1,
- "queue_name": "T4_16_62",
- "group_size": 50
- }
- }],
- "fp":
- [{
- "command": "mpirun -n 32 /opt/vasp/vasp_std",
- "machine": {
- "batch_type": "shell",
- "context_type": "lazylocal",
- "local_root" : "./",
- "remote_root": "/home/zhenyu/workplace/dpgen/AA-2400/debug/temp"
- },
- "resources": {
- "number_node": 1,
- "cpu_per_node": 12,
- "gpu_per_node": 0,
- "queue_name": "C_32_64",
- "group_size": 10,
- "local_root":"./",
- "custom_flags":["#PBS -l walltime=200:0:0"],
- "source_list": ["/opt/intel/oneapi/setvars.sh"]
- }
- }
- ]
+ "api_version": "1.0",
+ "deepmd_version": "2.0.1",
+ "train": [
+ {
+ "command": "dp",
+ "machine": {
+ "batch_type": "pbs",
+ "context_type": "lazylocal",
+ "local_root": "./"
+ },
+ "resources": {
+ "envs": {
+ "LD_LIBRARY_PATH": "/opt/software/cuda/10.1/lib64:$LD_LIBRARY_PATH"
+ },
+ "custom_flags": [
+ "#PBS -l walltime=48:0:0"
+ ],
+ "number_node": 1,
+ "local_root": "./",
+ "cpu_per_node": 16,
+ "gpu_per_node": 1,
+ "queue_name": "T4_16_62",
+ "group_size": 1
+ }
+ }
+ ],
+ "model_devi": [
+ {
+ "calypso_path": "/home/zhenyu/workplace/dpgen/AA-2400/debug/calypso_input",
+ "deepmdkit_python": "/home/zhenyu/soft/deepmd-kit/envs/debug/bin/python",
+ "_deepmdkit_python": "with calypso_run_model_devi.py script",
+ "command": "",
+ "machine": {
+ "_batch_type": "pbs",
+ "batch_type": "shell",
+ "context_type": "lazylocal",
+ "remote_root": "/home/zhenyu/workplace/dpgen/AA-2400/debug/temp",
+ "local_root": "./"
+ },
+ "resources": {
+ "envs": {
+ "LD_LIBRARY_PATH": "/opt/software/cuda/10.1/lib64:$LD_LIBRARY_PATH"
+ },
+ "custom_flags": [
+ "#PBS -l walltime=48:0:0"
+ ],
+ "number_node": 1,
+ "local_root": "./",
+ "cpu_per_node": 16,
+ "gpu_per_node": 1,
+ "queue_name": "T4_16_62",
+ "group_size": 50
+ }
+ }
+ ],
+ "fp": [
+ {
+ "command": "mpirun -n 32 /opt/vasp/vasp_std",
+ "machine": {
+ "batch_type": "shell",
+ "context_type": "lazylocal",
+ "local_root": "./",
+ "remote_root": "/home/zhenyu/workplace/dpgen/AA-2400/debug/temp"
+ },
+ "resources": {
+ "number_node": 1,
+ "cpu_per_node": 12,
+ "gpu_per_node": 0,
+ "queue_name": "C_32_64",
+ "group_size": 10,
+ "local_root": "./",
+ "custom_flags": [
+ "#PBS -l walltime=200:0:0"
+ ],
+ "source_list": [
+ "/opt/intel/oneapi/setvars.sh"
+ ]
+ }
+ }
+ ]
}
diff --git a/examples/run/dp-calypso-vasp/param.json b/examples/run/dp-calypso-vasp/param.json
index 96f566938..401216b89 100644
--- a/examples/run/dp-calypso-vasp/param.json
+++ b/examples/run/dp-calypso-vasp/param.json
@@ -1,103 +1,99 @@
{
- "model_devi_engine":"calypso",
- "_calypso_path":"/home/zhenyu/workplace/dpgen/AA-2400/debug",
- "_calypso_input_path":"/home/zhenyu/workplace/dpgen/AA-2400/debug/calypso_input",
- "_model_devi_max_iter": 50,
- "vsc":false,
-
+ "model_devi_engine": "calypso",
+ "_calypso_path": "/home/zhenyu/workplace/dpgen/AA-2400/debug",
+ "_calypso_input_path": "/home/zhenyu/workplace/dpgen/AA-2400/debug/calypso_input",
+ "_model_devi_max_iter": 50,
+ "vsc": false,
"type_map": [
- "Mg",
+ "Mg",
"Al",
"Cu"
],
"mass_map": [
- 24,
+ 24,
27,
64
],
- "init_data_prefix":"/home/zhenyu/workplace/dpgen/AA-2400/data/",
+ "init_data_prefix": "/home/zhenyu/workplace/dpgen/AA-2400/data/",
"init_data_sys": [
- "data.init/data.init/AlCuMg/init.000"
+ "data.init/data.init/AlCuMg/init.000"
],
- "_comment": " that's all ",
-
+ "_comment1": " that's all ",
"training_init_model": false,
"training_iter0_model_path": "/home/zhenyu/workplace/dpgen/AA-2400/pb/00[0-3]",
- "training_reuse_iter": 0,
- "training_reuse_old_ratio": 0.9,
- "training_reuse_start_lr": 1e-4,
- "training_reuse_stop_batch": 1000000,
- "training_reuse_start_pref_e": 0.2,
- "training_reuse_start_pref_f": 100,
-
+ "training_reuse_iter": 0,
+ "training_reuse_old_ratio": 0.9,
+ "training_reuse_start_lr": 0.0001,
+ "training_reuse_stop_batch": 1000000,
+ "training_reuse_start_pref_e": 0.2,
+ "training_reuse_start_pref_f": 100,
"numb_models": 4,
"default_training_param": {
- "model": {
- "descriptor": {
- "type": "se_e2_a",
- "sel": [
- 500,
- 700,
- 1100
- ],
- "rcut_smth": 2.0,
- "rcut": 12.0,
- "neuron": [
- 25,
- 50,
- 100
- ],
- "resnet_dt": false,
- "axis_neuron": 12,
- "type_one_side": true,
- "seed": 1801819940,
- "_activation_function": "tanh"
+ "model": {
+ "descriptor": {
+ "type": "se_e2_a",
+ "sel": [
+ 500,
+ 700,
+ 1100
+ ],
+ "rcut_smth": 2.0,
+ "rcut": 12.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 12,
+ "type_one_side": true,
+ "seed": 1801819940,
+ "_activation_function": "tanh"
+ },
+ "fitting_net": {
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true,
+ "seed": 2375417769
+ },
+ "type_map": [
+ "Mg",
+ "Al",
+ "Cu"
+ ]
},
- "fitting_net": {
- "neuron": [
- 240,
- 240,
- 240
- ],
- "resnet_dt": true,
- "seed": 2375417769
+ "learning_rate": {
+ "type": "exp",
+ "start_lr": 0.001,
+ "decay_steps": 5000
},
- "type_map": [
- "Mg",
- "Al",
- "Cu"
- ]
- },
- "learning_rate": {
- "type": "exp",
- "start_lr": 0.001,
- "decay_steps": 5000
- },
- "loss": {
- "start_pref_e": 0.2,
- "limit_pref_e": 2,
- "start_pref_f": 100,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0
+ "loss": {
+ "start_pref_e": 0.2,
+ "limit_pref_e": 2,
+ "start_pref_f": 100,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0
+ },
+ "training": {
+ "stop_batch": 6000,
+ "seed": 3982377700,
+ "_comment2": "that's all",
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 2000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "set_prefix": "set"
+ }
},
- "training": {
- "stop_batch": 6000,
- "seed": 3982377700,
- "_comment": "that's all",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 4,
- "save_freq": 2000,
- "save_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
- "set_prefix": "set"
- }
- },
- "sys_configs":"",
+ "sys_configs": "",
"model_devi_dt": 0.002,
"model_devi_skip": 0,
"model_devi_f_trust_lo": 0.05,
@@ -106,22 +102,311 @@
"model_devi_e_trust_hi": 10000000000.0,
"model_devi_clean_traj": true,
"model_devi_jobs": [
-{"times":[0],"NameOfAtoms":["Mg","Al","Cu"],"NumberOfAtoms":[1,1,1],"NumberOfFormula":[1,1],"Volume":[30],"DistanceOfIon":[[1.48,1.44,1.59],[1.44,1.41,1.56],[1.59,1.56,1.70]],"PsoRatio":[0.6],"PopSize":[500],"MaxStep":[3],"ICode":[1],"Split":"T","VSC":"T","MaxNumAtom":[31],"CtrlRange":[[1,10],[1,10],[1,10]]},
-{"times":[1],"NameOfAtoms":["Mg","Al"],"NumberOfAtoms":[1,1],"NumberOfFormula":[1,1],"Volume":[30],"DistanceOfIon":[[1.48,1.44],[1.44,1.41]],"PsoRatio":[0.6],"PopSize":[500],"MaxStep":[3],"ICode":[1],"Split":"T"},
-{"times":[3],"NameOfAtoms":["Al","Cu"],"NumberOfAtoms":[1,10],"NumberOfFormula":[1,2],"Volume":[300],"DistanceOfIon":[[1.48,1.44],[1.44,1.41]],"PsoRatio":[0.6],"PopSize":[5],"MaxStep":[3],"ICode":[1],"Split":"T"},
-{"times":[2],"NameOfAtoms":["Mg","Al","Cu"],"NumberOfAtoms":[1,1,1],"NumberOfFormula":[1,1],"Volume":[30],"DistanceOfIon":[[1.48,1.44,1.59],[1.44,1.41,1.56],[1.59,1.56,1.70]],"PsoRatio":[0.6],"PopSize":[5],"MaxStep":[1],"ICode":[1],"Split":"T","VSC":"T","MaxNumAtom":[31],"CtrlRange":[[1,10],[1,10],[1,10]],"PSTRESS":[0],"fmax":[0.01]},
-{"times":[4],"NameOfAtoms":["Mg","Al","Cu"],"NumberOfAtoms":[1,1,1],"NumberOfFormula":[1,1],"Volume":30,"DistanceOfIon":[[1.48,1.44,1.59],[1.44,1.41,1.56],[1.59,1.56,1.70]],"PsoRatio":0.6,"PopSize":5,"MaxStep":1,"ICode":1,"Split":"T","VSC":"T","MaxNumAtom":31,"CtrlRange":[[1,10],[1,10],[1,10]],"PSTRESS":[0, 400 ],"fmax":0.01}
+ {
+ "times": [
+ 0
+ ],
+ "NameOfAtoms": [
+ "Mg",
+ "Al",
+ "Cu"
+ ],
+ "NumberOfAtoms": [
+ 1,
+ 1,
+ 1
+ ],
+ "NumberOfFormula": [
+ 1,
+ 1
+ ],
+ "Volume": [
+ 30
+ ],
+ "DistanceOfIon": [
+ [
+ 1.48,
+ 1.44,
+ 1.59
+ ],
+ [
+ 1.44,
+ 1.41,
+ 1.56
+ ],
+ [
+ 1.59,
+ 1.56,
+ 1.7
+ ]
+ ],
+ "PsoRatio": [
+ 0.6
+ ],
+ "PopSize": [
+ 500
+ ],
+ "MaxStep": [
+ 3
+ ],
+ "ICode": [
+ 1
+ ],
+ "Split": "T",
+ "VSC": "T",
+ "MaxNumAtom": [
+ 31
+ ],
+ "CtrlRange": [
+ [
+ 1,
+ 10
+ ],
+ [
+ 1,
+ 10
+ ],
+ [
+ 1,
+ 10
+ ]
+ ]
+ },
+ {
+ "times": [
+ 1
+ ],
+ "NameOfAtoms": [
+ "Mg",
+ "Al"
+ ],
+ "NumberOfAtoms": [
+ 1,
+ 1
+ ],
+ "NumberOfFormula": [
+ 1,
+ 1
+ ],
+ "Volume": [
+ 30
+ ],
+ "DistanceOfIon": [
+ [
+ 1.48,
+ 1.44
+ ],
+ [
+ 1.44,
+ 1.41
+ ]
+ ],
+ "PsoRatio": [
+ 0.6
+ ],
+ "PopSize": [
+ 500
+ ],
+ "MaxStep": [
+ 3
+ ],
+ "ICode": [
+ 1
+ ],
+ "Split": "T"
+ },
+ {
+ "times": [
+ 3
+ ],
+ "NameOfAtoms": [
+ "Al",
+ "Cu"
+ ],
+ "NumberOfAtoms": [
+ 1,
+ 10
+ ],
+ "NumberOfFormula": [
+ 1,
+ 2
+ ],
+ "Volume": [
+ 300
+ ],
+ "DistanceOfIon": [
+ [
+ 1.48,
+ 1.44
+ ],
+ [
+ 1.44,
+ 1.41
+ ]
+ ],
+ "PsoRatio": [
+ 0.6
+ ],
+ "PopSize": [
+ 5
+ ],
+ "MaxStep": [
+ 3
+ ],
+ "ICode": [
+ 1
+ ],
+ "Split": "T"
+ },
+ {
+ "times": [
+ 2
+ ],
+ "NameOfAtoms": [
+ "Mg",
+ "Al",
+ "Cu"
+ ],
+ "NumberOfAtoms": [
+ 1,
+ 1,
+ 1
+ ],
+ "NumberOfFormula": [
+ 1,
+ 1
+ ],
+ "Volume": [
+ 30
+ ],
+ "DistanceOfIon": [
+ [
+ 1.48,
+ 1.44,
+ 1.59
+ ],
+ [
+ 1.44,
+ 1.41,
+ 1.56
+ ],
+ [
+ 1.59,
+ 1.56,
+ 1.7
+ ]
+ ],
+ "PsoRatio": [
+ 0.6
+ ],
+ "PopSize": [
+ 5
+ ],
+ "MaxStep": [
+ 1
+ ],
+ "ICode": [
+ 1
+ ],
+ "Split": "T",
+ "VSC": "T",
+ "MaxNumAtom": [
+ 31
+ ],
+ "CtrlRange": [
+ [
+ 1,
+ 10
+ ],
+ [
+ 1,
+ 10
+ ],
+ [
+ 1,
+ 10
+ ]
+ ],
+ "PSTRESS": [
+ 0
+ ],
+ "fmax": [
+ 0.01
+ ]
+ },
+ {
+ "times": [
+ 4
+ ],
+ "NameOfAtoms": [
+ "Mg",
+ "Al",
+ "Cu"
+ ],
+ "NumberOfAtoms": [
+ 1,
+ 1,
+ 1
+ ],
+ "NumberOfFormula": [
+ 1,
+ 1
+ ],
+ "Volume": 30,
+ "DistanceOfIon": [
+ [
+ 1.48,
+ 1.44,
+ 1.59
+ ],
+ [
+ 1.44,
+ 1.41,
+ 1.56
+ ],
+ [
+ 1.59,
+ 1.56,
+ 1.7
+ ]
+ ],
+ "PsoRatio": 0.6,
+ "PopSize": 5,
+ "MaxStep": 1,
+ "ICode": 1,
+ "Split": "T",
+ "VSC": "T",
+ "MaxNumAtom": 31,
+ "CtrlRange": [
+ [
+ 1,
+ 10
+ ],
+ [
+ 1,
+ 10
+ ],
+ [
+ 1,
+ 10
+ ]
+ ],
+ "PSTRESS": [
+ 0,
+ 400
+ ],
+ "fmax": 0.01
+ }
],
-
"fp_style": "vasp",
"shuffle_poscar": false,
"fp_task_max": 10,
"fp_task_min": 1,
"fp_pp_path": "/home/zhenyu/workplace/dpgen/AA-2400/vasp_input",
"fp_pp_files": [
- "POTCAR.Mg",
+ "POTCAR.Mg",
"POTCAR.Al",
"POTCAR.Cu"
],
- "fp_incar":"/home/zhenyu/workplace/dpgen/AA-2400/vasp_input/INCAR"
+ "fp_incar": "/home/zhenyu/workplace/dpgen/AA-2400/vasp_input/INCAR"
}
diff --git a/examples/run/dp-lammps-enhance_sampling/param.json b/examples/run/dp-lammps-enhance_sampling/param.json
index f63d04985..6bfb043a1 100644
--- a/examples/run/dp-lammps-enhance_sampling/param.json
+++ b/examples/run/dp-lammps-enhance_sampling/param.json
@@ -1,126 +1,223 @@
{
- "type_map": ["C", "H"],
- "mass_map": [12.0, 1.0],
-
- "_comment": "initial data set for Training and the number of frames in each training batch",
- "init_data_prefix": "someplace/tutorial-dpgen-enhance",
- "init_data_sys": [
- "raw_file"
- ],
- "init_batch_size": [
- 4
- ],
-
- "_comment": "configurations for starting MD in Exploration and batch sizes when traning snapshots derived from these configs (if they were selected)",
- "sys_configs_prefix": "someplace/tutorial-dpgen-enhance",
- "sys_configs": [
- [
- "configs/POSCAR_[0-9]"
+ "type_map": [
+ "C",
+ "H"
],
- [
- "configs/POSCAR_0"
- ]
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "training_init_model": true,
- "training_reuse_iter": 1,
- "training_reuse_old_ratio": 0.2,
- "training_reuse_stop_batch": 100000,
- "training_reuse_start_lr": 0.0001,
- "training_reuse_start_pref_e": 0.1,
- "training_reuse_start_pref_f": 200,
- "default_training_param": {
- "model": {
- "type_map": ["C","H"],
- "descriptor": {
- "type": "se_a",
- "sel": [2,6],
- "rcut_smth": 0.5,
- "rcut": 5.0,
- "neuron": [20,40,80],
- "resnet_dt": false,
- "axis_neuron": 6,
- "seed": 0
- },
- "fitting_net": {
- "neuron": [120,120,120],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
- "seed": 0
- }
- },
- "loss": {
- "start_pref_e": 0.02,
- "limit_pref_e": 1,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0
- },
- "learning_rate": {
- "type": "exp",
- "start_lr": 0.001,
- "decay_steps": 500,
- "decay_rate": 0.95
+ "mass_map": [
+ 12.0,
+ 1.0
+ ],
+ "_comment1": "initial data set for Training and the number of frames in each training batch",
+ "init_data_prefix": "someplace/tutorial-dpgen-enhance",
+ "init_data_sys": [
+ "raw_file"
+ ],
+ "init_batch_size": [
+ 4
+ ],
+ "_comment2": "configurations for starting MD in Exploration and batch sizes when traning snapshots derived from these configs (if they were selected)",
+ "sys_configs_prefix": "someplace/tutorial-dpgen-enhance",
+ "sys_configs": [
+ [
+ "configs/POSCAR_[0-9]"
+ ],
+ [
+ "configs/POSCAR_0"
+ ]
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "training_init_model": true,
+ "training_reuse_iter": 1,
+ "training_reuse_old_ratio": 0.2,
+ "training_reuse_stop_batch": 100000,
+ "training_reuse_start_lr": 0.0001,
+ "training_reuse_start_pref_e": 0.1,
+ "training_reuse_start_pref_f": 200,
+ "default_training_param": {
+ "model": {
+ "type_map": [
+ "C",
+ "H"
+ ],
+ "descriptor": {
+ "type": "se_a",
+ "sel": [
+ 2,
+ 6
+ ],
+ "rcut_smth": 0.5,
+ "rcut": 5.0,
+ "neuron": [
+ 20,
+ 40,
+ 80
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 6,
+ "seed": 0
+ },
+ "fitting_net": {
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true,
+ "coord_norm": true,
+ "type_fitting_net": false,
+ "seed": 0
+ }
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 1,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0
+ },
+ "learning_rate": {
+ "type": "exp",
+ "start_lr": 0.001,
+ "decay_steps": 500,
+ "stop_lr": 1.2286894111517773e-12
+ },
+ "training": {
+ "stop_batch": 200000,
+ "seed": 1,
+ "_comment4": "frequencies counted in batch",
+ "disp_file": "lcurve.out",
+ "disp_freq": 100,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
- "training": {
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 200000,
- "batch_size": 1,
- "seed": 1,
- "_comment": "frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 100,
- "numb_test": 10,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json"
- }
- },
-
- "_comment": " 01.model_devi ",
- "model_devi_dt": 0.0005,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.08,
- "model_devi_f_trust_hi": 0.25,
- "model_devi_clean_traj": false,
- "model_devi_plumed" : true,
- "model_devi_jobs": [
- { "sys_idx": [0],"trj_freq": 10,"_idx": "00",
- "template":{ "lmp": "lmp/input.lammps", "plm": "lmp/input.plumed" },
- "rev_mat":{ "lmp": {"V_NSTEPS": [20000], "V_TEMP": [300], "V_PRES": [1]},
- "plm": {"V_TEMP": [300], "V_STRIDE": [10]}
- }
+ "_comment5": " 01.model_devi ",
+ "model_devi_dt": 0.0005,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.08,
+ "model_devi_f_trust_hi": 0.25,
+ "model_devi_clean_traj": false,
+ "model_devi_plumed": true,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0
+ ],
+ "trj_freq": 10,
+ "_idx": "00",
+ "template": {
+ "lmp": "lmp/input.lammps",
+ "plm": "lmp/input.plumed"
+ },
+ "rev_mat": {
+ "lmp": {
+ "V_NSTEPS": [
+ 20000
+ ],
+ "V_TEMP": [
+ 300
+ ],
+ "V_PRES": [
+ 1
+ ]
+ },
+ "plm": {
+ "V_TEMP": [
+ 300
+ ],
+ "V_STRIDE": [
+ 10
+ ]
+ }
+ }
},
- { "sys_idx": [0],"trj_freq": 10,"_idx": "01",
- "template":{ "lmp": "lmp/input.lammps", "plm": "lmp/input.plumed" },
- "rev_mat":{ "lmp": {"V_NSTEPS": [50000], "V_TEMP": [300], "V_PRES": [1]},
- "plm": {"V_TEMP": [300], "V_STRIDE": [10]}
- }
+ {
+ "sys_idx": [
+ 0
+ ],
+ "trj_freq": 10,
+ "_idx": "01",
+ "template": {
+ "lmp": "lmp/input.lammps",
+ "plm": "lmp/input.plumed"
+ },
+ "rev_mat": {
+ "lmp": {
+ "V_NSTEPS": [
+ 50000
+ ],
+ "V_TEMP": [
+ 300
+ ],
+ "V_PRES": [
+ 1
+ ]
+ },
+ "plm": {
+ "V_TEMP": [
+ 300
+ ],
+ "V_STRIDE": [
+ 10
+ ]
+ }
+ }
},
- { "sys_idx": [1],"trj_freq": 10,"_idx": "01",
- "template":{ "lmp": "lmp/input.lammps", "plm": "lmp/input.plumed" },
- "rev_mat":{ "lmp": {"V_NSTEPS": [300000], "V_TEMP": [300], "V_PRES": [1]},
- "plm": {"V_TEMP": [300], "V_STRIDE": [10]}
- }
+ {
+ "sys_idx": [
+ 1
+ ],
+ "trj_freq": 10,
+ "_idx": "01",
+ "template": {
+ "lmp": "lmp/input.lammps",
+ "plm": "lmp/input.plumed"
+ },
+ "rev_mat": {
+ "lmp": {
+ "V_NSTEPS": [
+ 300000
+ ],
+ "V_TEMP": [
+ 300
+ ],
+ "V_PRES": [
+ 1
+ ]
+ },
+ "plm": {
+ "V_TEMP": [
+ 300
+ ],
+ "V_STRIDE": [
+ 10
+ ]
+ }
+ }
}
- ],
-
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 150,
- "_comment": "the maximum number of stcs to calc.",
- "fp_task_min": 5,
- "fp_pp_path": "./",
- "fp_pp_files": ["POTCAR_C", "POTCAR_H"],
- "fp_incar" : "INCAR",
- "_comment": " that's all "
+ ],
+ "_comment6": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 150,
+ "_comment7": "the maximum number of stcs to calc.",
+ "fp_task_min": 5,
+ "fp_pp_path": "./",
+ "fp_pp_files": [
+ "POTCAR_C",
+ "POTCAR_H"
+ ],
+ "fp_incar": "INCAR",
+ "_comment8": " that's all "
}
diff --git a/examples/run/dp1.x-lammps-ABACUS-lcao-dpks/methane/machine.json b/examples/run/dp1.x-lammps-ABACUS-lcao-dpks/methane/machine.json
deleted file mode 100644
index 0bc72e8b2..000000000
--- a/examples/run/dp1.x-lammps-ABACUS-lcao-dpks/methane/machine.json
+++ /dev/null
@@ -1,75 +0,0 @@
-{
- "api_version": "1.0",
- "train": [
- {
- "command": "dp",
- "machine": {
- "batch_type": "PBS",
- "context_type": "SSHContext",
- "local_root": "./",
- "remote_root": "/home/user1234/work_path_dpdispatcher_test",
- "remote_profile": {
- "hostname": "39.xxx.xx.xx",
- "username": "user1234"
- }
- },
- "resources": {
- "number_node": 1,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "T4_4_15",
- "group_size": 1,
- "custom_flags":["#SBATCH --mem=32G"],
- "strategy": {"if_cuda_multi_devices": true},
- "para_deg": 3,
- "source_list": ["/home/user1234/deepmd.1.2.4.env"]
- }
- }
- ],
- "model_devi":[
- {
- "command": "lmp",
- "machine":{
- "batch_type": "PBS",
- "context_type": "SSHContext",
- "local_root": "./",
- "remote_root": "/home/user1234/work_path_dpdispatcher_test",
- "remote_profile": {
- "hostname": "39.xxx.xx.xx",
- "username": "user1234"
- }
- },
- "resources": {
- "number_node": 1,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "T4_4_15",
- "group_size": 5,
- "source_list": ["/home/user1234/deepmd.1.2.4.env"]
- }
- }
- ],
- "fp":[
- {
- "command": "ABACUS.mpi",
- "machine":{
- "batch_type": "PBS",
- "context_type": "SSHContext",
- "local_root": "./",
- "remote_root": "/home/user1234/work_path_dpdispatcher_test",
- "remote_profile": {
- "hostname": "39.xxx.xx.xx",
- "username": "user1234"
- }
- },
- "resources": {
- "number_node": 1,
- "cpu_per_node": 32,
- "gpu_per_node": 0,
- "queue_name": "G_32_128",
- "group_size": 1,
- "source_list": ["~/abacus.env"]
- }
- }
- ]
- }
diff --git a/examples/run/dp1.x-lammps-ABACUS-lcao-dpks/methane/param.json b/examples/run/dp1.x-lammps-ABACUS-lcao-dpks/methane/param.json
deleted file mode 100644
index 1af3ae951..000000000
--- a/examples/run/dp1.x-lammps-ABACUS-lcao-dpks/methane/param.json
+++ /dev/null
@@ -1,150 +0,0 @@
-{
- "type_map": ["H", "C"],
- "mass_map": [1.0, 12.0],
-
- "_comment": "initial data set for Training and the number of frames in each training batch",
- "init_data_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run_abacus/",
- "init_data_sys": [
- "abacus_init_data"
- ],
- "init_batch_size": [
- 8
- ],
-
- "_comment": "configurations for starting MD in Exploration and batch sizes when traning snapshots derived from these configs (if they were selected)",
- "sys_configs_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run",
- "sys_configs": [
- [
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000000/POSCAR",
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000001/POSCAR",
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000[2-9]/POSCAR"
- ],
- [
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
- ]
- ],
- "sys_batch_size": [
- 8,
- 8
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
-
- "default_training_param": {
- "model": {
- "type_map": ["H","C"],
- "descriptor": {
- "type": "se_a",
- "sel": [16,4],
- "rcut_smth": 0.5,
- "rcut": 5.0,
- "neuron": [10,20,40],
- "resnet_dt": false,
- "axis_neuron": 12,
- "seed": 0
- },
- "fitting_net": {
- "neuron": [120,120,120],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
- "seed": 0
- }
- },
- "loss": {
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0
- },
- "learning_rate": {
- "type": "exp",
- "start_lr": 0.001,
- "decay_steps": 180,
- "decay_rate": 0.95
- },
- "training": {
- "set_prefix": "set",
- "numb_steps": 2000,
- "batch_size": 1,
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 4,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
- "_comment": "that's all"
- }
- },
-
- "_comment": " 01.model_devi ",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.15,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {
- "sys_idx": [
- 0
- ],
- "temps": [
- 100
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 3000,
- "ensemble": "nvt",
- "_idx": "00"
- },
- {
- "sys_idx": [
- 1
- ],
- "temps": [
- 150
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 9000,
- "ensemble": "nvt",
- "_idx": "01"
- }
- ],
-
- "_comment": " 02.fp ",
- "fp_style": "abacus",
- "shuffle_poscar": false,
- "fp_task_max": 50,
- "fp_task_min": 8,
- "fp_pp_path": "./",
- "fp_pp_files": [ "H_ONCV_PBE-1.0.upf","C_ONCV_PBE-1.0.upf"],
- "fp_orb_files": ["H_gga_8au_60Ry_2s1p.orb", "C_gga_8au_60Ry_2s2p1d.orb"],
- "fp_dpks_descriptor": "jle.orb",
- "user_fp_params":{
- "ntype": 2,
- "cal_force": 1,
- "cal_stress": 1,
- "deepks_model": "model.ptg",
- "deepks_out_labels": 1,
- "basis_type": "lcao",
- "gamma_only": 1,
- "ecutwfc": 80,
- "mixing_type": "pulay",
- "mixing_beta": 0.4,
- "symmetry": 1,
- "nbands": 5,
- "nspin": 1,
- "smearing_method": "fixed"
- }
-}
diff --git a/examples/run/dp1.x-lammps-ABACUS-pw/methane/machine.json b/examples/run/dp1.x-lammps-ABACUS-pw/methane/machine.json
deleted file mode 100644
index 0bc72e8b2..000000000
--- a/examples/run/dp1.x-lammps-ABACUS-pw/methane/machine.json
+++ /dev/null
@@ -1,75 +0,0 @@
-{
- "api_version": "1.0",
- "train": [
- {
- "command": "dp",
- "machine": {
- "batch_type": "PBS",
- "context_type": "SSHContext",
- "local_root": "./",
- "remote_root": "/home/user1234/work_path_dpdispatcher_test",
- "remote_profile": {
- "hostname": "39.xxx.xx.xx",
- "username": "user1234"
- }
- },
- "resources": {
- "number_node": 1,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "T4_4_15",
- "group_size": 1,
- "custom_flags":["#SBATCH --mem=32G"],
- "strategy": {"if_cuda_multi_devices": true},
- "para_deg": 3,
- "source_list": ["/home/user1234/deepmd.1.2.4.env"]
- }
- }
- ],
- "model_devi":[
- {
- "command": "lmp",
- "machine":{
- "batch_type": "PBS",
- "context_type": "SSHContext",
- "local_root": "./",
- "remote_root": "/home/user1234/work_path_dpdispatcher_test",
- "remote_profile": {
- "hostname": "39.xxx.xx.xx",
- "username": "user1234"
- }
- },
- "resources": {
- "number_node": 1,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "T4_4_15",
- "group_size": 5,
- "source_list": ["/home/user1234/deepmd.1.2.4.env"]
- }
- }
- ],
- "fp":[
- {
- "command": "ABACUS.mpi",
- "machine":{
- "batch_type": "PBS",
- "context_type": "SSHContext",
- "local_root": "./",
- "remote_root": "/home/user1234/work_path_dpdispatcher_test",
- "remote_profile": {
- "hostname": "39.xxx.xx.xx",
- "username": "user1234"
- }
- },
- "resources": {
- "number_node": 1,
- "cpu_per_node": 32,
- "gpu_per_node": 0,
- "queue_name": "G_32_128",
- "group_size": 1,
- "source_list": ["~/abacus.env"]
- }
- }
- ]
- }
diff --git a/examples/run/dp1.x-lammps-ABACUS-pw/methane/param.json b/examples/run/dp1.x-lammps-ABACUS-pw/methane/param.json
deleted file mode 100644
index a6cf0eb30..000000000
--- a/examples/run/dp1.x-lammps-ABACUS-pw/methane/param.json
+++ /dev/null
@@ -1,144 +0,0 @@
-{
- "type_map": ["H", "C"],
- "mass_map": [1.0, 12.0],
-
- "_comment": "initial data set for Training and the number of frames in each training batch",
- "init_data_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run_abacus/",
- "init_data_sys": [
- "abacus_init_data"
- ],
- "init_batch_size": [
- 8
- ],
-
- "_comment": "configurations for starting MD in Exploration and batch sizes when traning snapshots derived from these configs (if they were selected)",
- "sys_configs_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run",
- "sys_configs": [
- [
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000000/POSCAR",
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000001/POSCAR",
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000[2-9]/POSCAR"
- ],
- [
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
- ]
- ],
- "sys_batch_size": [
- 8,
- 8
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
-
- "default_training_param": {
- "model": {
- "type_map": ["H","C"],
- "descriptor": {
- "type": "se_a",
- "sel": [16,4],
- "rcut_smth": 0.5,
- "rcut": 5.0,
- "neuron": [10,20,40],
- "resnet_dt": false,
- "axis_neuron": 12,
- "seed": 0
- },
- "fitting_net": {
- "neuron": [120,120,120],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
- "seed": 0
- }
- },
- "loss": {
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0
- },
- "learning_rate": {
- "type": "exp",
- "start_lr": 0.001,
- "decay_steps": 180,
- "decay_rate": 0.95
- },
- "training": {
- "set_prefix": "set",
- "numb_steps": 2000,
- "batch_size": 1,
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 4,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
- "_comment": "that's all"
- }
- },
-
- "_comment": " 01.model_devi ",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.15,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {
- "sys_idx": [
- 0
- ],
- "temps": [
- 50
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 1000,
- "ensemble": "nvt",
- "_idx": "00"
- },
- {
- "sys_idx": [
- 1
- ],
- "temps": [
- 50
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 3000,
- "ensemble": "nvt",
- "_idx": "01"
- }
- ],
-
- "_comment": " 02.fp ",
- "fp_style": "abacus",
- "shuffle_poscar": false,
- "fp_task_max": 30,
- "fp_task_min": 8,
- "fp_pp_path": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/SG15_ONCV_v1.0_upf",
- "fp_pp_files": [ "H_ONCV_PBE-1.0.upf","C_ONCV_PBE-1.0.upf"],
- "user_fp_params":{
- "ntype": 2,
- "ecutwfc": 80,
- "mixing_type": "pulay",
- "mixing_beta": 0.4,
- "symmetry": 1,
- "nbands": 5,
- "nspin": 1,
- "ks_solver": "cg",
- "smearing": "fixed",
- "sigma": 0.001
- }
-}
diff --git a/examples/run/dp1.x-lammps-cp2k/methane/param-ch4.json b/examples/run/dp1.x-lammps-cp2k/methane/param-ch4.json
deleted file mode 100644
index bab722abf..000000000
--- a/examples/run/dp1.x-lammps-cp2k/methane/param-ch4.json
+++ /dev/null
@@ -1,134 +0,0 @@
-{
- "type_map": [
- "H",
- "C"
- ],
- "mass_map": [
- 1,
- 12
- ],
- "init_data_prefix": "/data/ybzhuang/methane-dpgen/dpgen-tutorial-2020-08-23/dpgen-tutorial-mathane/data",
- "init_data_sys": [
- "deepmd"
- ],
- "init_batch_size": [
- 8
- ],
- "sys_configs": [
- ["/data/ybzhuang/methane-dpgen/dpgen-tutorial-2020-08-23/dpgen-tutorial-mathane/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000*/POSCAR"],
- ["/data/ybzhuang/methane-dpgen/dpgen-tutorial-2020-08-23/dpgen-tutorial-mathane/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000*/POSCAR"]
- ],
- "sys_batch_size": [
- 8,
- 8,
- 8,
- 8
- ],
- "_comment": " that's all ",
- "numb_models": 4,
- "default_training_param": {
- "model": {
- "descriptor": {
- "type": "se_a",
- "sel": [
- 16,
- 4
- ],
- "rcut_smth": 0.5,
- "rcut": 5.0,
- "_comment": "modify according your system",
- "neuron": [
- 10,
- 20,
- 40
- ],
- "resnet_dt": false,
- "axis_neuron": 12,
- "seed": 1
- },
- "fitting_net": {
- "neuron": [
- 120,
- 120,
- 120
- ],
- "resnet_dt": true,
- "seed": 1
- }},
- "learning_rate": {
- "type": "exp",
- "start_lr": 0.001,
- "decay_steps": 100,
- "_comment": "nope",
- "decay_rate": 0.95
- },
- "loss": {
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0
- },
- "training": {
- "systems": [ ],
- "set_prefix": "set",
- "stop_batch": 2000,
- "batch_size": 1,
- "seed": 1,
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 4,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json"
- }
- },
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.15,
- "model_devi_clean_traj": true,
- "model_devi_jobs": [
- {
- "sys_idx": [
- 0
- ],
- "temps": [
- 100
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 300,
- "ensemble": "nvt",
- "_idx": "00"
- },
- {
- "sys_idx": [
- 1
- ],
- "temps": [
- 100
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 3000,
- "ensemble": "nvt",
- "_idx": "01"
- }
-
- ],
- "fp_style": "cp2k",
- "shuffle_poscar": false,
- "fp_task_max": 20,
- "fp_task_min": 5,
- "external_input_path": "/data/ybzhuang/methane-dpgen/dpgen-tutorial-2020-08-23/dpgen-tutorial-mathane/cp2k_dpgen/template.inp"
-}
diff --git a/examples/run/dp1.x-lammps-vasp-et/param_elet.json b/examples/run/dp1.x-lammps-vasp-et/param_elet.json
deleted file mode 100644
index cc0f4a962..000000000
--- a/examples/run/dp1.x-lammps-vasp-et/param_elet.json
+++ /dev/null
@@ -1,99 +0,0 @@
-{
- "type_map": ["Al", "Mg"],
- "mass_map": [27, 24],
- "use_ele_temp": 2,
-
- "init_data_prefix": "/home/wanghan/study/deep.md/data/almgop.20/init//",
-
- "init_data_sys": [
- "al.fcc.01x01x01/02.md/sys-0004/deepmd",
- "mg.fcc.01x01x01/02.md/sys-0004/deepmd"
- ],
- "sys_configs": [
- ["/home/wanghan/study/deep.md/data/almgop.20/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR"],
- ["/home/wanghan/study/deep.md/data/almgop.20/init/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR"]
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "model" : {
- "descriptor": {
- "type": "se_a",
- "sel": [90, 90],
- "rcut_smth": 1.80,
- "rcut": 6.00,
- "neuron": [10, 20, 40],
- "resnet_dt": false,
- "axis_neuron": 4,
- "seed": 1
- },
- "fitting_net" : {
- "neuron": [120, 120, 120],
- "resnet_dt": true,
- "numb_fparam": 10,
- "seed": 1
- }
- },
-
- "loss" : {
- "start_pref_e": 0.02,
- "limit_pref_e": 1,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0
- },
-
- "learning_rate" : {
- "start_lr": 0.001,
- "decay_steps": 5000,
- "decay_rate": 0.95
- },
-
- "_comment": " traing controls",
- "training" : {
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 1000,
- "batch_size": 1,
-
- "seed": 1,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 1,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training":true,
- "time_training":true,
- "profiling": false,
- "profiling_file": "timeline.json"
- },
- "_comment": "that's all"
- },
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.20,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- { "_idx": 0, "ensemble": "npt", "nsteps": 50, "press": [1.0,2.0], "sys_idx": [0, 1], "temps": [50,100], "trj_freq": 10 }
- ],
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 8,
- "fp_task_min": 2,
- "fp_pp_path": "/home/wanghan/study/deep.md/dpgen/almg/vasp",
- "fp_pp_files": ["POTCAR.Al", "POTCAR.Mg"],
- "fp_incar": "/home/wanghan/study/deep.md/dpgen/almg/vasp/INCAR",
- "_comment": " that's all "
-}
diff --git a/examples/run/dp1.x-lammps-vasp/Al/param_al_all_gpu-deepmd-kit-1.1.0.json b/examples/run/dp1.x-lammps-vasp/Al/param_al_all_gpu-deepmd-kit-1.1.0.json
deleted file mode 100644
index 4b4d92ba2..000000000
--- a/examples/run/dp1.x-lammps-vasp/Al/param_al_all_gpu-deepmd-kit-1.1.0.json
+++ /dev/null
@@ -1,371 +0,0 @@
-{
- "type_map": ["Al"],
- "mass_map": [27],
-
- "init_data_prefix": "/data1/yfb222333/2_dpgen_gpu_multi/init/",
-
- "init_data_sys": [
- "al.fcc.02x02x02/02.md/sys-0032/deepmd",
- "al.hcp.02x02x02/02.md/sys-0016/deepmd",
- "al.bcc.02x02x02/02.md/sys-0016/deepmd"
- ],
- "sys_configs": [
-
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[5-9]/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00001*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00002*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00003*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00004*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00005*/POSCAR",
- "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00006*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00007*/POSCAR",
- "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00008*/POSCAR"],
-
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[0-4]/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[5-9]/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00001*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00002*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00003*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00004*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00005*/POSCAR",
- "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00006*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00007*/POSCAR",
- "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00008*/POSCAR"],
-
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[0-4]/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[5-9]/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00001*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00002*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00003*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00004*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00005*/POSCAR",
- "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00006*/POSCAR"],
- ["/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00007*/POSCAR",
- "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00008*/POSCAR"]
- ],
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "model":{
- "_comment": " model parameters",
- "type_map":["Al"],
- "descriptor":{
- "type": "se_a",
- "sel": [300],
- "rcut_smth": 2.00,
- "rcut": 8.00,
- "neuron": [240, 240, 240],
- "resnet_dt": true,
- "axis_neuron": 12,
- "seed": 1
-},
- "fitting_net":{
- "neuron": [25, 50, 100],
- "resnet_dt": false,
- "sedd": 1
-}},
- "learning_rate":{
- "type": "exp",
- "start_lr": 0.001,
- "decay_steps": 2000,
- "decay_rate": 0.95
-},
- "loss":{
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0
-},
- "training":{
- "coord_norm": true,
- "type_fitting_net": false,
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 20000,
- "batch_size": 1,
- "seed": 0,
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 4,
- "save_freq": 2000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
- "_comment": "that's all"}
- },
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.20,
- "model_devi_clean_traj": false,
- "model_devi_jobs":
-[
- {
- "_idx": 0,
- "ensemble": "npt",
- "nsteps": 1000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 0,
- 8,
- 16
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 1,
- "ensemble": "npt",
- "nsteps": 1000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 1,
- 9,
- 17
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 2,
- "ensemble": "npt",
- "nsteps": 3000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 2,
- 10,
- 18
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 3,
- "ensemble": "npt",
- "nsteps": 3000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 3,
- 11,
- 19
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 4,
- "ensemble": "npt",
- "nsteps": 3000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 4,
- 12,
- 20
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 5,
- "ensemble": "npt",
- "nsteps": 3000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 5,
- 13,
- 21
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 6,
- "ensemble": "npt",
- "nsteps": 3000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 6,
- 14,
- 22
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 7,
- "ensemble": "npt",
- "nsteps": 3000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 7,
- 15,
- 23
- ],
- "temps": [
- 50,
- 132.0,
- 198.0,
- 264.0
- ],
- "trj_freq": 10
- },
- {
- "_idx": 8,
- "ensemble": "npt",
- "nsteps": 1000,
- "press": [
- 1.0,
- 10.0,
- 100.0,
- 1000.0,
- 5000.0,
- 10000.0,
- 20000.0,
- 50000.0
- ],
- "sys_idx": [
- 0,
- 8,
- 16
- ],
- "temps": [
- 330.0,
- 396.0,
- 462.0,
- 528.0,
- 594.0
- ],
- "trj_freq": 10
- }
-],
-
-
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 300,
- "fp_task_min": 5,
- "fp_pp_path": "/data1/yfb222333/2_dpgen_gpu_multi/POTCAR-Al",
- "fp_pp_files": ["POTCAR"],
- "fp_incar": "/data1/yfb222333/2_dpgen_gpu_multi/INCAR_metal_scf_gpu",
- "_comment": " that's all "
-}
diff --git a/examples/run/dp1.x_lammps_gaussian/dodecane/dodecane.json b/examples/run/dp1.x_lammps_gaussian/dodecane/dodecane.json
deleted file mode 100644
index b6f80d142..000000000
--- a/examples/run/dp1.x_lammps_gaussian/dodecane/dodecane.json
+++ /dev/null
@@ -1,84 +0,0 @@
-{
- "type_map": ["C", "H"],
- "mass_map": [12.011, 1.008],
- "init_data_prefix": "/home/jzzeng/0719dodecane/gen/",
- "init_data_sys": ["init_data"],
- "sys_configs": [
- ["/home/jzzeng/0719dodecane/gen/data.dodecane.atomic"]
- ],
- "sys_format":"lammps/lmp",
- "numb_models": 4,
- "default_training_param" : {
- "model":{
- "type_map": ["C","H"],
- "descriptor":{
- "type":"se_a",
- "sel": [40, 80],
- "rcut_smth": 1.00,
- "rcut": 6.00,
- "neuron": [25, 50, 100],
- "resnet_dt": false,
- "axis_neuron": 12
- },
- "fitting_net":{
- "neuron": [240, 240, 240],
- "resnet_dt": true
- }
- },
- "learning_rate":{
- "type": "exp",
- "start_lr": 0.001,
- "decay_steps": 400,
- "decay_rate": 0.99
- },
- "loss":{
- "start_pref_e": 0.02,
- "limit_pref_e": 1,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0,
- "start_pref_pf": 0,
- "limit_pref_pf": 0
- },
- "training":{
- "set_prefix": "set",
- "stop_batch": 400000,
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 1,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json"
- }
- },
- "use_clusters": true,
- "cluster_cutoff": 3.5,
- "cluster_minify": true,
- "use_relative": true,
- "epsilon": 1.0,
- "model_devi_dt": 0.0001,
- "model_devi_skip": 100,
- "model_devi_f_trust_lo": 0.20,
- "model_devi_f_trust_hi": 0.45,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {"sys_idx": [0], "temps": [ 3000], "trj_freq": 10, "nsteps": 2000, "ensemble": "nvt", "_idx": "00"},
- {"sys_idx": [0], "temps": [ 3000], "trj_freq": 10, "nsteps": 4000, "ensemble": "nvt", "_idx": "01"},
- {"sys_idx": [0], "temps": [ 3000], "trj_freq": 10, "nsteps": 8000, "ensemble": "nvt", "_idx": "02"},
- {"sys_idx": [0], "temps": [ 3000], "trj_freq": 10, "nsteps": 16000, "ensemble": "nvt", "_idx": "03"}
- ],
- "fp_style": "gaussian",
- "shuffle_poscar": false,
- "fp_task_max": 1000,
- "fp_task_min": 10,
- "fp_params": {
- "keywords": "force mn15/6-31g**",
- "nproc": 4,
- "multiplicity": "auto"
- }
-}
diff --git a/examples/run/dp2.x-gromacs-gaussian/param.json b/examples/run/dp2.x-gromacs-gaussian/param.json
index 86561e34a..3371cda38 100644
--- a/examples/run/dp2.x-gromacs-gaussian/param.json
+++ b/examples/run/dp2.x-gromacs-gaussian/param.json
@@ -1,157 +1,281 @@
{
- "type_map": ["H", "C", "N", "O", "F", "S", "Cl"],
- "mass_map": [2, 12, 14, 16, 17, 32, 35],
- "init_data_prefix": "/path/to/init/data",
- "init_data_sys": ["data.init"],
- "sys_configs_prefix": "/path/to/model/devi/data",
- "sys_configs": [
- ["model_devi/CHEMBL3402749_500"],
- ["model_devi/CHEMBL3402741_400"],
- ["model_devi/CHEMBL3402748_5300"],
- ["model_devi/CHEMBL3402743_42"],
- ["model_devi/CHEMBL3402761_1"],
- ["model_devi/CHEMBL3402756_2.7"],
- ["model_devi/CHEMBL3402750_400"],
- ["model_devi/CHEMBL3402764_90"],
- ["model_devi/CHEMBL3402758_10"],
- ["model_devi/CHEMBL3402754_40"],
- ["model_devi/CHEMBL3402747_3400"],
- ["model_devi/CHEMBL3402762_1"],
- ["model_devi/CHEMBL3402744_300"],
- ["model_devi/CHEMBL3402752_30000"],
- ["model_devi/CHEMBL3402742_23"],
- ["model_devi/CHEMBL3402759_5.7"],
- ["model_devi/CHEMBL3402745_200"],
- ["model_devi/CHEMBL3402757_6.5"],
- ["model_devi/CHEMBL3402755_4200"],
- ["model_devi/CHEMBL3402751_2100"],
- ["model_devi/CHEMBL3402753_200"],
- ["model_devi/CHEMBL3402763_90"],
- ["model_devi/CHEMBL3402765_11-charged-pKa-8.1"],
- ["model_devi/CHEMBL3402760_1"]
- ],
- "sys_charges": [
- 0,
- 1,
- 0,
- 1,
- 0,
- 1,
- 0,
- 1,
- 1,
- 0,
- 0,
- 1,
- 0,
- 0,
- 1,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 1,
- 1,
- 1
- ],
- "sys_format": "gromacs/gro",
- "numb_models": 4,
- "training_reuse_iter": 1,
- "training_reuse_old_ratio": 0.3,
- "training_reuse_start_lr": 0.0001,
- "training_reuse_decay_steps": 500,
- "training_reuse_numb_steps": 200000,
- "training_reuse_start_pref_e": 1,
- "training_reuse_start_pref_f": 100,
- "train_param": "input.json",
- "default_training_param": {
- "model": {
- "type_map": ["H", "C", "N", "O", "F", "S", "Cl"],
- "descriptor": {
- "type": "se_e2_a",
- "sel": [40, 48, 48, 48, 48, 48, 48],
- "rcut_smth": 0.50,
- "rcut": 6.00,
- "neuron": [25, 50, 100],
- "resnet_dt": false,
- "axis_neuron": 16,
- "type_one_side": true
- },
- "fitting_net": {
- "neuron": [240, 240, 240],
- "resnet_dt": true,
- "type": "ener"
- }
+ "type_map": [
+ "H",
+ "C",
+ "N",
+ "O",
+ "F",
+ "S",
+ "Cl"
+ ],
+ "mass_map": [
+ 2,
+ 12,
+ 14,
+ 16,
+ 17,
+ 32,
+ 35
+ ],
+ "init_data_prefix": "/path/to/init/data",
+ "init_data_sys": [
+ "data.init"
+ ],
+ "sys_configs_prefix": "/path/to/model/devi/data",
+ "sys_configs": [
+ [
+ "model_devi/CHEMBL3402749_500"
+ ],
+ [
+ "model_devi/CHEMBL3402741_400"
+ ],
+ [
+ "model_devi/CHEMBL3402748_5300"
+ ],
+ [
+ "model_devi/CHEMBL3402743_42"
+ ],
+ [
+ "model_devi/CHEMBL3402761_1"
+ ],
+ [
+ "model_devi/CHEMBL3402756_2.7"
+ ],
+ [
+ "model_devi/CHEMBL3402750_400"
+ ],
+ [
+ "model_devi/CHEMBL3402764_90"
+ ],
+ [
+ "model_devi/CHEMBL3402758_10"
+ ],
+ [
+ "model_devi/CHEMBL3402754_40"
+ ],
+ [
+ "model_devi/CHEMBL3402747_3400"
+ ],
+ [
+ "model_devi/CHEMBL3402762_1"
+ ],
+ [
+ "model_devi/CHEMBL3402744_300"
+ ],
+ [
+ "model_devi/CHEMBL3402752_30000"
+ ],
+ [
+ "model_devi/CHEMBL3402742_23"
+ ],
+ [
+ "model_devi/CHEMBL3402759_5.7"
+ ],
+ [
+ "model_devi/CHEMBL3402745_200"
+ ],
+ [
+ "model_devi/CHEMBL3402757_6.5"
+ ],
+ [
+ "model_devi/CHEMBL3402755_4200"
+ ],
+ [
+ "model_devi/CHEMBL3402751_2100"
+ ],
+ [
+ "model_devi/CHEMBL3402753_200"
+ ],
+ [
+ "model_devi/CHEMBL3402763_90"
+ ],
+ [
+ "model_devi/CHEMBL3402765_11-charged-pKa-8.1"
+ ],
+ [
+ "model_devi/CHEMBL3402760_1"
+ ]
+ ],
+ "sys_charges": [
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 1,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 1,
+ 1,
+ 1
+ ],
+ "sys_format": "gromacs/gro",
+ "numb_models": 4,
+ "training_reuse_iter": 1,
+ "training_reuse_old_ratio": 0.3,
+ "training_reuse_start_lr": 0.0001,
+ "training_reuse_decay_steps": 500,
+ "training_reuse_numb_steps": 200000,
+ "training_reuse_start_pref_e": 1,
+ "training_reuse_start_pref_f": 100,
+ "train_param": "input.json",
+ "default_training_param": {
+ "model": {
+ "type_map": [
+ "H",
+ "C",
+ "N",
+ "O",
+ "F",
+ "S",
+ "Cl"
+ ],
+ "descriptor": {
+ "type": "se_e2_a",
+ "sel": [
+ 40,
+ 48,
+ 48,
+ 48,
+ 48,
+ 48,
+ 48
+ ],
+ "rcut_smth": 0.5,
+ "rcut": 6.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 16,
+ "type_one_side": true
+ },
+ "fitting_net": {
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true,
+ "type": "ener"
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "start_lr": 0.001,
+ "decay_steps": 5000
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 8,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0
+ },
+ "training": {
+ "numb_steps": 1000000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt"
+ }
},
- "learning_rate": {
- "type": "exp",
- "start_lr": 0.001,
- "decay_steps": 5000
+ "model_devi_engine": "gromacs",
+ "gromacs_settings": {
+ "mdp_filename": "md.mdp",
+ "topol_filename": "processed.top",
+ "conf_filename": "npt.gro",
+ "index_filename": "index.raw",
+ "ref_filename": "em.tpr",
+ "model_devi_script": "model_devi.py",
+ "traj_filename": "deepmd_traj.gro",
+ "group_name": "Other"
},
- "loss": {
- "start_pref_e": 0.02,
- "limit_pref_e": 8,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0
- },
- "training": {
- "numb_steps": 1000000,
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 1,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt"
- }
- },
- "model_devi_engine": "gromacs",
- "gromacs_settings": {
- "mdp_filename": "md.mdp",
- "topol_filename": "processed.top",
- "conf_filename": "npt.gro",
- "index_filename": "index.raw",
- "ref_filename": "em.tpr",
- "model_devi_script": "model_devi.py",
- "traj_filename": "deepmd_traj.gro",
- "group_name": "Other"
- },
- "model_devi_dt": 0.001,
- "model_devi_f_trust_lo": 0.20,
- "model_devi_f_trust_hi": 0.60,
- "model_devi_clean_traj": false,
- "model_devi_skip": 0,
- "model_devi_nopbc": true,
- "model_devi_activation_func": [
- ["tanh", "tanh"],
- ["tanh", "tanh"],
- ["tanh", "tanh"],
- ["tanh", "tanh"]
- ],
- "model_devi_jobs": [
- {
- "_idx": 0,
- "ensemble": "nvt",
- "nsteps": 100,
- "press": [],
- "sys_idx": [ 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23],
- "temps": [],
- "trj_freq": 1
+ "model_devi_dt": 0.001,
+ "model_devi_f_trust_lo": 0.2,
+ "model_devi_f_trust_hi": 0.6,
+ "model_devi_clean_traj": false,
+ "model_devi_skip": 0,
+ "model_devi_nopbc": true,
+ "model_devi_activation_func": [
+ [
+ "tanh",
+ "tanh"
+ ],
+ [
+ "tanh",
+ "tanh"
+ ],
+ [
+ "tanh",
+ "tanh"
+ ],
+ [
+ "tanh",
+ "tanh"
+ ]
+ ],
+ "model_devi_jobs": [
+ {
+ "_idx": 0,
+ "ensemble": "nvt",
+ "nsteps": 100,
+ "press": [],
+ "sys_idx": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+ 11,
+ 12,
+ 13,
+ 14,
+ 15,
+ 16,
+ 17,
+ 18,
+ 19,
+ 20,
+ 21,
+ 22,
+ 23
+ ],
+ "temps": [],
+ "trj_freq": 1
+ }
+ ],
+ "fp_style": "gaussian",
+ "shuffle_poscar": false,
+ "fp_task_max": 50,
+ "fp_task_min": 1,
+ "fp_pp_path": "./",
+ "fp_pp_files": [],
+ "fp_params": {
+ "keywords": "force m062x/6-31** nosymm",
+ "nproc": 28,
+ "multiplicity": 1
}
- ],
- "fp_style": "gaussian",
- "shuffle_poscar": false,
- "fp_task_max": 50,
- "fp_task_min": 1,
- "fp_pp_path": "./",
- "fp_pp_files": [],
- "fp_params": {
- "keywords": "force m062x/6-31** nosymm",
- "nproc": 28,
- "multiplicity": 1
- }
}
diff --git a/examples/run/dp2.x-lammps-ABACUS-lcao-dpks/methane/machine.json b/examples/run/dp2.x-lammps-ABACUS-lcao-dpks/methane/machine.json
new file mode 100644
index 000000000..0ff483640
--- /dev/null
+++ b/examples/run/dp2.x-lammps-ABACUS-lcao-dpks/methane/machine.json
@@ -0,0 +1,85 @@
+{
+ "api_version": "1.0",
+ "train": [
+ {
+ "command": "dp",
+ "machine": {
+ "batch_type": "PBS",
+ "context_type": "SSHContext",
+ "local_root": "./",
+ "remote_root": "/home/user1234/work_path_dpdispatcher_test",
+ "remote_profile": {
+ "hostname": "39.xxx.xx.xx",
+ "username": "user1234"
+ }
+ },
+ "resources": {
+ "number_node": 1,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "T4_4_15",
+ "group_size": 1,
+ "custom_flags": [
+ "#SBATCH --mem=32G"
+ ],
+ "strategy": {
+ "if_cuda_multi_devices": true
+ },
+ "para_deg": 3,
+ "source_list": [
+ "/home/user1234/deepmd.1.2.4.env"
+ ]
+ }
+ }
+ ],
+ "model_devi": [
+ {
+ "command": "lmp",
+ "machine": {
+ "batch_type": "PBS",
+ "context_type": "SSHContext",
+ "local_root": "./",
+ "remote_root": "/home/user1234/work_path_dpdispatcher_test",
+ "remote_profile": {
+ "hostname": "39.xxx.xx.xx",
+ "username": "user1234"
+ }
+ },
+ "resources": {
+ "number_node": 1,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "T4_4_15",
+ "group_size": 5,
+ "source_list": [
+ "/home/user1234/deepmd.1.2.4.env"
+ ]
+ }
+ }
+ ],
+ "fp": [
+ {
+ "command": "ABACUS.mpi",
+ "machine": {
+ "batch_type": "PBS",
+ "context_type": "SSHContext",
+ "local_root": "./",
+ "remote_root": "/home/user1234/work_path_dpdispatcher_test",
+ "remote_profile": {
+ "hostname": "39.xxx.xx.xx",
+ "username": "user1234"
+ }
+ },
+ "resources": {
+ "number_node": 1,
+ "cpu_per_node": 32,
+ "gpu_per_node": 0,
+ "queue_name": "G_32_128",
+ "group_size": 1,
+ "source_list": [
+ "~/abacus.env"
+ ]
+ }
+ }
+ ]
+}
diff --git a/examples/run/dp2.x-lammps-ABACUS-lcao-dpks/methane/param.json b/examples/run/dp2.x-lammps-ABACUS-lcao-dpks/methane/param.json
new file mode 100644
index 000000000..6f99f4ae2
--- /dev/null
+++ b/examples/run/dp2.x-lammps-ABACUS-lcao-dpks/methane/param.json
@@ -0,0 +1,171 @@
+{
+ "type_map": [
+ "H",
+ "C"
+ ],
+ "mass_map": [
+ 1.0,
+ 12.0
+ ],
+ "_comment1": "initial data set for Training and the number of frames in each training batch",
+ "init_data_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run_abacus/",
+ "init_data_sys": [
+ "abacus_init_data"
+ ],
+ "init_batch_size": [
+ 8
+ ],
+ "_comment2": "configurations for starting MD in Exploration and batch sizes when traning snapshots derived from these configs (if they were selected)",
+ "sys_configs_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run",
+ "sys_configs": [
+ [
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000000/POSCAR",
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000001/POSCAR",
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000[2-9]/POSCAR"
+ ],
+ [
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 8,
+ 8
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "type_map": [
+ "H",
+ "C"
+ ],
+ "descriptor": {
+ "type": "se_a",
+ "sel": [
+ 16,
+ 4
+ ],
+ "rcut_smth": 0.5,
+ "rcut": 5.0,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 12,
+ "seed": 0
+ },
+ "fitting_net": {
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true,
+ "coord_norm": true,
+ "type_fitting_net": false,
+ "seed": 0
+ }
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0
+ },
+ "learning_rate": {
+ "type": "exp",
+ "start_lr": 0.001,
+ "decay_steps": 180,
+ "stop_lr": 0.0005655675757628467
+ },
+ "training": {
+ "numb_steps": 2000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "_comment4": "that's all",
+ "training_data": {
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
+ },
+ "_comment5": " 01.model_devi ",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1
+ ],
+ "temps": [
+ 150
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 9000,
+ "ensemble": "nvt",
+ "_idx": "01"
+ }
+ ],
+ "_comment6": " 02.fp ",
+ "fp_style": "abacus",
+ "shuffle_poscar": false,
+ "fp_task_max": 50,
+ "fp_task_min": 8,
+ "fp_pp_path": "./",
+ "fp_pp_files": [
+ "H_ONCV_PBE-1.0.upf",
+ "C_ONCV_PBE-1.0.upf"
+ ],
+ "fp_orb_files": [
+ "H_gga_8au_60Ry_2s1p.orb",
+ "C_gga_8au_60Ry_2s2p1d.orb"
+ ],
+ "fp_dpks_descriptor": "jle.orb",
+ "user_fp_params": {
+ "ntype": 2,
+ "cal_force": 1,
+ "cal_stress": 1,
+ "deepks_model": "model.ptg",
+ "deepks_out_labels": 1,
+ "basis_type": "lcao",
+ "gamma_only": 1,
+ "ecutwfc": 80,
+ "mixing_type": "pulay",
+ "mixing_beta": 0.4,
+ "symmetry": 1,
+ "nbands": 5,
+ "nspin": 1,
+ "smearing_method": "fixed"
+ }
+}
diff --git a/examples/run/dp2.x-lammps-ABACUS-lcao/fcc-al/machine.json b/examples/run/dp2.x-lammps-ABACUS-lcao/fcc-al/machine.json
index 21d234673..92e6fba99 100644
--- a/examples/run/dp2.x-lammps-ABACUS-lcao/fcc-al/machine.json
+++ b/examples/run/dp2.x-lammps-ABACUS-lcao/fcc-al/machine.json
@@ -1,103 +1,105 @@
{
- "api_version": "1.0",
- "deepmd_version": "2.0.1",
- "train" :
- {
- "command": "dp",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": 0,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "00*/train.log",
- "grouped":true,
- "job_name": "dpgen_train_job",
- "disk_size": 200,
- "scass_type":"",
- "checkpoint_files":["00*/checkpoint","00*/model.ckpt*"],
- "checkpoint_time":30,
- "platform": "",
- "region":"",
- "image_name":"",
- "on_demand":0
+ "api_version": "1.0",
+ "deepmd_version": "2.0.1",
+ "train": {
+ "command": "dp",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "00*/train.log",
+ "grouped": true,
+ "job_name": "dpgen_train_job",
+ "disk_size": 200,
+ "scass_type": "",
+ "checkpoint_files": [
+ "00*/checkpoint",
+ "00*/model.ckpt*"
+ ],
+ "checkpoint_time": 30,
+ "platform": "",
+ "region": "",
+ "image_name": "",
+ "on_demand": 0
+ }
}
+ },
+ "resources": {
+ "batch_type": "Lebesgue",
+ "group_size": 1
}
- },
- "resources": {
- "batch_type": "Lebesgue",
- "group_size": 1
- }
},
- "model_devi":
- {
- "command": "lmp -i input.lammps -v restart 0",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": 0,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "*/model_devi.log",
- "grouped":true,
- "job_name": "dpgen_model_devi_job",
- "disk_size": 200,
- "scass_type":"",
- "platform": "",
- "region":"",
- "image_name":"",
- "checkpoint_files": "sync_files",
- "checkpoint_time":30,
- "on_demand":0
+ "model_devi": {
+ "command": "lmp -i input.lammps -v restart 0",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "*/model_devi.log",
+ "grouped": true,
+ "job_name": "dpgen_model_devi_job",
+ "disk_size": 200,
+ "scass_type": "",
+ "platform": "",
+ "region": "",
+ "image_name": "",
+ "checkpoint_files": "sync_files",
+ "checkpoint_time": 30,
+ "on_demand": 0
+ }
}
+ },
+ "resources": {
+ "batch_type": "Lebesgue",
+ "group_size": 50
}
- },
- "resources": {
- "batch_type": "Lebesgue",
- "group_size": 50
- }
},
- "fp":
- {
- "command": "OMP_NUM_THREADS=1 mpirun -n 8 abacus",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": 0,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "task*/fp.log",
- "grouped":true,
- "job_name": "dpgen_fp_job",
- "disk_size": 100,
- "checkpoint_files": "sync_files",
- "checkpoint_time":30,
- "scass_type":"",
- "platform": "",
- "image_name":"",
- "on_demand":0
+ "fp": {
+ "command": "OMP_NUM_THREADS=1 mpirun -n 8 abacus",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "task*/fp.log",
+ "grouped": true,
+ "job_name": "dpgen_fp_job",
+ "disk_size": 100,
+ "checkpoint_files": "sync_files",
+ "checkpoint_time": 30,
+ "scass_type": "",
+ "platform": "",
+ "image_name": "",
+ "on_demand": 0
+ }
}
+ },
+ "resources": {
+ "batch_type": "Lebesgue",
+ "group_size": 50,
+ "source_list": [
+ ""
+ ]
}
- },
- "resources": {
- "batch_type": "Lebesgue",
- "group_size": 50,
- "source_list": [""]
- }
}
}
diff --git a/examples/run/dp2.x-lammps-ABACUS-lcao/fcc-al/run_param.json b/examples/run/dp2.x-lammps-ABACUS-lcao/fcc-al/run_param.json
index cdfc177a7..59b0f22c9 100644
--- a/examples/run/dp2.x-lammps-ABACUS-lcao/fcc-al/run_param.json
+++ b/examples/run/dp2.x-lammps-ABACUS-lcao/fcc-al/run_param.json
@@ -9,14 +9,14 @@
"init_data_sys": [
"Al.STRU.02x01x01/02.md/sys-0008/deepmd"
],
- "sys_format":"abacus/stru",
+ "sys_format": "abacus/stru",
"sys_configs_prefix": "./",
"sys_configs": [
[
"Al.STRU.02x01x01/01.scale_pert/sys-0008/scale*/00000*/STRU"
]
],
- "_comment": " that's all ",
+ "_comment1": " that's all ",
"numb_models": 4,
"default_training_param": {
"model": {
@@ -66,14 +66,13 @@
"stop_batch": 20000,
"disp_file": "lcurve.out",
"disp_freq": 1000,
- "numb_test": 4,
"save_freq": 1000,
"save_ckpt": "model.ckpt",
"disp_training": true,
"time_training": true,
"profiling": false,
"profiling_file": "timeline.json",
- "_comment": "that's all"
+ "_comment2": "that's all"
}
},
"model_devi_dt": 0.002,
@@ -82,29 +81,69 @@
"model_devi_f_trust_hi": 0.15,
"model_devi_clean_traj": false,
"model_devi_jobs": [
- { "sys_idx": [0], "temps": [100], "press": [1.0], "trj_freq": 10,"nsteps": 300, "ensemble": "nvt", "_idx": "00"},
- { "sys_idx": [0], "temps": [100, 300], "press": [1.0, 100.0], "trj_freq": 10,"nsteps": 300, "ensemble": "nvt", "_idx": "01"}
-
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 300,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 100,
+ 300
+ ],
+ "press": [
+ 1.0,
+ 100.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 300,
+ "ensemble": "nvt",
+ "_idx": "01"
+ }
],
"fp_style": "abacus",
"shuffle_poscar": false,
"fp_task_max": 20,
"fp_task_min": 5,
"fp_pp_path": "./",
- "fp_pp_files": ["Al_ONCV_PBE-1.0.upf"],
- "fp_orb_files": ["Al_gga_9au_100Ry_4s4p1d.orb"],
- "k_points": [1,1,1,0,0,0],
- "user_fp_params":{
- "ntype": 1,
- "symmetry": 0,
- "basis_type": "lcao",
- "ecutwfc": 100,
- "scf_thr": 1e-8,
- "scf_nmax": 100,
- "smearing_method": "gauss",
- "smearing_sigma": 0.002,
- "mixing_type": "pulay",
- "mixing_beta": 0.3,
- "cal_force": 1
- }
+ "fp_pp_files": [
+ "Al_ONCV_PBE-1.0.upf"
+ ],
+ "fp_orb_files": [
+ "Al_gga_9au_100Ry_4s4p1d.orb"
+ ],
+ "k_points": [
+ 1,
+ 1,
+ 1,
+ 0,
+ 0,
+ 0
+ ],
+ "user_fp_params": {
+ "ntype": 1,
+ "symmetry": 0,
+ "basis_type": "lcao",
+ "ecutwfc": 100,
+ "scf_thr": 1e-08,
+ "scf_nmax": 100,
+ "smearing_method": "gauss",
+ "smearing_sigma": 0.002,
+ "mixing_type": "pulay",
+ "mixing_beta": 0.3,
+ "cal_force": 1
+ }
}
diff --git a/examples/run/dp2.x-lammps-ABACUS-pw/fcc-al/machine.json b/examples/run/dp2.x-lammps-ABACUS-pw/fcc-al/machine.json
index 21d234673..92e6fba99 100644
--- a/examples/run/dp2.x-lammps-ABACUS-pw/fcc-al/machine.json
+++ b/examples/run/dp2.x-lammps-ABACUS-pw/fcc-al/machine.json
@@ -1,103 +1,105 @@
{
- "api_version": "1.0",
- "deepmd_version": "2.0.1",
- "train" :
- {
- "command": "dp",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": 0,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "00*/train.log",
- "grouped":true,
- "job_name": "dpgen_train_job",
- "disk_size": 200,
- "scass_type":"",
- "checkpoint_files":["00*/checkpoint","00*/model.ckpt*"],
- "checkpoint_time":30,
- "platform": "",
- "region":"",
- "image_name":"",
- "on_demand":0
+ "api_version": "1.0",
+ "deepmd_version": "2.0.1",
+ "train": {
+ "command": "dp",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "00*/train.log",
+ "grouped": true,
+ "job_name": "dpgen_train_job",
+ "disk_size": 200,
+ "scass_type": "",
+ "checkpoint_files": [
+ "00*/checkpoint",
+ "00*/model.ckpt*"
+ ],
+ "checkpoint_time": 30,
+ "platform": "",
+ "region": "",
+ "image_name": "",
+ "on_demand": 0
+ }
}
+ },
+ "resources": {
+ "batch_type": "Lebesgue",
+ "group_size": 1
}
- },
- "resources": {
- "batch_type": "Lebesgue",
- "group_size": 1
- }
},
- "model_devi":
- {
- "command": "lmp -i input.lammps -v restart 0",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": 0,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "*/model_devi.log",
- "grouped":true,
- "job_name": "dpgen_model_devi_job",
- "disk_size": 200,
- "scass_type":"",
- "platform": "",
- "region":"",
- "image_name":"",
- "checkpoint_files": "sync_files",
- "checkpoint_time":30,
- "on_demand":0
+ "model_devi": {
+ "command": "lmp -i input.lammps -v restart 0",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "*/model_devi.log",
+ "grouped": true,
+ "job_name": "dpgen_model_devi_job",
+ "disk_size": 200,
+ "scass_type": "",
+ "platform": "",
+ "region": "",
+ "image_name": "",
+ "checkpoint_files": "sync_files",
+ "checkpoint_time": 30,
+ "on_demand": 0
+ }
}
+ },
+ "resources": {
+ "batch_type": "Lebesgue",
+ "group_size": 50
}
- },
- "resources": {
- "batch_type": "Lebesgue",
- "group_size": 50
- }
},
- "fp":
- {
- "command": "OMP_NUM_THREADS=1 mpirun -n 8 abacus",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": 0,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "task*/fp.log",
- "grouped":true,
- "job_name": "dpgen_fp_job",
- "disk_size": 100,
- "checkpoint_files": "sync_files",
- "checkpoint_time":30,
- "scass_type":"",
- "platform": "",
- "image_name":"",
- "on_demand":0
+ "fp": {
+ "command": "OMP_NUM_THREADS=1 mpirun -n 8 abacus",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "task*/fp.log",
+ "grouped": true,
+ "job_name": "dpgen_fp_job",
+ "disk_size": 100,
+ "checkpoint_files": "sync_files",
+ "checkpoint_time": 30,
+ "scass_type": "",
+ "platform": "",
+ "image_name": "",
+ "on_demand": 0
+ }
}
+ },
+ "resources": {
+ "batch_type": "Lebesgue",
+ "group_size": 50,
+ "source_list": [
+ ""
+ ]
}
- },
- "resources": {
- "batch_type": "Lebesgue",
- "group_size": 50,
- "source_list": [""]
- }
}
}
diff --git a/examples/run/dp2.x-lammps-ABACUS-pw/fcc-al/run_param.json b/examples/run/dp2.x-lammps-ABACUS-pw/fcc-al/run_param.json
index 1c492b309..e295f1db0 100644
--- a/examples/run/dp2.x-lammps-ABACUS-pw/fcc-al/run_param.json
+++ b/examples/run/dp2.x-lammps-ABACUS-pw/fcc-al/run_param.json
@@ -9,7 +9,7 @@
"init_data_sys": [
"Al.STRU.02x01x01/02.md/sys-0008/deepmd"
],
- "sys_format":"abacus/stru",
+ "sys_format": "abacus/stru",
"sys_configs_prefix": "./",
"sys_configs": [
[
@@ -19,7 +19,7 @@
"Al.STRU.02x01x01/01.scale_pert/sys-0008/scale*/000010/STRU"
]
],
- "_comment": " 00.train ",
+ "_comment1": " 00.train ",
"numb_models": 4,
"default_training_param": {
"model": {
@@ -69,17 +69,16 @@
"stop_batch": 20000,
"disp_file": "lcurve.out",
"disp_freq": 1000,
- "numb_test": 4,
"save_freq": 1000,
"save_ckpt": "model.ckpt",
"disp_training": true,
"time_training": true,
"profiling": false,
"profiling_file": "timeline.json",
- "_comment": "that's all"
+ "_comment2": "that's all"
}
},
- "_comment": "01.model_devi ",
+ "_comment3": "01.model_devi ",
"model_devi_dt": 0.002,
"model_devi_skip": 0,
"model_devi_f_trust_lo": 0.05,
diff --git a/examples/run/dp2.x-lammps-ABACUS-pw/methane/machine.json b/examples/run/dp2.x-lammps-ABACUS-pw/methane/machine.json
new file mode 100644
index 000000000..0ff483640
--- /dev/null
+++ b/examples/run/dp2.x-lammps-ABACUS-pw/methane/machine.json
@@ -0,0 +1,85 @@
+{
+ "api_version": "1.0",
+ "train": [
+ {
+ "command": "dp",
+ "machine": {
+ "batch_type": "PBS",
+ "context_type": "SSHContext",
+ "local_root": "./",
+ "remote_root": "/home/user1234/work_path_dpdispatcher_test",
+ "remote_profile": {
+ "hostname": "39.xxx.xx.xx",
+ "username": "user1234"
+ }
+ },
+ "resources": {
+ "number_node": 1,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "T4_4_15",
+ "group_size": 1,
+ "custom_flags": [
+ "#SBATCH --mem=32G"
+ ],
+ "strategy": {
+ "if_cuda_multi_devices": true
+ },
+ "para_deg": 3,
+ "source_list": [
+ "/home/user1234/deepmd.1.2.4.env"
+ ]
+ }
+ }
+ ],
+ "model_devi": [
+ {
+ "command": "lmp",
+ "machine": {
+ "batch_type": "PBS",
+ "context_type": "SSHContext",
+ "local_root": "./",
+ "remote_root": "/home/user1234/work_path_dpdispatcher_test",
+ "remote_profile": {
+ "hostname": "39.xxx.xx.xx",
+ "username": "user1234"
+ }
+ },
+ "resources": {
+ "number_node": 1,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "T4_4_15",
+ "group_size": 5,
+ "source_list": [
+ "/home/user1234/deepmd.1.2.4.env"
+ ]
+ }
+ }
+ ],
+ "fp": [
+ {
+ "command": "ABACUS.mpi",
+ "machine": {
+ "batch_type": "PBS",
+ "context_type": "SSHContext",
+ "local_root": "./",
+ "remote_root": "/home/user1234/work_path_dpdispatcher_test",
+ "remote_profile": {
+ "hostname": "39.xxx.xx.xx",
+ "username": "user1234"
+ }
+ },
+ "resources": {
+ "number_node": 1,
+ "cpu_per_node": 32,
+ "gpu_per_node": 0,
+ "queue_name": "G_32_128",
+ "group_size": 1,
+ "source_list": [
+ "~/abacus.env"
+ ]
+ }
+ }
+ ]
+}
diff --git a/examples/run/dp2.x-lammps-ABACUS-pw/methane/param.json b/examples/run/dp2.x-lammps-ABACUS-pw/methane/param.json
new file mode 100644
index 000000000..d0ebc40a0
--- /dev/null
+++ b/examples/run/dp2.x-lammps-ABACUS-pw/methane/param.json
@@ -0,0 +1,162 @@
+{
+ "type_map": [
+ "H",
+ "C"
+ ],
+ "mass_map": [
+ 1.0,
+ 12.0
+ ],
+ "_comment1": "initial data set for Training and the number of frames in each training batch",
+ "init_data_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run_abacus/",
+ "init_data_sys": [
+ "abacus_init_data"
+ ],
+ "init_batch_size": [
+ 8
+ ],
+ "_comment2": "configurations for starting MD in Exploration and batch sizes when traning snapshots derived from these configs (if they were selected)",
+ "sys_configs_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run",
+ "sys_configs": [
+ [
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000000/POSCAR",
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000001/POSCAR",
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000[2-9]/POSCAR"
+ ],
+ [
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 8,
+ 8
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "type_map": [
+ "H",
+ "C"
+ ],
+ "descriptor": {
+ "type": "se_a",
+ "sel": [
+ 16,
+ 4
+ ],
+ "rcut_smth": 0.5,
+ "rcut": 5.0,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 12,
+ "seed": 0
+ },
+ "fitting_net": {
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true,
+ "coord_norm": true,
+ "type_fitting_net": false,
+ "seed": 0
+ }
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0
+ },
+ "learning_rate": {
+ "type": "exp",
+ "start_lr": 0.001,
+ "decay_steps": 180,
+ "stop_lr": 0.0005655675757628467
+ },
+ "training": {
+ "numb_steps": 2000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "_comment4": "that's all",
+ "training_data": {
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
+ },
+ "_comment5": " 01.model_devi ",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "01"
+ }
+ ],
+ "_comment6": " 02.fp ",
+ "fp_style": "abacus",
+ "shuffle_poscar": false,
+ "fp_task_max": 30,
+ "fp_task_min": 8,
+ "fp_pp_path": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/SG15_ONCV_v1.0_upf",
+ "fp_pp_files": [
+ "H_ONCV_PBE-1.0.upf",
+ "C_ONCV_PBE-1.0.upf"
+ ],
+ "user_fp_params": {
+ "ntype": 2,
+ "ecutwfc": 80,
+ "mixing_type": "pulay",
+ "mixing_beta": 0.4,
+ "symmetry": 1,
+ "nbands": 5,
+ "nspin": 1,
+ "ks_solver": "cg",
+ "smearing": "fixed",
+ "sigma": 0.001
+ }
+}
diff --git a/examples/run/dp2.x-lammps-cp2k/methane/param-ch4.json b/examples/run/dp2.x-lammps-cp2k/methane/param-ch4.json
new file mode 100644
index 000000000..9f998fb46
--- /dev/null
+++ b/examples/run/dp2.x-lammps-cp2k/methane/param-ch4.json
@@ -0,0 +1,138 @@
+{
+ "type_map": [
+ "H",
+ "C"
+ ],
+ "mass_map": [
+ 1,
+ 12
+ ],
+ "init_data_prefix": "/data/ybzhuang/methane-dpgen/dpgen-tutorial-2020-08-23/dpgen-tutorial-mathane/data",
+ "init_data_sys": [
+ "deepmd"
+ ],
+ "init_batch_size": [
+ 8
+ ],
+ "sys_configs": [
+ [
+ "/data/ybzhuang/methane-dpgen/dpgen-tutorial-2020-08-23/dpgen-tutorial-mathane/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000*/POSCAR"
+ ],
+ [
+ "/data/ybzhuang/methane-dpgen/dpgen-tutorial-2020-08-23/dpgen-tutorial-mathane/data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000*/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 8,
+ 8,
+ 8,
+ 8
+ ],
+ "_comment1": " that's all ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "type": "se_a",
+ "sel": [
+ 16,
+ 4
+ ],
+ "rcut_smth": 0.5,
+ "rcut": 5.0,
+ "_comment2": "modify according your system",
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 12,
+ "seed": 1
+ },
+ "fitting_net": {
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true,
+ "seed": 1
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "start_lr": 0.001,
+ "decay_steps": 100,
+ "_comment3": "nope",
+ "stop_lr": 0.0003584859224085419
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "stop_batch": 2000,
+ "seed": 1,
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
+ },
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": true,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 300,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "01"
+ }
+ ],
+ "fp_style": "cp2k",
+ "shuffle_poscar": false,
+ "fp_task_max": 20,
+ "fp_task_min": 5,
+ "external_input_path": "/data/ybzhuang/methane-dpgen/dpgen-tutorial-2020-08-23/dpgen-tutorial-mathane/cp2k_dpgen/template.inp"
+}
diff --git a/examples/run/dp1.x-lammps-cp2k/methane/template.inp b/examples/run/dp2.x-lammps-cp2k/methane/template.inp
similarity index 100%
rename from examples/run/dp1.x-lammps-cp2k/methane/template.inp
rename to examples/run/dp2.x-lammps-cp2k/methane/template.inp
diff --git a/examples/run/dp2.x-lammps-cp2k/param_CH4_deepmd-kit-2.0.1.json b/examples/run/dp2.x-lammps-cp2k/param_CH4_deepmd-kit-2.0.1.json
index df596a6d1..7c7f5acbb 100644
--- a/examples/run/dp2.x-lammps-cp2k/param_CH4_deepmd-kit-2.0.1.json
+++ b/examples/run/dp2.x-lammps-cp2k/param_CH4_deepmd-kit-2.0.1.json
@@ -19,7 +19,7 @@
"./data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
]
],
- "_comment": " that's all ",
+ "_comment1": " that's all ",
"numb_models": 4,
"default_training_param": {
"model": {
@@ -73,14 +73,13 @@
"_batch_size": 1,
"disp_file": "lcurve.out",
"disp_freq": 1000,
- "numb_test": 4,
"save_freq": 1000,
"save_ckpt": "model.ckpt",
"disp_training": true,
"time_training": true,
"profiling": false,
"profiling_file": "timeline.json",
- "_comment": "that's all"
+ "_comment2": "that's all"
}
},
"model_devi_dt": 0.002,
@@ -119,24 +118,32 @@
"ensemble": "nvt",
"_idx": "01"
}
-
],
- "ratio_failed": 0.20,
+ "ratio_failed": 0.2,
"fp_style": "cp2k",
"shuffle_poscar": false,
"fp_task_max": 30,
"fp_task_min": 1,
- "user_fp_params": {
- "FORCE_EVAL":{
- "DFT":{
+ "user_fp_params": {
+ "FORCE_EVAL": {
+ "DFT": {
"BASIS_SET_FILE_NAME": "BASIS_MOLOPT",
"POTENTIAL_FILE_NAME": "GTH_POTENTIALS"
},
- "SUBSYS":{
- "KIND":{
- "_": ["C","H"],
- "POTENTIAL": ["GTH-PBE-q4", "GTH-PBE-q1"],
- "BASIS_SET": ["DZVP-MOLOPT-GTH","DZVP-MOLOPT-GTH"]
+ "SUBSYS": {
+ "KIND": {
+ "_": [
+ "C",
+ "H"
+ ],
+ "POTENTIAL": [
+ "GTH-PBE-q4",
+ "GTH-PBE-q1"
+ ],
+ "BASIS_SET": [
+ "DZVP-MOLOPT-GTH",
+ "DZVP-MOLOPT-GTH"
+ ]
}
}
}
diff --git a/examples/run/dp2.x-lammps-gaussian/machine.json b/examples/run/dp2.x-lammps-gaussian/machine.json
index f9f19c37a..450baa944 100644
--- a/examples/run/dp2.x-lammps-gaussian/machine.json
+++ b/examples/run/dp2.x-lammps-gaussian/machine.json
@@ -1,109 +1,111 @@
{
- "api_version": "1.0",
- "deepmd_version": "2.1.0",
- "train" :
- {
- "command": "dp",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "xxx",
- "password": "xxx",
- "program_id": 123,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "00*/train.log",
- "grouped":true,
- "job_name": "dpgen_train_job",
- "disk_size": 100,
- "scass_type":"c4_m15_1 * NVIDIA T4",
- "checkpoint_files":["00*/checkpoint","00*/model.ckpt*"],
- "checkpoint_time":30,
- "platform": "ali",
- "image_name":"LBG_DeePMD-kit_2.1.0_v1",
- "on_demand":0
+ "api_version": "1.0",
+ "deepmd_version": "2.1.0",
+ "train": {
+ "command": "dp",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "xxx",
+ "password": "xxx",
+ "program_id": 123,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "00*/train.log",
+ "grouped": true,
+ "job_name": "dpgen_train_job",
+ "disk_size": 100,
+ "scass_type": "c4_m15_1 * NVIDIA T4",
+ "checkpoint_files": [
+ "00*/checkpoint",
+ "00*/model.ckpt*"
+ ],
+ "checkpoint_time": 30,
+ "platform": "ali",
+ "image_name": "LBG_DeePMD-kit_2.1.0_v1",
+ "on_demand": 0
+ }
}
+ },
+ "resources": {
+ "batch_type": "Lebesgue",
+ "number_node": 1,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "T4_4_15",
+ "group_size": 1
}
- },
- "resources": {
- "batch_type": "Lebesgue",
- "number_node": 1,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "T4_4_15",
- "group_size": 1
- }
},
- "model_devi":
- {
- "command": "lmp",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "xxx",
- "password": "xxx",
- "program_id": 123,
- "keep_backup":true,
- "input_data":{
- "job_type": "indicate",
- "log_file": "*/model_devi.log",
- "grouped":true,
- "job_name": "dpgen_model_devi_job",
- "disk_size": 200,
- "scass_type":"c4_m15_1 * NVIDIA T4",
- "platform": "ali",
- "image_name":"LBG_DeePMD-kit_2.1.0_v1",
- "on_demand":0
+ "model_devi": {
+ "command": "lmp",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "xxx",
+ "password": "xxx",
+ "program_id": 123,
+ "keep_backup": true,
+ "input_data": {
+ "job_type": "indicate",
+ "log_file": "*/model_devi.log",
+ "grouped": true,
+ "job_name": "dpgen_model_devi_job",
+ "disk_size": 200,
+ "scass_type": "c4_m15_1 * NVIDIA T4",
+ "platform": "ali",
+ "image_name": "LBG_DeePMD-kit_2.1.0_v1",
+ "on_demand": 0
+ }
}
+ },
+ "resources": {
+ "batch_type": "Lebesgue",
+ "number_node": 1,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "T4_4_15",
+ "group_size": 50
}
- },
- "resources": {
- "batch_type": "Lebesgue",
- "number_node": 1,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "T4_4_15",
- "group_size": 50
- }
},
- "fp":
- {
- "command": "g09 < input > output ||:",
- "machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "xxx",
- "password": "xxx",
- "program_id": 123,
- "input_data":{
- "api_version":2,
- "job_type": "indicate",
- "log_file": "task*/fp.log",
- "grouped":true,
- "job_name": "dpgen_fp_job",
- "disk_size": 100,
- "scass_type":"c16_m32_cpu",
- "platform": "ali",
- "image_name":"LBG_Gaussian_09_v2",
- "on_demand":0
+ "fp": {
+ "command": "g09 < input > output ||:",
+ "machine": {
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "xxx",
+ "password": "xxx",
+ "program_id": 123,
+ "input_data": {
+ "api_version": 2,
+ "job_type": "indicate",
+ "log_file": "task*/fp.log",
+ "grouped": true,
+ "job_name": "dpgen_fp_job",
+ "disk_size": 100,
+ "scass_type": "c16_m32_cpu",
+ "platform": "ali",
+ "image_name": "LBG_Gaussian_09_v2",
+ "on_demand": 0
+ }
}
+ },
+ "resources": {
+ "batch_type": "Lebesgue",
+ "source_list": [
+ "/root/g09.sh"
+ ],
+ "number_node": 1,
+ "cpu_per_node": 16,
+ "gpu_per_node": 0,
+ "queue_name": "CPU",
+ "group_size": 10
}
- },
- "resources": {
- "batch_type": "Lebesgue",
- "source_list": ["/root/g09.sh"],
- "number_node": 1,
- "cpu_per_node": 16,
- "gpu_per_node": 0,
- "queue_name": "CPU",
- "group_size": 10
- }
}
}
diff --git a/examples/run/dp2.x-lammps-gaussian/param_C4H16N4_deepmd-kit-2.0.1.json b/examples/run/dp2.x-lammps-gaussian/param_C4H16N4_deepmd-kit-2.0.1.json
index 4f422fe73..5dac25455 100644
--- a/examples/run/dp2.x-lammps-gaussian/param_C4H16N4_deepmd-kit-2.0.1.json
+++ b/examples/run/dp2.x-lammps-gaussian/param_C4H16N4_deepmd-kit-2.0.1.json
@@ -11,17 +11,29 @@
],
"init_data_prefix": "./data/deepmd/",
"init_data_sys": [
- "data.000","data.001","data.002","data.003","data.004","data.005"
+ "data.000",
+ "data.001",
+ "data.002",
+ "data.003",
+ "data.004",
+ "data.005"
+ ],
+ "init_batch_size": [
+ "auto",
+ "auto",
+ "auto",
+ "auto",
+ "auto",
+ "auto"
],
- "init_batch_size": ["auto","auto","auto","auto","auto","auto"],
"sys_configs": [
[
"./data/md_sys/data.ch4n2"
]
],
- "_comment": " that's all ",
+ "_comment1": " that's all ",
"numb_models": 4,
- "sys_format":"lammps/lmp",
+ "sys_format": "lammps/lmp",
"default_training_param": {
"model": {
"type_map": [
@@ -74,14 +86,13 @@
"_batch_size": 1,
"disp_file": "lcurve.out",
"disp_freq": 1000,
- "numb_test": 4,
"save_freq": 1000,
"save_ckpt": "model.ckpt",
"disp_training": true,
"time_training": true,
"profiling": false,
"profiling_file": "timeline.json",
- "_comment": "that's all"
+ "_comment2": "that's all"
}
},
"model_devi_dt": 0.002,
@@ -120,21 +131,20 @@
"ensemble": "nvt",
"_idx": "01"
}
-
],
"use_clusters": true,
"cluster_cutoff": 5.0,
"cluster_minify": true,
"use_relative": true,
"epsilon": 1.0,
- "ratio_failed": 0.20,
+ "ratio_failed": 0.2,
"fp_style": "gaussian",
"shuffle_poscar": false,
"fp_task_max": 20,
"fp_task_min": 5,
- "fp_params":{
- "keywords": "force B3LYP 6-31g(d,p) nosymm",
- "nproc":2 ,
- "multiplicity": "auto"
+ "fp_params": {
+ "keywords": "force B3LYP 6-31g(d,p) nosymm",
+ "nproc": 2,
+ "multiplicity": "auto"
}
}
diff --git a/examples/run/dp2.x-lammps-vasp-et/param_elet.json b/examples/run/dp2.x-lammps-vasp-et/param_elet.json
new file mode 100644
index 000000000..92c34262a
--- /dev/null
+++ b/examples/run/dp2.x-lammps-vasp-et/param_elet.json
@@ -0,0 +1,131 @@
+{
+ "type_map": [
+ "Al",
+ "Mg"
+ ],
+ "mass_map": [
+ 27,
+ 24
+ ],
+ "use_ele_temp": 2,
+ "init_data_prefix": "/home/wanghan/study/deep.md/data/almgop.20/init//",
+ "init_data_sys": [
+ "al.fcc.01x01x01/02.md/sys-0004/deepmd",
+ "mg.fcc.01x01x01/02.md/sys-0004/deepmd"
+ ],
+ "sys_configs": [
+ [
+ "/home/wanghan/study/deep.md/data/almgop.20/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR"
+ ],
+ [
+ "/home/wanghan/study/deep.md/data/almgop.20/init/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR"
+ ]
+ ],
+ "_comment1": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "_comment2": " model parameters",
+ "model": {
+ "descriptor": {
+ "type": "se_a",
+ "sel": [
+ 90,
+ 90
+ ],
+ "rcut_smth": 1.8,
+ "rcut": 6.0,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 4,
+ "seed": 1
+ },
+ "fitting_net": {
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true,
+ "numb_fparam": 10,
+ "seed": 1
+ }
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 1,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0
+ },
+ "learning_rate": {
+ "start_lr": 0.001,
+ "decay_steps": 5000,
+ "stop_lr": 0.0009897937816869885
+ },
+ "_comment3": " traing controls",
+ "training": {
+ "stop_batch": 1000,
+ "seed": 1,
+ "_comment4": " display and restart",
+ "_comment5": " frequencies counted in batch",
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ },
+ "_comment6": "that's all"
+ },
+ "_comment7": " 01.model_devi ",
+ "_comment8": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.2,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "_idx": 0,
+ "ensemble": "npt",
+ "nsteps": 50,
+ "press": [
+ 1.0,
+ 2.0
+ ],
+ "sys_idx": [
+ 0,
+ 1
+ ],
+ "temps": [
+ 50,
+ 100
+ ],
+ "trj_freq": 10
+ }
+ ],
+ "_comment9": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 8,
+ "fp_task_min": 2,
+ "fp_pp_path": "/home/wanghan/study/deep.md/dpgen/almg/vasp",
+ "fp_pp_files": [
+ "POTCAR.Al",
+ "POTCAR.Mg"
+ ],
+ "fp_incar": "/home/wanghan/study/deep.md/dpgen/almg/vasp/INCAR",
+ "_comment10": " that's all "
+}
diff --git a/examples/run/dp2.x-lammps-vasp/Al/param_al_all_gpu-deepmd-kit-2.x.json b/examples/run/dp2.x-lammps-vasp/Al/param_al_all_gpu-deepmd-kit-2.x.json
new file mode 100644
index 000000000..25c5f6b2a
--- /dev/null
+++ b/examples/run/dp2.x-lammps-vasp/Al/param_al_all_gpu-deepmd-kit-2.x.json
@@ -0,0 +1,430 @@
+{
+ "type_map": [
+ "Al"
+ ],
+ "mass_map": [
+ 27
+ ],
+ "init_data_prefix": "/data1/yfb222333/2_dpgen_gpu_multi/init/",
+ "init_data_sys": [
+ "al.fcc.02x02x02/02.md/sys-0032/deepmd",
+ "al.hcp.02x02x02/02.md/sys-0016/deepmd",
+ "al.bcc.02x02x02/02.md/sys-0016/deepmd"
+ ],
+ "sys_configs": [
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[5-9]/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00001*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00002*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00003*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00004*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00005*/POSCAR",
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00006*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00007*/POSCAR",
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00008*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[0-4]/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[5-9]/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00001*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00002*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00003*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00004*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00005*/POSCAR",
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00006*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00007*/POSCAR",
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00008*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[0-4]/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[5-9]/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00001*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00002*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00003*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00004*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00005*/POSCAR",
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00006*/POSCAR"
+ ],
+ [
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00007*/POSCAR",
+ "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00008*/POSCAR"
+ ]
+ ],
+ "_comment1": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "_comment2": " model parameters",
+ "type_map": [
+ "Al"
+ ],
+ "descriptor": {
+ "type": "se_a",
+ "sel": [
+ 300
+ ],
+ "rcut_smth": 2.0,
+ "rcut": 8.0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true,
+ "axis_neuron": 12,
+ "seed": 1
+ },
+ "fitting_net": {
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "resnet_dt": false,
+ "sedd": 1
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "start_lr": 0.001,
+ "decay_steps": 2000,
+ "stop_lr": 0.0005987369392383787
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "coord_norm": true,
+ "type_fitting_net": false,
+ "_comment3": " traing controls",
+ "stop_batch": 20000,
+ "seed": 0,
+ "_comment4": " display and restart",
+ "_comment5": " frequencies counted in batch",
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 2000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "_comment6": "that's all",
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
+ },
+ "_comment7": " 01.model_devi ",
+ "_comment8": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.2,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "_idx": 0,
+ "ensemble": "npt",
+ "nsteps": 1000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 0,
+ 8,
+ 16
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 1,
+ "ensemble": "npt",
+ "nsteps": 1000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 1,
+ 9,
+ 17
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 2,
+ "ensemble": "npt",
+ "nsteps": 3000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 2,
+ 10,
+ 18
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 3,
+ "ensemble": "npt",
+ "nsteps": 3000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 3,
+ 11,
+ 19
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 4,
+ "ensemble": "npt",
+ "nsteps": 3000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 4,
+ 12,
+ 20
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 5,
+ "ensemble": "npt",
+ "nsteps": 3000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 5,
+ 13,
+ 21
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 6,
+ "ensemble": "npt",
+ "nsteps": 3000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 6,
+ 14,
+ 22
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 7,
+ "ensemble": "npt",
+ "nsteps": 3000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 7,
+ 15,
+ 23
+ ],
+ "temps": [
+ 50,
+ 132.0,
+ 198.0,
+ 264.0
+ ],
+ "trj_freq": 10
+ },
+ {
+ "_idx": 8,
+ "ensemble": "npt",
+ "nsteps": 1000,
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 5000.0,
+ 10000.0,
+ 20000.0,
+ 50000.0
+ ],
+ "sys_idx": [
+ 0,
+ 8,
+ 16
+ ],
+ "temps": [
+ 330.0,
+ 396.0,
+ 462.0,
+ 528.0,
+ 594.0
+ ],
+ "trj_freq": 10
+ }
+ ],
+ "_comment9": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 300,
+ "fp_task_min": 5,
+ "fp_pp_path": "/data1/yfb222333/2_dpgen_gpu_multi/POTCAR-Al",
+ "fp_pp_files": [
+ "POTCAR"
+ ],
+ "fp_incar": "/data1/yfb222333/2_dpgen_gpu_multi/INCAR_metal_scf_gpu",
+ "_comment10": " that's all "
+}
diff --git a/examples/run/dp1.x-lammps-vasp/CH4/INCAR_methane b/examples/run/dp2.x-lammps-vasp/CH4/INCAR_methane
similarity index 100%
rename from examples/run/dp1.x-lammps-vasp/CH4/INCAR_methane
rename to examples/run/dp2.x-lammps-vasp/CH4/INCAR_methane
diff --git a/examples/run/dp1.x-lammps-vasp/CH4/POT_C b/examples/run/dp2.x-lammps-vasp/CH4/POT_C
similarity index 100%
rename from examples/run/dp1.x-lammps-vasp/CH4/POT_C
rename to examples/run/dp2.x-lammps-vasp/CH4/POT_C
diff --git a/examples/run/dp1.x-lammps-vasp/CH4/POT_H b/examples/run/dp2.x-lammps-vasp/CH4/POT_H
similarity index 100%
rename from examples/run/dp1.x-lammps-vasp/CH4/POT_H
rename to examples/run/dp2.x-lammps-vasp/CH4/POT_H
diff --git a/examples/run/dp1.x-lammps-vasp/CH4/param_CH4_deepmd-kit-1.1.0.json b/examples/run/dp2.x-lammps-vasp/CH4/param_CH4_deepmd-kit-2.x.json
similarity index 89%
rename from examples/run/dp1.x-lammps-vasp/CH4/param_CH4_deepmd-kit-1.1.0.json
rename to examples/run/dp2.x-lammps-vasp/CH4/param_CH4_deepmd-kit-2.x.json
index 7925ce3ee..5c094f0fb 100644
--- a/examples/run/dp1.x-lammps-vasp/CH4/param_CH4_deepmd-kit-1.1.0.json
+++ b/examples/run/dp2.x-lammps-vasp/CH4/param_CH4_deepmd-kit-2.x.json
@@ -20,7 +20,7 @@
"CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00001*/POSCAR"
]
],
- "_comment": " that's all ",
+ "_comment1": " that's all ",
"numb_models": 4,
"default_training_param": {
"model": {
@@ -59,7 +59,7 @@
"type": "exp",
"start_lr": 0.001,
"decay_steps": 100,
- "decay_rate": 0.95
+ "stop_lr": 0.0003584859224085419
},
"loss": {
"start_pref_e": 0.02,
@@ -70,20 +70,20 @@
"limit_pref_v": 0.0
},
"training": {
- "set_prefix": "set",
"stop_batch": 2000,
- "batch_size": 1,
"disp_file": "lcurve.out",
"disp_freq": 1000,
- "numb_test": 4,
"save_freq": 1000,
"save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
"disp_training": true,
"time_training": true,
"profiling": false,
"profiling_file": "timeline.json",
- "_comment": "that's all"
+ "_comment2": "that's all",
+ "training_data": {
+ "set_prefix": "set",
+ "batch_size": 1
+ }
}
},
"model_devi_dt": 0.002,
@@ -132,6 +132,6 @@
"POTCAR_H",
"POTCAR_C"
],
- "_comments" : "We can only provide empty files in public, you should provide valid POTCARS yourself when running DP-GEN",
+ "_comments": "We can only provide empty files in public, you should provide valid POTCARS yourself when running DP-GEN",
"fp_incar": "/data1/yfb222333/2_dpgen_gpu_multi/INCAR_methane"
}
diff --git a/examples/run/dp2.x-lammps-vasp/param_CH4_deepmd-kit-2.0.1.json b/examples/run/dp2.x-lammps-vasp/param_CH4_deepmd-kit-2.0.1.json
index b732f34e9..a59f44f9f 100644
--- a/examples/run/dp2.x-lammps-vasp/param_CH4_deepmd-kit-2.0.1.json
+++ b/examples/run/dp2.x-lammps-vasp/param_CH4_deepmd-kit-2.0.1.json
@@ -20,7 +20,7 @@
"CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00001*/POSCAR"
]
],
- "_comment": " that's all ",
+ "_comment1": " that's all ",
"numb_models": 4,
"default_training_param": {
"model": {
@@ -74,14 +74,13 @@
"batch_size": 1,
"disp_file": "lcurve.out",
"disp_freq": 1000,
- "numb_test": 4,
"save_freq": 1000,
"save_ckpt": "model.ckpt",
"disp_training": true,
"time_training": true,
"profiling": false,
"profiling_file": "timeline.json",
- "_comment": "that's all"
+ "_comment2": "that's all"
}
},
"model_devi_dt": 0.002,
diff --git a/examples/run/dp2.x_lammps_gaussian/dodecane/dodecane.json b/examples/run/dp2.x_lammps_gaussian/dodecane/dodecane.json
new file mode 100644
index 000000000..e28574bb9
--- /dev/null
+++ b/examples/run/dp2.x_lammps_gaussian/dodecane/dodecane.json
@@ -0,0 +1,152 @@
+{
+ "type_map": [
+ "C",
+ "H"
+ ],
+ "mass_map": [
+ 12.011,
+ 1.008
+ ],
+ "init_data_prefix": "/home/jzzeng/0719dodecane/gen/",
+ "init_data_sys": [
+ "init_data"
+ ],
+ "sys_configs": [
+ [
+ "/home/jzzeng/0719dodecane/gen/data.dodecane.atomic"
+ ]
+ ],
+ "sys_format": "lammps/lmp",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "type_map": [
+ "C",
+ "H"
+ ],
+ "descriptor": {
+ "type": "se_a",
+ "sel": [
+ 40,
+ 80
+ ],
+ "rcut_smth": 1.0,
+ "rcut": 6.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 12
+ },
+ "fitting_net": {
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "start_lr": 0.001,
+ "decay_steps": 400,
+ "stop_lr": 4.317124741065782e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 1,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0,
+ "start_pref_pf": 0,
+ "limit_pref_pf": 0
+ },
+ "training": {
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "training_data": {
+ "set_prefix": "set"
+ }
+ }
+ },
+ "use_clusters": true,
+ "cluster_cutoff": 3.5,
+ "cluster_minify": true,
+ "use_relative": true,
+ "epsilon": 1.0,
+ "model_devi_dt": 0.0001,
+ "model_devi_skip": 100,
+ "model_devi_f_trust_lo": 0.2,
+ "model_devi_f_trust_hi": 0.45,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 3000
+ ],
+ "trj_freq": 10,
+ "nsteps": 2000,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 3000
+ ],
+ "trj_freq": 10,
+ "nsteps": 4000,
+ "ensemble": "nvt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 3000
+ ],
+ "trj_freq": 10,
+ "nsteps": 8000,
+ "ensemble": "nvt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 3000
+ ],
+ "trj_freq": 10,
+ "nsteps": 16000,
+ "ensemble": "nvt",
+ "_idx": "03"
+ }
+ ],
+ "fp_style": "gaussian",
+ "shuffle_poscar": false,
+ "fp_task_max": 1000,
+ "fp_task_min": 10,
+ "fp_params": {
+ "keywords": "force mn15/6-31g**",
+ "nproc": 4,
+ "multiplicity": "auto"
+ }
+}
diff --git a/examples/simplify-MAPbI3-scan-lebesgue/simplify_example/machine.json b/examples/simplify-MAPbI3-scan-lebesgue/simplify_example/machine.json
index ae25aa061..967735fb5 100644
--- a/examples/simplify-MAPbI3-scan-lebesgue/simplify_example/machine.json
+++ b/examples/simplify-MAPbI3-scan-lebesgue/simplify_example/machine.json
@@ -1,113 +1,115 @@
{
"api_version": "1.0",
- "_comment": "dependent on dpdispatcher 0.4.15",
- "train" :
- {
+ "_comment1": "dependent on dpdispatcher 0.4.15",
+ "train": {
"command": "dp",
"machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": 0,
- "input_data":{
- "api_version":2,
- "job_type": "indicate",
- "log_file": "00*/lcurve.out",
- "grouped": true,
- "job_name": "simplify_MAPbI3-scan_train_job",
- "disk_size": 100,
- "scass_type":"c8_m32_1 * NVIDIA V100",
- "platform": "ali",
- "checkpoint_files": ["00*/model.ckpt*", "00*/checkpoint"],
- "checkpoint_time": 15,
- "image_name":"LBG_DeePMD-kit_2.1.1_v1.1",
- "on_demand":0
- }
- }
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "input_data": {
+ "api_version": 2,
+ "job_type": "indicate",
+ "log_file": "00*/lcurve.out",
+ "grouped": true,
+ "job_name": "simplify_MAPbI3-scan_train_job",
+ "disk_size": 100,
+ "scass_type": "c8_m32_1 * NVIDIA V100",
+ "platform": "ali",
+ "checkpoint_files": [
+ "00*/model.ckpt*",
+ "00*/checkpoint"
+ ],
+ "checkpoint_time": 15,
+ "image_name": "LBG_DeePMD-kit_2.1.1_v1.1",
+ "on_demand": 0
+ }
+ }
},
"resources": {
- "batch_type": "Lebesgue",
- "number_node": 15,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "V100_8_32",
- "group_size": 1
+ "batch_type": "Lebesgue",
+ "number_node": 15,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "V100_8_32",
+ "group_size": 1
}
- },
- "model_devi":
- {
+ },
+ "model_devi": {
"command": "dp",
"machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": 0,
- "input_data":{
- "api_version":2,
- "job_type": "indicate",
- "log_file": "cubic-*/*/md.log",
- "grouped": true,
- "job_name": "MAPbI3-scan_md_job",
- "disk_size": 100,
- "scass_type":"c8_m32_1 * NVIDIA V100",
- "platform": "ali",
- "checkpoint_files": "sync_files",
- "checkpoint_time": 15,
- "image_name":"LBG_DeePMD-kit_2.1.1_v1.1",
- "on_demand":0
- }
- }
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "input_data": {
+ "api_version": 2,
+ "job_type": "indicate",
+ "log_file": "cubic-*/*/md.log",
+ "grouped": true,
+ "job_name": "MAPbI3-scan_md_job",
+ "disk_size": 100,
+ "scass_type": "c8_m32_1 * NVIDIA V100",
+ "platform": "ali",
+ "checkpoint_files": "sync_files",
+ "checkpoint_time": 15,
+ "image_name": "LBG_DeePMD-kit_2.1.1_v1.1",
+ "on_demand": 0
+ }
+ }
},
"resources": {
- "batch_type": "Lebesgue",
- "number_node": 15,
- "cpu_per_node": 4,
- "gpu_per_node": 1,
- "queue_name": "V100_8_32",
- "group_size": 10
+ "batch_type": "Lebesgue",
+ "number_node": 15,
+ "cpu_per_node": 4,
+ "gpu_per_node": 1,
+ "queue_name": "V100_8_32",
+ "group_size": 10
}
- },
- "fp":
- {
+ },
+ "fp": {
"command": "ulimit -m unlimited; ulimit -s unlimited; mpirun -n 32 vasp_std",
"machine": {
- "batch_type": "Lebesgue",
- "context_type": "LebesgueContext",
- "local_root" : "./",
- "remote_profile":{
- "email": "",
- "password": "",
- "program_id": 0,
- "input_data":{
- "api_version":2,
- "job_type": "indicate",
- "log_file": "**/fp.log",
- "grouped": true,
- "job_name": "simplify_MAPbI3-scan_fp_job",
- "disk_size": 100,
- "scass_type":"c32_m64_cpu",
- "platform": "ali",
- "checkpoint_files": "sync_files",
- "checkpoint_time": 15,
- "image_name":"LBG_vasp-5-4-4_v1",
- "on_demand":0
- }
- }
+ "batch_type": "Lebesgue",
+ "context_type": "LebesgueContext",
+ "local_root": "./",
+ "remote_profile": {
+ "email": "",
+ "password": "",
+ "program_id": 0,
+ "input_data": {
+ "api_version": 2,
+ "job_type": "indicate",
+ "log_file": "**/fp.log",
+ "grouped": true,
+ "job_name": "simplify_MAPbI3-scan_fp_job",
+ "disk_size": 100,
+ "scass_type": "c32_m64_cpu",
+ "platform": "ali",
+ "checkpoint_files": "sync_files",
+ "checkpoint_time": 15,
+ "image_name": "LBG_vasp-5-4-4_v1",
+ "on_demand": 0
+ }
+ }
},
"resources": {
- "batch_type": "Lebesgue",
- "number_node": 15,
- "cpu_per_node": 32,
- "gpu_per_node": 0,
- "queue_name": "CPU",
- "group_size": 10,
- "source_list": ["/opt/intel/oneapi/setvars.sh"]
+ "batch_type": "Lebesgue",
+ "number_node": 15,
+ "cpu_per_node": 32,
+ "gpu_per_node": 0,
+ "queue_name": "CPU",
+ "group_size": 10,
+ "source_list": [
+ "/opt/intel/oneapi/setvars.sh"
+ ]
}
- }
- }
+ }
+}
diff --git a/examples/simplify-MAPbI3-scan-lebesgue/simplify_example/simplify.json b/examples/simplify-MAPbI3-scan-lebesgue/simplify_example/simplify.json
index cb5420910..1d664d39b 100644
--- a/examples/simplify-MAPbI3-scan-lebesgue/simplify_example/simplify.json
+++ b/examples/simplify-MAPbI3-scan-lebesgue/simplify_example/simplify.json
@@ -1,94 +1,145 @@
{
- "type_map": ["I","Pb","C","N","H"],
- "mass_map": [126.90447, 207.2, 12.0108, 14.0067, 1.00795],
-
- "pick_data": "../data",
- "init_data_prefix": "",
- "init_data_sys": [],
- "sys_configs": [null],
- "sys_batch_size": [1],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "model_devi_activation_func":[["tanh","tanh"],["tanh","gelu"],["gelu","gelu"],["gelu","tanh"]],
-
- "default_training_param": {
- "model": {
- "type_map": ["I","Pb","C","N","H"],
- "descriptor": {
- "type": "se_e2_a",
- "sel":
+ "type_map": [
+ "I",
+ "Pb",
+ "C",
+ "N",
+ "H"
+ ],
+ "mass_map": [
+ 126.90447,
+ 207.2,
+ 12.0108,
+ 14.0067,
+ 1.00795
+ ],
+ "pick_data": "../data",
+ "init_data_prefix": "",
+ "init_data_sys": [],
+ "sys_configs": [],
+ "sys_batch_size": [
+ 1
+ ],
+ "_comment1": " 00.train ",
+ "numb_models": 4,
+ "model_devi_activation_func": [
[
- 20,
- 8,
- 8,
- 8,
- 48
+ "tanh",
+ "tanh"
],
- "rcut_smth": 2.00,
- "rcut": 6.00,
- "neuron": [25, 50, 100],
- "resnet_dt": false,
- "type_one_side": true,
- "trainable": true,
- "axis_neuron": 12,
- "seed": 0
- },
- "fitting_net": {
- "neuron": [240, 240, 240],
- "resnet_dt": true,
- "trainable": [true, true, true, true],
- "seed": 0
- }
- },
- "loss": {
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 2,
- "start_pref_v": 0.01,
- "limit_pref_v": 1
- },
- "learning_rate": {
- "type": "exp",
- "start_lr": 0.001,
- "decay_steps": 25,
- "decay_rate": 0.95
+ [
+ "tanh",
+ "gelu"
+ ],
+ [
+ "gelu",
+ "gelu"
+ ],
+ [
+ "gelu",
+ "tanh"
+ ]
+ ],
+ "default_training_param": {
+ "model": {
+ "type_map": [
+ "I",
+ "Pb",
+ "C",
+ "N",
+ "H"
+ ],
+ "descriptor": {
+ "type": "se_e2_a",
+ "sel": [
+ 20,
+ 8,
+ 8,
+ 8,
+ 48
+ ],
+ "rcut_smth": 2.0,
+ "rcut": 6.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "resnet_dt": false,
+ "type_one_side": true,
+ "trainable": true,
+ "axis_neuron": 12,
+ "seed": 0
+ },
+ "fitting_net": {
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true,
+ "trainable": [
+ true,
+ true,
+ true,
+ true
+ ],
+ "seed": 0
+ }
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 2,
+ "start_pref_v": 0.01,
+ "limit_pref_v": 1
+ },
+ "learning_rate": {
+ "type": "exp",
+ "start_lr": 0.001,
+ "decay_steps": 25,
+ "stop_lr": 3.505266624882874e-08
+ },
+ "training": {
+ "stop_batch": 5000,
+ "seed": 1,
+ "_comment2": "frequencies counted in batch",
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 10000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "training_data": {
+ "set_prefix": "set",
+ "batch_size": "auto"
+ }
+ }
},
- "training": {
- "set_prefix": "set",
- "stop_batch": 5000,
- "batch_size": "auto",
- "seed": 1,
- "_comment": "frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 4,
- "save_freq": 10000,
- "save_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json"
- }
- },
-
- "_comment": "02.fp",
- "fp_style": "vasp",
- "fp_skip_bad_box": "length_ratio:5;height_ratio:5",
- "fp_accurate_threshold": 0.10,
- "fp_accurate_soft_threshold": 0.00,
- "fp_task_max": 20,
- "fp_task_min": 5,
- "ratio_failed": 0.30,
- "fp_pp_path": "../vasp_inputs/",
- "fp_pp_files": ["POTCAR_I","POTCAR_Pb_d","POTCAR_C","POTCAR_N","POTCAR_H"],
- "fp_incar": "INCAR",
-
- "labeled": false,
- "init_pick_number":5,
- "iter_pick_number":5,
- "model_devi_f_trust_lo":0.30,
- "model_devi_f_trust_hi":100.00,
- "cvasp": false
+ "_comment3": "02.fp",
+ "fp_style": "vasp",
+ "fp_skip_bad_box": "length_ratio:5;height_ratio:5",
+ "fp_accurate_threshold": 0.1,
+ "fp_accurate_soft_threshold": 0.0,
+ "fp_task_max": 20,
+ "fp_task_min": 5,
+ "ratio_failed": 0.3,
+ "fp_pp_path": "../vasp_inputs/",
+ "fp_pp_files": [
+ "POTCAR_I",
+ "POTCAR_Pb_d",
+ "POTCAR_C",
+ "POTCAR_N",
+ "POTCAR_H"
+ ],
+ "fp_incar": "INCAR",
+ "labeled": false,
+ "init_pick_number": 5,
+ "iter_pick_number": 5,
+ "model_devi_f_trust_lo": 0.3,
+ "model_devi_f_trust_hi": 100.0,
+ "cvasp": false
}
diff --git a/examples/simplify/qm7.json b/examples/simplify/qm7.json
index 38ba048c2..dd80c503f 100644
--- a/examples/simplify/qm7.json
+++ b/examples/simplify/qm7.json
@@ -16,7 +16,7 @@
"pick_data": "/scratch/jz748/simplify/qm7",
"init_data_prefix": "",
"init_data_sys": [],
- "sys_configs": [null],
+ "sys_configs": [],
"sys_batch_size": [
"auto"
],
@@ -39,8 +39,8 @@
3,
1
],
- "rcut_smth": 1.00,
- "rcut": 6.00,
+ "rcut_smth": 1.0,
+ "rcut": 6.0,
"neuron": [
25,
50,
@@ -62,7 +62,7 @@
"type": "exp",
"start_lr": 0.001,
"decay_steps": 10,
- "decay_rate": 0.99
+ "stop_lr": 4.317124741065782e-08
},
"loss": {
"start_pref_e": 0.02,
@@ -75,19 +75,20 @@
"limit_pref_pf": 0
},
"training": {
- "set_prefix": "set",
"stop_batch": 10000,
"disp_file": "lcurve.out",
"disp_freq": 1000,
- "numb_test": 1,
"save_freq": 1000,
"save_ckpt": "model.ckpt",
"disp_training": true,
"time_training": true,
"profiling": false,
- "profiling_file": "timeline.json"
+ "profiling_file": "timeline.json",
+ "training_data": {
+ "set_prefix": "set"
+ }
},
- "_comment": "that's all"
+ "_comment1": "that's all"
},
"use_clusters": true,
"fp_style": "gaussian",
@@ -97,11 +98,11 @@
"keywords": "mn15/6-31g** force nosymm scf(maxcyc=512)",
"nproc": 28,
"multiplicity": 1,
- "_comment": " that's all "
+ "_comment2": " that's all "
},
- "init_pick_number":100,
- "iter_pick_number":100,
- "model_devi_f_trust_lo":0.10,
- "model_devi_f_trust_hi":0.30,
- "_comment": " that's all "
+ "init_pick_number": 100,
+ "iter_pick_number": 100,
+ "model_devi_f_trust_lo": 0.1,
+ "model_devi_f_trust_hi": 0.3,
+ "_comment3": " that's all "
}
diff --git a/examples/test/deepmd_param.json b/examples/test/deepmd_param.json
index ae920184d..5d04afc66 100644
--- a/examples/test/deepmd_param.json
+++ b/examples/test/deepmd_param.json
@@ -1,5 +1,5 @@
{
- "_comment": "models",
+ "_comment1": "models",
"potcar_map": {
"Al": "/somewhere/example/POTCAR"
},
@@ -7,15 +7,14 @@
"key_id": "key id of Material project",
"task_type": "deepmd",
"task": "all",
-
"vasp_params": {
"ecut": 650,
- "ediff": 1e-6,
+ "ediff": 1e-06,
"kspacing": 0.1,
"kgamma": false,
"npar": 1,
"kpar": 1,
- "_comment": " that's all "
+ "_comment2": " that's all "
},
"lammps_params": {
"model_dir": "somewhere/example/Al_model",
@@ -25,39 +24,39 @@
"model_name": false,
"model_param_type": false
},
- "_comment": "00.equi",
+ "_comment3": "00.equi",
"alloy_shift": false,
- "_comment": "01.eos",
+ "_comment4": "01.eos",
"vol_start": 12,
"vol_end": 22,
"vol_step": 0.5,
- "_comment": "02.elastic",
- "norm_deform": 2e-2,
- "shear_deform": 5e-2,
- "_comment": "03.vacancy",
+ "_comment5": "02.elastic",
+ "norm_deform": 0.02,
+ "shear_deform": 0.05,
+ "_comment6": "03.vacancy",
"supercell": [
3,
3,
3
],
- "_comment": "04.interstitial",
+ "_comment7": "04.interstitial",
"insert_ele": [
"Al"
],
"reprod-opt": false,
- "_comment": "05.surface",
+ "_comment8": "05.surface",
"min_slab_size": 10,
"min_vacuum_size": 11,
- "_comment": "pert xz to work around vasp bug...",
+ "_comment9": "pert xz to work around vasp bug...",
"pert_xz": 0.01,
"max_miller": 2,
"relax_box": false,
- "_comment": "06.phonon",
+ "_comment10": "06.phonon",
"supercell_matrix": [
2,
2,
2
],
"band": "0 1 0 0.5 1 0.5 0.375 0.75 0.375 0 0 0 0.5 0.5 0.5",
- "_comment": "that's all"
+ "_comment11": "that's all"
}
diff --git a/examples/test/meam_param.json b/examples/test/meam_param.json
index 1790bb2a9..7eeec66d2 100644
--- a/examples/test/meam_param.json
+++ b/examples/test/meam_param.json
@@ -1,5 +1,5 @@
{
- "_comment": "models",
+ "_comment1": "models",
"potcar_map": {
"Al": "/somewhere/example/POTCAR"
},
@@ -7,15 +7,14 @@
"key_id": "key id of Material project",
"task_type": "meam",
"task": "all",
-
"vasp_params": {
"ecut": 650,
- "ediff": 1e-6,
+ "ediff": 1e-06,
"kspacing": 0.1,
"kgamma": false,
"npar": 1,
"kpar": 1,
- "_comment": " that's all "
+ "_comment2": " that's all "
},
"lammps_params": {
"model_dir": "somewhere/example/meam",
@@ -38,39 +37,39 @@
"FeS"
]
},
- "_comment": "00.equi",
+ "_comment3": "00.equi",
"alloy_shift": false,
- "_comment": "01.eos",
+ "_comment4": "01.eos",
"vol_start": 12,
"vol_end": 22,
"vol_step": 0.5,
- "_comment": "02.elastic",
- "norm_deform": 2e-2,
- "shear_deform": 5e-2,
- "_comment": "03.vacancy",
+ "_comment5": "02.elastic",
+ "norm_deform": 0.02,
+ "shear_deform": 0.05,
+ "_comment6": "03.vacancy",
"supercell": [
3,
3,
3
],
- "_comment": "04.interstitial",
+ "_comment7": "04.interstitial",
"insert_ele": [
"Al"
],
"reprod-opt": false,
- "_comment": "05.surface",
+ "_comment8": "05.surface",
"min_slab_size": 10,
"min_vacuum_size": 11,
- "_comment": "pert xz to work around vasp bug...",
+ "_comment9": "pert xz to work around vasp bug...",
"pert_xz": 0.01,
"max_miller": 2,
"relax_box": false,
- "_comment": "06.phonon",
+ "_comment10": "06.phonon",
"supercell_matrix": [
2,
2,
2
],
"band": "0 1 0 0.5 1 0.5 0.375 0.75 0.375 0 0 0 0.5 0.5 0.5",
- "_comment": "that's all"
+ "_comment11": "that's all"
}
diff --git a/examples/test/vasp_param.json b/examples/test/vasp_param.json
index d1dfb9a1d..981b78f02 100644
--- a/examples/test/vasp_param.json
+++ b/examples/test/vasp_param.json
@@ -1,55 +1,54 @@
{
- "_comment": "models",
- "potcar_map": {
- "Al": "/somewhere/example/POTCAR"
- },
- "conf_dir": "confs/Al/std-fcc",
- "key_id": "key id of Material project",
- "task_type": "vasp",
- "task": "all",
-
- "vasp_params": {
- "ecut": 650,
- "ediff": 1e-6,
- "kspacing": 0.1,
- "kgamma": false,
- "npar": 1,
- "kpar": 1,
- "_comment": " that's all "
- },
- "_comment": "00.equi",
- "alloy_shift": false,
- "_comment": "01.eos",
- "vol_start": 12,
- "vol_end": 22,
- "vol_step": 0.5,
- "_comment": "02.elastic",
- "norm_deform": 2e-2,
- "shear_deform": 5e-2,
- "_comment": "03.vacancy",
- "supercell": [
- 3,
- 3,
- 3
- ],
- "_comment": "04.interstitial",
- "insert_ele": [
- "Al"
- ],
- "reprod-opt": false,
- "_comment": "05.surface",
- "min_slab_size": 10,
- "min_vacuum_size": 11,
- "_comment": "pert xz to work around vasp bug...",
- "pert_xz": 0.01,
- "max_miller": 2,
- "relax_box": false,
- "_comment": "06.phonon",
- "supercell_matrix": [
- 2,
- 2,
- 2
- ],
- "band": "0 1 0 0.5 1 0.5 0.375 0.75 0.375 0 0 0 0.5 0.5 0.5",
- "_comment": "that's all"
+ "_comment1": "models",
+ "potcar_map": {
+ "Al": "/somewhere/example/POTCAR"
+ },
+ "conf_dir": "confs/Al/std-fcc",
+ "key_id": "key id of Material project",
+ "task_type": "vasp",
+ "task": "all",
+ "vasp_params": {
+ "ecut": 650,
+ "ediff": 1e-06,
+ "kspacing": 0.1,
+ "kgamma": false,
+ "npar": 1,
+ "kpar": 1,
+ "_comment2": " that's all "
+ },
+ "_comment3": "00.equi",
+ "alloy_shift": false,
+ "_comment4": "01.eos",
+ "vol_start": 12,
+ "vol_end": 22,
+ "vol_step": 0.5,
+ "_comment5": "02.elastic",
+ "norm_deform": 0.02,
+ "shear_deform": 0.05,
+ "_comment6": "03.vacancy",
+ "supercell": [
+ 3,
+ 3,
+ 3
+ ],
+ "_comment7": "04.interstitial",
+ "insert_ele": [
+ "Al"
+ ],
+ "reprod-opt": false,
+ "_comment8": "05.surface",
+ "min_slab_size": 10,
+ "min_vacuum_size": 11,
+ "_comment9": "pert xz to work around vasp bug...",
+ "pert_xz": 0.01,
+ "max_miller": 2,
+ "relax_box": false,
+ "_comment10": "06.phonon",
+ "supercell_matrix": [
+ 2,
+ 2,
+ 2
+ ],
+ "band": "0 1 0 0.5 1 0.5 0.375 0.75 0.375 0 0 0 0.5 0.5 0.5",
+ "_comment11": "that's all"
}
diff --git a/examples/test/vasp_param_from_incar.json b/examples/test/vasp_param_from_incar.json
index c5cf91ba4..9acf0928e 100644
--- a/examples/test/vasp_param_from_incar.json
+++ b/examples/test/vasp_param_from_incar.json
@@ -1,5 +1,5 @@
{
- "_comment": "models",
+ "_comment1": "models",
"potcar_map": {
"Al": "/somewhere/example/POTCAR"
},
@@ -7,43 +7,41 @@
"key_id": "key id of Material project",
"task_type": "vasp",
"task": "all",
-
"relax_incar": "somewhere/relax_incar",
"scf_incar": "somewhere/scf_incar",
-
- "_comment": "00.equi",
+ "_comment2": "00.equi",
"alloy_shift": false,
- "_comment": "01.eos",
+ "_comment3": "01.eos",
"vol_start": 12,
"vol_end": 22,
"vol_step": 0.5,
- "_comment": "02.elastic",
- "norm_deform": 2e-2,
- "shear_deform": 5e-2,
- "_comment": "03.vacancy",
+ "_comment4": "02.elastic",
+ "norm_deform": 0.02,
+ "shear_deform": 0.05,
+ "_comment5": "03.vacancy",
"supercell": [
3,
3,
3
],
- "_comment": "04.interstitial",
+ "_comment6": "04.interstitial",
"insert_ele": [
"Al"
],
"reprod-opt": false,
- "_comment": "05.surface",
+ "_comment7": "05.surface",
"min_slab_size": 10,
"min_vacuum_size": 11,
- "_comment": "pert xz to work around vasp bug...",
+ "_comment8": "pert xz to work around vasp bug...",
"pert_xz": 0.01,
"max_miller": 2,
"relax_box": false,
- "_comment": "06.phonon",
+ "_comment9": "06.phonon",
"supercell_matrix": [
2,
2,
2
],
"band": "0 1 0 0.5 1 0.5 0.375 0.75 0.375 0 0 0 0.5 0.5 0.5",
- "_comment": "that's all"
+ "_comment10": "that's all"
}
diff --git a/pyproject.toml b/pyproject.toml
index c893bddd1..4832355af 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -12,7 +12,6 @@ authors = [
]
license = {file = "LICENSE"}
classifiers = [
- "Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
@@ -20,7 +19,7 @@ classifiers = [
]
dependencies = [
'numpy>=1.14.3',
- 'dpdata>=0.2.6,!=0.2.11',
+ 'dpdata>=0.2.16',
'pymatgen>=2022.11.1',
'ase',
'monty>2.0.0',
@@ -29,13 +28,13 @@ dependencies = [
'GromacsWrapper>=0.8.0',
'dpdispatcher>=0.3.11',
'netCDF4',
- 'dargs>=0.2.9',
+ 'dargs>=0.4.0',
'h5py',
'pymatgen-analysis-defects',
'openbabel-wheel',
'packaging',
]
-requires-python = ">=3.8"
+requires-python = ">=3.9"
readme = "README.md"
keywords = ["deep potential generator", "active learning", "deepmd-kit"]
@@ -44,9 +43,33 @@ Homepage = "https://github.com/deepmodeling/dpgen"
documentation = "https://docs.deepmodeling.com/projects/dpgen"
repository = "https://github.com/deepmodeling/dpgen"
-[project.entry-points.console_scripts]
+[project.scripts]
dpgen = "dpgen.main:main"
+[project.entry-points."dpgui"]
+"DP-GEN Run" = "dpgen.generator.arginfo:run_jdata_arginfo"
+"DP-GEN Run Machine" = "dpgen.generator.arginfo:run_jdata_arginfo"
+"DP-GEN Simplify" = "dpgen.simplify.arginfo:simplify_jdata_arginfo"
+"DP-GEN Simplify Machine" = "dpgen.simplify.arginfo:simplify_mdata_arginfo"
+"DP-GEN init_bulk" = "dpgen.data.arginfo:init_bulk_jdata_arginfo"
+"DP-GEN init_bulk Machine" = "dpgen.data.arginfo:init_bulk_mdata_arginfo"
+"DP-GEN init_surf" = "dpgen.data.arginfo:init_surf_jdata_arginfo"
+"DP-GEN init_surf Machine" = "dpgen.data.arginfo:init_surf_mdata_arginfo"
+"DP-GEN init_reaction" = "dpgen.data.arginfo:init_reaction_jdata_arginfo"
+"DP-GEN init_reaction Machine" = "dpgen.data.arginfo:init_reaction_mdata_arginfo"
+
+[project.optional-dependencies]
+test = [
+ "dpgui",
+ "coverage",
+ "pymatgen-analysis-defects<2023.08.22",
+ # To be fixed: https://github.com/Becksteinlab/GromacsWrapper/issues/263
+ 'setuptools; python_version >= "3.12"',
+]
+gui = [
+ "dpgui",
+]
+
[tool.setuptools.packages.find]
include = ["dpgen*"]
@@ -57,7 +80,34 @@ write_to = "dpgen/_version.py"
profile = "black"
[tool.ruff]
-target-version = "py37"
select = [
"I", # isort
+ "E", # errors
+ "F", # pyflakes
+ "D", # pydocstyle
+ "UP", # pyupgrade
+]
+ignore = [
+ "E501", # line too long
+ "F841", # local variable is assigned to but never used
+ "E741", # ambiguous variable name
+ "E402", # module level import not at top of file
+ "D413", # missing blank line after last section
+ "D416", # section name should end with a colon
+ "D203", # 1 blank line required before class docstring
+ "D107", # missing docstring in __init__
+ "D213", # multi-line docstring summary should start at the second line
+ "D100", # TODO: missing docstring in public module
+ "D101", # TODO: missing docstring in public class
+ "D102", # TODO: missing docstring in public method
+ "D103", # TODO: missing docstring in public function
+ "D104", # TODO: missing docstring in public package
+ "D105", # TODO: missing docstring in magic method
+ "D205", # 1 blank line required between summary line and description
+ "D401", # TODO: first line should be in imperative mood
+ "D404", # TODO: first word of the docstring should not be This
]
+ignore-init-module-imports = true
+
+[tool.ruff.pydocstyle]
+convention = "numpy"
diff --git a/tests/auto_test/abacus_input/INPUT.dpks b/tests/auto_test/abacus_input/INPUT.dpks
new file mode 100644
index 000000000..aabc29bbd
--- /dev/null
+++ b/tests/auto_test/abacus_input/INPUT.dpks
@@ -0,0 +1,27 @@
+INPUT_PARAMETERS
+#Parameters (1.General)
+suffix ABACUS
+calculation relax
+symmetry 1
+pseudo_type upf201
+
+#Parameters (2.Iteration)
+ecutwfc 60
+scf_thr 1e-7
+scf_nmax 100
+#Parameters (3.Basis)
+basis_type pw
+
+#Parameters (4.Smearing)
+smearing_method gauss
+smearing_sigma 0.002
+
+#Parameters (5.Mixing)
+mixing_type pulay
+mixing_beta 0.3
+ks_solver cg
+
+cal_stress 1
+kspacing 0.2
+
+deepks_model model.ptg
diff --git a/tests/auto_test/abacus_input/jle.orb b/tests/auto_test/abacus_input/jle.orb
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/auto_test/abacus_input/model.ptg b/tests/auto_test/abacus_input/model.ptg
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/auto_test/confs/fcc-Al-deepks/STRU b/tests/auto_test/confs/fcc-Al-deepks/STRU
new file mode 100644
index 000000000..6642a0474
--- /dev/null
+++ b/tests/auto_test/confs/fcc-Al-deepks/STRU
@@ -0,0 +1,26 @@
+ATOMIC_SPECIES
+Al 26.9815 ./pp_orb/Al_ONCV_PBE-1.0.upf
+
+NUMERICAL_ORBITAL
+pp_orb/Al_gga_9au_100Ry_4s4p1d.orb
+
+LATTICE_CONSTANT
+1.8897261254578281
+
+LATTICE_VECTORS
+4.05 0.0 0.0
+0.0 4.05 0.0
+0.0 0.0 4.05
+
+ATOMIC_POSITIONS
+Cartesian # Cartesian(Unit is LATTICE_CONSTANT)
+Al
+0.0
+4
+0.000000000000 0.000000000000 0.000000000000 1 1 1
+0.000000000000 2.025000000000 2.025000000000 1 1 1
+2.025000000000 0.000000000000 2.025000000000 1 1 1
+2.025000000000 2.025000000000 0.000000000000 1 1 1
+
+NUMERICAL_DESCRIPTOR
+pp_orb/jle.orb
diff --git a/tests/auto_test/context.py b/tests/auto_test/context.py
index 454820555..37f558c74 100644
--- a/tests/auto_test/context.py
+++ b/tests/auto_test/context.py
@@ -2,7 +2,7 @@
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
-from dpgen.auto_test.lib.vasp import *
+from dpgen.auto_test.lib.vasp import * # noqa: F403
def setUpModule():
diff --git a/tests/auto_test/equi/abacus/INPUT.outstru b/tests/auto_test/equi/abacus/INPUT.outstru
new file mode 100644
index 000000000..b081476f3
--- /dev/null
+++ b/tests/auto_test/equi/abacus/INPUT.outstru
@@ -0,0 +1,21 @@
+INPUT_PARAMETERS
+#Parameters (5.Mixing)
+suffix ABACUS
+calculation cell-relax
+symmetry 1
+pseudo_type upf201
+ecutwfc 60
+scf_thr 1e-7
+scf_nmax 100
+basis_type pw
+smearing_method gauss
+smearing_sigma 0.002
+mixing_type pulay
+mixing_beta 0.3
+ks_solver cg
+cal_stress 1
+kspacing 0.2
+relax_nmax 100
+force_thr_ev 0.01
+stress_thr 0.1
+out_stru 1
diff --git a/tests/auto_test/equi/abacus/STRU_ION47_D b/tests/auto_test/equi/abacus/STRU_ION47_D
new file mode 100644
index 000000000..b1e198899
--- /dev/null
+++ b/tests/auto_test/equi/abacus/STRU_ION47_D
@@ -0,0 +1,21 @@
+ATOMIC_SPECIES
+Al 26.9815 ./pp_orb/Al_ONCV_PBE-1.0.upf
+
+LATTICE_CONSTANT
+1.88972612546
+
+LATTICE_VECTORS
+4.01993427025 7.2584598854e-31 7.13301566977e-30 #latvec1
+7.2584598854e-31 4.01993427025 1.22599728095e-29 #latvec2
+7.13301566977e-30 1.22599728095e-29 4.01993427025 #latvec3
+
+ATOMIC_POSITIONS
+Direct
+
+Al #label
+0 #magnetism
+4 #number of atoms
+0 0 0 m 1 1 1
+0 0.5 0.5 m 1 1 1
+0.5 0 0.5 m 1 1 1
+0.5 0.5 0 m 1 1 1
diff --git a/tests/auto_test/equi/abacus/cell-relax.json b/tests/auto_test/equi/abacus/cell-relax.json
index 03d7fcb71..f394f46db 100644
--- a/tests/auto_test/equi/abacus/cell-relax.json
+++ b/tests/auto_test/equi/abacus/cell-relax.json
@@ -4776,4 +4776,4 @@
]
}
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/equi/vasp/Al-fcc.json b/tests/auto_test/equi/vasp/Al-fcc.json
index ad921e693..e0d30e9ab 100644
--- a/tests/auto_test/equi/vasp/Al-fcc.json
+++ b/tests/auto_test/equi/vasp/Al-fcc.json
@@ -267,4 +267,4 @@
]
}
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/equi/vasp/outcar.json b/tests/auto_test/equi/vasp/outcar.json
index 9866ee2d3..48ff14c96 100644
--- a/tests/auto_test/equi/vasp/outcar.json
+++ b/tests/auto_test/equi/vasp/outcar.json
@@ -4668,4 +4668,4 @@
]
}
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/output/gamma_00/task.000000/inter.json b/tests/auto_test/output/gamma_00/task.000000/inter.json
index 052167468..3f046499f 100644
--- a/tests/auto_test/output/gamma_00/task.000000/inter.json
+++ b/tests/auto_test/output/gamma_00/task.000000/inter.json
@@ -5,4 +5,4 @@
"type_map": {
"Mo": 0
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/output/gamma_00/task.000000/miller.json b/tests/auto_test/output/gamma_00/task.000000/miller.json
index 0a6e1ab11..35084a204 100644
--- a/tests/auto_test/output/gamma_00/task.000000/miller.json
+++ b/tests/auto_test/output/gamma_00/task.000000/miller.json
@@ -1 +1,5 @@
-[1, 1, 0]
\ No newline at end of file
+[
+ 1,
+ 1,
+ 0
+]
diff --git a/tests/auto_test/output/gamma_00/task.000000/result_task.json b/tests/auto_test/output/gamma_00/task.000000/result_task.json
index 591103fc6..bcc319404 100644
--- a/tests/auto_test/output/gamma_00/task.000000/result_task.json
+++ b/tests/auto_test/output/gamma_00/task.000000/result_task.json
@@ -10680,4 +10680,4 @@
]
}
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/output/gamma_00/task.000000/task.json b/tests/auto_test/output/gamma_00/task.000000/task.json
index dfe1db76b..b757d2c2f 100644
--- a/tests/auto_test/output/gamma_00/task.000000/task.json
+++ b/tests/auto_test/output/gamma_00/task.000000/task.json
@@ -31,4 +31,4 @@
"relax_shape": false,
"relax_vol": false
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/output/gamma_00/task.000001/inter.json b/tests/auto_test/output/gamma_00/task.000001/inter.json
index 052167468..3f046499f 100644
--- a/tests/auto_test/output/gamma_00/task.000001/inter.json
+++ b/tests/auto_test/output/gamma_00/task.000001/inter.json
@@ -5,4 +5,4 @@
"type_map": {
"Mo": 0
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/output/gamma_00/task.000001/miller.json b/tests/auto_test/output/gamma_00/task.000001/miller.json
index 0a6e1ab11..35084a204 100644
--- a/tests/auto_test/output/gamma_00/task.000001/miller.json
+++ b/tests/auto_test/output/gamma_00/task.000001/miller.json
@@ -1 +1,5 @@
-[1, 1, 0]
\ No newline at end of file
+[
+ 1,
+ 1,
+ 0
+]
diff --git a/tests/auto_test/output/gamma_00/task.000001/result_task.json b/tests/auto_test/output/gamma_00/task.000001/result_task.json
index 50f35afdf..7be63eddc 100644
--- a/tests/auto_test/output/gamma_00/task.000001/result_task.json
+++ b/tests/auto_test/output/gamma_00/task.000001/result_task.json
@@ -10680,4 +10680,4 @@
]
}
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/output/gamma_00/task.000001/task.json b/tests/auto_test/output/gamma_00/task.000001/task.json
index dfe1db76b..b757d2c2f 100644
--- a/tests/auto_test/output/gamma_00/task.000001/task.json
+++ b/tests/auto_test/output/gamma_00/task.000001/task.json
@@ -31,4 +31,4 @@
"relax_shape": false,
"relax_vol": false
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/output/gamma_00/task.000002/inter.json b/tests/auto_test/output/gamma_00/task.000002/inter.json
index 052167468..3f046499f 100644
--- a/tests/auto_test/output/gamma_00/task.000002/inter.json
+++ b/tests/auto_test/output/gamma_00/task.000002/inter.json
@@ -5,4 +5,4 @@
"type_map": {
"Mo": 0
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/output/gamma_00/task.000002/miller.json b/tests/auto_test/output/gamma_00/task.000002/miller.json
index 0a6e1ab11..35084a204 100644
--- a/tests/auto_test/output/gamma_00/task.000002/miller.json
+++ b/tests/auto_test/output/gamma_00/task.000002/miller.json
@@ -1 +1,5 @@
-[1, 1, 0]
\ No newline at end of file
+[
+ 1,
+ 1,
+ 0
+]
diff --git a/tests/auto_test/output/gamma_00/task.000002/result_task.json b/tests/auto_test/output/gamma_00/task.000002/result_task.json
index cb2da59ad..6d11eb0c0 100644
--- a/tests/auto_test/output/gamma_00/task.000002/result_task.json
+++ b/tests/auto_test/output/gamma_00/task.000002/result_task.json
@@ -10680,4 +10680,4 @@
]
}
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/output/gamma_00/task.000002/task.json b/tests/auto_test/output/gamma_00/task.000002/task.json
index dfe1db76b..b757d2c2f 100644
--- a/tests/auto_test/output/gamma_00/task.000002/task.json
+++ b/tests/auto_test/output/gamma_00/task.000002/task.json
@@ -31,4 +31,4 @@
"relax_shape": false,
"relax_vol": false
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/output/relaxation/relax_task/result.json b/tests/auto_test/output/relaxation/relax_task/result.json
index 051fe8cf2..cc38cd7fd 100644
--- a/tests/auto_test/output/relaxation/relax_task/result.json
+++ b/tests/auto_test/output/relaxation/relax_task/result.json
@@ -374,4 +374,4 @@
]
}
}
-}
\ No newline at end of file
+}
diff --git a/tests/auto_test/test_abacus.py b/tests/auto_test/test_abacus.py
index 0bf09dced..28099e821 100644
--- a/tests/auto_test/test_abacus.py
+++ b/tests/auto_test/test_abacus.py
@@ -12,7 +12,7 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "auto_test"
-from .context import setUpModule
+from .context import setUpModule # noqa: F401
class TestABACUS(unittest.TestCase):
@@ -62,7 +62,7 @@ def test_make_potential_files(self):
self.assertTrue(
os.path.isfile(os.path.join(self.equi_path, "pp_orb/Al_ONCV_PBE-1.0.upf"))
)
- self.assertTrue(
+ self.assertFalse(
os.path.isfile(
os.path.join(self.equi_path, "pp_orb/Al_gga_9au_100Ry_4s4p1d.orb")
)
@@ -200,6 +200,22 @@ def test_make_input_file_kspacing(self):
kpt = f1.read().strip().split("\n")[-1].split()
self.assertEqual(kpt, ["9", "9", "9", "0", "0", "0"])
+ def test_make_input_file_kspacing_three_value(self):
+ param = self.task_param.copy()
+ param["cal_setting"] = {
+ "relax_pos": False,
+ "relax_shape": True,
+ "relax_vol": True,
+ "kspacing": [0.1, 0.2, 0.3],
+ }
+ shutil.copy(
+ os.path.join(self.conf_path, "STRU"), os.path.join(self.equi_path, "STRU")
+ )
+ self.ABACUS.make_input_file(self.equi_path, "relaxation", param)
+ with open(os.path.join(self.equi_path, "KPT")) as f1:
+ kpt = f1.read().strip().split("\n")[-1].split()
+ self.assertEqual(kpt, ["9", "5", "3", "0", "0", "0"])
+
def test_compuate(self):
ret = self.ABACUS.compute(os.path.join(self.equi_path))
self.assertIsNone(ret)
@@ -221,10 +237,10 @@ def test_compuate(self):
def compare_dict(dict1, dict2):
self.assertEqual(dict1.keys(), dict2.keys())
for key in dict1:
- if type(dict1[key]) is dict:
+ if isinstance(dict1[key], dict):
compare_dict(dict1[key], dict2[key])
else:
- if type(dict1[key]) is np.ndarray:
+ if isinstance(dict1[key], np.ndarray):
np.testing.assert_almost_equal(
dict1[key], dict2[key], decimal=5
)
@@ -232,3 +248,88 @@ def compare_dict(dict1, dict2):
self.assertTrue(dict1[key] == dict2[key])
compare_dict(ret, ret_ref.as_dict())
+
+
+class TestABACUSDeepKS(unittest.TestCase):
+ def setUp(self):
+ self.jdata = {
+ "structures": ["confs/fcc-Al-deepks"],
+ "interaction": {
+ "type": "abacus",
+ "incar": "abacus_input/INPUT.dpks",
+ "potcar_prefix": "abacus_input",
+ "potcars": {"Al": "Al_ONCV_PBE-1.0.upf"},
+ "orb_files": {"Al": "Al_gga_9au_100Ry_4s4p1d.orb"},
+ "deepks_desc": "jle.orb",
+ "deepks_model": "model.ptg",
+ },
+ "relaxation": {
+ "cal_type": "relaxation",
+ "cal_setting": {
+ "relax_pos": True,
+ "relax_shape": True,
+ "relax_vol": True,
+ },
+ },
+ }
+
+ self.conf_path = "confs/fcc-Al-deepks"
+ self.equi_path = "confs/fcc-Al-deepks/relaxation/relax_task"
+ self.source_path = "equi/abacus"
+ if not os.path.exists(self.equi_path):
+ os.makedirs(self.equi_path)
+
+ self.confs = self.jdata["structures"]
+ inter_param = self.jdata["interaction"]
+ self.task_param = self.jdata["relaxation"]
+ self.ABACUS = ABACUS(inter_param, os.path.join(self.conf_path, "STRU"))
+
+ def tearDown(self):
+ if os.path.exists("confs/fcc-Al-deepks/relaxation"):
+ shutil.rmtree("confs/fcc-Al-deepks/relaxation")
+
+ def test_make_potential_files(self):
+ if not os.path.exists(os.path.join(self.equi_path, "STRU")):
+ with self.assertRaises(FileNotFoundError):
+ self.ABACUS.make_potential_files(self.equi_path)
+ shutil.copy(
+ os.path.join(self.conf_path, "STRU"), os.path.join(self.equi_path, "STRU")
+ )
+ self.ABACUS.make_potential_files(self.equi_path)
+ self.assertTrue(
+ os.path.isfile(os.path.join(self.equi_path, "pp_orb/Al_ONCV_PBE-1.0.upf"))
+ )
+ self.assertTrue(
+ os.path.isfile(
+ os.path.join(self.equi_path, "pp_orb/Al_gga_9au_100Ry_4s4p1d.orb")
+ )
+ )
+ self.assertTrue(os.path.isfile(os.path.join(self.equi_path, "pp_orb/jle.orb")))
+ self.assertTrue(
+ os.path.isfile(os.path.join(self.equi_path, "pp_orb/model.ptg"))
+ )
+ self.assertTrue(os.path.isfile(os.path.join(self.equi_path, "inter.json")))
+
+ def test_make_input_file_1(self):
+ param = self.task_param.copy()
+ param["cal_setting"] = {
+ "relax_pos": True,
+ "relax_shape": True,
+ "relax_vol": False,
+ }
+ shutil.copy(
+ os.path.join(self.conf_path, "STRU"), os.path.join(self.equi_path, "STRU")
+ )
+ self.ABACUS.make_input_file(self.equi_path, "relaxation", param)
+ self.assertTrue(os.path.isfile(os.path.join(self.equi_path, "task.json")))
+ self.assertTrue(os.path.isfile(os.path.join(self.equi_path, "KPT")))
+ self.assertTrue(os.path.isfile(os.path.join(self.equi_path, "INPUT")))
+ abacus_input = abacus_scf.get_abacus_input_parameters(
+ os.path.join(self.equi_path, "INPUT")
+ )
+ self.assertEqual(abacus_input["calculation"].lower(), "cell-relax")
+ self.assertEqual(abacus_input["fixed_axes"].lower(), "volume")
+ self.assertEqual(abacus_input["deepks_model"].lower(), "pp_orb/model.ptg")
+ self.assertTrue(
+ abacus.check_stru_fixed(os.path.join(self.equi_path, "STRU"), fixed=False)
+ )
diff --git a/tests/auto_test/test_abacus_equi.py b/tests/auto_test/test_abacus_equi.py
index 372e5eb0e..c2a5ce144 100644
--- a/tests/auto_test/test_abacus_equi.py
+++ b/tests/auto_test/test_abacus_equi.py
@@ -1,5 +1,3 @@
-import glob
-import json
import os
import shutil
import sys
@@ -12,7 +10,7 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "auto_test"
-from .context import setUpModule
+from .context import setUpModule # noqa: F401
class TestEqui(unittest.TestCase):
@@ -34,6 +32,8 @@ class TestEqui(unittest.TestCase):
def tearDown(self):
if os.path.exists("confs/fcc-Al/relaxation"):
shutil.rmtree("confs/fcc-Al/relaxation")
+ if os.path.exists("confs/fcc-Al/STRU.bk"):
+ os.remove("confs/fcc-Al/STRU.bk")
def test_make_equi(self):
confs = self.jdata["structures"]
@@ -57,14 +57,6 @@ def test_make_equi(self):
pot1 = fp.read()
self.assertEqual(pot0, pot1)
- with open(os.path.join("abacus_input", "Al_gga_9au_100Ry_4s4p1d.orb")) as fp:
- pot0 = fp.read()
- with open(
- os.path.join(target_path, "pp_orb", "Al_gga_9au_100Ry_4s4p1d.orb")
- ) as fp:
- pot1 = fp.read()
- self.assertEqual(pot0, pot1)
-
self.assertTrue(os.path.isfile(os.path.join(target_path, "KPT")))
task_json_file = os.path.join(target_path, "task.json")
diff --git a/tests/auto_test/test_abacus_property.py b/tests/auto_test/test_abacus_property.py
index 41e25382c..764092258 100644
--- a/tests/auto_test/test_abacus_property.py
+++ b/tests/auto_test/test_abacus_property.py
@@ -20,7 +20,7 @@
from dpgen.auto_test.Surface import Surface
from dpgen.auto_test.Vacancy import Vacancy
-from .context import setUpModule
+from .context import setUpModule # noqa: F401
class TestABACUS(unittest.TestCase):
@@ -79,6 +79,8 @@ def tearDown(self):
shutil.rmtree("confs/fcc-Al/interstitial_00")
if os.path.exists("confs/fcc-Al/surface_00"):
shutil.rmtree("confs/fcc-Al/surface_00")
+ if os.path.exists("confs/fcc-Al/gamma_00"):
+ shutil.rmtree("confs/fcc-Al/gamma_00")
def test_make_property(self):
property = {"type": "eos", "vol_start": 0.85, "vol_end": 1.15, "vol_step": 0.01}
@@ -100,6 +102,35 @@ def test_make_property(self):
),
)
+ def test_make_property_outstru(self):
+ os.remove(os.path.join(self.equi_path, "INPUT"))
+ shutil.copy(
+ os.path.join(self.source_path, "INPUT.outstru"),
+ os.path.join(self.equi_path, "INPUT"),
+ )
+ shutil.copy(
+ os.path.join(self.source_path, "STRU_ION47_D"),
+ os.path.join(self.equi_path, "OUT.ABACUS/STRU_ION47_D"),
+ )
+ property = {"type": "eos", "vol_start": 0.85, "vol_end": 1.15, "vol_step": 0.01}
+ make_property(self.jdata["structures"], self.jdata["interaction"], [property])
+ self.assertTrue(os.path.exists(os.path.join(self.conf_path, "eos_00")))
+ self.assertTrue(os.path.exists(os.path.join(self.conf_path, "eos_00", "INPUT")))
+ for ii in glob.glob(os.path.join(self.conf_path, "eos_00", "task.*")):
+ self.assertTrue(os.path.exists(os.path.join(ii, "INPUT")))
+ self.assertTrue(os.path.exists(os.path.join(ii, "pp_orb")))
+ self.assertTrue(os.path.exists(os.path.join(ii, "KPT")))
+ self.assertTrue(os.path.exists(os.path.join(ii, "STRU")))
+ self.assertEqual(
+ os.path.realpath(os.path.join(ii, "pp_orb", "Al_ONCV_PBE-1.0.upf")),
+ os.path.realpath(
+ os.path.join(
+ self.jdata["interaction"]["potcar_prefix"],
+ "Al_ONCV_PBE-1.0.upf",
+ )
+ ),
+ )
+
def test_make_property_eos(self):
property = {"type": "eos", "vol_start": 0.85, "vol_end": 1.15, "vol_step": 0.01}
work_path = os.path.join(self.conf_path, "eos_00")
@@ -143,6 +174,7 @@ def test_make_property_elastic(self):
os.remove(
os.path.realpath(os.path.join(self.equi_path, "OUT.ABACUS", "STRU_ION_D"))
)
+ os.remove(os.path.realpath(os.path.join(self.equi_path, "STRU")))
with self.assertRaises(RuntimeError):
elastic.make_confs(work_path, self.equi_path, refine=False)
diff --git a/tests/auto_test/test_elastic.py b/tests/auto_test/test_elastic.py
index c611a4f8a..1a56655ae 100644
--- a/tests/auto_test/test_elastic.py
+++ b/tests/auto_test/test_elastic.py
@@ -1,14 +1,9 @@
import glob
-import json
import os
import shutil
import sys
import unittest
-import dpdata
-import numpy as np
-from monty.serialization import dumpfn, loadfn
-from pymatgen.analysis.elasticity.strain import Deformation, Strain
from pymatgen.core import Structure
from pymatgen.io.vasp import Incar
@@ -17,7 +12,7 @@
from dpgen.auto_test.Elastic import Elastic
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
class TestElastic(unittest.TestCase):
@@ -67,7 +62,6 @@ def test_task_param(self):
self.assertEqual(self.prop_param[0], self.elastic.task_param())
def test_make_confs(self):
-
shutil.copy(
os.path.join(self.source_path, "Al-fcc.json"),
os.path.join(self.equi_path, "result.json"),
diff --git a/tests/auto_test/test_eos.py b/tests/auto_test/test_eos.py
index 6c5f90ad1..bd3d15251 100644
--- a/tests/auto_test/test_eos.py
+++ b/tests/auto_test/test_eos.py
@@ -1,5 +1,4 @@
import glob
-import json
import os
import shutil
import sys
@@ -7,7 +6,7 @@
import dpdata
import numpy as np
-from monty.serialization import dumpfn, loadfn
+from monty.serialization import loadfn
from pymatgen.io.vasp import Incar
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
@@ -15,7 +14,7 @@
from dpgen.auto_test.EOS import EOS
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
class TestEOS(unittest.TestCase):
@@ -74,7 +73,6 @@ def test_task_param(self):
self.assertEqual(self.prop_param[0], self.eos.task_param())
def test_make_confs_0(self):
-
if not os.path.exists(os.path.join(self.equi_path, "CONTCAR")):
with self.assertRaises(RuntimeError):
self.eos.make_confs(self.target_path, self.equi_path)
diff --git a/tests/auto_test/test_gamma.py b/tests/auto_test/test_gamma.py
index 7cdd97371..7268c58a2 100644
--- a/tests/auto_test/test_gamma.py
+++ b/tests/auto_test/test_gamma.py
@@ -1,33 +1,18 @@
import glob
-import json
import os
import shutil
import sys
import unittest
-import dpdata
-import numpy as np
-from ase.lattice.cubic import BodyCenteredCubic as bcc
-from ase.lattice.cubic import FaceCenteredCubic as fcc
-from ase.lattice.hexagonal import HexagonalClosedPacked as hcp
-from monty.serialization import dumpfn, loadfn
from pymatgen.core.structure import Structure
-from pymatgen.core.surface import SlabGenerator
-from pymatgen.io.ase import AseAtomsAdaptor
from pymatgen.io.vasp import Incar
-import dpgen.auto_test.lib.vasp as vasp
-from dpgen import dlog
-from dpgen.auto_test.Property import Property
-from dpgen.auto_test.refine import make_refine
-from dpgen.auto_test.reproduce import make_repro, post_repro
-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "auto_test"
from dpgen.auto_test.Gamma import Gamma
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
class TestGamma(unittest.TestCase):
@@ -115,7 +100,7 @@ def test_make_confs_bcc(self):
st1_file = os.path.join(ii, "POSCAR.tmp")
self.assertTrue(os.path.isfile(st1_file))
st1 = Structure.from_file(st1_file)
- with open(st1_file, mode="r") as f:
+ with open(st1_file) as f:
z_coord_str = f.readlines()[-1].split()[-2]
z_coord = float(z_coord_str)
self.assertTrue(z_coord <= 1)
diff --git a/tests/auto_test/test_interstitial.py b/tests/auto_test/test_interstitial.py
index ce22631bb..51e8ec276 100644
--- a/tests/auto_test/test_interstitial.py
+++ b/tests/auto_test/test_interstitial.py
@@ -1,24 +1,20 @@
import glob
-import json
import os
import shutil
import sys
import unittest
-import dpdata
import numpy as np
-from monty.serialization import dumpfn, loadfn
from pymatgen.analysis.defects.core import Interstitial as pmg_Interstitial
from pymatgen.core import Structure
from pymatgen.io.vasp import Incar
-from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "auto_test"
from dpgen.auto_test.Interstitial import Interstitial
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
class TestInterstitial(unittest.TestCase):
diff --git a/tests/auto_test/test_lammps.py b/tests/auto_test/test_lammps.py
index a13f5c6a8..5bf420558 100644
--- a/tests/auto_test/test_lammps.py
+++ b/tests/auto_test/test_lammps.py
@@ -1,13 +1,9 @@
-import glob
-import json
import os
import shutil
import sys
import unittest
-import dpdata
-import numpy as np
-from monty.serialization import dumpfn, loadfn
+from monty.serialization import loadfn
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "auto_test"
@@ -15,7 +11,7 @@
from dpgen.auto_test.Lammps import Lammps
from dpgen.auto_test.lib.lammps import inter_deepmd
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
class TestLammps(unittest.TestCase):
diff --git a/tests/auto_test/test_make_prop.py b/tests/auto_test/test_make_prop.py
index 2c63b5845..5e6649508 100644
--- a/tests/auto_test/test_make_prop.py
+++ b/tests/auto_test/test_make_prop.py
@@ -1,13 +1,10 @@
import glob
-import json
import os
import shutil
import sys
import unittest
-import dpdata
-import numpy as np
-from monty.serialization import dumpfn, loadfn
+from monty.serialization import loadfn
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "auto_test"
@@ -16,7 +13,7 @@
from dpgen.auto_test.common_prop import make_property
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
class TestMakeProperty(unittest.TestCase):
diff --git a/tests/auto_test/test_mpdb.py b/tests/auto_test/test_mpdb.py
index 055240908..b27a84227 100644
--- a/tests/auto_test/test_mpdb.py
+++ b/tests/auto_test/test_mpdb.py
@@ -2,7 +2,6 @@
import sys
import unittest
-from monty.serialization import dumpfn, loadfn
from pymatgen.analysis.structure_matcher import StructureMatcher
from pymatgen.core import Structure
@@ -10,7 +9,7 @@
__package__ = "auto_test"
from dpgen.auto_test.mpdb import get_structure
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
try:
os.environ["MAPI_KEY"]
diff --git a/tests/auto_test/test_refine.py b/tests/auto_test/test_refine.py
index b380ead2d..5b698952c 100644
--- a/tests/auto_test/test_refine.py
+++ b/tests/auto_test/test_refine.py
@@ -1,22 +1,15 @@
import glob
-import json
import os
import shutil
import sys
import unittest
-import dpdata
-import numpy as np
-from monty.serialization import dumpfn, loadfn
-from pymatgen.io.vasp import Incar
-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "auto_test"
from dpgen.auto_test.common_prop import make_property
-from dpgen.auto_test.refine import make_refine
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
class TestMakeProperty(unittest.TestCase):
@@ -59,7 +52,6 @@ def tearDown(self):
shutil.rmtree("confs/std-fcc/relaxation")
def test_make_eos(self):
-
pwd = os.getcwd()
confs = self.jdata["structures"]
inter_param = self.jdata["interaction"]
diff --git a/tests/auto_test/test_surface.py b/tests/auto_test/test_surface.py
index b6abdfa26..228fb2504 100644
--- a/tests/auto_test/test_surface.py
+++ b/tests/auto_test/test_surface.py
@@ -1,13 +1,10 @@
import glob
-import json
import os
import shutil
import sys
import unittest
-import dpdata
-import numpy as np
-from monty.serialization import dumpfn, loadfn
+from monty.serialization import loadfn
from pymatgen.core import Structure
from pymatgen.core.surface import SlabGenerator
from pymatgen.io.vasp import Incar
@@ -17,7 +14,7 @@
from dpgen.auto_test.Surface import Surface
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
class TestSurface(unittest.TestCase):
diff --git a/tests/auto_test/test_vacancy.py b/tests/auto_test/test_vacancy.py
index b2e348573..8ee680b69 100644
--- a/tests/auto_test/test_vacancy.py
+++ b/tests/auto_test/test_vacancy.py
@@ -1,13 +1,10 @@
import glob
-import json
import os
import shutil
import sys
import unittest
-import dpdata
import numpy as np
-from monty.serialization import dumpfn, loadfn
from pymatgen.analysis.defects.core import Vacancy as pmg_Vacancy
from pymatgen.core import Structure
from pymatgen.io.vasp import Incar
@@ -18,7 +15,7 @@
from dpgen.auto_test.Vacancy import Vacancy
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
class TestVacancy(unittest.TestCase):
diff --git a/tests/auto_test/test_vasp.py b/tests/auto_test/test_vasp.py
index e994c8906..ae458b393 100644
--- a/tests/auto_test/test_vasp.py
+++ b/tests/auto_test/test_vasp.py
@@ -1,14 +1,10 @@
-import glob
-import json
import os
import shutil
import sys
import unittest
-import dpdata
import numpy as np
-from dpdata import LabeledSystem
-from monty.serialization import dumpfn, loadfn
+from monty.serialization import loadfn
from pymatgen.io.vasp import Incar
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
@@ -17,7 +13,7 @@
from dpgen.auto_test.VASP import VASP
from dpgen.generator.lib.vasp import incar_upper
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
class TestVASP(unittest.TestCase):
@@ -123,7 +119,7 @@ def test_make_input_file_5(self):
incar = incar_upper(Incar.from_file(os.path.join(self.equi_path, "INCAR")))
self.assertEqual(incar["ISIF"], 6)
- def test_make_input_file_5(self):
+ def test_make_input_file_6(self):
param = self.task_param.copy()
param["cal_setting"] = {
"relax_pos": False,
@@ -151,10 +147,10 @@ def compare_dict(dict1, dict2):
for key in dict1:
if key == "stress":
self.assertTrue((np.array(dict1[key]["data"]) == dict2[key]).all())
- elif type(dict1[key]) is dict:
+ elif isinstance(dict1[key], dict):
compare_dict(dict1[key], dict2[key])
else:
- if type(dict1[key]) is np.ndarray:
+ if isinstance(dict1[key], np.ndarray):
self.assertTrue((dict1[key] == dict2[key]).all())
else:
self.assertTrue(dict1[key] == dict2[key])
diff --git a/tests/auto_test/test_vasp_equi.py b/tests/auto_test/test_vasp_equi.py
index 37c7f6c60..1195660d0 100644
--- a/tests/auto_test/test_vasp_equi.py
+++ b/tests/auto_test/test_vasp_equi.py
@@ -1,23 +1,18 @@
-import glob
-import json
import os
import shutil
import sys
import unittest
-import dpdata
-import numpy as np
-from monty.serialization import dumpfn, loadfn
+from monty.serialization import loadfn
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "auto_test"
from pymatgen.io.vasp import Incar
-from dpgen.auto_test.calculator import make_calculator
from dpgen.auto_test.common_equi import make_equi, post_equi
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
class TestEqui(unittest.TestCase):
diff --git a/tests/auto_test/test_vasp_equi_std.py b/tests/auto_test/test_vasp_equi_std.py
index 5f513dbaa..d5f3061be 100644
--- a/tests/auto_test/test_vasp_equi_std.py
+++ b/tests/auto_test/test_vasp_equi_std.py
@@ -1,23 +1,18 @@
-import glob
-import json
import os
import shutil
import sys
import unittest
-import dpdata
-import numpy as np
-from monty.serialization import dumpfn, loadfn
+from monty.serialization import loadfn
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "auto_test"
from pymatgen.io.vasp import Incar
-from dpgen.auto_test.calculator import make_calculator
-from dpgen.auto_test.common_equi import make_equi, post_equi
+from dpgen.auto_test.common_equi import make_equi
-from .context import make_kspacing_kpoints, setUpModule
+from .context import setUpModule # noqa: F401
class TestEqui(unittest.TestCase):
diff --git a/tests/auto_test/test_vasp_kspacing.py b/tests/auto_test/test_vasp_kspacing.py
index cac726a8a..43adfc2c3 100644
--- a/tests/auto_test/test_vasp_kspacing.py
+++ b/tests/auto_test/test_vasp_kspacing.py
@@ -1,18 +1,17 @@
import glob
-import json
import os
-import shutil
import sys
import unittest
-import dpdata
import numpy as np
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "auto_test"
-from pymatgen.io.vasp import Incar, Kpoints
-from .context import make_kspacing_kpoints, setUpModule
+from .context import (
+ make_kspacing_kpoints,
+ setUpModule, # noqa: F401
+)
class TestVASPMakeKpoint(unittest.TestCase):
diff --git a/tests/data/CuW.json b/tests/data/CuW.json
index 4d289710e..9ad025de7 100644
--- a/tests/data/CuW.json
+++ b/tests/data/CuW.json
@@ -1,20 +1,29 @@
{
- "init_fp_style": "ABACUS",
- "stages": [1, 2, 3, 4],
+ "init_fp_style": "ABACUS",
+ "stages": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
"cell_type": "fcc",
"latt": 3.76,
"super_cell": [
1,
- 1,
- 1
+ 2,
+ 2
],
"elements": [
- "Cu", "W"
+ "Cu",
+ "W"
+ ],
+ "atom_masses": [
+ 63.55,
+ 183.8
],
- "atom_masses": [63.55, 183.8],
"potcars": [
"abacus.in/Cu_ONCV_PBE-1.0.upf",
- "abacus.in/W_ONCV_PBE-1.0.upf"
+ "abacus.in/W_ONCV_PBE-1.0.upf"
],
"relax_incar": "abacus.in/INPUT",
"relax_kpt": "abacus.in/KPT",
@@ -33,5 +42,5 @@
"Cu",
"W"
],
- "_comment": "that's all"
+ "_comment1": "that's all"
}
diff --git a/tests/data/al.json b/tests/data/al.json
index b19e7c884..3c96c484f 100644
--- a/tests/data/al.json
+++ b/tests/data/al.json
@@ -1,19 +1,32 @@
{
- "cell_type": "fcc",
- "super_cell": [1, 1, 1],
- "elements": ["Al"],
- "from_poscar": false,
- "from_poscar_path": "example/POSCAR",
- "potcars": ["example/POTCAR"],
- "relax_incar": "example/INCAR.rlx",
- "md_incar" : "example/INCAR.md",
- "scale": [1.00],
- "skip_relax": false,
- "pert_numb": 2,
- "md_nstep" : 1,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "coll_ndata": 10,
- "type_map" : ["Mg", "Al"],
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Al"
+ ],
+ "from_poscar": false,
+ "from_poscar_path": "example/POSCAR",
+ "potcars": [
+ "example/POTCAR"
+ ],
+ "relax_incar": "example/INCAR.rlx",
+ "md_incar": "example/INCAR.md",
+ "scale": [
+ 1.0
+ ],
+ "skip_relax": false,
+ "pert_numb": 2,
+ "md_nstep": 1,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "coll_ndata": 10,
+ "type_map": [
+ "Mg",
+ "Al"
+ ],
+ "_comment1": "that's all"
}
diff --git a/tests/data/alloy.json b/tests/data/alloy.json
index 78cfa5e61..dd42d585c 100644
--- a/tests/data/alloy.json
+++ b/tests/data/alloy.json
@@ -1,19 +1,31 @@
{
- "cell_type": "fcc",
- "latt": 2.4,
- "super_cell": [1, 1, 1],
- "elements": ["Al","Mg"],
- "from_poscar": false,
- "from_poscar_path": "example/POSCAR",
- "potcars": ["./POTCAR","./POTCAR"],
- "relax_incar": "./INCAR_metal_rlx_low",
- "md_incar" : "example/INCAR.md",
- "scale": [1.00],
- "skip_relax": true,
- "pert_numb": 3,
- "md_nstep" : 1,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "coll_ndata": 3,
- "_comment": "that's all"
+ "cell_type": "fcc",
+ "latt": 2.4,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "elements": [
+ "Al",
+ "Mg"
+ ],
+ "from_poscar": false,
+ "from_poscar_path": "example/POSCAR",
+ "potcars": [
+ "./POTCAR",
+ "./POTCAR"
+ ],
+ "relax_incar": "./INCAR_metal_rlx_low",
+ "md_incar": "example/INCAR.md",
+ "scale": [
+ 1.0
+ ],
+ "skip_relax": true,
+ "pert_numb": 3,
+ "md_nstep": 1,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "coll_ndata": 3,
+ "_comment1": "that's all"
}
diff --git a/tests/data/ch4.json b/tests/data/ch4.json
index 7f3a74933..ce67eeb1f 100644
--- a/tests/data/ch4.json
+++ b/tests/data/ch4.json
@@ -1,26 +1,46 @@
{
- "init_fp_style": "ABACUS",
- "stages": [1, 2, 3, 4],
- "super_cell": [1, 1, 1],
- "_comment": "if from_poscar = true, the cell_type and super_cell keys are actually useless",
+ "init_fp_style": "ABACUS",
+ "stages": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "_comment1": "if from_poscar = true, the cell_type and super_cell keys are actually useless",
"cell_type": "fcc",
- "elements": ["H","C"],
- "atom_masses": [1, 12],
- "_comment": "if from_poscar = false, you have to set atom_masse.",
- "out_dir": "./",
- "from_poscar": true,
- "from_poscar_path": "./STRU",
- "potcars": ["./H_ONCV_PBE-1.0.upf", "./C_ONCV_PBE-1.0.upf"],
- "relax_incar": "./INPUT",
+ "elements": [
+ "H",
+ "C"
+ ],
+ "atom_masses": [
+ 1,
+ 12
+ ],
+ "_comment2": "if from_poscar = false, you have to set atom_masse.",
+ "out_dir": "./",
+ "from_poscar": true,
+ "from_poscar_path": "./STRU",
+ "potcars": [
+ "./H_ONCV_PBE-1.0.upf",
+ "./C_ONCV_PBE-1.0.upf"
+ ],
+ "relax_incar": "./INPUT",
"relax_kspacing": 10,
- "md_incar" : "./INPUT.md",
+ "md_incar": "./INPUT.md",
"md_kspacing": 10,
- "scale": [0.95],
- "skip_relax": false,
- "pert_numb": 2,
- "md_nstep" : 3,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "coll_ndata": 10,
- "_comment": "that's all"
+ "scale": [
+ 0.95
+ ],
+ "skip_relax": false,
+ "pert_numb": 2,
+ "md_nstep": 3,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "coll_ndata": 10,
+ "_comment3": "that's all"
}
diff --git a/tests/data/context.py b/tests/data/context.py
index 4c65e8fd7..4697fc89d 100644
--- a/tests/data/context.py
+++ b/tests/data/context.py
@@ -2,7 +2,7 @@
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
-from dpgen.data.gen import *
+from dpgen.data.gen import * # noqa: F403
param_file = "al.json"
abacus_param_file = "ch4.json"
diff --git a/tests/data/context_bulk.py b/tests/data/context_bulk.py
index 9602a2e12..995da6554 100644
--- a/tests/data/context_bulk.py
+++ b/tests/data/context_bulk.py
@@ -1,8 +1,14 @@
import os
import sys
+import numpy as np
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
-from dpgen.data.gen import *
+from dpgen.data.gen import * # noqa: F403
param_file = "alloy.json"
abacus_param_file = "CuW.json"
+
+abacus_ref_Cu_coord = 3.76 * np.array(
+ [[0.5, 0, 0.5], [0.5, 0, 1.5], [0.5, 1, 0.5], [0.5, 1, 1.5]]
+)
diff --git a/tests/data/context_surf.py b/tests/data/context_surf.py
index e4ad3516a..4a5bd2ecb 100644
--- a/tests/data/context_surf.py
+++ b/tests/data/context_surf.py
@@ -2,6 +2,6 @@
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
-from dpgen.data.surf import *
+from dpgen.data.surf import * # noqa: F403
param_file = "surf.json"
diff --git a/tests/data/context_surf_poscar.py b/tests/data/context_surf_poscar.py
index 11d15717f..f3cf6bc77 100644
--- a/tests/data/context_surf_poscar.py
+++ b/tests/data/context_surf_poscar.py
@@ -2,6 +2,6 @@
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
-from dpgen.data.surf import *
+from dpgen.data.surf import * # noqa: F403
param_file = "surf_poscar.json"
diff --git a/tests/data/surf.json b/tests/data/surf.json
index f0bcc45b1..d3f5afee4 100644
--- a/tests/data/surf.json
+++ b/tests/data/surf.json
@@ -1,46 +1,46 @@
{
- "stages": [
- 1,
- 2
- ],
- "cell_type": "fcc",
- "latt": 4.1,
- "super_cell": [
- 1,
- 1,
- 1
- ],
- "layer_numb": 3,
- "vacuum_max": 9.0,
- "vacuum_resol": [
- 0.5,
- 1
- ],
- "mid_point": 4.0,
- "head_ratio": 0.6,
- "vacuum_numb": 20,
- "millers": [
- [
- 1,
- 0,
- 0
- ]
- ],
- "elements": [
- "Al"
- ],
- "potcars": [
- "./POTCAR"
- ],
- "relax_incar" : "INCAR_metal_rlx_low",
- "scale": [
- 0.98,
- 1.0
- ],
- "skip_relax": true,
- "pert_numb": 5,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "stages": [
+ 1,
+ 2
+ ],
+ "cell_type": "fcc",
+ "latt": 4.1,
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "layer_numb": 3,
+ "vacuum_max": 9.0,
+ "vacuum_resol": [
+ 0.5,
+ 1
+ ],
+ "mid_point": 4.0,
+ "head_ratio": 0.6,
+ "vacuum_numb": 20,
+ "millers": [
+ [
+ 1,
+ 0,
+ 0
+ ]
+ ],
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "./POTCAR"
+ ],
+ "relax_incar": "INCAR_metal_rlx_low",
+ "scale": [
+ 0.98,
+ 1.0
+ ],
+ "skip_relax": true,
+ "pert_numb": 5,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/tests/data/surf_poscar.json b/tests/data/surf_poscar.json
index 3399b920f..2cfbc27a4 100644
--- a/tests/data/surf_poscar.json
+++ b/tests/data/surf_poscar.json
@@ -1,43 +1,46 @@
{
- "stages": [
- 1,
- 2
- ],
- "cell_type": "fcc",
- "from_poscar": true,
- "from_poscar_path": "POSCAR",
- "super_cell": [
- 1,
- 1,
- 1
- ],
- "layer_numb": 3,
- "vacuum_max": 5,
- "vacuum_resol": [0.5,2],
- "mid_point": 2.0,
- "_head_ratio": 0.6,
- "_vacuum_numb": 20,
- "millers": [
- [
- 1,
- 0,
- 0
- ]
- ],
- "elements": [
- "Al"
- ],
- "potcars": [
- "./POTCAR"
- ],
- "relax_incar" : "INCAR_metal_rlx_low",
- "scale": [
- 1.0
- ],
- "skip_relax": true,
- "pert_numb": 5,
- "pert_box": 0.03,
- "pert_atom": 0.01,
- "coll_ndata": 5000,
- "_comment": "that's all"
+ "stages": [
+ 1,
+ 2
+ ],
+ "cell_type": "fcc",
+ "from_poscar": true,
+ "from_poscar_path": "POSCAR",
+ "super_cell": [
+ 1,
+ 1,
+ 1
+ ],
+ "layer_numb": 3,
+ "vacuum_max": 5,
+ "vacuum_resol": [
+ 0.5,
+ 2
+ ],
+ "mid_point": 2.0,
+ "_head_ratio": 0.6,
+ "_vacuum_numb": 20,
+ "millers": [
+ [
+ 1,
+ 0,
+ 0
+ ]
+ ],
+ "elements": [
+ "Al"
+ ],
+ "potcars": [
+ "./POTCAR"
+ ],
+ "relax_incar": "INCAR_metal_rlx_low",
+ "scale": [
+ 1.0
+ ],
+ "skip_relax": true,
+ "pert_numb": 5,
+ "pert_box": 0.03,
+ "pert_atom": 0.01,
+ "coll_ndata": 5000,
+ "_comment1": "that's all"
}
diff --git a/tests/data/test_coll_abacus.py b/tests/data/test_coll_abacus.py
index c5f11f526..63e2d6e7d 100644
--- a/tests/data/test_coll_abacus.py
+++ b/tests/data/test_coll_abacus.py
@@ -1,4 +1,3 @@
-import glob
import json
import os
import shutil
@@ -10,12 +9,17 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "data"
-from .context import abacus_param_file, coll_abacus_md, out_dir_name, setUpModule
+from .context import (
+ abacus_param_file,
+ coll_abacus_md,
+ out_dir_name,
+ setUpModule, # noqa: F401
+)
class TestCollAbacus(unittest.TestCase):
def setUp(self):
- with open(abacus_param_file, "r") as fp:
+ with open(abacus_param_file) as fp:
jdata = json.load(fp)
self.odir = out_dir_name(jdata)
assert os.path.isdir(
@@ -40,8 +44,7 @@ def tearDown(self):
shutil.rmtree(self.odir)
def test_coll(self):
-
- with open(abacus_param_file, "r") as fp:
+ with open(abacus_param_file) as fp:
jdata = json.load(fp)
jdata["out_dir"] = self.odir
print(os.getcwd())
diff --git a/tests/data/test_coll_vasp.py b/tests/data/test_coll_vasp.py
index e5b282698..bb3d9c877 100644
--- a/tests/data/test_coll_vasp.py
+++ b/tests/data/test_coll_vasp.py
@@ -1,4 +1,3 @@
-import glob
import json
import os
import shutil
@@ -10,12 +9,17 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "data"
-from .context import coll_vasp_md, out_dir_name, param_file, setUpModule
+from .context import (
+ coll_vasp_md,
+ out_dir_name,
+ param_file,
+ setUpModule, # noqa: F401
+)
class TestCollVasp(unittest.TestCase):
def setUp(self):
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
self.odir = out_dir_name(jdata)
assert os.path.isdir("out_data_02_md"), "out data for post fp vasp should exist"
@@ -49,8 +53,7 @@ def tearDown(self):
shutil.rmtree(self.odir)
def test_coll(self):
-
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
jdata["out_dir"] = self.odir
coll_vasp_md(jdata)
diff --git a/tests/data/test_disturb_abacus.py b/tests/data/test_disturb_abacus.py
index f64d8554c..365d3e723 100644
--- a/tests/data/test_disturb_abacus.py
+++ b/tests/data/test_disturb_abacus.py
@@ -8,7 +8,11 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "data"
-from .context import *
+from .context import (
+ abacus_stru_file,
+ get_abacus_STRU,
+ setUpModule, # noqa: F401
+)
class TestPertAbacus(unittest.TestCase):
diff --git a/tests/data/test_gen_bulk.py b/tests/data/test_gen_bulk.py
index a8eefad87..64df71bc8 100644
--- a/tests/data/test_gen_bulk.py
+++ b/tests/data/test_gen_bulk.py
@@ -9,14 +9,24 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "data"
-from .context import setUpModule
-from .context_bulk import *
+from .context import setUpModule # noqa: F401
+from .context_bulk import (
+ create_path,
+ make_scale,
+ make_super_cell,
+ make_unit_cell,
+ make_vasp_relax,
+ out_dir_name,
+ param_file,
+ pert_scaled,
+ place_element,
+)
class TestGenBulk(unittest.TestCase):
def setUp(self):
self.alloy = []
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
if "init_fp_style" not in jdata:
jdata["init_fp_style"] = "VASP"
diff --git a/tests/data/test_gen_bulk_abacus.py b/tests/data/test_gen_bulk_abacus.py
index 7223db6cf..520589829 100644
--- a/tests/data/test_gen_bulk_abacus.py
+++ b/tests/data/test_gen_bulk_abacus.py
@@ -5,16 +5,31 @@
import sys
import unittest
+import numpy as np
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "data"
-from .context import setUpModule
-from .context_bulk import *
+from .context import setUpModule # noqa: F401
+from .context_bulk import (
+ abacus_param_file,
+ abacus_ref_Cu_coord,
+ create_path,
+ get_abacus_STRU,
+ make_abacus_relax,
+ make_scale_ABACUS,
+ make_super_cell_ABACUS,
+ make_super_cell_STRU,
+ make_unit_cell_ABACUS,
+ out_dir_name,
+ pert_scaled,
+ place_element_ABACUS,
+)
class TestGenBulkABACUS(unittest.TestCase):
def setUp(self):
self.alloy = []
- with open(abacus_param_file, "r") as fp:
+ with open(abacus_param_file) as fp:
jdata = json.load(fp)
out_dir = out_dir_name(jdata)
self.out_dir = out_dir
@@ -27,6 +42,7 @@ def setUp(self):
create_path(out_dir)
def tearDown(self):
+ # pass
shutil.rmtree(self.root_dir)
def test(self):
@@ -68,14 +84,20 @@ def testSTRU(self):
# struct0=Structure.from_file(os.path.join(path,"STRU"))
alloys = glob.glob(os.path.join(path, "sys-*"))
stru0 = get_abacus_STRU(os.path.join(alloys[0], "STRU"))
- self.assertEqual(len(alloys), stru0["coords"].shape[0])
+ self.assertEqual(
+ jdata["super_cell"][0] * jdata["super_cell"][1] * jdata["super_cell"][2],
+ stru0["coords"].shape[0],
+ )
for ii in alloys:
elem_numb = [int(i) for i in ii.split("/")[-1].split("-")[1:]]
struct = get_abacus_STRU(os.path.join(ii, "STRU"))
self.assertEqual(struct["atom_numbs"], elem_numb)
+ if os.path.basename(ii) == "sys-0004":
+ np.testing.assert_almost_equal(
+ struct["coords"], abacus_ref_Cu_coord, decimal=3
+ )
path = self.out_dir + "/01.scale_pert"
alloys = glob.glob(os.path.join(path, "sys-*"))
- self.assertEqual(len(alloys), stru0["coords"].shape[0])
for ii in alloys:
scales = glob.glob(os.path.join(ii, "scale-*"))
self.assertEqual(len(scales), self.scale_numb)
diff --git a/tests/data/test_gen_surf.py b/tests/data/test_gen_surf.py
index e1a484d9b..1db270a09 100644
--- a/tests/data/test_gen_surf.py
+++ b/tests/data/test_gen_surf.py
@@ -9,8 +9,17 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "data"
-from .context import setUpModule
-from .context_surf import *
+from .context import setUpModule # noqa: F401
+from .context_surf import (
+ create_path,
+ make_scale,
+ make_super_cell_pymatgen,
+ make_vasp_relax,
+ out_dir_name,
+ param_file,
+ pert_scaled,
+ place_element,
+)
class TestGenSurf(unittest.TestCase):
@@ -30,7 +39,7 @@ def setUp(self):
"elong-7.000",
"elong-8.000",
]
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
out_dir = out_dir_name(jdata)
jdata["out_dir"] = out_dir
diff --git a/tests/data/test_gen_surf_poscar.py b/tests/data/test_gen_surf_poscar.py
index 89ebfc33c..06f559a1e 100644
--- a/tests/data/test_gen_surf_poscar.py
+++ b/tests/data/test_gen_surf_poscar.py
@@ -9,8 +9,17 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "data"
-from .context import setUpModule
-from .context_surf_poscar import *
+from .context import setUpModule # noqa: F401
+from .context_surf_poscar import (
+ create_path,
+ make_scale,
+ make_super_cell_pymatgen,
+ make_vasp_relax,
+ out_dir_name,
+ param_file,
+ pert_scaled,
+ place_element,
+)
class TestGenSurfPOSCAR(unittest.TestCase):
@@ -23,7 +32,7 @@ def setUp(self):
"elong-2.000",
"elong-4.000",
]
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
out_dir = out_dir_name(jdata)
jdata["out_dir"] = out_dir
diff --git a/tests/database/context.py b/tests/database/context.py
index fbe0aa186..f9fe353fd 100644
--- a/tests/database/context.py
+++ b/tests/database/context.py
@@ -2,10 +2,10 @@
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
-import dpgen
-from dpgen.database.entry import Entry
-from dpgen.database.run import parsing_vasp
-from dpgen.database.vasp import DPPotcar, VaspInput
+import dpgen # noqa: F401
+from dpgen.database.entry import Entry # noqa: F401
+from dpgen.database.run import parsing_vasp # noqa: F401
+from dpgen.database.vasp import DPPotcar, VaspInput # noqa: F401
def setUpModule():
diff --git a/tests/database/param_Al.json b/tests/database/param_Al.json
index 3295d8ce8..48f767d30 100644
--- a/tests/database/param_Al.json
+++ b/tests/database/param_Al.json
@@ -1,19 +1,100 @@
{
- "path" : "./",
- "calculator" : "vasp",
- "_comment" : "vasp/pwscf/gaussian",
- "output" : "dpgen_db.json",
- "id_prefix" : "",
- "config_info_dict" : {
- "fcc-bulk" : [0,1,2,3,4,5,6,7],
- "hcp-bulk" : [8,9,10,11,12,13,14,15],
- "bcc-bulk" : [16,17,18,19,20,21,22,23],
- "fcc-surf-100" : [24,25,26,27,28,29,30,31],
- "fcc-surf-111" : [32,33,34,35,36,37,38,39],
- "fcc-surf-110" : [40,41,42,43,44,45,46,47],
- "hcp-surf-001" : [48,49,50,51,52,53,54,55],
- "hcp-surf-100" : [56,57,58,59,60,61,62,63],
- "hcp-surf-110" : [64,65,66,67,68,69,70,71]
- },
- "skip_init" : true
+ "path": "./",
+ "calculator": "vasp",
+ "_comment1": "vasp/pwscf/gaussian",
+ "output": "dpgen_db.json",
+ "id_prefix": "",
+ "config_info_dict": {
+ "fcc-bulk": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7
+ ],
+ "hcp-bulk": [
+ 8,
+ 9,
+ 10,
+ 11,
+ 12,
+ 13,
+ 14,
+ 15
+ ],
+ "bcc-bulk": [
+ 16,
+ 17,
+ 18,
+ 19,
+ 20,
+ 21,
+ 22,
+ 23
+ ],
+ "fcc-surf-100": [
+ 24,
+ 25,
+ 26,
+ 27,
+ 28,
+ 29,
+ 30,
+ 31
+ ],
+ "fcc-surf-111": [
+ 32,
+ 33,
+ 34,
+ 35,
+ 36,
+ 37,
+ 38,
+ 39
+ ],
+ "fcc-surf-110": [
+ 40,
+ 41,
+ 42,
+ 43,
+ 44,
+ 45,
+ 46,
+ 47
+ ],
+ "hcp-surf-001": [
+ 48,
+ 49,
+ 50,
+ 51,
+ 52,
+ 53,
+ 54,
+ 55
+ ],
+ "hcp-surf-100": [
+ 56,
+ 57,
+ 58,
+ 59,
+ 60,
+ 61,
+ 62,
+ 63
+ ],
+ "hcp-surf-110": [
+ 64,
+ 65,
+ 66,
+ 67,
+ 68,
+ 69,
+ 70,
+ 71
+ ]
+ },
+ "skip_init": true
}
diff --git a/tests/database/test_db_vasp.py b/tests/database/test_db_vasp.py
index 17fe7f0fd..514ef3fe2 100644
--- a/tests/database/test_db_vasp.py
+++ b/tests/database/test_db_vasp.py
@@ -6,16 +6,20 @@
import unittest
from glob import glob
-import numpy as np
-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "database"
-from dpdata import LabeledSystem, System
-from monty.serialization import dumpfn, loadfn
-from monty.shutil import remove
+from dpdata import LabeledSystem
+from monty.serialization import loadfn
from pymatgen.io.vasp import Incar, Kpoints, Poscar, Potcar
-from .context import DPPotcar, Entry, VaspInput, dpgen, parsing_vasp, setUpModule
+from .context import (
+ DPPotcar,
+ Entry,
+ VaspInput,
+ dpgen,
+ parsing_vasp,
+ setUpModule, # noqa: F401
+)
iter_pat = "02.fp/task.007.00000*"
init_pat = "al.bcc.02x02x02/02.md/sys-0016/scale-1.000/00000*"
@@ -44,14 +48,13 @@ def setUp(self):
self.ref_entries = loadfn(os.path.join(self.cwd, "data/entries.json"))
self.init_path = sorted(glob(os.path.join(self.r_init_path, init_pat)))
self.iter_path = sorted(glob(os.path.join(self.r_iter_path, iter_pat)))
- with open("param_Al.json", "r") as fr:
+ with open("param_Al.json") as fr:
jdata = json.load(fr)
self.config_info_dict = jdata["config_info_dict"]
self.skip_init = jdata["skip_init"]
self.output = jdata["output"]
def testDPPotcar(self):
-
refd = {
"@module": "dpgen.database.vasp",
"@class": "DPPotcar",
diff --git a/tests/generator/amber/MON.parm7 b/tests/generator/amber/MON.parm7
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/generator/amber/init_-1.20.disang b/tests/generator/amber/init_-1.20.disang
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/generator/context.py b/tests/generator/context.py
index 033f4cb50..a58b0dddb 100644
--- a/tests/generator/context.py
+++ b/tests/generator/context.py
@@ -2,17 +2,25 @@
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
-from dpgen.generator.lib.ele_temp import NBandsEsti
-from dpgen.generator.lib.gaussian import _crd2frag, detect_multiplicity
-from dpgen.generator.lib.lammps import get_all_dumped_forces, get_dumped_forces
-from dpgen.generator.lib.make_calypso import make_calypso_input, write_model_devi_out
+from dpgen.generator.lib.ele_temp import NBandsEsti # noqa: F401
+from dpgen.generator.lib.gaussian import _crd2frag, detect_multiplicity # noqa: F401
+from dpgen.generator.lib.lammps import (
+ get_all_dumped_forces, # noqa: F401
+ get_dumped_forces, # noqa: F401
+)
+from dpgen.generator.lib.make_calypso import (
+ make_calypso_input, # noqa: F401
+ write_model_devi_out, # noqa: F401
+)
from dpgen.generator.lib.parse_calypso import (
- _parse_calypso_dis_mtx,
- _parse_calypso_input,
+ _parse_calypso_dis_mtx, # noqa: F401
+ _parse_calypso_input, # noqa: F401
)
-from dpgen.generator.run import *
+from dpgen.generator.run import * # noqa: F403
+from dpgen.util import setup_ele_temp # noqa: F401
param_file = "param-mg-vasp.json"
+param_pimd_file = "param-mg-pimd-vasp.json"
param_file_merge_traj = "param-mg-vasp_merge_traj.json"
param_file_v1 = "param-mg-vasp-v1.json"
param_file_v1_et = "param-mg-vasp-v1-et.json"
@@ -34,6 +42,7 @@
param_diy_abacus_post_file = "param-methane-abacus-diy.json"
param_amber_file = "param-amber.json"
param_multiple_trust_file = "param-mg-vasp-multi-trust.json"
+param_custom_fp_file = "param-custom-fp.json"
def my_file_cmp(test, f0, f1):
diff --git a/tests/generator/gromacs/model_devi_case/input.json b/tests/generator/gromacs/model_devi_case/input.json
index 99449ec0d..bd68970d2 100644
--- a/tests/generator/gromacs/model_devi_case/input.json
+++ b/tests/generator/gromacs/model_devi_case/input.json
@@ -4,4 +4,4 @@
"type_file": "/data1/anguse/yuzhi/fep/DP_FF/tyk2/init_data/lig_ejm_31/type.raw",
"index_file": "index.raw",
"lambda": 1.0
-}
\ No newline at end of file
+}
diff --git a/tests/generator/gromacs/model_devi_case/model_devi.py b/tests/generator/gromacs/model_devi_case/model_devi.py
index 6c0b81568..7ce46e301 100755
--- a/tests/generator/gromacs/model_devi_case/model_devi.py
+++ b/tests/generator/gromacs/model_devi_case/model_devi.py
@@ -9,9 +9,7 @@
def calc_model_devi_f(fs):
- """
- fs : numpy.ndarray, size of `n_models x n_frames x n_atoms x 3`
- """
+ """Fs : numpy.ndarray, size of `n_models x n_frames x n_atoms x 3`."""
fs_mean = np.mean(fs, axis=0)
# print(fs_mean.shape)
fs_err = np.sum((fs - fs_mean) ** 2, axis=-1)
diff --git a/tests/generator/machine-local-v1.json b/tests/generator/machine-local-v1.json
index 2218884f2..6ffac93a7 100644
--- a/tests/generator/machine-local-v1.json
+++ b/tests/generator/machine-local-v1.json
@@ -1,48 +1,51 @@
{
"train_machine": {
- "machine_type": "shell",
- "lazy_local": true
+ "machine_type": "shell",
+ "lazy_local": true
},
"train_resources": {
- "numb_node": 1,
- "numb_gpu": 0,
- "task_per_node": 4,
- "exclude_list": [],
- "source_list": ["/home/wanghan/study/deep.md/venvs/py3.6-tf1.8/bin/active"],
- "envs" : {
- },
- "_comment": "that's All"
+ "numb_node": 1,
+ "numb_gpu": 0,
+ "task_per_node": 4,
+ "exclude_list": [],
+ "source_list": [
+ "/home/wanghan/study/deep.md/venvs/py3.6-tf1.8/bin/active"
+ ],
+ "envs": {},
+ "_comment1": "that's All"
},
"python_path": "/home/wanghan/study/deep.md/venvs/py3.6-tf1.8/bin/python",
-
"model_devi_machine": {
- "machine_type": "shell",
- "work_path": "/home/wanghan/study/deep.md/dpgen/almg/tmp"
+ "machine_type": "shell",
+ "work_path": "/home/wanghan/study/deep.md/dpgen/almg/tmp"
},
"model_devi_resources": {
- "numb_node": 1,
- "task_per_node": 4,
- "with_mpi": true,
- "module_list" : ["mpi"],
- "exclude_list": [],
- "source_list": [],
- "_comment": "that's All"
+ "numb_node": 1,
+ "task_per_node": 4,
+ "with_mpi": true,
+ "module_list": [
+ "mpi"
+ ],
+ "exclude_list": [],
+ "source_list": [],
+ "_comment2": "that's All"
},
"model_devi_command": "/home/wanghan/local/bin/lmp_mpi_1_1_0",
"model_devi_group_size": 10,
-
"fp_machine": {
- "machine_type": "shell",
- "work_path": "/home/wanghan/study/deep.md/dpgen/almg/tmp"
+ "machine_type": "shell",
+ "work_path": "/home/wanghan/study/deep.md/dpgen/almg/tmp"
},
"fp_resources": {
- "cvasp": false,
- "task_per_node": 4,
- "exclude_list": [],
- "with_mpi": true,
- "module_list" : ["mpi"],
- "source_list": [],
- "_comment": "that's All"
+ "cvasp": false,
+ "task_per_node": 4,
+ "exclude_list": [],
+ "with_mpi": true,
+ "module_list": [
+ "mpi"
+ ],
+ "source_list": [],
+ "_comment3": "that's All"
},
"fp_command": "/home/wanghan/local/bin/vasp_std",
"fp_group_size": 5
diff --git a/tests/generator/machine-local.json b/tests/generator/machine-local.json
index a4743c964..fb2d47073 100644
--- a/tests/generator/machine-local.json
+++ b/tests/generator/machine-local.json
@@ -1,54 +1,55 @@
{
- "_comment": "training on localhost ",
- "deepmd_path": "/home/wanghan/local/deepmd/0.10.1/",
- "train_machine": {
- "machine_type": "local",
- "hostname" : "127.0.0.1",
- "port" : 22,
- "username": "wanghan",
- "work_path" : "/home/wanghan/tmp/subs/",
- "_comment" : "that's all"
- },
- "train_resources": {
- "envs": {
- "PYTHONPATH" : "/home/wanghan/local/tensorflow/1.8.py/lib/python3.6/site-packages/"
- },
- "_comment": "that's all"
- },
-
-
- "_comment": "model_devi on localhost ",
- "model_devi_command": "/home/wanghan/local/bin/lmp_mpi_010",
+ "_comment1": "training on localhost ",
+ "deepmd_path": "/home/wanghan/local/deepmd/0.10.1/",
+ "train_machine": {
+ "machine_type": "local",
+ "hostname": "127.0.0.1",
+ "port": 22,
+ "username": "wanghan",
+ "work_path": "/home/wanghan/tmp/subs/",
+ "_comment2": "that's all"
+ },
+ "train_resources": {
+ "envs": {
+ "PYTHONPATH": "/home/wanghan/local/tensorflow/1.8.py/lib/python3.6/site-packages/"
+ },
+ "_comment3": "that's all"
+ },
+ "_comment4": "model_devi on localhost ",
+ "model_devi_command": "/home/wanghan/local/bin/lmp_mpi_010",
"model_devi_group_size": 5,
- "model_devi_machine": {
- "machine_type": "local",
- "hostname" : "127.0.0.1",
- "port" : 22,
- "username": "wanghan",
- "work_path" : "/home/wanghan/tmp/subs/",
- "_comment" : "that's all"
- },
- "model_devi_resources": {
- "_comment": "that's all"
- },
-
- "_comment": "fp on localhost ",
- "fp_command": "/home/wanghan/local/bin/vasp_std",
- "fp_group_size": 2,
- "fp_machine": {
- "machine_type": "local",
- "hostname" : "127.0.0.1",
- "port" : 22,
- "username": "wanghan",
- "work_path" : "/home/wanghan/tmp/subs/",
- "_comment" : "that's all"
- },
- "fp_resources": {
- "module_list": ["mpi"],
- "task_per_node":4,
- "with_mpi": true,
- "_comment": "that's all"
+ "model_devi_machine": {
+ "machine_type": "local",
+ "hostname": "127.0.0.1",
+ "port": 22,
+ "username": "wanghan",
+ "work_path": "/home/wanghan/tmp/subs/",
+ "_comment5": "that's all"
+ },
+ "model_devi_resources": {
+ "_comment6": "that's all"
+ },
+ "_comment7": "fp on localhost ",
+ "fp_command": "/home/wanghan/local/bin/vasp_std",
+ "fp_group_size": 2,
+ "fp_machine": {
+ "machine_type": "local",
+ "hostname": "127.0.0.1",
+ "port": 22,
+ "username": "wanghan",
+ "work_path": "/home/wanghan/tmp/subs/",
+ "_comment8": "that's all"
+ },
+ "fp_resources": {
+ "module_list": [
+ "mpi"
+ ],
+ "task_per_node": 4,
+ "with_mpi": true,
+ "_comment9": "that's all"
},
- "fp_user_forward_files" : ["vdw_kernel.bindat"],
- "_comment": " that's all "
+ "fp_user_forward_files": [
+ "vdw_kernel.bindat"
+ ],
+ "_comment10": " that's all "
}
diff --git a/tests/generator/out_data_post_fp_cp2k/orig/box.raw b/tests/generator/out_data_post_fp_cp2k/orig/box.raw
index ba9babfb2..7de7fc209 100644
--- a/tests/generator/out_data_post_fp_cp2k/orig/box.raw
+++ b/tests/generator/out_data_post_fp_cp2k/orig/box.raw
@@ -1 +1 @@
-1.080399990081787109e+01 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.049800014495849609e+01 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.095600032806396484e+01
+1.080400000000000027e+01 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.049799999999999933e+01 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.095599999999999952e+01
diff --git a/tests/generator/out_data_post_fp_cp2k/orig/coord.raw b/tests/generator/out_data_post_fp_cp2k/orig/coord.raw
index fbad9852a..f95b14882 100644
--- a/tests/generator/out_data_post_fp_cp2k/orig/coord.raw
+++ b/tests/generator/out_data_post_fp_cp2k/orig/coord.raw
@@ -1 +1 @@
-1.027354955673217773e+00 1.706662058830261230e+00 1.602476000785827637e+00 3.963681936264038086e+00 3.976695060729980469e+00 3.215037107467651367e+00 4.365913867950439453e+00 5.882829189300537109e+00 5.464285850524902344e+00 1.528406023979187012e+00 2.262054920196533203e+00 3.791754961013793945e+00 6.766289234161376953e+00 7.323278903961181641e+00 7.395022869110107422e+00 8.059174537658691406e+00 9.176419258117675781e+00 5.758306026458740234e+00
+1.027355000000000018e+00 1.706661999999999901e+00 1.602476000000000012e+00 3.963681999999999928e+00 3.976694999999999869e+00 3.215037000000000145e+00 4.365914000000000073e+00 5.882829000000000086e+00 5.464286000000000421e+00 1.528405999999999931e+00 2.262055000000000149e+00 3.791755000000000209e+00 6.766289000000000442e+00 7.323279000000000316e+00 7.395023000000000124e+00 8.059174999999999756e+00 9.176418999999999215e+00 5.758306000000000147e+00
diff --git a/tests/generator/out_data_post_fp_cp2k/orig/energy.raw b/tests/generator/out_data_post_fp_cp2k/orig/energy.raw
index 16e1e92a4..362e9a65e 100644
--- a/tests/generator/out_data_post_fp_cp2k/orig/energy.raw
+++ b/tests/generator/out_data_post_fp_cp2k/orig/energy.raw
@@ -1 +1 @@
--8.447582397460937500e+02
+-8.447582606992446017e+02
diff --git a/tests/generator/out_data_post_fp_cp2k/orig/force.raw b/tests/generator/out_data_post_fp_cp2k/orig/force.raw
index eb099f7db..0ad41126e 100644
--- a/tests/generator/out_data_post_fp_cp2k/orig/force.raw
+++ b/tests/generator/out_data_post_fp_cp2k/orig/force.raw
@@ -1 +1 @@
-6.917656660079956055e-01 7.553510665893554688e-01 2.274964809417724609e+00 -3.209683299064636230e-01 2.775192558765411377e-01 9.094060063362121582e-01 -6.332576274871826172e-02 -6.449618339538574219e-01 -8.145296573638916016e-01 -1.756150871515274048e-01 -3.121818304061889648e-01 -2.260577917098999023e+00 1.112470626831054688e+00 1.688659071922302246e+00 -1.721519827842712402e+00 -1.208800196647644043e+00 -1.778025507926940918e+00 1.601097583770751953e+00
+6.917656471387700901e-01 7.553510904559461725e-01 2.274964715661485837e+00 -3.209683176564304130e-01 2.775192417423087421e-01 9.094059481875964579e-01 -6.332576187642065257e-02 -6.449617955424929994e-01 -8.145296625904011600e-01 -1.756151021831240944e-01 -3.121818289867506202e-01 -2.260577849622959601e+00 1.112470664210258198e+00 1.688659044047888358e+00 -1.721519802047959624e+00 -1.208800137434334454e+00 -1.778025455114995435e+00 1.601097547549200639e+00
diff --git a/tests/generator/out_data_post_fp_vasp/02.fp/task.000.000000/job.json b/tests/generator/out_data_post_fp_vasp/02.fp/task.000.000000/job.json
index e2f74b65b..660b8b34d 100644
--- a/tests/generator/out_data_post_fp_vasp/02.fp/task.000.000000/job.json
+++ b/tests/generator/out_data_post_fp_vasp/02.fp/task.000.000000/job.json
@@ -1 +1,3 @@
-{ "ele_temp": 0 }
+{
+ "ele_temp": 0
+}
diff --git a/tests/generator/out_data_post_fp_vasp/02.fp/task.000.000001/job.json b/tests/generator/out_data_post_fp_vasp/02.fp/task.000.000001/job.json
index ec49f8a06..4d97f09db 100644
--- a/tests/generator/out_data_post_fp_vasp/02.fp/task.000.000001/job.json
+++ b/tests/generator/out_data_post_fp_vasp/02.fp/task.000.000001/job.json
@@ -1 +1,3 @@
-{ "ele_temp": 1 }
+{
+ "ele_temp": 1
+}
diff --git a/tests/generator/out_data_post_fp_vasp/02.fp/task.001.000000/job.json b/tests/generator/out_data_post_fp_vasp/02.fp/task.001.000000/job.json
index c4924f0bd..75362c521 100644
--- a/tests/generator/out_data_post_fp_vasp/02.fp/task.001.000000/job.json
+++ b/tests/generator/out_data_post_fp_vasp/02.fp/task.001.000000/job.json
@@ -1 +1,3 @@
-{ "ele_temp": 100000 }
+{
+ "ele_temp": 100000
+}
diff --git a/tests/generator/out_data_post_fp_vasp/02.fp/task.001.000001/job.json b/tests/generator/out_data_post_fp_vasp/02.fp/task.001.000001/job.json
index a393fb733..ce0542325 100644
--- a/tests/generator/out_data_post_fp_vasp/02.fp/task.001.000001/job.json
+++ b/tests/generator/out_data_post_fp_vasp/02.fp/task.001.000001/job.json
@@ -1 +1,3 @@
-{ "ele_temp": 110000 }
+{
+ "ele_temp": 110000
+}
diff --git a/tests/generator/param-amber.json b/tests/generator/param-amber.json
index 69df44ed3..905af9118 100644
--- a/tests/generator/param-amber.json
+++ b/tests/generator/param-amber.json
@@ -1,7 +1,9 @@
{
"model_devi_jobs": [
{
- "sys_idx": [0]
+ "sys_idx": [
+ 0
+ ]
}
],
"use_multi_systems": true,
@@ -10,7 +12,7 @@
"numb_models": 4,
"mdin_prefix": "amber",
"parm7_prefix": "amber",
- "sys_prefix": "amber",
+ "sys_configs_prefix": "amber",
"disang_prefix": "amber",
"sys_configs": [
[
@@ -33,22 +35,32 @@
0
],
"r": [
- [-1.20]
+ [
+ -1.2
+ ]
],
"nsteps": [
1000
],
- "type_map": ["C", "H", "O", "N", "P", "HW", "OW"],
+ "type_map": [
+ "C",
+ "H",
+ "O",
+ "N",
+ "P",
+ "HW",
+ "OW"
+ ],
"shuffle_poscar": false,
"low_level": "DFTB2",
"high_level": "PBE0",
"cutoff": 6.0,
"fp_task_max": 1000,
"model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.10,
+ "model_devi_f_trust_lo": 0.1,
"model_devi_f_trust_hi": 0.25,
"fp_params": {
"low_level_mdin": "ml.mdin",
"high_level_mdin": "ml.mdin"
}
-}
\ No newline at end of file
+}
diff --git a/tests/generator/param-custom-fp.json b/tests/generator/param-custom-fp.json
new file mode 100644
index 000000000..f62a48816
--- /dev/null
+++ b/tests/generator/param-custom-fp.json
@@ -0,0 +1,321 @@
+{
+ "type_map": [
+ "C",
+ "H",
+ "N"
+ ],
+ "mass_map": [
+ 16,
+ 2,
+ 14
+ ],
+ "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
+ "init_data_sys": [
+ "Pyridine-I",
+ "Pyridine-II"
+ ],
+ "init_batch_size": [
+ 1,
+ 1
+ ],
+ "sys_configs": [
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 81,
+ 81,
+ 20
+ ],
+ "rcut": 6.5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
+ },
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.001,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "03"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "04"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "05"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "06"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "07"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "custom",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [],
+ "fp_params": {
+ "input_fn": "input.h5",
+ "input_fmt": "deepmd/hdf5",
+ "output_fn": "output.h5",
+ "output_fmt": "deepmd/hdf5"
+ },
+ "_comment12": " that's all "
+}
diff --git a/tests/generator/param-methane-abacus-diy.json b/tests/generator/param-methane-abacus-diy.json
index f7dbbe3d3..da70ed645 100644
--- a/tests/generator/param-methane-abacus-diy.json
+++ b/tests/generator/param-methane-abacus-diy.json
@@ -1,138 +1,162 @@
{
- "type_map": ["H", "C"],
- "mass_map": [1.0, 12.0],
-
- "_comment": "initial data set for Training and the number of frames in each training batch",
- "init_data_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run_abacus/",
- "init_data_sys": [
- "abacus_init_data"
- ],
- "init_batch_size": [
- 8
- ],
-
- "_comment": "configurations for starting MD in Exploration and batch sizes when traning snapshots derived from these configs (if they were selected)",
- "sys_configs_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run",
- "sys_configs": [
- [
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000000/POSCAR",
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000001/POSCAR",
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000[2-9]/POSCAR"
+ "type_map": [
+ "H",
+ "C"
],
- [
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
- ]
- ],
- "sys_batch_size": [
- 8,
- 8
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
-
- "default_training_param": {
- "model": {
- "type_map": ["H","C"],
- "descriptor": {
- "type": "se_a",
- "sel": [16,4],
- "rcut_smth": 0.5,
- "rcut": 5.0,
- "neuron": [10,20,40],
- "resnet_dt": false,
- "axis_neuron": 12,
- "seed": 0
- },
- "fitting_net": {
- "neuron": [120,120,120],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
- "seed": 0
- }
- },
- "loss": {
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0
- },
- "learning_rate": {
- "type": "exp",
- "start_lr": 0.001,
- "decay_steps": 180,
- "decay_rate": 0.95
+ "mass_map": [
+ 1.0,
+ 12.0
+ ],
+ "_comment1": "initial data set for Training and the number of frames in each training batch",
+ "init_data_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run_abacus/",
+ "init_data_sys": [
+ "abacus_init_data"
+ ],
+ "init_batch_size": [
+ 8
+ ],
+ "_comment2": "configurations for starting MD in Exploration and batch sizes when traning snapshots derived from these configs (if they were selected)",
+ "sys_configs_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run",
+ "sys_configs": [
+ [
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000000/POSCAR",
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000001/POSCAR",
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000[2-9]/POSCAR"
+ ],
+ [
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 8,
+ 8
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "type_map": [
+ "H",
+ "C"
+ ],
+ "descriptor": {
+ "type": "se_a",
+ "sel": [
+ 16,
+ 4
+ ],
+ "rcut_smth": 0.5,
+ "rcut": 5.0,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 12,
+ "seed": 0
+ },
+ "fitting_net": {
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true,
+ "coord_norm": true,
+ "type_fitting_net": false,
+ "seed": 0
+ }
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0
+ },
+ "learning_rate": {
+ "type": "exp",
+ "start_lr": 0.001,
+ "decay_steps": 180,
+ "stop_lr": 3.505266624882874e-08
+ },
+ "training": {
+ "stop_batch": 36000,
+ "seed": 1,
+ "_comment4": "frequencies counted in batch",
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
- "training": {
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 36000,
- "batch_size": 1,
- "seed": 1,
- "_comment": "frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 4,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json"
- }
- },
-
- "_comment": " 01.model_devi ",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.15,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {
- "sys_idx": [
+ "_comment5": " 01.model_devi ",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "01"
+ }
+ ],
+ "_comment6": " 02.fp ",
+ "fp_style": "abacus",
+ "shuffle_poscar": false,
+ "fp_task_max": 30,
+ "fp_task_min": 8,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "./H_HSCV_PBE-1.0.UPF",
+ "./C_HSCV_PBE-1.0.UPF"
+ ],
+ "fp_incar": "abacus/INPUT.diy",
+ "_k_points": [
+ 3,
+ 3,
+ 3,
+ 0,
+ 0,
0
- ],
- "temps": [
- 50
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 1000,
- "ensemble": "nvt",
- "_idx": "00"
- },
- {
- "sys_idx": [
- 1
- ],
- "temps": [
- 50
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 3000,
- "ensemble": "nvt",
- "_idx": "01"
- }
- ],
-
- "_comment": " 02.fp ",
- "fp_style": "abacus",
- "shuffle_poscar": false,
- "fp_task_max": 30,
- "fp_task_min": 8,
- "fp_pp_path": ".",
- "fp_pp_files": [ "./H_HSCV_PBE-1.0.UPF","./C_HSCV_PBE-1.0.UPF"],
- "fp_incar": "abacus/INPUT.diy",
- "_k_points": [3, 3, 3, 0, 0, 0],
- "_fp_kpt_file": "./abacus/KPT"
+ ],
+ "_fp_kpt_file": "./abacus/KPT"
}
diff --git a/tests/generator/param-methane-abacus.json b/tests/generator/param-methane-abacus.json
index 2f9ff1b96..50b21a0ec 100644
--- a/tests/generator/param-methane-abacus.json
+++ b/tests/generator/param-methane-abacus.json
@@ -1,160 +1,184 @@
{
- "type_map": ["H", "C"],
- "mass_map": [1.0, 12.0],
-
- "_comment": "initial data set for Training and the number of frames in each training batch",
- "init_data_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run_abacus/",
- "init_data_sys": [
- "abacus_init_data"
- ],
- "init_batch_size": [
- 8
- ],
-
- "_comment": "configurations for starting MD in Exploration and batch sizes when traning snapshots derived from these configs (if they were selected)",
- "sys_configs_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run",
- "sys_configs": [
- [
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000000/POSCAR",
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000001/POSCAR",
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000[2-9]/POSCAR"
+ "type_map": [
+ "H",
+ "C"
],
- [
- "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
- ]
- ],
- "sys_batch_size": [
- 8,
- 8
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
-
- "default_training_param": {
- "model": {
- "type_map": ["H","C"],
- "descriptor": {
- "type": "se_a",
- "sel": [16,4],
- "rcut_smth": 0.5,
- "rcut": 5.0,
- "neuron": [10,20,40],
- "resnet_dt": false,
- "axis_neuron": 12,
- "seed": 0
- },
- "fitting_net": {
- "neuron": [120,120,120],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
- "seed": 0
- }
- },
- "loss": {
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0
- },
- "learning_rate": {
- "type": "exp",
- "start_lr": 0.001,
- "decay_steps": 180,
- "decay_rate": 0.95
+ "mass_map": [
+ 1.0,
+ 12.0
+ ],
+ "_comment1": "initial data set for Training and the number of frames in each training batch",
+ "init_data_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run_abacus/",
+ "init_data_sys": [
+ "abacus_init_data"
+ ],
+ "init_batch_size": [
+ 8
+ ],
+ "_comment2": "configurations for starting MD in Exploration and batch sizes when traning snapshots derived from these configs (if they were selected)",
+ "sys_configs_prefix": "/home/mhchen_pkuhpc/mhchen_cls/lustre2/5_liurenxi/5_ABACUS_dpgen_interface/5_dpgen_examples/dpgen-example/run",
+ "sys_configs": [
+ [
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000000/POSCAR",
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/000001/POSCAR",
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000[2-9]/POSCAR"
+ ],
+ [
+ "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 8,
+ 8
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "type_map": [
+ "H",
+ "C"
+ ],
+ "descriptor": {
+ "type": "se_a",
+ "sel": [
+ 16,
+ 4
+ ],
+ "rcut_smth": 0.5,
+ "rcut": 5.0,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 12,
+ "seed": 0
+ },
+ "fitting_net": {
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true,
+ "coord_norm": true,
+ "type_fitting_net": false,
+ "seed": 0
+ }
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0
+ },
+ "learning_rate": {
+ "type": "exp",
+ "start_lr": 0.001,
+ "decay_steps": 180,
+ "stop_lr": 3.505266624882874e-08
+ },
+ "training": {
+ "stop_batch": 36000,
+ "seed": 1,
+ "_comment4": "frequencies counted in batch",
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
- "training": {
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 36000,
- "batch_size": 1,
- "seed": 1,
- "_comment": "frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 4,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json"
- }
- },
-
- "_comment": " 01.model_devi ",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.15,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {
- "sys_idx": [
+ "_comment5": " 01.model_devi ",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "nvt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1
+ ],
+ "trj_freq": 10,
+ "nsteps": 3000,
+ "ensemble": "nvt",
+ "_idx": "01"
+ }
+ ],
+ "_comment6": " 02.fp ",
+ "fp_style": "abacus",
+ "shuffle_poscar": false,
+ "fp_task_max": 30,
+ "fp_task_min": 8,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "./H_HSCV_PBE-1.0.UPF",
+ "./C_HSCV_PBE-1.0.UPF"
+ ],
+ "_fp_kpt_file": "./abacus/KPT",
+ "_k_points": [
+ 3,
+ 3,
+ 3,
+ 0,
+ 0,
0
- ],
- "temps": [
- 50
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 1000,
- "ensemble": "nvt",
- "_idx": "00"
- },
- {
- "sys_idx": [
- 1
- ],
- "temps": [
- 50
- ],
- "press": [
- 1
- ],
- "trj_freq": 10,
- "nsteps": 3000,
- "ensemble": "nvt",
- "_idx": "01"
+ ],
+ "user_fp_params": {
+ "ecutwfc": 80,
+ "scf_thr": 1e-07,
+ "scf_nmax": 50,
+ "basis_type": "pw",
+ "gamma_only": 1,
+ "_kspacing": 0.04,
+ "dft_functional": "pbe",
+ "mixing_type": "pulay",
+ "mixing_beta": 0.4,
+ "symmetry": 1,
+ "nbands": 5,
+ "nspin": 1,
+ "ks_solver": "cg",
+ "smearing_method": "fixed",
+ "smearing_sigma": 0.001,
+ "cal_force": 1,
+ "cal_stress": 1,
+ "deepks_out_labels": 0,
+ "deepks_descriptor_lmax": 0,
+ "deepks_scf": 0,
+ "deepks_model": "model.ptg"
}
- ],
-
- "_comment": " 02.fp ",
- "fp_style": "abacus",
- "shuffle_poscar": false,
- "fp_task_max": 30,
- "fp_task_min": 8,
- "fp_pp_path": ".",
- "fp_pp_files": [ "./H_HSCV_PBE-1.0.UPF","./C_HSCV_PBE-1.0.UPF"],
- "_fp_kpt_file": "./abacus/KPT",
- "_k_points": [3,3,3,0,0,0],
- "user_fp_params":{
- "ecutwfc": 80,
- "scf_thr": 1e-7,
- "scf_nmax": 50,
- "basis_type": "pw",
- "gamma_only": 1,
- "_kspacing": 0.04,
- "dft_functional": "pbe",
- "mixing_type": "pulay",
- "mixing_beta": 0.4,
- "symmetry": 1,
- "nbands": 5,
- "nspin": 1,
- "ks_solver": "cg",
- "smearing_method": "fixed",
- "smearing_sigma": 0.001,
- "cal_force":1,
- "cal_stress":1,
- "deepks_out_labels":0,
- "deepks_descriptor_lmax":0,
- "deepks_scf":0,
- "deepks_model":"model.ptg"
- }
}
diff --git a/tests/generator/param-mg-pimd-vasp.json b/tests/generator/param-mg-pimd-vasp.json
new file mode 100644
index 000000000..efd75dd5c
--- /dev/null
+++ b/tests/generator/param-mg-pimd-vasp.json
@@ -0,0 +1,153 @@
+{
+ "type_map": [
+ "Mg",
+ "Al"
+ ],
+ "mass_map": [
+ 24,
+ 27
+ ],
+ "init_data_prefix": "data",
+ "init_data_sys": [
+ "deepmd"
+ ],
+ "init_batch_size": [
+ 16
+ ],
+ "sys_configs": [
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000000/POSCAR"
+ ],
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000001/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 90
+ ],
+ "rcut": 6.0,
+ "rcut_smth": 2.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
+ },
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 1
+ ],
+ "temps": [
+ 50,
+ 100
+ ],
+ "press": [
+ 1.0,
+ 2.0
+ ],
+ "nbeads": 4,
+ "trj_freq": 10,
+ "nsteps": 10,
+ "ensemble": "npt",
+ "_idx": "00"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "vasp/potcars/POTCAR.mg",
+ "vasp/potcars/POTCAR.al"
+ ],
+ "_comment12": " user provided vasp script ",
+ "user_fp_params": {
+ "PREC": "A",
+ "ENCUT": 600,
+ "ISYM": 0,
+ "ALGO": "fast",
+ "EDIFF": 1e-05,
+ "LREAL": "A",
+ "NPAR": 1,
+ "KPAR": 1,
+ "NELMIN": 4,
+ "ISIF": 2,
+ "ISMEAR": 1,
+ "SIGMA": 0.25,
+ "IBRION": -1,
+ "NSW": 0,
+ "LWAVE": false,
+ "LCHARG": false,
+ "PSTRESS": 0,
+ "KSPACING": 0.16,
+ "KGAMMA": false
+ },
+ "_comment13": " that's all "
+}
diff --git a/tests/generator/param-mg-vasp-diy.json b/tests/generator/param-mg-vasp-diy.json
index f095f85f1..d66e6fb19 100644
--- a/tests/generator/param-mg-vasp-diy.json
+++ b/tests/generator/param-mg-vasp-diy.json
@@ -1,89 +1,133 @@
{
- "type_map": ["Mg", "Al"],
- "mass_map": [24, 27],
-
- "init_data_prefix": "data",
- "init_data_sys": ["deepmd"
- ],
- "init_batch_size": [16],
- "sys_configs": [
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000010/POSCAR"],
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/00000[8-9]/POSCAR"]
+ "type_map": [
+ "Mg",
+ "Al"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [90],
- "rcut_smth": 2.00,
- "rcut": 6.00,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 24,
+ 27
+ ],
+ "init_data_prefix": "data",
+ "init_data_sys": [
+ "deepmd"
+ ],
+ "init_batch_size": [
+ 16
+ ],
+ "sys_configs": [
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000010/POSCAR"
+ ],
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/00000[8-9]/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 90
+ ],
+ "rcut": 6.0,
+ "rcut_smth": 2.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {"sys_idx": [0,1], "temps": [50,100], "press": [1.0,2.0], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 1
+ ],
+ "temps": [
+ 50,
+ 100
+ ],
+ "press": [
+ 1.0,
+ 2.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "vasp/potcars/POTCAR.mg",
+ "vasp/potcars/POTCAR.al"
],
-
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": ".",
- "fp_pp_files": ["vasp/potcars/POTCAR.mg", "vasp/potcars/POTCAR.al"],
- "_comment": " user provided vasp script ",
- "fp_incar" : "vasp/INCAR.diy",
+ "_comment12": " user provided vasp script ",
+ "fp_incar": "vasp/INCAR.diy",
"fp_nbands_esti_data": "vasp/nbands_esti.out",
- "_comment": " that's all "
+ "_comment13": " that's all "
}
diff --git a/tests/generator/param-mg-vasp-multi-trust.json b/tests/generator/param-mg-vasp-multi-trust.json
index acd7e1865..b2cc9b5e1 100644
--- a/tests/generator/param-mg-vasp-multi-trust.json
+++ b/tests/generator/param-mg-vasp-multi-trust.json
@@ -1,111 +1,161 @@
-{
- "type_map": ["Mg", "Al"],
- "mass_map": [24, 27],
-
- "init_data_prefix": "data",
- "init_data_sys": ["deepmd"
- ],
- "init_batch_size": [16],
- "sys_configs": [
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000000/POSCAR"],
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000001/POSCAR"]
+{
+ "type_map": [
+ "Mg",
+ "Al"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "train_param": "input.json",
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [90],
- "rcut_smth": 2.00,
- "rcut": 6.00,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 24,
+ 27
+ ],
+ "init_data_prefix": "data",
+ "init_data_sys": [
+ "deepmd"
+ ],
+ "init_batch_size": [
+ 16
+ ],
+ "sys_configs": [
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000000/POSCAR"
+ ],
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000001/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "train_param": "input.json",
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 90
+ ],
+ "rcut": 6.0,
+ "rcut_smth": 2.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
+ },
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": [
+ 0.0,
+ 0.05
+ ],
+ "model_devi_f_trust_hi": {
+ "1": 0.1,
+ "0": 0.15
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": [0.000, 0.050],
- "model_devi_f_trust_hi": {"1": 0.100, "0": 0.150},
- "model_devi_e_trust_lo": 1e10,
- "model_devi_e_trust_hi": 1e10,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {"sys_idx": [0, 1], "temps": [50,100], "press": [1.0,2.0], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"}
+ "model_devi_e_trust_lo": 10000000000.0,
+ "model_devi_e_trust_hi": 10000000000.0,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 1
+ ],
+ "temps": [
+ 50,
+ 100
+ ],
+ "press": [
+ 1.0,
+ 2.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "vasp/potcars/POTCAR.mg",
+ "vasp/potcars/POTCAR.al"
],
-
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": ".",
- "fp_pp_files": ["vasp/potcars/POTCAR.mg", "vasp/potcars/POTCAR.al"],
- "_comment": " user provided vasp script ",
+ "_comment12": " user provided vasp script ",
"user_fp_params": {
- "PREC": "A",
- "ENCUT": 600,
- "ISYM": 0,
- "ALGO": "fast",
- "EDIFF": 1e-05,
- "LREAL": "A",
- "NPAR": 1,
- "KPAR": 1,
- "NELMIN": 4,
- "ISIF": 2,
- "ISMEAR": 1,
- "SIGMA": 0.25,
- "IBRION": -1,
- "NSW": 0,
- "LWAVE": false,
- "LCHARG": false,
- "PSTRESS": 0,
- "KSPACING": 0.16,
- "KGAMMA": false
+ "PREC": "A",
+ "ENCUT": 600,
+ "ISYM": 0,
+ "ALGO": "fast",
+ "EDIFF": 1e-05,
+ "LREAL": "A",
+ "NPAR": 1,
+ "KPAR": 1,
+ "NELMIN": 4,
+ "ISIF": 2,
+ "ISMEAR": 1,
+ "SIGMA": 0.25,
+ "IBRION": -1,
+ "NSW": 0,
+ "LWAVE": false,
+ "LCHARG": false,
+ "PSTRESS": 0,
+ "KSPACING": 0.16,
+ "KGAMMA": false
},
- "_comment": " that's all "
+ "_comment13": " that's all "
}
diff --git a/tests/generator/param-mg-vasp-old.json b/tests/generator/param-mg-vasp-old.json
index 3926876c2..83a86a439 100644
--- a/tests/generator/param-mg-vasp-old.json
+++ b/tests/generator/param-mg-vasp-old.json
@@ -1,103 +1,147 @@
-{
- "type_map": ["Mg", "Al"],
- "mass_map": [24, 27],
-
- "init_data_prefix": "data",
- "init_data_sys": ["deepmd"
- ],
- "init_batch_size": [16],
- "sys_configs": [
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000010/POSCAR"],
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/00000[8-9]/POSCAR"]
+{
+ "type_map": [
+ "Mg",
+ "Al"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [90],
- "rcut_smth": 2.00,
- "rcut": 6.00,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 24,
+ 27
+ ],
+ "init_data_prefix": "data",
+ "init_data_sys": [
+ "deepmd"
+ ],
+ "init_batch_size": [
+ 16
+ ],
+ "sys_configs": [
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000010/POSCAR"
+ ],
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/00000[8-9]/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 90
+ ],
+ "rcut": 6.0,
+ "rcut_smth": 2.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {"sys_idx": [0,1], "temps": [50,100], "press": [1.0,2.0], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 1
+ ],
+ "temps": [
+ 50,
+ 100
+ ],
+ "press": [
+ 1.0,
+ 2.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "vasp/potcars/POTCAR.mg",
+ "vasp/potcars/POTCAR.al"
],
-
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": ".",
- "fp_pp_files": ["vasp/potcars/POTCAR.mg", "vasp/potcars/POTCAR.al"],
- "fp_params": {
- "_comment": "given in unit depending on the fp method",
- "ecut": 600,
- "ediff": 1e-6,
- "kspacing": 0.16,
- "_comment": "gauss, mp:N(methfessel-paxton:order by default order=1), fd(Fermi-Dirac)",
- "smearing": "mp",
- "sigma": 0.25,
- "_comment": "only for vasp, can be NONE, SCAN, TPSS, RTPSS, M06L or MBJ",
- "metagga": "NONE",
- "npar": 1,
- "kpar": 1,
- "user_vasp_params": {
- "EDIFF" : 1e-5
- },
- "_comment": " that's all "
+ "fp_params": {
+ "_comment12": "given in unit depending on the fp method",
+ "ecut": 600,
+ "ediff": 1e-06,
+ "kspacing": 0.16,
+ "_comment13": "gauss, mp:N(methfessel-paxton:order by default order=1), fd(Fermi-Dirac)",
+ "smearing": "mp",
+ "sigma": 0.25,
+ "_comment14": "only for vasp, can be NONE, SCAN, TPSS, RTPSS, M06L or MBJ",
+ "metagga": "NONE",
+ "npar": 1,
+ "kpar": 1,
+ "user_vasp_params": {
+ "EDIFF": 1e-05
+ },
+ "_comment15": " that's all "
},
- "_comment": " that's all "
+ "_comment16": " that's all "
}
diff --git a/tests/generator/param-mg-vasp-v1-et.json b/tests/generator/param-mg-vasp-v1-et.json
index cfa8071d1..80c088102 100644
--- a/tests/generator/param-mg-vasp-v1-et.json
+++ b/tests/generator/param-mg-vasp-v1-et.json
@@ -1,96 +1,134 @@
{
- "type_map": ["Al", "Mg"],
- "mass_map": [27, 24],
- "use_ele_temp": 2,
-
- "init_data_prefix": "data",
- "init_data_sys": ["deepmd"
- ],
- "init_batch_size": [16],
- "sys_configs": [
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000010/POSCAR"],
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/00000[8-9]/POSCAR"]
+ "type_map": [
+ "Al",
+ "Mg"
],
- "sys_batch_size": [1,1],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "model" : {
- "descriptor": {
- "type": "se_a",
- "sel": [90, 90],
- "rcut_smth": 1.80,
- "rcut": 6.00,
- "neuron": [10, 20, 40],
- "resnet_dt": false,
- "axis_neuron": 4,
- "seed": 1
- },
- "fitting_net" : {
- "neuron": [120, 120, 120],
- "resnet_dt": true,
- "numb_fparam": 10,
- "seed": 1
- }
- },
-
- "loss" : {
- "start_pref_e": 0.02,
- "limit_pref_e": 1,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0
- },
-
- "learning_rate" : {
- "start_lr": 0.001,
- "decay_steps": 5000,
- "decay_rate": 0.95
- },
-
- "training" : {
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 1000,
- "batch_size": 1,
-
- "seed": 1,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 1,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training":true,
- "time_training":true,
- "profiling": false,
- "profiling_file": "timeline.json"
- }
+ "mass_map": [
+ 27,
+ 24
+ ],
+ "use_ele_temp": 2,
+ "init_data_prefix": "data",
+ "init_data_sys": [
+ "deepmd"
+ ],
+ "init_batch_size": [
+ 16
+ ],
+ "sys_configs": [
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000010/POSCAR"
+ ],
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/00000[8-9]/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 1,
+ 1
+ ],
+ "_comment1": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "type": "se_a",
+ "sel": [
+ 90,
+ 90
+ ],
+ "rcut_smth": 1.8,
+ "rcut": 6.0,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 4,
+ "seed": 1
+ },
+ "fitting_net": {
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true,
+ "numb_fparam": 10,
+ "seed": 1
+ }
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 1,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0
+ },
+ "learning_rate": {
+ "start_lr": 0.001,
+ "decay_steps": 5000,
+ "stop_lr": 0.0009897937816869885
+ },
+ "training": {
+ "stop_batch": 1000,
+ "seed": 1,
+ "_comment2": " display and restart",
+ "_comment3": " frequencies counted in batch",
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json",
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.20,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- { "_idx": 0, "ensemble": "npt", "nsteps": 50, "press": [1.0,2.0], "sys_idx": [0, 1], "temps": [50,100], "trj_freq": 10 }
+ "_comment4": " 01.model_devi ",
+ "_comment5": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.2,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "_idx": 0,
+ "ensemble": "npt",
+ "nsteps": 50,
+ "press": [
+ 1.0,
+ 2.0
+ ],
+ "sys_idx": [
+ 0,
+ 1
+ ],
+ "temps": [
+ 50,
+ 100
+ ],
+ "trj_freq": 10
+ }
+ ],
+ "_comment6": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 8,
+ "fp_task_min": 2,
+ "fp_pp_path": "/home/wanghan/study/deep.md/dpgen/almg/vasp",
+ "fp_pp_files": [
+ "POTCAR.Al",
+ "POTCAR.Mg"
],
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 8,
- "fp_task_min": 2,
- "fp_pp_path": "/home/wanghan/study/deep.md/dpgen/almg/vasp",
- "fp_pp_files": ["POTCAR.Al", "POTCAR.Mg"],
- "fp_incar": "/home/wanghan/study/deep.md/dpgen/almg/vasp/INCAR",
- "_comment": " that's all "
+ "fp_incar": "/home/wanghan/study/deep.md/dpgen/almg/vasp/INCAR",
+ "_comment7": " that's all "
}
-
diff --git a/tests/generator/param-mg-vasp-v1.json b/tests/generator/param-mg-vasp-v1.json
index 9355bea0d..79b296b8f 100644
--- a/tests/generator/param-mg-vasp-v1.json
+++ b/tests/generator/param-mg-vasp-v1.json
@@ -1,95 +1,133 @@
{
- "type_map": ["Al", "Mg"],
- "mass_map": [27, 24],
- "use_ele_temp": 0,
-
- "init_data_prefix": "data",
- "init_data_sys": ["deepmd"
- ],
- "init_batch_size": [16],
- "sys_configs": [
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000010/POSCAR"],
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/00000[8-9]/POSCAR"]
+ "type_map": [
+ "Al",
+ "Mg"
],
- "sys_batch_size": [1,1],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "model" : {
- "descriptor": {
- "type": "se_a",
- "sel": [90, 90],
- "rcut_smth": 1.80,
- "rcut": 6.00,
- "neuron": [10, 20, 40],
- "resnet_dt": false,
- "axis_neuron": 4,
- "seed": 1
- },
- "fitting_net" : {
- "neuron": [120, 120, 120],
- "resnet_dt": true,
- "seed": 1
- }
- },
-
- "loss" : {
- "start_pref_e": 0.02,
- "limit_pref_e": 1,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0,
- "limit_pref_v": 0
- },
-
- "learning_rate" : {
- "start_lr": 0.001,
- "decay_steps": 5000,
- "decay_rate": 0.95
- },
-
- "training" : {
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 1000,
- "batch_size": 1,
-
- "seed": 1,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 1,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training":true,
- "time_training":true,
- "profiling": false,
- "profiling_file": "timeline.json"
- }
+ "mass_map": [
+ 27,
+ 24
+ ],
+ "use_ele_temp": 0,
+ "init_data_prefix": "data",
+ "init_data_sys": [
+ "deepmd"
+ ],
+ "init_batch_size": [
+ 16
+ ],
+ "sys_configs": [
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000010/POSCAR"
+ ],
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/00000[8-9]/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 1,
+ 1
+ ],
+ "_comment1": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "type": "se_a",
+ "sel": [
+ 90,
+ 90
+ ],
+ "rcut_smth": 1.8,
+ "rcut": 6.0,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "resnet_dt": false,
+ "axis_neuron": 4,
+ "seed": 1
+ },
+ "fitting_net": {
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true,
+ "seed": 1
+ }
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 1,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0,
+ "limit_pref_v": 0
+ },
+ "learning_rate": {
+ "start_lr": 0.001,
+ "decay_steps": 5000,
+ "decay_rate": 0.95
+ },
+ "training": {
+ "systems": [],
+ "set_prefix": "set",
+ "stop_batch": 1000,
+ "batch_size": 1,
+ "seed": 1,
+ "_comment2": " display and restart",
+ "_comment3": " frequencies counted in batch",
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "numb_test": 1,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "load_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "profiling_file": "timeline.json"
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.20,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- { "_idx": 0, "ensemble": "npt", "nsteps": 50, "press": [1.0,2.0], "sys_idx": [0, 1], "temps": [50,100], "trj_freq": 10 }
+ "_comment4": " 01.model_devi ",
+ "_comment5": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.2,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "_idx": 0,
+ "ensemble": "npt",
+ "nsteps": 50,
+ "press": [
+ 1.0,
+ 2.0
+ ],
+ "sys_idx": [
+ 0,
+ 1
+ ],
+ "temps": [
+ 50,
+ 100
+ ],
+ "trj_freq": 10
+ }
+ ],
+ "_comment6": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 8,
+ "fp_task_min": 2,
+ "fp_pp_path": "/home/wanghan/study/deep.md/dpgen/almg/vasp",
+ "fp_pp_files": [
+ "POTCAR.Al",
+ "POTCAR.Mg"
],
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 8,
- "fp_task_min": 2,
- "fp_pp_path": "/home/wanghan/study/deep.md/dpgen/almg/vasp",
- "fp_pp_files": ["POTCAR.Al", "POTCAR.Mg"],
- "fp_incar": "/home/wanghan/study/deep.md/dpgen/almg/vasp/INCAR",
- "_comment": " that's all "
+ "fp_incar": "/home/wanghan/study/deep.md/dpgen/almg/vasp/INCAR",
+ "_comment7": " that's all "
}
-
diff --git a/tests/generator/param-mg-vasp.json b/tests/generator/param-mg-vasp.json
index df2c86172..2de1d32a6 100644
--- a/tests/generator/param-mg-vasp.json
+++ b/tests/generator/param-mg-vasp.json
@@ -1,108 +1,152 @@
-{
- "type_map": ["Mg", "Al"],
- "mass_map": [24, 27],
-
- "init_data_prefix": "data",
- "init_data_sys": ["deepmd"
- ],
- "init_batch_size": [16],
- "sys_configs": [
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000000/POSCAR"],
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000001/POSCAR"]
+{
+ "type_map": [
+ "Mg",
+ "Al"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [90],
- "rcut_smth": 2.00,
- "rcut": 6.00,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 24,
+ 27
+ ],
+ "init_data_prefix": "data",
+ "init_data_sys": [
+ "deepmd"
+ ],
+ "init_batch_size": [
+ 16
+ ],
+ "sys_configs": [
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000000/POSCAR"
+ ],
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000001/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 90
+ ],
+ "rcut": 6.0,
+ "rcut_smth": 2.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {"sys_idx": [0,1], "temps": [50,100], "press": [1.0,2.0], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 1
+ ],
+ "temps": [
+ 50,
+ 100
+ ],
+ "press": [
+ 1.0,
+ 2.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "vasp/potcars/POTCAR.mg",
+ "vasp/potcars/POTCAR.al"
],
-
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": ".",
- "fp_pp_files": ["vasp/potcars/POTCAR.mg", "vasp/potcars/POTCAR.al"],
- "_comment": " user provided vasp script ",
+ "_comment12": " user provided vasp script ",
"user_fp_params": {
- "PREC": "A",
- "ENCUT": 600,
- "ISYM": 0,
- "ALGO": "fast",
- "EDIFF": 1e-05,
- "LREAL": "A",
- "NPAR": 1,
- "KPAR": 1,
- "NELMIN": 4,
- "ISIF": 2,
- "ISMEAR": 1,
- "SIGMA": 0.25,
- "IBRION": -1,
- "NSW": 0,
- "LWAVE": false,
- "LCHARG": false,
- "PSTRESS": 0,
- "KSPACING": 0.16,
- "KGAMMA": false
+ "PREC": "A",
+ "ENCUT": 600,
+ "ISYM": 0,
+ "ALGO": "fast",
+ "EDIFF": 1e-05,
+ "LREAL": "A",
+ "NPAR": 1,
+ "KPAR": 1,
+ "NELMIN": 4,
+ "ISIF": 2,
+ "ISMEAR": 1,
+ "SIGMA": 0.25,
+ "IBRION": -1,
+ "NSW": 0,
+ "LWAVE": false,
+ "LCHARG": false,
+ "PSTRESS": 0,
+ "KSPACING": 0.16,
+ "KGAMMA": false
},
- "_comment": " that's all "
+ "_comment13": " that's all "
}
diff --git a/tests/generator/param-mg-vasp_merge_traj.json b/tests/generator/param-mg-vasp_merge_traj.json
index 4d8f1c75f..0d51ffeb1 100644
--- a/tests/generator/param-mg-vasp_merge_traj.json
+++ b/tests/generator/param-mg-vasp_merge_traj.json
@@ -1,108 +1,152 @@
-{
- "type_map": ["Mg", "Al"],
- "mass_map": [24, 27],
-
- "init_data_prefix": "data",
- "init_data_sys": ["deepmd"
- ],
- "init_batch_size": [16],
- "sys_configs": [
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000000/POSCAR"],
- ["data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000001/POSCAR"]
+{
+ "type_map": [
+ "Mg",
+ "Al"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [90],
- "rcut_smth": 2.00,
- "rcut": 6.00,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 24,
+ 27
+ ],
+ "init_data_prefix": "data",
+ "init_data_sys": [
+ "deepmd"
+ ],
+ "init_batch_size": [
+ 16
+ ],
+ "sys_configs": [
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000000/POSCAR"
+ ],
+ [
+ "data/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale*/000001/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 90
+ ],
+ "rcut": 6.0,
+ "rcut_smth": 2.0,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
"model_devi_merge_traj": true,
- "model_devi_jobs": [
- {"sys_idx": [0,1], "temps": [50,100], "press": [1.0,2.0], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"}
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 1
+ ],
+ "temps": [
+ 50,
+ 100
+ ],
+ "press": [
+ 1.0,
+ 2.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "vasp/potcars/POTCAR.mg",
+ "vasp/potcars/POTCAR.al"
],
-
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": ".",
- "fp_pp_files": ["vasp/potcars/POTCAR.mg", "vasp/potcars/POTCAR.al"],
- "_comment": " user provided vasp script ",
+ "_comment12": " user provided vasp script ",
"user_fp_params": {
- "PREC": "A",
- "ENCUT": 600,
- "ISYM": 0,
- "ALGO": "fast",
- "EDIFF": 1e-05,
- "LREAL": "A",
- "NPAR": 1,
- "KPAR": 1,
- "NELMIN": 4,
- "ISIF": 2,
- "ISMEAR": 1,
- "SIGMA": 0.25,
- "IBRION": -1,
- "NSW": 0,
- "LWAVE": false,
- "LCHARG": false,
- "PSTRESS": 0,
- "KSPACING": 0.16,
- "KGAMMA": false
+ "PREC": "A",
+ "ENCUT": 600,
+ "ISYM": 0,
+ "ALGO": "fast",
+ "EDIFF": 1e-05,
+ "LREAL": "A",
+ "NPAR": 1,
+ "KPAR": 1,
+ "NELMIN": 4,
+ "ISIF": 2,
+ "ISMEAR": 1,
+ "SIGMA": 0.25,
+ "IBRION": -1,
+ "NSW": 0,
+ "LWAVE": false,
+ "LCHARG": false,
+ "PSTRESS": 0,
+ "KSPACING": 0.16,
+ "KGAMMA": false
},
- "_comment": " that's all "
+ "_comment13": " that's all "
}
diff --git a/tests/generator/param-mgo-cp2k-exinput.json b/tests/generator/param-mgo-cp2k-exinput.json
index 0c4f33b75..14aa22a41 100644
--- a/tests/generator/param-mgo-cp2k-exinput.json
+++ b/tests/generator/param-mgo-cp2k-exinput.json
@@ -1,102 +1,316 @@
-{
- "type_map": ["C", "H", "N"],
- "mass_map": [16, 2, 14],
-
- "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
- "init_data_sys": ["Pyridine-I",
- "Pyridine-II"
- ],
- "init_batch_size": [1, 1],
- "sys_configs": [
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"]
+{
+ "type_map": [
+ "C",
+ "H",
+ "N"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1, 1, 1,
- 1, 1, 1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [81, 81, 20],
- "rcut_smth": 0.50,
- "rcut": 6.50,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 16,
+ 2,
+ 14
+ ],
+ "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
+ "init_data_sys": [
+ "Pyridine-I",
+ "Pyridine-II"
+ ],
+ "init_batch_size": [
+ 1,
+ 1
+ ],
+ "sys_configs": [
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 81,
+ 81,
+ 20
+ ],
+ "rcut": 6.5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.001,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "01"},
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "02"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "03"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "04"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "05"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "06"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "07"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.001,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "03"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "04"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "05"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "06"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "07"
+ }
],
-
- "_comment": " 02.fp ",
- "fp_style": "cp2k",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": ".",
- "fp_pp_files": [],
+ "_comment11": " 02.fp ",
+ "fp_style": "cp2k",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [],
"external_input_path": "./cp2k_make_fp_files/exinput/template.inp",
- "_comment": " that's all "
+ "_comment12": " that's all "
}
diff --git a/tests/generator/param-pyridine-cp2k.json b/tests/generator/param-pyridine-cp2k.json
index 1dd5f737c..911098807 100644
--- a/tests/generator/param-pyridine-cp2k.json
+++ b/tests/generator/param-pyridine-cp2k.json
@@ -1,105 +1,319 @@
-{
- "type_map": ["C", "H", "N"],
- "mass_map": [16, 2, 14],
-
- "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
- "init_data_sys": ["Pyridine-I",
- "Pyridine-II"
- ],
- "init_batch_size": [1, 1],
- "sys_configs": [
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"]
+{
+ "type_map": [
+ "C",
+ "H",
+ "N"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1, 1, 1,
- 1, 1, 1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [81, 81, 20],
- "rcut_smth": 0.50,
- "rcut": 6.50,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 16,
+ 2,
+ 14
+ ],
+ "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
+ "init_data_sys": [
+ "Pyridine-I",
+ "Pyridine-II"
+ ],
+ "init_batch_size": [
+ 1,
+ 1
+ ],
+ "sys_configs": [
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 81,
+ 81,
+ 20
+ ],
+ "rcut": 6.5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.001,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "01"},
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "02"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "03"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "04"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "05"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "06"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "07"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.001,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "03"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "04"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "05"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "06"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "07"
+ }
],
-
- "_comment": " 02.fp ",
- "fp_style": "cp2k",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": ".",
- "fp_pp_files": [],
- "user_fp_params": {
- "FORCE_EVAL":{
- "DFT":{
+ "_comment11": " 02.fp ",
+ "fp_style": "cp2k",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [],
+ "user_fp_params": {
+ "FORCE_EVAL": {
+ "DFT": {
"SCF": {
"OT": {
"MINIMIZER": "DIIS",
@@ -107,15 +321,26 @@
}
}
},
- "SUBSYS":{
- "KIND":{
- "_": ["N","C","H"],
- "POTENTIAL": ["GTH-PBE-q5","GTH-PBE-q4", "GTH-PBE-q1"],
- "BASIS_SET": ["DZVP-MOLOPT-GTH","DZVP-MOLOPT-GTH","DZVP-MOLOPT-GTH"]
- }
- }
- }
-
+ "SUBSYS": {
+ "KIND": {
+ "_": [
+ "N",
+ "C",
+ "H"
+ ],
+ "POTENTIAL": [
+ "GTH-PBE-q5",
+ "GTH-PBE-q4",
+ "GTH-PBE-q1"
+ ],
+ "BASIS_SET": [
+ "DZVP-MOLOPT-GTH",
+ "DZVP-MOLOPT-GTH",
+ "DZVP-MOLOPT-GTH"
+ ]
+ }
+ }
+ }
},
- "_comment": " that's all "
+ "_comment12": " that's all "
}
diff --git a/tests/generator/param-pyridine-gaussian.json b/tests/generator/param-pyridine-gaussian.json
index a92f6ee6f..a456b26fb 100644
--- a/tests/generator/param-pyridine-gaussian.json
+++ b/tests/generator/param-pyridine-gaussian.json
@@ -1,105 +1,319 @@
-{
- "type_map": ["C", "H", "N"],
- "mass_map": [16, 2, 14],
-
- "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
- "init_data_sys": ["Pyridine-I",
- "Pyridine-II"
- ],
- "init_batch_size": [1, 1],
- "sys_configs": [
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"]
+{
+ "type_map": [
+ "C",
+ "H",
+ "N"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1, 1, 1,
- 1, 1, 1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [81, 81, 20],
- "rcut_smth": 0.50,
- "rcut": 6.50,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 16,
+ 2,
+ 14
+ ],
+ "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
+ "init_data_sys": [
+ "Pyridine-I",
+ "Pyridine-II"
+ ],
+ "init_batch_size": [
+ 1,
+ 1
+ ],
+ "sys_configs": [
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 81,
+ 81,
+ 20
+ ],
+ "rcut": 6.5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.001,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "01"},
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "02"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "03"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "04"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "05"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "06"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "07"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.001,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "03"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "04"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "05"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "06"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "07"
+ }
],
-
- "_comment": " 02.fp ",
- "fp_style": "gaussian",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": ".",
- "fp_pp_files": [],
- "user_fp_params": {
- "nproc": 14,
- "keywords": "force b3lyp/6-31g*"
+ "_comment11": " 02.fp ",
+ "fp_style": "gaussian",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [],
+ "user_fp_params": {
+ "nproc": 14,
+ "keywords": "force b3lyp/6-31g*"
},
- "_comment": " that's all "
+ "_comment12": " that's all "
}
diff --git a/tests/generator/param-pyridine-pwmat.json b/tests/generator/param-pyridine-pwmat.json
index d19f71289..ac73b09b6 100644
--- a/tests/generator/param-pyridine-pwmat.json
+++ b/tests/generator/param-pyridine-pwmat.json
@@ -1,120 +1,337 @@
-{
- "type_map": ["H", "C", "N"],
- "mass_map": [2, 16, 14],
-
- "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
- "init_data_sys": ["Pyridine-I",
- "Pyridine-II"
- ],
- "init_batch_size": [1, 1],
- "sys_configs": [
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"]
+{
+ "type_map": [
+ "H",
+ "C",
+ "N"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1, 1, 1,
- 1, 1, 1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [81, 81, 20],
- "rcut_smth": 0.50,
- "rcut": 6.50,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 2,
+ 16,
+ 14
+ ],
+ "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
+ "init_data_sys": [
+ "Pyridine-I",
+ "Pyridine-II"
+ ],
+ "init_batch_size": [
+ 1,
+ 1
+ ],
+ "sys_configs": [
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 81,
+ 81,
+ 20
+ ],
+ "rcut": 6.5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.001,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "01"},
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "02"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "03"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "04"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "05"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "06"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "07"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.001,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "03"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "04"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "05"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "06"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "07"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "pwmat",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "C.SG15.PBE.UPF",
+ "H.SG15.PBE.UPF",
+ "N.SG15.PBE.UPF"
],
-
- "_comment": " 02.fp ",
- "fp_style": "pwmat",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": ".",
- "fp_pp_files": ["C.SG15.PBE.UPF", "H.SG15.PBE.UPF", "N.SG15.PBE.UPF"],
- "user_fp_params": {
- "node1": 4,
- "node2": 1,
- "job": "SCF",
- "in.atom": "atom.config",
- "in.psp1": "C.SG15.PBE.UPF",
- "in.psp2": "H.SG15.PBE.UPF",
- "in.psp3": "N.SG15.PBE.UPF",
- "ecut": 50,
- "flag_symm": 2,
- "e_error": 1.0E-4,
- "rho_error": 1.0E-4,
- "scf_iter0_1": "6 4 3 0.0000 0.025 2",
- "scf_iter0_2": "94 4 3 1.0000 0.025 2",
- "xcfunctional": "PBE",
- "convergence": "EASY",
- "kspacing": 0.1
-
+ "user_fp_params": {
+ "node1": 4,
+ "node2": 1,
+ "job": "SCF",
+ "in.atom": "atom.config",
+ "in.psp1": "C.SG15.PBE.UPF",
+ "in.psp2": "H.SG15.PBE.UPF",
+ "in.psp3": "N.SG15.PBE.UPF",
+ "ecut": 50,
+ "flag_symm": 2,
+ "e_error": 0.0001,
+ "rho_error": 0.0001,
+ "scf_iter0_1": "6 4 3 0.0000 0.025 2",
+ "scf_iter0_2": "94 4 3 1.0000 0.025 2",
+ "xcfunctional": "PBE",
+ "convergence": "EASY",
+ "kspacing": 0.1
},
- "_comment": " that's all "
+ "_comment12": " that's all "
}
diff --git a/tests/generator/param-pyridine-pwscf-old.json b/tests/generator/param-pyridine-pwscf-old.json
index 145d9aadf..11a419f9e 100644
--- a/tests/generator/param-pyridine-pwscf-old.json
+++ b/tests/generator/param-pyridine-pwscf-old.json
@@ -1,110 +1,328 @@
-{
- "type_map": ["C", "H", "N"],
- "mass_map": [16, 2, 14],
-
- "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
- "init_data_sys": ["Pyridine-I",
- "Pyridine-II"
- ],
- "init_batch_size": [1, 1],
- "sys_configs": [
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"]
+{
+ "type_map": [
+ "C",
+ "H",
+ "N"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1, 1, 1,
- 1, 1, 1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [81, 81, 20],
- "rcut_smth": 0.50,
- "rcut": 6.50,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 16,
+ 2,
+ 14
+ ],
+ "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
+ "init_data_sys": [
+ "Pyridine-I",
+ "Pyridine-II"
+ ],
+ "init_batch_size": [
+ 1,
+ 1
+ ],
+ "sys_configs": [
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 81,
+ 81,
+ 20
+ ],
+ "rcut": 6.5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.001,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "01"},
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "02"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "03"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "04"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "05"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "06"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "07"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.001,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "03"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "04"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "05"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "06"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "07"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "pwscf",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "C_HSCV_PBE-1.0.UPF",
+ "H_HSCV_PBE-1.0.UPF",
+ "N_HSCV_PBE-1.0.UPF"
],
-
- "_comment": " 02.fp ",
- "fp_style": "pwscf",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": ".",
- "fp_pp_files": ["C_HSCV_PBE-1.0.UPF", "H_HSCV_PBE-1.0.UPF", "N_HSCV_PBE-1.0.UPF"],
- "fp_params": {
- "_comment": "given in unit depending on the fp method",
- "ecut": 110,
- "ediff": 1e-8,
- "kspacing": 0.6,
- "npar": 1,
- "kpar": 1,
- "_comment": " that's all "
+ "fp_params": {
+ "_comment12": "given in unit depending on the fp method",
+ "ecut": 110,
+ "ediff": 1e-08,
+ "kspacing": 0.6,
+ "npar": 1,
+ "kpar": 1,
+ "_comment13": " that's all "
},
- "_comment": " that's all "
+ "_comment14": " that's all "
}
diff --git a/tests/generator/param-pyridine-pwscf.json b/tests/generator/param-pyridine-pwscf.json
index 94af3e8b6..c6a7cd80a 100644
--- a/tests/generator/param-pyridine-pwscf.json
+++ b/tests/generator/param-pyridine-pwscf.json
@@ -1,123 +1,341 @@
-{
- "type_map": ["C", "H", "N"],
- "mass_map": [16, 2, 14],
-
- "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
- "init_data_sys": ["Pyridine-I",
- "Pyridine-II"
- ],
- "init_batch_size": [1, 1],
- "sys_configs": [
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"]
+{
+ "type_map": [
+ "C",
+ "H",
+ "N"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1, 1, 1,
- 1, 1, 1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [81, 81, 20],
- "rcut_smth": 0.50,
- "rcut": 6.50,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 16,
+ 2,
+ 14
+ ],
+ "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
+ "init_data_sys": [
+ "Pyridine-I",
+ "Pyridine-II"
+ ],
+ "init_batch_size": [
+ 1,
+ 1
+ ],
+ "sys_configs": [
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 81,
+ 81,
+ 20
+ ],
+ "rcut": 6.5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.001,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "01"},
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "02"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "03"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "04"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "05"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "06"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "07"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.001,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "03"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "04"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "05"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "06"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "07"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "pwscf",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "C_HSCV_PBE-1.0.UPF",
+ "H_HSCV_PBE-1.0.UPF",
+ "N_HSCV_PBE-1.0.UPF"
],
-
- "_comment": " 02.fp ",
- "fp_style": "pwscf",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": ".",
- "fp_pp_files": ["C_HSCV_PBE-1.0.UPF", "H_HSCV_PBE-1.0.UPF", "N_HSCV_PBE-1.0.UPF"],
- "user_fp_params": {
- "_comment": "pseudo_dir will be added automatically",
- "control": {
- "calculation": "scf",
- "restart_mode": "from_scratch",
- "outdir": "./OUT",
- "tprnfor": true,
- "tstress": true,
- "disk_io": "none"
- },
- "_comment": "ibrav, nat and ntyp will be added automatically",
- "system": {
- "vdw_corr": "TS",
- "ecutwfc": 110,
- "ts_vdw_econv_thr": 1e-8,
- "nosym": true
- },
- "electrons": {
- "conv_thr": 1e-8
- },
- "kspacing": 0.6
+ "user_fp_params": {
+ "_comment12": "pseudo_dir will be added automatically",
+ "control": {
+ "calculation": "scf",
+ "restart_mode": "from_scratch",
+ "outdir": "./OUT",
+ "tprnfor": true,
+ "tstress": true,
+ "disk_io": "none"
+ },
+ "_comment13": "ibrav, nat and ntyp will be added automatically",
+ "system": {
+ "vdw_corr": "TS",
+ "ecutwfc": 110,
+ "ts_vdw_econv_thr": 1e-08,
+ "nosym": true
+ },
+ "electrons": {
+ "conv_thr": 1e-08
+ },
+ "kspacing": 0.6
},
- "_comment": " that's all "
+ "_comment14": " that's all "
}
diff --git a/tests/generator/param-pyridine-siesta.json b/tests/generator/param-pyridine-siesta.json
index d718d52ed..3667402fa 100644
--- a/tests/generator/param-pyridine-siesta.json
+++ b/tests/generator/param-pyridine-siesta.json
@@ -1,108 +1,326 @@
-{
- "type_map": ["C", "H", "N"],
- "mass_map": [16, 2, 14],
-
- "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
- "init_data_sys": ["Pyridine-I",
- "Pyridine-II"
- ],
- "init_batch_size": [1, 1],
- "sys_configs": [
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"],
- ["/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"]
+{
+ "type_map": [
+ "C",
+ "H",
+ "N"
],
- "_comment": "0 1 2 3",
- "_comment": "4 5 6 7",
- "sys_batch_size": [1, 1, 1, 1,
- 1, 1, 1, 1
- ],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [81, 81, 20],
- "rcut_smth": 0.50,
- "rcut": 6.50,
- "filter_neuron": [25, 50, 100],
- "filter_resnet_dt": false,
- "n_axis_neuron": 12,
- "n_neuron": [240, 240, 240],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 400000,
- "batch_size": 1,
- "start_lr": 0.002,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 2000,
- "numb_test": 10,
- "save_freq": 20000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "mass_map": [
+ 16,
+ 2,
+ 14
+ ],
+ "init_data_prefix": "/home/linfengz/SCR/wanghan/deepgen.pyridine/init",
+ "init_data_sys": [
+ "Pyridine-I",
+ "Pyridine-II"
+ ],
+ "init_batch_size": [
+ 1,
+ 1
+ ],
+ "sys_configs": [
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyI.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/00009?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[7-8]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[5-6]?/POSCAR"
+ ],
+ [
+ "/home/linfengz/SCR/wanghan/data/pyridine/pyII.POSCAR.01x01x01/01.scale_pert/sys-0080-0080-0016/scale-1.000/0000[0-4]?/POSCAR"
+ ]
+ ],
+ "_comment1": "0 1 2 3",
+ "_comment2": "4 5 6 7",
+ "sys_batch_size": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ "_comment3": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 81,
+ 81,
+ 20
+ ],
+ "rcut": 6.5,
+ "rcut_smth": 0.5,
+ "neuron": [
+ 25,
+ 50,
+ 100
+ ],
+ "axis_neuron": 12,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 240,
+ 240,
+ 240
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.002,
+ "stop_lr": 7.010533249765748e-08
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 400000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 2000,
+ "save_freq": 20000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.001,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.050,
- "model_devi_f_trust_hi": 0.150,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "00"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "01"},
- {"sys_idx": [0,4], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "02"},
- {"sys_idx": [1,5], "temps": [ 50], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "03"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "04"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "05"},
- {"sys_idx": [0,4], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "06"},
- {"sys_idx": [1,5], "temps": [ 100], "press": [1e0,1e1,1e2,1e3,1e4,2e4,4e4], "trj_freq": 10, "nsteps": 1000, "ensemble": "npt", "_idx": "07"}
+ "_comment9": " 01.model_devi ",
+ "_comment10": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.001,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.15,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "00"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "01"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "02"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 50
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "03"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "04"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "05"
+ },
+ {
+ "sys_idx": [
+ 0,
+ 4
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "06"
+ },
+ {
+ "sys_idx": [
+ 1,
+ 5
+ ],
+ "temps": [
+ 100
+ ],
+ "press": [
+ 1.0,
+ 10.0,
+ 100.0,
+ 1000.0,
+ 10000.0,
+ 20000.0,
+ 40000.0
+ ],
+ "trj_freq": 10,
+ "nsteps": 1000,
+ "ensemble": "npt",
+ "_idx": "07"
+ }
+ ],
+ "_comment11": " 02.fp ",
+ "fp_style": "siesta",
+ "shuffle_poscar": false,
+ "fp_task_max": 100,
+ "fp_task_min": 10,
+ "fp_pp_path": ".",
+ "fp_pp_files": [
+ "C.psf",
+ "H.psf",
+ "N.psf"
],
-
- "_comment": " 02.fp ",
- "fp_style": "siesta",
- "shuffle_poscar": false,
- "fp_task_max": 100,
- "fp_task_min": 10,
- "fp_pp_path": ".",
- "fp_pp_files": ["C.psf", "H.psf", "N.psf"],
- "fp_params":{
- "ecut": 300,
- "ediff": 1.0e-4,
- "mixingWeight": 0.05,
- "NumberPulay":5,
- "kspacing": 0.5
+ "fp_params": {
+ "ecut": 300,
+ "ediff": 0.0001,
+ "mixingWeight": 0.05,
+ "NumberPulay": 5,
+ "kspacing": 0.5
},
- "_comment": " that's all "
+ "_comment12": " that's all "
}
diff --git a/tests/generator/test_calypso.py b/tests/generator/test_calypso.py
index cb4546bca..5d9abb854 100644
--- a/tests/generator/test_calypso.py
+++ b/tests/generator/test_calypso.py
@@ -1,13 +1,8 @@
-import glob
-import json
import os
-import shutil
import sys
-import textwrap
import unittest
from pathlib import Path
-import dpdata
import numpy as np
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
@@ -17,6 +12,7 @@
_parse_calypso_dis_mtx,
_parse_calypso_input,
make_calypso_input,
+ setUpModule, # noqa: F401
write_model_devi_out,
)
diff --git a/tests/generator/test_check_bad_box.py b/tests/generator/test_check_bad_box.py
index e40b42853..7de9070bd 100644
--- a/tests/generator/test_check_bad_box.py
+++ b/tests/generator/test_check_bad_box.py
@@ -1,16 +1,13 @@
-import glob
-import json
import os
-import shutil
import sys
import unittest
-import dpdata
-import numpy as np
-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "generator"
-from .context import check_bad_box
+from .context import (
+ check_bad_box,
+ setUpModule, # noqa: F401
+)
class TestCheckBadBox(unittest.TestCase):
diff --git a/tests/generator/test_check_cluster.py b/tests/generator/test_check_cluster.py
index fb969e047..e5e92ee49 100644
--- a/tests/generator/test_check_cluster.py
+++ b/tests/generator/test_check_cluster.py
@@ -1,14 +1,13 @@
-import importlib
import os
import sys
import unittest
-import dpdata
-import numpy as np
-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "generator"
-from .context import check_cluster, setUpModule
+from .context import (
+ check_cluster,
+ setUpModule, # noqa: F401
+)
class Test_check_cluster(unittest.TestCase):
diff --git a/tests/generator/test_cluster.py b/tests/generator/test_cluster.py
index 87151b4ef..193306d1d 100644
--- a/tests/generator/test_cluster.py
+++ b/tests/generator/test_cluster.py
@@ -9,7 +9,11 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "generator"
from .comp_sys import CompSys
-from .context import _crd2frag, setUpModule, take_cluster
+from .context import (
+ _crd2frag,
+ setUpModule, # noqa: F401
+ take_cluster,
+)
@unittest.skipIf(importlib.util.find_spec("openbabel") is None, "requires openbabel")
diff --git a/tests/generator/test_concat_fp_vasp_pp.py b/tests/generator/test_concat_fp_vasp_pp.py
index 989a09bd2..a9efcd5f6 100644
--- a/tests/generator/test_concat_fp_vasp_pp.py
+++ b/tests/generator/test_concat_fp_vasp_pp.py
@@ -1,16 +1,16 @@
-import glob
-import json
import os
import shutil
import sys
import unittest
-import dpdata
-import numpy as np
-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "generator"
-from .context import fp_name, make_iter_name, setUpModule, sys_link_fp_vasp_pp
+from .context import (
+ fp_name,
+ make_iter_name,
+ setUpModule, # noqa: F401
+ sys_link_fp_vasp_pp,
+)
class TestConcatVASPPP(unittest.TestCase):
@@ -53,10 +53,10 @@ def test(self):
)
self.assertTrue(os.path.isfile(os.path.join(work_path, "POTCAR.000")))
self.assertTrue(os.path.isfile(os.path.join(work_path, "POTCAR.001")))
- with open((os.path.join(work_path, "POTCAR.000"))) as fp:
+ with open(os.path.join(work_path, "POTCAR.000")) as fp:
pot = fp.read()
self.assertEqual(pot, "O\nH\n")
- with open((os.path.join(work_path, "POTCAR.001"))) as fp:
+ with open(os.path.join(work_path, "POTCAR.001")) as fp:
pot = fp.read()
self.assertEqual(pot, "H\nC\n")
for ii in ["task.000.000000", "task.000.000001"]:
diff --git a/tests/generator/test_gromacs_engine.py b/tests/generator/test_gromacs_engine.py
index 20c8d6e25..d74d1333d 100644
--- a/tests/generator/test_gromacs_engine.py
+++ b/tests/generator/test_gromacs_engine.py
@@ -1,6 +1,4 @@
-import glob
import importlib
-import json
import os
import shutil
import sys
@@ -12,7 +10,11 @@
__package__ = "generator"
dirname = os.path.join(os.path.abspath(os.path.dirname(__file__)), "gromacs")
-from .context import make_fp_gaussian, make_model_devi
+from .context import (
+ make_fp,
+ make_model_devi,
+ setUpModule, # noqa: F401
+)
def _make_fake_graphs(train_path):
@@ -53,7 +55,6 @@ def setUp(self):
],
"shuffle_poscar": False,
"fp_style": "gaussian",
- "shuffle_poscar": False,
"fp_task_max": 20,
"fp_task_min": 1,
"fp_pp_path": "./",
@@ -105,7 +106,7 @@ def _copy_outputs(self, path_1, path_2):
shutil.copytree(os.path.join(path_1, "traj"), os.path.join(path_2, "traj"))
@unittest.skipIf(
- importlib.util.find_spec("openbabel") != None,
+ importlib.util.find_spec("openbabel") is not None,
"when openbabel is found, this test will be skipped. ",
)
def test_make_model_devi_gromacs_without_openbabel(self):
@@ -131,7 +132,7 @@ def test_make_model_devi_gromacs_with_openbabel(self):
self._copy_outputs(
os.path.join(self.dirname, "outputs"), self.model_devi_task_path
)
- make_fp_gaussian(iter_index=0, jdata=self.jdata)
+ make_fp(iter_index=0, jdata=self.jdata, mdata={})
candi = np.loadtxt(
os.path.join(self.fp_path, "candidate.shuffled.000.out"), dtype=str
)
diff --git a/tests/generator/test_lammps.py b/tests/generator/test_lammps.py
index 2fbf011ca..df2d6acf0 100644
--- a/tests/generator/test_lammps.py
+++ b/tests/generator/test_lammps.py
@@ -1,17 +1,17 @@
-import glob
-import json
import os
-import shutil
import sys
import textwrap
import unittest
-import dpdata
import numpy as np
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "generator"
-from .context import get_all_dumped_forces, get_dumped_forces
+from .context import (
+ get_all_dumped_forces,
+ get_dumped_forces,
+ setUpModule, # noqa: F401
+)
class TestGetDumpForce(unittest.TestCase):
@@ -54,7 +54,7 @@ def test_read_dump(self):
self.assertAlmostEqual(ff[ii], self.expected_f[ii])
-class TestGetDumpForce(unittest.TestCase):
+class TestGetDumpForce2(unittest.TestCase):
def setUp(self):
file_content = textwrap.dedent(
"""\
diff --git a/tests/generator/test_make_fp.py b/tests/generator/test_make_fp.py
index c39b2323e..7c9699e6d 100644
--- a/tests/generator/test_make_fp.py
+++ b/tests/generator/test_make_fp.py
@@ -14,7 +14,7 @@
import scipy.constants as pc
from pymatgen.io.vasp import Incar, Kpoints
-from .comp_sys import test_atom_names, test_atom_types, test_cell, test_coord
+from .comp_sys import test_atom_names
from .context import (
detect_multiplicity,
machine_file,
@@ -25,6 +25,7 @@
param_amber_file,
param_cp2k_file,
param_cp2k_file_exinput,
+ param_custom_fp_file,
param_diy_abacus_post_file,
param_diy_file,
param_file,
@@ -36,10 +37,9 @@
param_pwscf_file,
param_pwscf_old_file,
param_siesta_file,
- parse_cur_job,
ref_cp2k_file_exinput,
ref_cp2k_file_input,
- setUpModule,
+ setUpModule, # noqa: F401
)
vasp_incar_ref = "PREC=A\n\
@@ -179,7 +179,7 @@
deepks_out_labels 0\n\
deepks_descriptor_lmax 0\n\
deepks_scf 0\n\
-deepks_model model.ptg\n"
+deepks_model pporb/model.ptg\n"
abacus_kpt_ref = "K_POINTS\n\
0\n\
@@ -232,7 +232,7 @@ def _write_lammps_dump(sys, dump_file, f_idx=0):
fp.write(str(natoms) + "\n")
fp.write("ITEM: BOX BOUNDS xy xz yz pp pp pp\n")
for ii in range(3):
- fp.write("%f %f %f\n" % (bd[ii][0], bd[ii][1], tilt[ii]))
+ fp.write(f"{bd[ii][0]:f} {bd[ii][1]:f} {tilt[ii]:f}\n")
fp.write("ITEM: ATOMS id type x y z\n")
for ii in range(natoms):
fp.write(
@@ -242,11 +242,10 @@ def _write_lammps_dump(sys, dump_file, f_idx=0):
def _make_fake_md(idx, md_descript, atom_types, type_map, ele_temp=None):
- """
- md_descript: list of dimension
+ """md_descript: list of dimension
[n_sys][n_MD][n_frame]
ele_temp: list of dimension
- [n_sys][n_MD]
+ [n_sys][n_MD].
"""
natoms = len(atom_types)
ntypes = len(type_map)
@@ -281,11 +280,10 @@ def _make_fake_md(idx, md_descript, atom_types, type_map, ele_temp=None):
def _make_fake_md_merge_traj(idx, md_descript, atom_types, type_map, ele_temp=None):
- """
- md_descript: list of dimension
+ """md_descript: list of dimension
[n_sys][n_MD][n_frame]
ele_temp: list of dimension
- [n_sys][n_MD]
+ [n_sys][n_MD].
"""
natoms = len(atom_types)
ntypes = len(type_map)
@@ -626,9 +624,9 @@ def test_make_fp_pwscf(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_pwscf_file, "r") as fp:
+ with open(param_pwscf_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
md_descript = []
nsys = 2
@@ -659,9 +657,9 @@ def test_make_fp_pwscf_old(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_pwscf_old_file, "r") as fp:
+ with open(param_pwscf_old_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
md_descript = []
nsys = 2
@@ -690,14 +688,28 @@ def test_make_fp_pwscf_old(self):
class TestMakeFPABACUS(unittest.TestCase):
+ def _check_pp(self, idx, fp_pp_path, fp_pp_files):
+ nfile = len(fp_pp_files)
+ fp_path = os.path.join("iter.%06d" % idx, "02.fp")
+ for ii in range(nfile):
+ self.assertTrue(os.path.isfile(os.path.join(fp_pp_path, fp_pp_files[ii])))
+ tasks = glob.glob(os.path.join(fp_path, "task.*"))
+ for ii in tasks:
+ for jj in range(nfile):
+ my_file_cmp(
+ self,
+ os.path.join(fp_pp_path, fp_pp_files[jj]),
+ os.path.join(ii, "pporb", fp_pp_files[jj]),
+ )
+
def test_make_fp_abacus(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_abacus_post_file, "r") as fp:
+ with open(param_abacus_post_file) as fp:
jdata = json.load(fp)
fp.close()
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
fp.close()
md_descript = []
@@ -723,7 +735,50 @@ def test_make_fp_abacus(self):
_check_poscars(self, 0, jdata["fp_task_max"], jdata["type_map"])
_check_abacus_input(self, 0)
_check_abacus_kpt(self, 0)
- _check_potcar(self, 0, jdata["fp_pp_path"], jdata["fp_pp_files"])
+ self._check_pp(0, jdata["fp_pp_path"], jdata["fp_pp_files"])
+ shutil.rmtree("iter.000000")
+
+ def test_make_fp_abacus_kspacing(self):
+ setUpModule()
+ if os.path.isdir("iter.000000"):
+ shutil.rmtree("iter.000000")
+ with open(param_abacus_post_file) as fp:
+ jdata = json.load(fp)
+ fp.close()
+ jdata["user_fp_params"]["gamma_only"] = 0
+ jdata["user_fp_params"]["kspacing"] = [0.04, 0.05, 0.06]
+ with open(machine_file) as fp:
+ mdata = json.load(fp)
+ fp.close()
+ md_descript = []
+ nsys = 2
+ nmd = 3
+ n_frame = 10
+ for ii in range(nsys):
+ tmp = []
+ for jj in range(nmd):
+ tmp.append(np.arange(0, 0.29, 0.29 / 10))
+ md_descript.append(tmp)
+ atom_types = [0, 0, 0, 0, 1]
+ type_map = jdata["type_map"]
+ _make_fake_md(0, md_descript, atom_types, type_map)
+ make_fp(0, jdata, {})
+
+ input_ref = abacus_input_ref.split("\n")
+ for ii, iline in enumerate(input_ref):
+ if "gamma_only" in iline:
+ input_ref[ii] = "gamma_only 0"
+ elif "kspacing" in iline:
+ input_ref[ii] = "kspacing 0.040000 0.050000 0.060000"
+
+ fp_path = os.path.join("iter.%06d" % 0, "02.fp", "INPUT")
+ tasks = glob.glob(os.path.join(fp_path, "task.*"))
+ for ii in tasks:
+ ifile = os.path.join(ii, "INPUT")
+ with open(ifile) as fp:
+ lines = fp.read().split("\n")
+ self.assertEqual(lines, input_ref)
+
shutil.rmtree("iter.000000")
def test_make_fp_abacus_from_input(self):
@@ -731,10 +786,10 @@ def test_make_fp_abacus_from_input(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_diy_abacus_post_file, "r") as fp:
+ with open(param_diy_abacus_post_file) as fp:
jdata = json.load(fp)
fp.close()
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
fp.close()
md_descript = []
@@ -760,7 +815,7 @@ def test_make_fp_abacus_from_input(self):
_check_poscars(self, 0, jdata["fp_task_max"], jdata["type_map"])
_check_abacus_input(self, 0)
_check_abacus_kpt(self, 0)
- _check_potcar(self, 0, jdata["fp_pp_path"], jdata["fp_pp_files"])
+ self._check_pp(0, jdata["fp_pp_path"], jdata["fp_pp_files"])
shutil.rmtree("iter.000000")
@@ -769,7 +824,7 @@ def test_make_fp_amber_diff(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_amber_file, "r") as fp:
+ with open(param_amber_file) as fp:
jdata = json.load(fp)
jdata["mdin_prefix"] = os.path.abspath(jdata["mdin_prefix"])
task_dir = os.path.join(
@@ -794,9 +849,9 @@ def test_make_fp_siesta(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_siesta_file, "r") as fp:
+ with open(param_siesta_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
md_descript = []
nsys = 2
@@ -829,9 +884,9 @@ def test_make_fp_vasp(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
md_descript = []
nsys = 2
@@ -866,9 +921,9 @@ def test_make_fp_vasp_merge_traj(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_file_merge_traj, "r") as fp:
+ with open(param_file_merge_traj) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
md_descript = []
nsys = 2
@@ -897,9 +952,9 @@ def test_make_fp_vasp_old(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_old_file, "r") as fp:
+ with open(param_old_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
md_descript = []
nsys = 2
@@ -933,9 +988,9 @@ def test_make_fp_vasp_old(self):
def test_make_fp_vasp_less_sel(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
md_descript = []
nsys = 1
@@ -971,10 +1026,10 @@ def test_make_fp_vasp_from_incar(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_diy_file, "r") as fp:
+ with open(param_diy_file) as fp:
jdata = json.load(fp)
fp.close()
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
fp.close()
md_descript = []
@@ -1011,10 +1066,10 @@ def test_make_fp_vasp_ele_temp(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_diy_file, "r") as fp:
+ with open(param_diy_file) as fp:
jdata = json.load(fp)
fp.close()
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
fp.close()
md_descript = []
@@ -1052,10 +1107,10 @@ def test_make_fp_vasp_multiple_trust_level(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_multiple_trust_file, "r") as fp:
+ with open(param_multiple_trust_file) as fp:
jdata = json.load(fp)
fp.close()
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
fp.close()
md_descript = []
@@ -1094,10 +1149,10 @@ def make_fp_gaussian(self, multiplicity="auto"):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_gaussian_file, "r") as fp:
+ with open(param_gaussian_file) as fp:
jdata = json.load(fp)
jdata["user_fp_params"]["multiplicity"] = multiplicity
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
md_descript = []
nsys = 2
@@ -1154,9 +1209,9 @@ def test_make_fp_cp2k(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_cp2k_file, "r") as fp:
+ with open(param_cp2k_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
md_descript = []
nsys = 2
@@ -1179,7 +1234,7 @@ def test_make_fp_cp2k(self):
jdata["model_devi_f_trust_hi"],
)
_check_poscars(self, 0, jdata["fp_task_max"], jdata["type_map"])
- with open(ref_cp2k_file_input, "r") as f:
+ with open(ref_cp2k_file_input) as f:
cp2k_input_ref = "".join(f.readlines())
_check_cp2k_input_head(self, 0, cp2k_input_ref)
_check_potcar(self, 0, jdata["fp_pp_path"], jdata["fp_pp_files"])
@@ -1189,9 +1244,9 @@ def test_make_fp_cp2k_exinput(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_cp2k_file_exinput, "r") as fp:
+ with open(param_cp2k_file_exinput) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
md_descript = []
nsys = 2
@@ -1214,7 +1269,7 @@ def test_make_fp_cp2k_exinput(self):
jdata["model_devi_f_trust_hi"],
)
_check_poscars(self, 0, jdata["fp_task_max"], jdata["type_map"])
- with open(ref_cp2k_file_exinput, "r") as f:
+ with open(ref_cp2k_file_exinput) as f:
cp2k_exinput_ref = "".join(f.readlines())
_check_cp2k_input_head(self, 0, cp2k_exinput_ref)
_check_potcar(self, 0, jdata["fp_pp_path"], jdata["fp_pp_files"])
@@ -1226,9 +1281,9 @@ def test_make_fp_pwmat(self):
setUpModule()
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_pwmat_file, "r") as fp:
+ with open(param_pwmat_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
md_descript = []
nsys = 2
@@ -1257,5 +1312,58 @@ def test_make_fp_pwmat(self):
# shutil.rmtree('iter.000000')
+class TestMakeFPCustom(unittest.TestCase):
+ def test_make_fp_custom(self):
+ setUpModule()
+ if os.path.isdir("iter.000000"):
+ shutil.rmtree("iter.000000")
+ with open(param_custom_fp_file) as fp:
+ jdata = json.load(fp)
+ with open(machine_file) as fp:
+ mdata = json.load(fp)
+ md_descript = []
+ nsys = 2
+ nmd = 3
+ n_frame = 10
+ for ii in range(nsys):
+ tmp = []
+ for jj in range(nmd):
+ tmp.append(np.arange(0, 0.29, 0.29 / 10))
+ md_descript.append(tmp)
+ atom_types = [0, 1, 2, 2, 0, 1]
+ type_map = jdata["type_map"]
+ _make_fake_md(0, md_descript, atom_types, type_map)
+ make_fp(0, jdata, {})
+ # check input.h5 can be read
+ fp_params = jdata["fp_params"]
+ input_fn = fp_params["input_fn"]
+ input_fmt = fp_params["input_fmt"]
+ fp_task_max = jdata["fp_task_max"]
+ type_map = jdata["type_map"]
+
+ fp_path = os.path.join("iter.%06d" % 0, "02.fp")
+ candi_files = glob.glob(os.path.join(fp_path, "candidate.shuffled.*.out"))
+ candi_files.sort()
+ sys_idx = [str(os.path.basename(ii).split(".")[2]) for ii in candi_files]
+ for sidx, ii in zip(sys_idx, candi_files):
+ md_task = []
+ f_idx = []
+ with open(ii) as fp:
+ for line in fp:
+ md_task.append(line.split()[0])
+ f_idx.append(line.split()[1])
+ md_task = md_task[:fp_task_max]
+ f_idx = f_idx[:fp_task_max]
+ for cc, (tt, ff) in enumerate(zip(md_task, f_idx)):
+ traj_file = os.path.join(tt, "traj", "%d.lammpstrj" % int(ff))
+ input_file = os.path.join(
+ fp_path, "task.%03d.%06d" % (int(sidx), cc), input_fn
+ )
+ system1 = dpdata.System(traj_file, "lammps/dump", type_map=type_map)
+ system2 = dpdata.System(input_file, input_fmt, type_map=type_map)
+ assert system1.formula == system2.formula
+ shutil.rmtree("iter.000000")
+
+
if __name__ == "__main__":
unittest.main()
diff --git a/tests/generator/test_make_md.py b/tests/generator/test_make_md.py
index f22bb4236..bf09508ee 100644
--- a/tests/generator/test_make_md.py
+++ b/tests/generator/test_make_md.py
@@ -5,30 +5,33 @@
import shutil
import sys
import unittest
-from pathlib import Path
import dpdata
import numpy as np
-from dpgen.generator.run import parse_cur_job_sys_revmat
+from dpgen.generator.run import _read_model_devi_file, parse_cur_job_sys_revmat
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "generator"
+import tempfile
+
from .comp_sys import test_atom_names, test_atom_types, test_cell, test_coord
from .context import (
find_only_one_key,
machine_file,
+ machine_file_v1,
make_model_devi,
my_file_cmp,
param_amber_file,
param_file,
+ param_pimd_file,
parse_cur_job,
parse_cur_job_revmat,
revise_by_keys,
revise_lmp_input_dump,
revise_lmp_input_model,
revise_lmp_input_plm,
- setUpModule,
+ run_model_devi,
)
@@ -98,7 +101,7 @@ def _check_traj_dir(testCase, idx):
def _get_lammps_pt(lmp_input):
with open(lmp_input) as fp:
for ii in fp:
- if "variable" in ii and "TEMP" in ii:
+ if "variable" in ii and "TEMP" in ii and "TEMP_NBEADS" not in ii:
lt = float(ii.split()[3])
if "variable" in ii and "PRES" in ii:
lp = float(ii.split()[3])
@@ -110,7 +113,7 @@ def _check_pt(testCase, idx, jdata):
tasks = glob.glob(os.path.join(md_dir, "task.*"))
tasks.sort()
cur_job = jdata["model_devi_jobs"][idx]
- ensemble, nsteps, trj_freq, temps, press, pka_e, dt = parse_cur_job(cur_job)
+ ensemble, nsteps, trj_freq, temps, press, pka_e, dt, nbeads = parse_cur_job(cur_job)
testCase.assertTrue(ensemble, "npt")
# get poscars
sys_idx = cur_job["sys_idx"]
@@ -139,13 +142,15 @@ class TestMakeModelDevi(unittest.TestCase):
def tearDown(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
+ if os.path.isdir("test_model_devi_pimd"):
+ shutil.rmtree("test_model_devi_pimd")
def test_make_model_devi(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
_make_fake_models(0, jdata["numb_models"])
make_model_devi(0, jdata, mdata)
@@ -155,13 +160,27 @@ def test_make_model_devi(self):
_check_pt(self, 0, jdata)
# shutil.rmtree('iter.000000')
+ def test_make_model_devi_pimd(self):
+ if os.path.isdir("iter.000000"):
+ shutil.rmtree("iter.000000")
+ with open(param_pimd_file) as fp:
+ jdata = json.load(fp)
+ with open(machine_file) as fp:
+ mdata = json.load(fp)
+ _make_fake_models(0, jdata["numb_models"])
+ make_model_devi(0, jdata, mdata)
+ _check_pb(self, 0)
+ _check_confs(self, 0, jdata)
+ _check_traj_dir(self, 0)
+ _check_pt(self, 0, jdata)
+
def test_make_model_devi_nopbc_npt(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
jdata["model_devi_nopbc"] = True
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
_make_fake_models(0, jdata["numb_models"])
cwd = os.getcwd()
@@ -172,11 +191,11 @@ def test_make_model_devi_nopbc_npt(self):
def test_make_model_devi_nopbc_nvt(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
jdata["model_devi_nopbc"] = True
jdata["model_devi_jobs"][0]["ensemble"] = "nvt"
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
_make_fake_models(0, jdata["numb_models"])
make_model_devi(0, jdata, mdata)
@@ -186,6 +205,66 @@ def test_make_model_devi_nopbc_nvt(self):
_check_pt(self, 0, jdata)
# shutil.rmtree('iter.000000')
+ def test_run_model_devi_pimd(self):
+ if os.path.isdir("iter.000000"):
+ shutil.rmtree("iter.000000")
+ with open(param_pimd_file) as fp:
+ jdata = json.load(fp)
+ with open(machine_file_v1) as fp:
+ mdata = json.load(fp)
+ _make_fake_models(0, jdata["numb_models"])
+ make_model_devi(0, jdata, mdata)
+ with tempfile.TemporaryDirectory() as remote_root:
+ run_model_devi(
+ 0,
+ jdata,
+ {
+ "api_version": "1.0",
+ "model_devi_command": (
+ "touch model_devi1.out model_devi2.out model_devi3.out model_devi4.out"
+ "&& echo lmp"
+ ),
+ "model_devi_machine": {
+ "batch_type": "shell",
+ "local_root": "./",
+ "remote_root": remote_root,
+ "context_type": "local",
+ },
+ "model_devi_group_size": 1,
+ "model_devi_resources": {
+ "group_size": 1,
+ "cpu_per_node": 4,
+ },
+ },
+ )
+
+ def test_read_model_devi_file_pimd(self):
+ path = "test_model_devi_pimd"
+ if os.path.isdir(path):
+ shutil.rmtree(path)
+ os.makedirs(path, exist_ok=True)
+ os.makedirs(os.path.join(path, "traj"), exist_ok=True)
+ for i in range(4):
+ for j in range(0, 5, 2):
+ with open(os.path.join(path, f"traj/{j}.lammpstrj{i+1}"), "a"):
+ pass
+ model_devi_array = np.zeros([3, 7])
+ model_devi_array[:, 0] = np.array([0, 2, 4])
+ for i in range(4):
+ np.savetxt(
+ os.path.join(path, f"model_devi{i+1}.out"), model_devi_array, fmt="%d"
+ )
+ _read_model_devi_file(path)
+ model_devi_total_array = np.zeros([12, 7])
+ total_steps = np.array([0, 2, 4, 5, 7, 9, 10, 12, 14, 15, 17, 19])
+ model_devi_total_array[:, 0] = total_steps
+ model_devi_out = np.loadtxt(os.path.join(path, "model_devi.out"))
+ np.testing.assert_array_almost_equal(model_devi_out, model_devi_total_array)
+ for istep in total_steps:
+ self.assertTrue(
+ os.path.isfile(os.path.join(path, f"traj/{istep}.lammpstrj"))
+ )
+
class TestMakeModelDeviRevMat(unittest.TestCase):
def tearDown(self):
@@ -532,16 +611,70 @@ def tearDown(self):
def test_make_model_devi(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
- with open(param_amber_file, "r") as fp:
+ with open(param_amber_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
- jdata["sys_prefix"] = os.path.abspath(jdata["sys_prefix"])
+ # TODO: these should be normalized in the main program
+ jdata["sys_configs_prefix"] = os.path.abspath(jdata["sys_configs_prefix"])
+ jdata["disang_prefix"] = os.path.abspath(jdata["disang_prefix"])
+ jdata["mdin_prefix"] = os.path.abspath(jdata["mdin_prefix"])
+ jdata["parm7_prefix"] = os.path.abspath(jdata["mdin_prefix"])
_make_fake_models(0, jdata["numb_models"])
make_model_devi(0, jdata, mdata)
_check_pb(self, 0)
- _check_confs(self, 0, jdata)
- _check_traj_dir(self, 0)
+ self._check_input(0)
+
+ def test_restart_from_iter(self):
+ if os.path.isdir("iter.000000"):
+ shutil.rmtree("iter.000000")
+ if os.path.isdir("iter.000001"):
+ shutil.rmtree("iter.000001")
+ with open(param_amber_file) as fp:
+ jdata = json.load(fp)
+ with open(machine_file) as fp:
+ mdata = json.load(fp)
+ jdata["model_devi_jobs"].append(
+ {
+ "sys_idx": [0],
+ "restart_from_iter": 0,
+ }
+ )
+ jdata["sys_configs_prefix"] = os.path.abspath(jdata["sys_configs_prefix"])
+ jdata["disang_prefix"] = os.path.abspath(jdata["disang_prefix"])
+ jdata["mdin_prefix"] = os.path.abspath(jdata["mdin_prefix"])
+ jdata["parm7_prefix"] = os.path.abspath(jdata["mdin_prefix"])
+ _make_fake_models(0, jdata["numb_models"])
+ make_model_devi(0, jdata, mdata)
+ _check_pb(self, 0)
+ self._check_input(0)
+ restart_text = "This is the fake restart file to test `restart_from_iter`"
+ with open(
+ os.path.join(
+ "iter.%06d" % 0, "01.model_devi", "task.000.000000", "rc.rst7"
+ ),
+ "w",
+ ) as fw:
+ fw.write(restart_text)
+ _make_fake_models(1, jdata["numb_models"])
+ make_model_devi(1, jdata, mdata)
+ _check_pb(self, 1)
+ self._check_input(1)
+ with open(
+ os.path.join(
+ "iter.%06d" % 1, "01.model_devi", "task.000.000000", "init.rst7"
+ )
+ ) as f:
+ assert f.read() == restart_text
+
+ def _check_input(self, iter_idx: int):
+ md_dir = os.path.join("iter.%06d" % iter_idx, "01.model_devi")
+ assert os.path.isfile(os.path.join(md_dir, "init0.mdin"))
+ assert os.path.isfile(os.path.join(md_dir, "qmmm0.parm7"))
+ tasks = glob.glob(os.path.join(md_dir, "task.*"))
+ for tt in tasks:
+ assert os.path.isfile(os.path.join(tt, "init.rst7"))
+ assert os.path.isfile(os.path.join(tt, "TEMPLATE.disang"))
if __name__ == "__main__":
diff --git a/tests/generator/test_make_train.py b/tests/generator/test_make_train.py
index bb368391b..04d091368 100644
--- a/tests/generator/test_make_train.py
+++ b/tests/generator/test_make_train.py
@@ -22,7 +22,7 @@
param_file_v1,
param_file_v1_et,
run_train,
- setUpModule,
+ setUpModule, # noqa: F401
)
@@ -52,7 +52,7 @@ def _comp_init_data(testCase, iter_idx, init_data_prefix, init_data_sys):
sys1 = os.path.join("iter.%06d" % iter_idx, "00.train", "data.init", ii)
testCase.assertTrue(
_comp_sys_files(sys0, sys1),
- "systems %s %s are not identical" % (sys0, sys1),
+ f"systems {sys0} {sys1} are not identical",
)
@@ -197,7 +197,7 @@ def _check_model_inputs_v1(testCase, iter_idx, jdata, reuse=False):
old_ratio = jdata["training_reuse_old_ratio"]
testCase.assertEqual(
jdata0["training"]["auto_prob_style"],
- "prob_sys_size; 0:1:%f; 1:2:%f" % (old_ratio, 1 - old_ratio),
+ f"prob_sys_size; 0:1:{old_ratio:f}; 1:2:{1 - old_ratio:f}",
)
@@ -230,9 +230,9 @@ class TestMakeTrain(unittest.TestCase):
def test_0(self):
# No longer support for DeePMD-kit-0.x version.
return
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
fp_task_min = jdata["fp_task_min"]
make_train(0, jdata, mdata)
@@ -250,9 +250,9 @@ def test_0(self):
def test_1_data(self):
# No longer support for DeePMD-kit-0.x version.
return
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
make_train(0, jdata, mdata)
# make fake fp results #data == fp_task_min
@@ -276,9 +276,9 @@ def test_1_data(self):
def test_1_skip(self):
# No longer support for DeePMD-kit-0.x version.
return
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
- with open(machine_file, "r") as fp:
+ with open(machine_file) as fp:
mdata = json.load(fp)
make_train(0, jdata, mdata)
# make fake fp results #data == fp_task_min - 1
@@ -295,10 +295,10 @@ def test_1_skip(self):
shutil.rmtree("iter.000000")
def test_1_data_v1(self):
- with open(param_file_v1, "r") as fp:
+ with open(param_file_v1) as fp:
jdata = json.load(fp)
jdata.pop("use_ele_temp", None)
- with open(machine_file_v1, "r") as fp:
+ with open(machine_file_v1) as fp:
mdata = json.load(fp)
make_train(0, jdata, mdata)
# make fake fp results #data == fp_task_min
@@ -320,7 +320,7 @@ def test_1_data_v1(self):
shutil.rmtree("iter.000000")
def test_1_data_reuse_v1(self):
- with open(param_file_v1, "r") as fp:
+ with open(param_file_v1) as fp:
jdata = json.load(fp)
jdata.pop("use_ele_temp", None)
jdata["training_reuse_iter"] = 1
@@ -329,7 +329,7 @@ def test_1_data_reuse_v1(self):
jdata["training_reuse_start_lr"] = 1e-4
jdata["training_reuse_start_pref_e"] = 0.1
jdata["training_reuse_start_pref_f"] = 100
- with open(machine_file_v1, "r") as fp:
+ with open(machine_file_v1) as fp:
mdata = json.load(fp)
make_train(0, jdata, mdata)
# make fake fp results #data == fp_task_min
@@ -364,9 +364,9 @@ def test_1_data_reuse_v1(self):
shutil.rmtree("iter.000000")
def test_1_data_v1_eletron_temp(self):
- with open(param_file_v1_et, "r") as fp:
+ with open(param_file_v1_et) as fp:
jdata = json.load(fp)
- with open(machine_file_v1, "r") as fp:
+ with open(machine_file_v1) as fp:
mdata = json.load(fp)
make_train(0, jdata, mdata)
# make fake fp results #data == fp_task_min
@@ -392,12 +392,12 @@ def test_1_data_v1_h5(self):
dpdata.LabeledSystem("data/deepmd", fmt="deepmd/npy").to_deepmd_hdf5(
"data/deepmd.hdf5"
)
- with open(param_file_v1, "r") as fp:
+ with open(param_file_v1) as fp:
jdata = json.load(fp)
jdata.pop("use_ele_temp", None)
jdata["init_data_sys"].append("deepmd.hdf5")
jdata["init_batch_size"].append("auto")
- with open(machine_file_v1, "r") as fp:
+ with open(machine_file_v1) as fp:
mdata = json.load(fp)
make_train(0, jdata, mdata)
# make fake fp results #data == fp_task_min
@@ -461,13 +461,13 @@ def test_1_data_v1_one_h5(self):
dpdata.LabeledSystem("data/deepmd", fmt="deepmd/npy").to_deepmd_hdf5(
"data/deepmd.hdf5"
)
- with open(param_file_v1, "r") as fp:
+ with open(param_file_v1) as fp:
jdata = json.load(fp)
jdata.pop("use_ele_temp", None)
jdata["init_data_sys"].append("deepmd.hdf5")
jdata["init_batch_size"].append("auto")
jdata["one_h5"] = True
- with open(machine_file_v1, "r") as fp:
+ with open(machine_file_v1) as fp:
mdata = json.load(fp)
make_train(0, jdata, mdata)
# make fake fp results #data == fp_task_min
@@ -491,7 +491,7 @@ def test_1_data_v1_one_h5(self):
jdata0["training"]["systems"],
[
"../data.hdf5#/data.init/deepmd",
- "../data.hdf5#/data.init/deepmd.hdf5/",
+ "../data.hdf5#/data.init/deepmd.hdf5",
"../data.hdf5#/data.iters/iter.000000/02.fp/data.000",
],
)
@@ -523,6 +523,108 @@ def test_1_data_v1_one_h5(self):
shutil.rmtree("iter.000001")
shutil.rmtree("iter.000000")
+ def test_training_finetune_model(self):
+ """Test `training_finetune_model`."""
+ with open(param_file_v1) as fp:
+ jdata = json.load(fp)
+ jdata.pop("use_ele_temp", None)
+ numb_models = 4
+ temp_file = "_temp.pb"
+ with open(temp_file, "w") as fw:
+ pass
+ jdata["training_finetune_model"] = [
+ os.path.abspath(temp_file) for _ in range(numb_models)
+ ]
+ with open(machine_file_v1) as fp:
+ mdata = json.load(fp)
+ make_train(0, jdata, mdata)
+ # check file exists
+ for ii in range(numb_models):
+ self.assertTrue(
+ os.path.isfile(
+ os.path.join(
+ "iter.000000", "00.train", "%03d" % ii, "old", "init.pb"
+ )
+ )
+ )
+ # test run_train -- confirm transferred files are correct
+ with tempfile.TemporaryDirectory() as remote_root:
+ run_train(
+ 0,
+ jdata,
+ {
+ "api_version": "1.0",
+ "train_command": (
+ "test -f ./old/init.pb"
+ "&& touch frozen_model.pb lcurve.out model.ckpt.meta model.ckpt.index model.ckpt.data-00000-of-00001 checkpoint"
+ "&& echo dp"
+ ),
+ "train_machine": {
+ "batch_type": "shell",
+ "local_root": "./",
+ "remote_root": remote_root,
+ "context_type": "local",
+ },
+ "train_resources": {
+ "group_size": 1,
+ },
+ },
+ )
+
+ # remove testing dirs
+ shutil.rmtree("iter.000000")
+
+ def test_training_init_frozen_model(self):
+ """Test `training_init_frozen_model`."""
+ with open(param_file_v1) as fp:
+ jdata = json.load(fp)
+ jdata.pop("use_ele_temp", None)
+ numb_models = 4
+ temp_file = "_temp.pb"
+ with open(temp_file, "w") as fw:
+ pass
+ jdata["training_init_frozen_model"] = [
+ os.path.abspath(temp_file) for _ in range(numb_models)
+ ]
+ with open(machine_file_v1) as fp:
+ mdata = json.load(fp)
+ make_train(0, jdata, mdata)
+ # check file exists
+ for ii in range(numb_models):
+ self.assertTrue(
+ os.path.isfile(
+ os.path.join(
+ "iter.000000", "00.train", "%03d" % ii, "old", "init.pb"
+ )
+ )
+ )
+ # test run_train -- confirm transferred files are correct
+ with tempfile.TemporaryDirectory() as remote_root:
+ run_train(
+ 0,
+ jdata,
+ {
+ "api_version": "1.0",
+ "train_command": (
+ "test -f ./old/init.pb"
+ "&& touch frozen_model.pb lcurve.out model.ckpt.meta model.ckpt.index model.ckpt.data-00000-of-00001 checkpoint"
+ "&& echo dp"
+ ),
+ "train_machine": {
+ "batch_type": "shell",
+ "local_root": "./",
+ "remote_root": remote_root,
+ "context_type": "local",
+ },
+ "train_resources": {
+ "group_size": 1,
+ },
+ },
+ )
+
+ # remove testing dirs
+ shutil.rmtree("iter.000000")
+
if __name__ == "__main__":
unittest.main()
diff --git a/tests/generator/test_nbands_esti.py b/tests/generator/test_nbands_esti.py
index c5d9bcdb5..4d2dccafa 100644
--- a/tests/generator/test_nbands_esti.py
+++ b/tests/generator/test_nbands_esti.py
@@ -1,14 +1,13 @@
-import importlib
import os
import sys
import unittest
-import dpdata
-import numpy as np
-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "generator"
-from .context import NBandsEsti
+from .context import (
+ NBandsEsti,
+ setUpModule, # noqa: F401
+)
class TestNBandsEsti(unittest.TestCase):
@@ -54,7 +53,7 @@ def test_get_default_nbands(self):
nb = NBandsEsti._get_default_nbands(res)
self.assertEqual(nb, 66)
- def test_get_default_nbands(self):
+ def test_get_default_nbands2(self):
res = NBandsEsti._get_res("out_data_nbands_esti/mgal/")
nb = NBandsEsti._get_default_nbands(res)
self.assertEqual(nb, 124)
diff --git a/tests/generator/test_parse_cur_job.py b/tests/generator/test_parse_cur_job.py
index e03c920ea..fb0a5a911 100644
--- a/tests/generator/test_parse_cur_job.py
+++ b/tests/generator/test_parse_cur_job.py
@@ -2,11 +2,12 @@
import sys
import unittest
-import numpy as np
-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
__package__ = "generator"
-from .context import machine_file, param_file, parse_cur_job, setUpModule
+from .context import (
+ parse_cur_job,
+ setUpModule, # noqa: F401
+)
class TestParseCurJob(unittest.TestCase):
diff --git a/tests/generator/test_post_fp.py b/tests/generator/test_post_fp.py
index 132819964..a4f6adc5f 100644
--- a/tests/generator/test_post_fp.py
+++ b/tests/generator/test_post_fp.py
@@ -1,4 +1,3 @@
-import glob
import json
import os
import shutil
@@ -12,31 +11,21 @@
__package__ = "generator"
from .comp_sys import (
CompLabeledSys,
- test_atom_names,
- test_atom_types,
- test_cell,
- test_coord,
)
from .context import (
- machine_file,
param_abacus_post_file,
param_amber_file,
param_cp2k_file,
+ param_custom_fp_file,
param_file,
param_gaussian_file,
- param_old_file,
param_pwmat_file,
param_pwscf_file,
- param_pwscf_old_file,
param_siesta_file,
post_fp,
- post_fp_abacus_scf,
- post_fp_cp2k,
- post_fp_gaussian,
- post_fp_pwscf,
- post_fp_siesta,
post_fp_vasp,
- setUpModule,
+ setup_ele_temp,
+ setUpModule, # noqa: F401
)
@@ -71,15 +60,21 @@ def setUp(self):
self.ref_e = np.array(self.ref_e)
self.ref_f = np.array(self.ref_f)
self.ref_v = np.array(self.ref_v)
+ # backup dpdata system data type
+ self._system_dtypes = dpdata.System.DTYPES
+ self._labeled_system_dtypes = dpdata.LabeledSystem.DTYPES
def tearDown(self):
shutil.rmtree("iter.000000")
+ # recover
+ dpdata.System.DTYPES = self._system_dtypes
+ dpdata.LabeledSystem.DTYPES = self._labeled_system_dtypes
def test_post_fp_vasp_0(self):
-
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
jdata["use_ele_temp"] = 2
+ setup_ele_temp(True)
post_fp_vasp(0, jdata, rfailed=0.3)
sys = dpdata.LabeledSystem("iter.000000/02.fp/data.000/", fmt="deepmd/raw")
@@ -127,10 +122,10 @@ def test_post_fp_vasp_0(self):
self.assertEqual(list(list(aparam)[1]), [1, 1])
def test_post_fp_vasp_1(self):
-
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
jdata["use_ele_temp"] = 1
+ setup_ele_temp(False)
post_fp_vasp(0, jdata, rfailed=0.3)
sys = dpdata.LabeledSystem("iter.000000/02.fp/data.001/", fmt="deepmd/raw")
@@ -175,7 +170,7 @@ def test_post_fp_vasp_1(self):
self.assertEqual(list(fparam), [100000])
def test_post_fp_vasp_2(self):
- with open(param_file, "r") as fp:
+ with open(param_file) as fp:
jdata = json.load(fp)
jdata["use_ele_temp"] = 1
with self.assertRaises(RuntimeError):
@@ -194,7 +189,7 @@ def setUp(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
shutil.copytree("out_data_post_fp_pwscf", "iter.000000")
- with open(param_pwscf_file, "r") as fp:
+ with open(param_pwscf_file) as fp:
jdata = json.load(fp)
post_fp(0, jdata)
self.system_1 = dpdata.LabeledSystem("iter.000000/orig", fmt="deepmd/raw")
@@ -215,7 +210,7 @@ def setUp(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
shutil.copytree("out_data_post_fp_abacus", "iter.000000")
- with open(param_abacus_post_file, "r") as fp:
+ with open(param_abacus_post_file) as fp:
jdata = json.load(fp)
post_fp(0, jdata)
self.system_1 = dpdata.LabeledSystem("iter.000000/orig", fmt="deepmd/raw")
@@ -239,7 +234,7 @@ def setUp(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
shutil.copytree("out_data_post_fp_siesta", "iter.000000")
- with open(param_siesta_file, "r") as fp:
+ with open(param_siesta_file) as fp:
jdata = json.load(fp)
post_fp(0, jdata)
self.system_1 = dpdata.LabeledSystem("iter.000000/orig", fmt="deepmd/raw")
@@ -260,7 +255,7 @@ def setUp(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
shutil.copytree("out_data_post_fp_gaussian", "iter.000000")
- with open(param_gaussian_file, "r") as fp:
+ with open(param_gaussian_file) as fp:
jdata = json.load(fp)
post_fp(0, jdata)
self.system_1 = dpdata.LabeledSystem("iter.000000/orig", fmt="deepmd/raw")
@@ -277,11 +272,11 @@ def setUp(self):
self.v_places = 5
assert os.path.isdir(
"out_data_post_fp_cp2k"
- ), "out data for post fp gaussian should exist"
+ ), "out data for post fp cp2k should exist"
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
shutil.copytree("out_data_post_fp_cp2k", "iter.000000")
- with open(param_cp2k_file, "r") as fp:
+ with open(param_cp2k_file) as fp:
jdata = json.load(fp)
post_fp(0, jdata)
self.system_1 = dpdata.LabeledSystem("iter.000000/orig", fmt="deepmd/raw")
@@ -302,7 +297,7 @@ def setUp(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
shutil.copytree("out_data_post_fp_pwmat", "iter.000000")
- with open(param_pwmat_file, "r") as fp:
+ with open(param_pwmat_file) as fp:
jdata = json.load(fp)
post_fp(0, jdata)
self.system_1 = dpdata.LabeledSystem("iter.000000/orig", fmt="deepmd/raw")
@@ -327,7 +322,7 @@ def setUp(self):
os.path.join("iter.000000", "02.fp", "task.000.000000", "dataset")
)
self.system_1 = list(ms.systems.values())[0]
- with open(param_amber_file, "r") as fp:
+ with open(param_amber_file) as fp:
jdata = json.load(fp)
jdata["type_map"] = self.system_1.get_atom_names()
post_fp(0, jdata)
@@ -338,5 +333,39 @@ def setUp(self):
)[0]
+class TestPostFPCustom(unittest.TestCase, CompLabeledSys):
+ def setUp(self):
+ self.places = 5
+ self.e_places = 5
+ self.f_places = 5
+ self.v_places = 2
+ assert os.path.isdir(
+ "out_data_post_fp_pwmat"
+ ), "out data for post fp pwmat should exist"
+ if os.path.isdir("iter.000000"):
+ shutil.rmtree("iter.000000")
+ with open(param_custom_fp_file) as fp:
+ jdata = json.load(fp)
+ fp_params = jdata["fp_params"]
+ output_fn = fp_params["output_fn"]
+ output_fmt = fp_params["output_fmt"]
+ type_map = jdata["type_map"] + ["Type_0"]
+ ss = dpdata.LabeledSystem(
+ os.path.join("data", "deepmd"), fmt="deepmd/raw", type_map=type_map
+ )
+ output_filename = os.path.join(
+ "iter.000000", "02.fp", "task.000.000000", output_fn
+ )
+ os.makedirs(os.path.dirname(output_filename), exist_ok=True)
+ ss.to(output_fmt, output_filename)
+ post_fp(0, jdata)
+ self.system_1 = ss
+ self.system_2 = list(
+ dpdata.MultiSystems(type_map=type_map)
+ .from_deepmd_raw("iter.000000/02.fp/data.000")
+ .systems.values()
+ )[0]
+
+
if __name__ == "__main__":
unittest.main()
diff --git a/tests/sample.json b/tests/sample.json
new file mode 100644
index 000000000..603a4ea06
--- /dev/null
+++ b/tests/sample.json
@@ -0,0 +1,3 @@
+{
+ "aa": "bb"
+}
diff --git a/tests/sample.yaml b/tests/sample.yaml
new file mode 100644
index 000000000..9f408e971
--- /dev/null
+++ b/tests/sample.yaml
@@ -0,0 +1 @@
+aa: bb
\ No newline at end of file
diff --git a/tests/simplify/__init__.py b/tests/simplify/__init__.py
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/tests/simplify/__init__.py
@@ -0,0 +1 @@
+
diff --git a/tests/simplify/context.py b/tests/simplify/context.py
index 88f06f91b..c68902eca 100644
--- a/tests/simplify/context.py
+++ b/tests/simplify/context.py
@@ -2,5 +2,4 @@
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
-
-import dpgen.simplify.simplify
+import dpgen.simplify.simplify # noqa: F401
diff --git a/tests/simplify/test_get_multi_system.py b/tests/simplify/test_get_multi_system.py
index 641e0e80c..c0e5a5b78 100644
--- a/tests/simplify/test_get_multi_system.py
+++ b/tests/simplify/test_get_multi_system.py
@@ -1,10 +1,14 @@
import os
import shutil
+import sys
import unittest
import dpdata
import numpy as np
-from context import dpgen
+
+sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
+__package__ = "simplify"
+from .context import dpgen
class TestGetMultiSystem(unittest.TestCase):
@@ -44,7 +48,7 @@ def test_get_multi_system(self):
with self.subTest(list_data=list_data, labeled=labeled):
ms = dpgen.simplify.simplify.get_multi_system(
self.data if list_data else self.data[0],
- {"labeled": labeled},
+ {"labeled": labeled, "type_map": ["H"]},
)
assert isinstance(ms, dpdata.MultiSystems)
for ss in ms.systems.values():
diff --git a/tests/simplify/test_post_model_devi.py b/tests/simplify/test_post_model_devi.py
new file mode 100644
index 000000000..539ad0f76
--- /dev/null
+++ b/tests/simplify/test_post_model_devi.py
@@ -0,0 +1,142 @@
+import os
+import shutil
+import sys
+import unittest
+from pathlib import Path
+
+import dpdata
+import numpy as np
+
+sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
+__package__ = "simplify"
+from .context import dpgen
+
+
+class TestSimplifyModelDevi(unittest.TestCase):
+ def setUp(self):
+ self.work_path = Path("iter.000001") / dpgen.simplify.simplify.model_devi_name
+ self.work_path.mkdir(exist_ok=True, parents=True)
+ self.system = dpdata.System(
+ data={
+ "atom_names": ["H"],
+ "atom_numbs": [1],
+ "atom_types": np.zeros((1,), dtype=int),
+ "coords": np.zeros((1, 1, 3), dtype=np.float32),
+ "cells": np.zeros((1, 3, 3), dtype=np.float32),
+ "orig": np.zeros(3, dtype=np.float32),
+ "nopbc": True,
+ "energies": np.zeros((1,), dtype=np.float32),
+ "forces": np.zeros((1, 1, 3), dtype=np.float32),
+ }
+ )
+ self.system.to_deepmd_npy(
+ self.work_path / "data.rest.old" / self.system.formula
+ )
+ model_devi = np.array([[0, 0.2, 0.1, 0.15, 0.2, 0.1, 0.15, 0.2]])
+ np.savetxt(
+ self.work_path / "details",
+ model_devi,
+ fmt=["%12d"] + ["%19.6e" for _ in range(7)],
+ header="data.rest.old/"
+ + self.system.formula
+ + "\n step max_devi_v min_devi_v avg_devi_v max_devi_f min_devi_f avg_devi_f devi_e",
+ )
+ np.savetxt(
+ self.work_path / "true_error",
+ model_devi,
+ fmt=["%12d"] + ["%19.6e" for _ in range(7)],
+ header="data.rest.old/"
+ + self.system.formula
+ + "\n step max_devi_v min_devi_v avg_devi_v max_devi_f min_devi_f avg_devi_f devi_e",
+ )
+
+ def tearDown(self):
+ shutil.rmtree("iter.000001", ignore_errors=True)
+
+ def test_post_model_devi_f_candidate(self):
+ dpgen.simplify.simplify.post_model_devi(
+ 1,
+ {
+ "model_devi_f_trust_lo": 0.15,
+ "model_devi_f_trust_hi": 0.25,
+ "model_devi_e_trust_lo": float("inf"),
+ "model_devi_e_trust_hi": float("inf"),
+ "iter_pick_number": 1,
+ },
+ {},
+ )
+ assert (self.work_path / "data.picked" / self.system.formula).exists()
+
+ def test_post_model_devi_e_candidate(self):
+ dpgen.simplify.simplify.post_model_devi(
+ 1,
+ {
+ "model_devi_e_trust_lo": 0.15,
+ "model_devi_e_trust_hi": 0.25,
+ "model_devi_f_trust_lo": float("inf"),
+ "model_devi_f_trust_hi": float("inf"),
+ "iter_pick_number": 1,
+ },
+ {},
+ )
+ assert (self.work_path / "data.picked" / self.system.formula).exists()
+
+ def test_post_model_devi_f_failed(self):
+ with self.assertRaises(RuntimeError):
+ dpgen.simplify.simplify.post_model_devi(
+ 1,
+ {
+ "model_devi_f_trust_lo": 0.0,
+ "model_devi_f_trust_hi": 0.0,
+ "model_devi_e_trust_lo": float("inf"),
+ "model_devi_e_trust_hi": float("inf"),
+ "iter_pick_number": 1,
+ },
+ {},
+ )
+
+ def test_post_model_devi_e_failed(self):
+ with self.assertRaises(RuntimeError):
+ dpgen.simplify.simplify.post_model_devi(
+ 1,
+ {
+ "model_devi_e_trust_lo": 0.0,
+ "model_devi_e_trust_hi": 0.0,
+ "model_devi_f_trust_lo": float("inf"),
+ "model_devi_f_trust_hi": float("inf"),
+ "iter_pick_number": 1,
+ },
+ {},
+ )
+
+ def test_post_model_devi_accurate(self):
+ dpgen.simplify.simplify.post_model_devi(
+ 1,
+ {
+ "model_devi_e_trust_lo": 0.3,
+ "model_devi_e_trust_hi": 0.4,
+ "model_devi_f_trust_lo": 0.3,
+ "model_devi_f_trust_hi": 0.4,
+ "iter_pick_number": 1,
+ },
+ {},
+ )
+ assert (self.work_path / "data.accurate" / self.system.formula).exists()
+
+ def test_post_model_devi_true_error_candidate(self):
+ dpgen.simplify.simplify.post_model_devi(
+ 1,
+ {
+ "model_devi_e_trust_lo": 0.15,
+ "model_devi_e_trust_hi": 0.25,
+ "model_devi_f_trust_lo": float("inf"),
+ "model_devi_f_trust_hi": float("inf"),
+ "true_error_e_trust_lo": float("inf"),
+ "true_error_e_trust_hi": float("inf"),
+ "true_error_f_trust_lo": 0.15,
+ "true_error_f_trust_hi": 0.25,
+ "iter_pick_number": 1,
+ },
+ {},
+ )
+ assert (self.work_path / "data.picked" / self.system.formula).exists()
diff --git a/tests/simplify/test_run_model_devi.py b/tests/simplify/test_run_model_devi.py
new file mode 100644
index 000000000..e928afa8e
--- /dev/null
+++ b/tests/simplify/test_run_model_devi.py
@@ -0,0 +1,112 @@
+import os
+import shutil
+import sys
+import tempfile
+import textwrap
+import unittest
+from pathlib import Path
+
+import dpdata
+
+sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
+__package__ = "simplify"
+from .context import dpgen
+
+
+class TestOneH5(unittest.TestCase):
+ def setUp(self):
+ work_path = Path("iter.000000") / "01.model_devi"
+ work_path.mkdir(parents=True, exist_ok=True)
+ with tempfile.TemporaryDirectory() as tmpdir:
+ with open(Path(tmpdir) / "test.xyz", "w") as f:
+ f.write(
+ textwrap.dedent(
+ """\
+ 2
+
+ H 0.0 0.0 0.0
+ H 0.0 0.0 1.0
+ """
+ )
+ )
+ dpdata.MultiSystems(
+ dpdata.System(Path(tmpdir) / "test.xyz", fmt="xyz")
+ ).to_deepmd_npy(
+ work_path / (dpgen.simplify.simplify.rest_data_name + ".old")
+ )
+
+ def tearDown(self) -> None:
+ shutil.rmtree("iter.000000")
+
+ def test_npy(self):
+ jdata = {
+ "type_map": ["H"],
+ }
+ with tempfile.TemporaryDirectory() as remote_root:
+ mdata = {
+ "model_devi_command": (
+ f"test -d {dpgen.simplify.simplify.rest_data_name}.old"
+ f"&& touch {dpgen.simplify.simplify.detail_file_name_prefix}"
+ "&& echo dp"
+ ),
+ "model_devi_machine": {
+ "context_type": "LocalContext",
+ "batch_type": "shell",
+ "local_root": "./",
+ "remote_root": remote_root,
+ },
+ "model_devi_resources": {
+ "group_size": 1,
+ },
+ }
+ dpgen.simplify.simplify.run_model_devi(0, jdata=jdata, mdata=mdata)
+
+ def test_one_h5(self):
+ jdata = {
+ "type_map": ["H"],
+ "one_h5": True,
+ }
+ with tempfile.TemporaryDirectory() as remote_root:
+ mdata = {
+ "model_devi_command": (
+ f"test -f {dpgen.simplify.simplify.rest_data_name}.old.hdf5"
+ f"&& touch {dpgen.simplify.simplify.detail_file_name_prefix}"
+ "&& echo dp"
+ ),
+ "model_devi_machine": {
+ "context_type": "LocalContext",
+ "batch_type": "shell",
+ "local_root": "./",
+ "remote_root": remote_root,
+ },
+ "model_devi_resources": {
+ "group_size": 1,
+ },
+ }
+ dpgen.simplify.simplify.run_model_devi(0, jdata=jdata, mdata=mdata)
+
+ def test_true_error(self):
+ jdata = {
+ "type_map": ["H"],
+ "true_error_f_trust_lo": 0.15,
+ "true_error_f_trust_hi": 0.25,
+ }
+ with tempfile.TemporaryDirectory() as remote_root:
+ mdata = {
+ "model_devi_command": (
+ f"test -d {dpgen.simplify.simplify.rest_data_name}.old"
+ f"&& touch {dpgen.simplify.simplify.detail_file_name_prefix}"
+ f"&& touch {dpgen.simplify.simplify.true_error_file_name}"
+ "&& echo dp"
+ ),
+ "model_devi_machine": {
+ "context_type": "LocalContext",
+ "batch_type": "shell",
+ "local_root": "./",
+ "remote_root": remote_root,
+ },
+ "model_devi_resources": {
+ "group_size": 1,
+ },
+ }
+ dpgen.simplify.simplify.run_model_devi(0, jdata=jdata, mdata=mdata)
diff --git a/tests/test_check_examples.py b/tests/test_check_examples.py
index 976980b15..8522e8568 100644
--- a/tests/test_check_examples.py
+++ b/tests/test_check_examples.py
@@ -54,19 +54,19 @@
run_jdata,
p_examples
/ "run"
- / "dp1.x-lammps-vasp"
+ / "dp2.x-lammps-vasp"
/ "CH4"
- / "param_CH4_deepmd-kit-1.1.0.json",
+ / "param_CH4_deepmd-kit-2.x.json",
),
(
run_jdata,
p_examples
/ "run"
- / "dp1.x-lammps-vasp"
+ / "dp2.x-lammps-vasp"
/ "Al"
- / "param_al_all_gpu-deepmd-kit-1.1.0.json",
+ / "param_al_all_gpu-deepmd-kit-2.x.json",
),
- (run_jdata, p_examples / "run" / "dp1.x-lammps-vasp-et" / "param_elet.json"),
+ (run_jdata, p_examples / "run" / "dp2.x-lammps-vasp-et" / "param_elet.json"),
(
run_jdata,
p_examples / "run" / "dp2.x-lammps-ABACUS-lcao" / "fcc-al" / "run_param.json",
@@ -77,19 +77,19 @@
),
(
run_jdata,
- p_examples / "run" / "dp1.x-lammps-cp2k" / "methane" / "param-ch4.json",
+ p_examples / "run" / "dp2.x-lammps-cp2k" / "methane" / "param-ch4.json",
),
(
run_jdata,
- p_examples / "run" / "dp1.x-lammps-ABACUS-pw" / "methane" / "param.json",
+ p_examples / "run" / "dp2.x-lammps-ABACUS-pw" / "methane" / "param.json",
),
(
run_jdata,
- p_examples / "run" / "dp1.x-lammps-ABACUS-lcao-dpks" / "methane" / "param.json",
+ p_examples / "run" / "dp2.x-lammps-ABACUS-lcao-dpks" / "methane" / "param.json",
),
(
run_jdata,
- p_examples / "run" / "dp1.x_lammps_gaussian" / "dodecane" / "dodecane.json",
+ p_examples / "run" / "dp2.x_lammps_gaussian" / "dodecane" / "dodecane.json",
),
(run_jdata, p_examples / "run" / "dp-lammps-enhance_sampling" / "param.json"),
# (run_jdata, p_examples / "run" / "deprecated" / "param-mg-vasp.json"),
@@ -101,17 +101,17 @@
p_examples
/ "run"
/ "deprecated"
- / "dp0.12-lammps-cp2k"
+ / "dp2.x-lammps-cp2k"
/ "CH4"
/ "param_CH4.json",
),
- # (run_jdata, p_examples / "run" / "deprecated" / "dp0.12-lammps-pwmat" / "param_CH4.json"),
+ # (run_jdata, p_examples / "run" / "deprecated" / "dp2.x-lammps-pwmat" / "param_CH4.json"),
(
run_jdata,
p_examples
/ "run"
/ "deprecated"
- / "dp0.12-lammps-siesta"
+ / "dp2.x-lammps-siesta"
/ "dp-lammps-siesta"
/ "CH4"
/ "param_CH4.json",
@@ -121,7 +121,7 @@
p_examples
/ "run"
/ "deprecated"
- / "dp0.12-lammps-vasp"
+ / "dp2.x-lammps-vasp"
/ "Al"
/ "param_al_all_gpu.json",
),
@@ -130,7 +130,7 @@
p_examples
/ "run"
/ "deprecated"
- / "dp0.12-lammps-vasp"
+ / "dp2.x-lammps-vasp"
/ "CH4"
/ "param_CH4.json",
),
diff --git a/tests/test_cli.py b/tests/test_cli.py
index cd2a4a7a3..0c2125d2a 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1,5 +1,4 @@
import subprocess as sp
-import sys
import unittest
diff --git a/tests/test_gui.py b/tests/test_gui.py
new file mode 100644
index 000000000..25fd7e665
--- /dev/null
+++ b/tests/test_gui.py
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: LGPL-3.0-or-later
+import unittest
+
+from dpgui import (
+ generate_dpgui_templates,
+)
+
+
+class TestDPGUI(unittest.TestCase):
+ def test_dpgui_entrypoints(self):
+ self.assertTrue(len(generate_dpgui_templates()) > 0)
diff --git a/tests/test_load_file.py b/tests/test_load_file.py
new file mode 100644
index 000000000..583d9c1aa
--- /dev/null
+++ b/tests/test_load_file.py
@@ -0,0 +1,18 @@
+import unittest
+from pathlib import Path
+
+from dpgen.util import load_file
+
+this_directory = Path(__file__).parent
+
+
+class TestLoadFile(unittest.TestCase):
+ def test_load_json_file(self):
+ ref = {"aa": "bb"}
+ jdata = load_file(this_directory / "sample.json")
+ self.assertEqual(jdata, ref)
+
+ def test_load_yaml_file(self):
+ ref = {"aa": "bb"}
+ jdata = load_file(this_directory / "sample.yaml")
+ self.assertEqual(jdata, ref)
diff --git a/tests/tools/context.py b/tests/tools/context.py
index 3f1ab8fbb..a51ca9249 100644
--- a/tests/tools/context.py
+++ b/tests/tools/context.py
@@ -2,7 +2,7 @@
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
-from dpgen.tools.run_report import *
+from dpgen.tools.run_report import * # noqa: F403
def my_file_cmp(test, f0, f1):
diff --git a/tests/tools/machine_fp_single.json b/tests/tools/machine_fp_single.json
index f998388eb..bb828fc32 100644
--- a/tests/tools/machine_fp_single.json
+++ b/tests/tools/machine_fp_single.json
@@ -1,15 +1,17 @@
{
- "fp":[
- {
- "command": "vasp_std",
- "machine":{
- "batch_type": "PBS"
- },
- "resources": {
- "group_size" : 8
- },
- "_comments" : "In user_forward_files, define input files to be uploaded.",
- "user_forward_files" : ["vdw_kernel.bindat"]
- }
+ "fp": [
+ {
+ "command": "vasp_std",
+ "machine": {
+ "batch_type": "PBS"
+ },
+ "resources": {
+ "group_size": 8
+ },
+ "_comments": "In user_forward_files, define input files to be uploaded.",
+ "user_forward_files": [
+ "vdw_kernel.bindat"
+ ]
+ }
]
-}
\ No newline at end of file
+}
diff --git a/tests/tools/machine_fp_single2.json b/tests/tools/machine_fp_single2.json
index 8c2212927..772f655ca 100644
--- a/tests/tools/machine_fp_single2.json
+++ b/tests/tools/machine_fp_single2.json
@@ -1,14 +1,15 @@
{
- "fp":
- {
- "command": "vasp_std",
- "machine":{
- "batch_type": "PBS"
- },
- "resources": {
- "group_size" : 8
- },
- "_comments" : "In user_forward_files, define input files to be uploaded.",
- "user_forward_files" : ["vdw_kernel.bindat"]
+ "fp": {
+ "command": "vasp_std",
+ "machine": {
+ "batch_type": "PBS"
+ },
+ "resources": {
+ "group_size": 8
+ },
+ "_comments": "In user_forward_files, define input files to be uploaded.",
+ "user_forward_files": [
+ "vdw_kernel.bindat"
+ ]
}
-}
\ No newline at end of file
+}
diff --git a/tests/tools/run_report_test_output/param.json b/tests/tools/run_report_test_output/param.json
index e8d11b9a8..397a785df 100644
--- a/tests/tools/run_report_test_output/param.json
+++ b/tests/tools/run_report_test_output/param.json
@@ -1,87 +1,132 @@
{
- "type_map": ["Al", "Mg"],
- "mass_map": [27, 24],
-
- "init_data_prefix": "/home/wanghan/study/deep.md/data/almgop.20/init//",
-
- "init_data_sys": [
- "al.fcc.01x01x01/02.md/sys-0004/deepmd",
- "mg.fcc.01x01x01/02.md/sys-0004/deepmd"
+ "type_map": [
+ "Al",
+ "Mg"
],
- "init_batch_size": [1,1],
- "sys_configs": [
- ["/home/wanghan/study/deep.md/data/almgop.20/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR"],
- ["/home/wanghan/study/deep.md/data/almgop.20/init/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR"]
+ "mass_map": [
+ 27,
+ 24
],
- "sys_batch_size": [1,1],
-
- "_comment": " 00.train ",
- "numb_models": 4,
- "default_training_param" : {
- "_comment": " model parameters",
- "use_smooth": true,
- "sel_a": [90, 90],
- "rcut_smth": 2.00,
- "rcut": 6.00,
- "filter_neuron": [10, 20, 40],
- "filter_resnet_dt": false,
- "n_axis_neuron": 4,
- "n_neuron": [120, 120, 120],
- "resnet_dt": true,
- "coord_norm": true,
- "type_fitting_net": false,
-
- "_comment": " traing controls",
- "systems": [],
- "set_prefix": "set",
- "stop_batch": 1000,
- "batch_size": 1,
- "start_lr": 0.001,
- "decay_steps": 2000,
- "decay_rate": 0.95,
- "seed": 0,
-
- "start_pref_e": 0.02,
- "limit_pref_e": 2,
- "start_pref_f": 1000,
- "limit_pref_f": 1,
- "start_pref_v": 0.0,
- "limit_pref_v": 0.0,
-
- "_comment": " display and restart",
- "_comment": " frequencies counted in batch",
- "disp_file": "lcurve.out",
- "disp_freq": 1000,
- "numb_test": 1,
- "save_freq": 1000,
- "save_ckpt": "model.ckpt",
- "load_ckpt": "model.ckpt",
- "disp_training": true,
- "time_training": true,
- "profiling": false,
- "profiling_file": "timeline.json",
-
- "_comment": "that's all"
+ "init_data_prefix": "/home/wanghan/study/deep.md/data/almgop.20/init//",
+ "init_data_sys": [
+ "al.fcc.01x01x01/02.md/sys-0004/deepmd",
+ "mg.fcc.01x01x01/02.md/sys-0004/deepmd"
+ ],
+ "init_batch_size": [
+ 1,
+ 1
+ ],
+ "sys_configs": [
+ [
+ "/home/wanghan/study/deep.md/data/almgop.20/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR"
+ ],
+ [
+ "/home/wanghan/study/deep.md/data/almgop.20/init/mg.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR"
+ ]
+ ],
+ "sys_batch_size": [
+ 1,
+ 1
+ ],
+ "_comment1": " 00.train ",
+ "numb_models": 4,
+ "default_training_param": {
+ "model": {
+ "descriptor": {
+ "seed": 0,
+ "type": "se_a",
+ "sel": [
+ 90,
+ 90
+ ],
+ "rcut": 6.0,
+ "rcut_smth": 2.0,
+ "neuron": [
+ 10,
+ 20,
+ 40
+ ],
+ "axis_neuron": 4,
+ "resnet_dt": false
+ },
+ "fitting_net": {
+ "seed": 0,
+ "neuron": [
+ 120,
+ 120,
+ 120
+ ],
+ "resnet_dt": true
+ }
+ },
+ "learning_rate": {
+ "type": "exp",
+ "decay_steps": 2000,
+ "start_lr": 0.001,
+ "stop_lr": 0.0009746794344808964
+ },
+ "loss": {
+ "start_pref_e": 0.02,
+ "limit_pref_e": 2,
+ "start_pref_f": 1000,
+ "limit_pref_f": 1,
+ "start_pref_v": 0.0,
+ "limit_pref_v": 0.0
+ },
+ "training": {
+ "seed": 0,
+ "stop_batch": 1000,
+ "disp_file": "lcurve.out",
+ "disp_freq": 1000,
+ "save_freq": 1000,
+ "save_ckpt": "model.ckpt",
+ "disp_training": true,
+ "time_training": true,
+ "profiling": false,
+ "training_data": {
+ "systems": [],
+ "set_prefix": "set",
+ "batch_size": 1
+ }
+ }
},
-
- "_comment": " 01.model_devi ",
- "_comment": "model_devi_skip: the first x of the recorded frames",
- "model_devi_dt": 0.002,
- "model_devi_skip": 0,
- "model_devi_f_trust_lo": 0.05,
- "model_devi_f_trust_hi": 0.20,
- "model_devi_clean_traj": false,
- "model_devi_jobs": [
- { "_idx": 0, "ensemble": "npt", "nsteps": 50, "press": [1.0,2.0], "sys_idx": [0, 1], "temps": [50,100], "trj_freq": 10 }
+ "_comment7": " 01.model_devi ",
+ "_comment8": "model_devi_skip: the first x of the recorded frames",
+ "model_devi_dt": 0.002,
+ "model_devi_skip": 0,
+ "model_devi_f_trust_lo": 0.05,
+ "model_devi_f_trust_hi": 0.2,
+ "model_devi_clean_traj": false,
+ "model_devi_jobs": [
+ {
+ "_idx": 0,
+ "ensemble": "npt",
+ "nsteps": 50,
+ "press": [
+ 1.0,
+ 2.0
+ ],
+ "sys_idx": [
+ 0,
+ 1
+ ],
+ "temps": [
+ 50,
+ 100
+ ],
+ "trj_freq": 10
+ }
+ ],
+ "_comment9": " 02.fp ",
+ "fp_style": "vasp",
+ "shuffle_poscar": false,
+ "fp_task_max": 8,
+ "fp_task_min": 2,
+ "fp_pp_path": "/home/wanghan/study/deep.md/dpgen/almg/vasp",
+ "fp_pp_files": [
+ "POTCAR.Al",
+ "POTCAR.Mg"
],
- "_comment": " 02.fp ",
- "fp_style": "vasp",
- "shuffle_poscar": false,
- "fp_task_max": 8,
- "fp_task_min": 2,
- "fp_pp_path": "/home/wanghan/study/deep.md/dpgen/almg/vasp",
- "fp_pp_files": ["POTCAR.Al", "POTCAR.Mg"],
- "fp_incar": "/home/wanghan/study/deep.md/dpgen/almg/vasp/INCAR",
- "_comment": " that's all "
+ "fp_incar": "/home/wanghan/study/deep.md/dpgen/almg/vasp/INCAR",
+ "_comment10": " that's all "
}
-
diff --git a/tests/tools/test_convert_mdata.py b/tests/tools/test_convert_mdata.py
index 1f0c020c8..f5d76c7a0 100644
--- a/tests/tools/test_convert_mdata.py
+++ b/tests/tools/test_convert_mdata.py
@@ -1,4 +1,3 @@
-import json
import os
import sys
import unittest
@@ -7,15 +6,16 @@
sys.path.insert(0, os.path.join(test_dir, ".."))
__package__ = "tools"
from dpgen.remote.decide_machine import convert_mdata
+from dpgen.util import load_file
-from .context import setUpModule
+from .context import setUpModule # noqa: F401
class TestConvertMdata(unittest.TestCase):
machine_file = "machine_fp_single.json"
def test_convert_mdata(self):
- mdata = json.load(open(self.machine_file))
+ mdata = load_file(self.machine_file)
mdata = convert_mdata(mdata, ["fp"])
self.assertEqual(mdata["fp_command"], "vasp_std")
self.assertEqual(mdata["fp_group_size"], 8)
diff --git a/tests/tools/test_run_report.py b/tests/tools/test_run_report.py
index 0553d99f0..44474c366 100644
--- a/tests/tools/test_run_report.py
+++ b/tests/tools/test_run_report.py
@@ -6,7 +6,10 @@
test_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
sys.path.insert(0, os.path.join(test_dir, ".."))
__package__ = "tools"
-from .context import stat_sys
+from .context import (
+ setUpModule, # noqa: F401
+ stat_sys,
+)
class TestRunReport(unittest.TestCase):