aiida plugin for ShengBTE
This plugin is the default output of the AiiDA plugin cutter, intended to help developers get started with their AiiDA plugins.
.github/
: Github Actions configurationci.yml
: runs tests, checks test coverage and builds documentation at every new commitpublish-on-pypi.yml
: automatically deploy git tags to PyPI - just generate a PyPI API token for your PyPI account and add it to thepypi_token
secret of your github repository
aiida_shengbte/
: The main source code of the plugin packagedata/
: A newDiffParameters
data class, used as input to theDiffCalculation
CalcJob
classcalculations.py
: A newDiffCalculation
CalcJob
classcli.py
: Extensions of theverdi data
command line interface for theDiffParameters
classhelpers.py
: Helpers for setting up an AiiDA code fordiff
automaticallyparsers.py
: A newParser
for theDiffCalculation
docs/
: A documentation template ready for publication on Read the Docsexamples/
: An example of how to submit a calculation using this plugintests/
: Basic regression tests using the pytest framework (submitting a calculation, ...). Installpip install -e .[testing]
and runpytest
..coveragerc
: Configuration of coverage.py tool reporting which lines of your plugin are covered by tests.gitignore
: Telling git which files to ignore.pre-commit-config.yaml
: Configuration of pre-commit hooks that sanitize coding style and check for syntax errors. Enable viapip install -e .[pre-commit] && pre-commit install
.readthedocs.yml
: Configuration of documentation build for Read the DocsLICENSE
: License for your pluginMANIFEST.in
: Configure non-Python files to be included for publication on PyPIREADME.md
: This fileconftest.py
: Configuration of fixtures for pytestpytest.ini
: Configuration of pytest test discoverysetup.json
: Plugin metadata for registration on PyPI and the AiiDA plugin registry (including entry points)setup.py
: Installation script for pip / PyPI
See also the following video sequences from the 2019-05 AiiDA tutorial:
- aiida-diff setup.json
- run aiida-diff example calculation
- aiida-diff CalcJob plugin
- aiida-diff Parser plugin
- aiida-diff computer/code helpers
- aiida-diff input data (with validation)
- aiida-diff cli
- aiida-diff tests
- Adding your plugin to the registry
- pre-commit hooks
For more information, see the developer guide of your plugin.
-
Add input files using
SinglefileData
:SinglefileData = DataFactory('singlefile') inputs['file1'] = SinglefileData(file='/path/to/file1') inputs['file2'] = SinglefileData(file='/path/to/file2')
-
Specify command line options via a python dictionary and
DiffParameters
:d = { 'ignore-case': True } DiffParameters = DataFactory('shengbte') inputs['parameters'] = DiffParameters(dict=d)
-
DiffParameters
dictionaries are validated using voluptuous. Find out about supported options:DiffParameters = DataFactory('shengbte') print(DiffParameters.schema.schema)
-
ShengBTE Vasp WorkChain
- Covergence criterion
- set potential_mapping for vasp automatically
- set proper parameters of phonopy and vasp
-
ShengBTE QE WorkChain
-
tools
- transform
control dict
file to ShengBTECONTROL
file or reversely
- transform
pip install aiida-shengbte
verdi quicksetup # better to set up a new profile
verdi plugin list aiida.calculations # should now show your calclulation plugins
Here goes a complete example of how to submit a test calculation using this plugin.
A quick demo of how to submit a calculation:
verdi daemon start # make sure the daemon is running
cd examples
./example_01.py # run test calculation
verdi process list -a # check record of the calculation
The plugin also includes verdi commands to inspect its data types:
verdi data shengbte list
verdi data shengbte export <PK>
git clone https://github.com/PorYoung/aiida-shengbte .
cd aiida-shengbte
pip install -e .[pre-commit,testing] # install extra dependencies
pre-commit install # install pre-commit hooks
pytest -v # discover and run all tests
dict validator
_CONTROL = {
'allocations': {
'nelements': {
'type': int,
'mandatory': True
},
'natoms': {
'type': int,
'mandatory': True
},
'ngrid': {
# <len 3>
'type': list,
'mandatory': True
},
'norientations': {
'type': int,
'default': 0
}
},
'crystal': {
'lfactor': {
'type': float,
'default': 1.0
},
'lattvec': {
# <3*3>
'type': list,
'mandatory': True
},
'types': {
# <len natoms>
'type': list,
'mandatory': True
},
'elements': {
# <len nelements>
'type': list,
'mandatory': True
},
'positions': {
# <3 * natoms>
'type': list,
'mandatory': True
},
'masses': {
'type': float
},
'gfactors': {
'type': float
},
'epsilon': {
# <3 * 3>
'type': list,
},
'born': {
# <3 * 3 * natoms>
'type': list,
},
'scell': {
# <len 3>
'type': list,
'mandatory': True
},
'orientations': {
# <3 * norientations> mandatory unless norientations == 0
'type': list,
# 'mandatory': True
}
},
'parameters': {
'T': {},
'T_min': {},
'T_max': {},
'T_step': {},
'omega_max': {
'default': 1.e100
},
'scalebroad': {
'default': 1.0
},
'rmin': {
'default': 5.0
},
'rmax': {
'default': 505.0
},
'dr': {
'default': 100.0
},
'maxiter': {
'default': 1000
},
'nticks': {
'default': 100
},
'eps': {
'default': 1.e-5
},
},
'flags': {
'nonanalytic': {
'default': True
},
'convergence': {
'default': True
},
'isotopes': {
'default': True
},
'autoisotopes': {
'default': True
},
'nanowires': {
'default': False
},
'onlyharmonic': {
'default': False
},
'espresso': {
'default': False
}
}
}
About Retrieve List of CalcJob
-
0 - 99: Reserved for internal use by aiida-core
-
100 - 199: Reserved for errors parsed from scheduler output of calculation jobs (note: this is not yet implemented)
-
200 - 299: Suggested to be used for process input validation errors
-
300 - 399: Suggested for critical process errors
-
For any other exit codes, one can use the integers from 400 and up.
See the developer guide for more information.
-
aiida container
-
vasp container(or other remote container)
- clone phono3py repository
- create
setup_mkl.py
file in phono3py repository pip install -e .
-
force_constants
- type:
ArrayData
get_array('force_constants')
return force constants arrayget_array(p2s_map)
phonopy.fileIO.write_FORCE_CONSTANTS( force_constants, filename='FORCE_CONSTANTS', p2s_map=None,)
- type:
-
nac_params
- type:
ArrayData
get_array('epsilon')
get_array('born_charges')
- type:
- VASP
- require
POSCAR
PhonopyWorkChainNode.outputs.primitive.get_ase()
return ase Atom Objectase.write('POSCAR','vasp')
- require
-
ShengBTE 真实环境计算流程(如改变温度)
-
计算结果的存储
- 分别就地存储
- retrieve all results by aiida
-
Get the real path of nodes in aiida
def get_node_repository_sub_folder(uuid):
"""Return the absolute path to the sub folder `path` within the repository of the node with the given UUID.
:param uuid: UUID of the node
:return: absolute path to node repository folder, i.e `/some/path/repository/node/12/ab/c123134-a123/path`
"""
from aiida.manage.configuration import get_profile
uuid = str(uuid)
repo_dirpath = os.path.join(get_profile().repository_path, 'repository')
node_dirpath = os.path.join(repo_dirpath, 'node', uuid[:2], uuid[2:4], uuid[4:], 'path')
return node_dirpath
-
Vasp failed with code 7 when 'tot_num_mpiprocs' set to 30
-
ShengBTEVaspWorkflow cannot run correctly while using
submit
rather thanrun
. (some Vasp calculations failed and exited)After submitting the workflow, all the calculations will start at the same time using the number of processes defined, so some will crash. So if the hpc has a job management system such as Torque or has sufficient processes, it would be ok.
- Warning: supercell too small to find n-th neighbors
-
Test current Calculations
- Thirdorder Sow
- Thirdorder Reap
- ShengBTE Calculation
-
Test current Workflows
- Thirdorder WorkChain
- ShengBTE WorkChain
- ShengBTE Vasp WorkChain
MIT