Skip to content

Commit

Permalink
Support remote force constants calculation
Browse files Browse the repository at this point in the history
To compute force constants from a large ensemble of displacement-force datasets by alm, large computation power can be necessary. So running this calculation on a remote computer is supported. The calcfuntion of get_random_displacements is divided into one calcfunction and one python method1) collect_dataset (calcfunction): Collect displacements and forces from previous calculations and some treatments are applied following parameters. 2) get_random_displacements (python method): This generates supercell random displacements for which forces are calculated. The later dispalcement dataset is passed to PhonopyWorkChain by submitting to daemon. Therefore it is stored in AiiDA DB as an input parameter.
  • Loading branch information
atztogo committed Jul 15, 2020
1 parent 12fa782 commit d410a9a
Show file tree
Hide file tree
Showing 5 changed files with 277 additions and 203 deletions.
15 changes: 8 additions & 7 deletions aiida_phonopy/common/file_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ def get_phonopy_yaml_txt(structure,

def get_phonopy_options(settings):
mesh_opts = []
mesh = settings['mesh']
try:
length = float(mesh)
mesh_opts.append('--mesh=%f' % length)
except TypeError:
mesh_opts.append('--mesh=\"%d %d %d\"' % tuple(mesh))
mesh_opts.append('--nowritemesh')
if 'mesh' in settings:
mesh = settings['mesh']
try:
length = float(mesh)
mesh_opts.append('--mesh=%f' % length)
except TypeError:
mesh_opts.append('--mesh=\"%d %d %d\"' % tuple(mesh))

This comment has been minimized.

Copy link
@BeZie

BeZie Jul 22, 2020

@atztogo
For me, this leads to a failure in Phonopy because of the additional " , I fixed it by changing the following line in cui/settings.py but an easier fix would probably already here:

cui/settings.py: [int(x.replace('"','')) for x in vals[:3]])

This comment has been minimized.

Copy link
@atztogo

atztogo Jul 22, 2020

Author Contributor

Please give your message on issues. I don't catch your meaning well quickly.

mesh_opts.append('--nowritemesh')

fc_opts = []
if 'fc_calculator' in settings:
Expand Down
3 changes: 0 additions & 3 deletions aiida_phonopy/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def generate_phonopy_cells(phonon_settings,
symmetry_tolerance,
dataset=None):
ph_settings = _get_setting_info(phonon_settings,
structure,
symmetry_tolerance)

ph = get_phonopy_instance(structure, ph_settings, {})
Expand All @@ -43,7 +42,6 @@ def generate_phono3py_cells(phonon_settings,
symmetry_tolerance,
dataset=None):
ph_settings = _get_setting_info(phonon_settings,
structure,
symmetry_tolerance)

ph = get_phono3py_instance(structure, ph_settings, {})
Expand Down Expand Up @@ -451,7 +449,6 @@ def collect_vasp_forces_and_energies(ctx, ctx_supercells, prefix="force_calc"):


def _get_setting_info(phonon_settings,
structure,
symmetry_tolerance,
code_name='phonopy'):
"""Convert AiiDA inputs to a dict
Expand Down
9 changes: 6 additions & 3 deletions aiida_phonopy/parsers/phonopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ def parse(self, **kwargs):
fname = f.name
self.out('thermal_properties', parse_thermal_properties(fname))

sym_dataset = self.node.inputs.settings['symmetry']
label = "%s (%d)" % (sym_dataset['international'],
sym_dataset['number'])
band_filename = self.node.inputs.band_structure_filename.value
if band_filename in list_of_files:
if 'symmetry' in self.node.inputs.settings:
sym_dataset = self.node.inputs.settings['symmetry']
label = "%s (%d)" % (sym_dataset['international'],
sym_dataset['number'])
else:
label = None
with output_folder.open(band_filename) as f:
fname = f.name
self.out('band_structure',
Expand Down

0 comments on commit d410a9a

Please sign in to comment.