Skip to content

Commit 75d72b3

Browse files
authored
Error handling when clean remote folder failed (#245)
For convergence `_base`
1 parent 38e5ebd commit 75d72b3

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

src/aiida_sssp_workflow/protocol/convergence.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fine:
4040

4141
base: # base parameters is inherit by other process
4242
occupations: smearing
43-
degauss: 0.0125
43+
degauss: 0.0125
4444
smearing: fd
4545
conv_thr_per_atom: 1.0e-9
4646
kpoints_distance: 0.1 # fine protocol of qe -> gabriel

src/aiida_sssp_workflow/protocol/criteria.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ efficiency:
7878

7979
eos:
8080
mode: 0
81-
bounds: [0.0, 0.2]
81+
bounds: [0.0, 0.2]
8282
eps: 1.0e-3
8383

8484
phonon_frequencies:

src/aiida_sssp_workflow/workflows/common.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
from builtins import ConnectionError
12
from typing import Optional
3+
from paramiko import ssh_exception
4+
25

36
from aiida import orm
47

@@ -40,8 +43,12 @@ def clean_workdir(node: orm.CalcJobNode) -> Optional[int]:
4043
# other subsequent calcjob as `parent_folder`, i.e PH calculation.
4144
cached_from = node.base.extras.get("_aiida_cached_from", None)
4245
if not cached_from:
43-
node.outputs.remote_folder._clean() # pylint: disable=protected-access
44-
return node.pk
46+
try:
47+
node.outputs.remote_folder._clean() # pylint: disable=protected-access
48+
except ssh_exception.SSHException as exc:
49+
raise ConnectionError("ssh error") from exc
50+
else:
51+
return node.pk
4552
else:
4653
return None
4754

src/aiida_sssp_workflow/workflows/evaluate/_phonon_frequencies.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,15 @@ def finalize(self):
194194
"""set ecutwfc and ecutrho"""
195195

196196
if self.inputs.clean_workdir.value is True:
197-
cleaned_calcs = operate_calcjobs(
198-
self.node, operator=clean_workdir, all_same_nodes=False
199-
)
200-
201-
if cleaned_calcs:
197+
try:
198+
cleaned_calcs = operate_calcjobs(
199+
self.node, operator=clean_workdir, all_same_nodes=False
200+
)
201+
except ConnectionError as exc:
202+
self.logger.warning(
203+
f"clean remote workdir folder {self.inputs.clean_workir} failed: {exc}"
204+
)
205+
else:
202206
self.report(
203207
f"cleaned remote folders of calculations: {' '.join(map(str, cleaned_calcs))}"
204208
)

0 commit comments

Comments
 (0)