Skip to content

Commit 4d15f6d

Browse files
committed
tmp commit
1 parent a691f04 commit 4d15f6d

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

src/aiida_quantumespresso/workflows/pw/base.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,8 @@ def handle_electronic_convergence_not_reached(self, calculation):
599599
if 'scf_failed_once' not in self.ctx:
600600
nbnd_new = nbnd_cur + max(int(nbnd_cur * self.defaults.delta_factor_nbnd), self.defaults.delta_minimum_nbnd)
601601
self.ctx.inputs.parameters['SYSTEM']['nbnd'] = nbnd_new
602-
self.ctx.inputs.parameters['ELECTRONS']['electron_maxstep'] = 200
603602
self.report(
604-
f'First SCF failure encountered: increasing number of bands to {nbnd_new} and `electron_maxstep` to 200'
603+
f'First SCF failure encountered: increasing number of bands to {nbnd_new}'
605604
)
606605
self.ctx.scf_failed_once = True
607606

@@ -627,7 +626,7 @@ def handle_electronic_convergence_not_reached(self, calculation):
627626

628627
if 'diagonalizations' not in self.ctx:
629628
# Initialize a list to track diagonalisations that haven't been tried in reverse order or preference
630-
self.ctx.diagonalizations = [value for value in ['cg', 'paro', 'ppcg', 'david'] if value != diagonalization.lower()]
629+
self.ctx.diagonalizations = [value for value in ['cg', 'paro', 'ppcg', 'rmm-paro', 'david'] if value != diagonalization.lower()]
631630

632631
try:
633632
new = self.ctx.diagonalizations.pop()
@@ -654,6 +653,8 @@ def handle_electronic_convergence_not_reached(self, calculation):
654653
self.report_error_handled(calculation, action)
655654
return ProcessHandlerReport(True)
656655

656+
return ProcessHandlerReport(True)
657+
657658
@process_handler(priority=420, exit_codes=[
658659
PwCalculation.exit_codes.WARNING_ELECTRONIC_CONVERGENCE_NOT_REACHED,
659660
])

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ def _generate_calc_job_node(
246246
filename = os.path.join(entry_point_name[len('quantumespresso.'):], test_name)
247247
filepath_folder = os.path.join(basepath, 'parsers', 'fixtures', filename)
248248
filepath_input = os.path.join(filepath_folder, 'aiida.in')
249+
print(basepath)
249250

250251
entry_point = format_entry_point_string('aiida.calculations', entry_point_name)
251252

@@ -640,7 +641,7 @@ def _generate_inputs_pw():
640641
structure = generate_structure()
641642
inputs = {
642643
'code': fixture_code('quantumespresso.pw'),
643-
'structure': generate_structure(),
644+
'structure': structure,
644645
'kpoints': generate_kpoints_mesh(2),
645646
'parameters': parameters,
646647
'pseudos': {kind: generate_upf_data(kind) for kind in structure.get_kind_names()},

tests/workflows/pw/test_base.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,29 @@ def test_handle_out_of_walltime_structure_changed(generate_workchain_pw, generat
6767
assert result.status == 0
6868

6969

70-
def test_handle_electronic_convergence_not_reached(generate_workchain_pw, fixture_localhost, generate_remote_data):
70+
def test_handle_electronic_convergence_not_reached(
71+
generate_workchain_pw, fixture_localhost, generate_remote_data, generate_structure,
72+
generate_calc_job_node
73+
):
7174
"""Test `PwBaseWorkChain.handle_electronic_convergence_not_reached`."""
7275
remote_data = generate_remote_data(computer=fixture_localhost, remote_path='/path/to/remote')
7376

7477
process = generate_workchain_pw(
7578
exit_code=PwCalculation.exit_codes.ERROR_ELECTRONIC_CONVERGENCE_NOT_REACHED,
76-
pw_outputs={'remote_folder': remote_data}
79+
pw_outputs={'remote_folder': remote_data},
7780
)
7881
process.setup()
7982

83+
cj_node = generate_calc_job_node('quantumespresso.pw', fixture_localhost, 'test')
84+
85+
print(cj_node.outputs.output_parameters.get_dict())
86+
87+
process.ctx.structure = generate_structure('2D-xy-arsenic')
88+
8089
process.ctx.inputs.parameters['ELECTRONS']['mixing_beta'] = 0.5
8190

8291
result = process.handle_electronic_convergence_not_reached(process.ctx.children[-1])
92+
8393
assert isinstance(result, ProcessHandlerReport)
8494
assert process.ctx.inputs.parameters['ELECTRONS']['mixing_beta'] == \
8595
process.defaults.delta_factor_mixing_beta * 0.5

0 commit comments

Comments
 (0)