Skip to content

Commit 3c8684e

Browse files
committed
Handle monoatomic species for DLPNO methods in Orca
Generalize the H-atom-specific check to all monoatomic species when using DLPNO methods in Orca, as these methods are incompatible with single-atom systems that lack electron pairs to correlate. Added tests for trsh regard monoatomic
1 parent 8a1a79d commit 3c8684e

2 files changed

Lines changed: 27 additions & 4 deletions

File tree

arc/job/trsh.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@ def trsh_ess_job(label: str,
838838
cpu_cores: int,
839839
ess_trsh_methods: list,
840840
is_h: bool = False,
841+
is_monoatomic: bool = False,
841842
) -> tuple:
842843
"""
843844
Troubleshoot issues related to the electronic structure software, such as convergence.
@@ -856,6 +857,7 @@ def trsh_ess_job(label: str,
856857
cpu_cores (int): The total number of cpu cores requested for a job.
857858
ess_trsh_methods (list): The troubleshooting methods tried for this job.
858859
is_h (bool): Whether the species is a hydrogen atom (or its isotope). e.g., H, D, T.
860+
is_monoatomic (bool): Whether the species is monoatomic (single atom).
859861
860862
Todo:
861863
- Change server to one that has the same ESS if running out of disk space.
@@ -1016,7 +1018,10 @@ def trsh_ess_job(label: str,
10161018
couldnt_trsh = True
10171019

10181020
elif 'orca' in software:
1019-
if 'Memory' in job_status['keywords']:
1021+
if 'dlpno' in level_of_theory.method and (is_monoatomic or is_h):
1022+
raise TrshError(f'DLPNO methods are incompatible with monoatomic species {label} in Orca. '
1023+
f'This should have been caught by the Scheduler before job submission.')
1024+
elif 'Memory' in job_status['keywords']:
10201025
# Increase memory allocation.
10211026
# job_status will be for example
10221027
# `Error (ORCA_SCF): Not enough memory available! Please increase MaxCore to more than: 289 MB`.
@@ -1067,9 +1072,6 @@ def trsh_ess_job(label: str,
10671072
logger.info(f'Troubleshooting {job_type} job in {software} for {label} using {cpu_cores} cpu cores.')
10681073
if 'cpu' not in ess_trsh_methods:
10691074
ess_trsh_methods.append('cpu')
1070-
elif 'dlpno' in level_of_theory.method and is_h:
1071-
logger.error('DLPNO method is not supported for H atom (or its isotope D or T) in Orca.')
1072-
couldnt_trsh = True
10731075
else:
10741076
couldnt_trsh = True
10751077

arc/job/trsh_test.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import arc.job.trsh as trsh
1313
from arc.common import ARC_TESTING_PATH
14+
from arc.exceptions import TrshError
1415
from arc.imports import settings
1516
from arc.parser.parser import parse_1d_scan_energies
1617

@@ -775,6 +776,26 @@ def test_trsh_ess_job(self):
775776
self.assertIn('cpu', ess_trsh_methods)
776777
self.assertEqual(cpu_cores, 10)
777778

779+
# Orca: test 5
780+
# Test that DLPNO + monoatomic species raises TrshError
781+
label = 'H'
782+
level_of_theory = {'method': 'dlpno-ccsd(T)'}
783+
server = 'server1'
784+
job_type = 'sp'
785+
software = 'orca'
786+
fine = True
787+
memory_gb = 16
788+
cpu_cores = 12
789+
num_heavy_atoms = 0
790+
ess_trsh_methods = []
791+
job_status = {'keywords': ['MDCI', 'Memory'],
792+
'error': 'MDCI error in Orca. Assuming memory allocation error.'}
793+
with self.assertRaises(TrshError):
794+
trsh.trsh_ess_job(label, level_of_theory, server, job_status,
795+
job_type, software, fine, memory_gb,
796+
num_heavy_atoms, cpu_cores, ess_trsh_methods,
797+
is_h=True, is_monoatomic=True)
798+
778799
def test_determine_job_log_memory_issues(self):
779800
"""Test the determine_job_log_memory_issues() function."""
780801
job_log_path_1 = os.path.join(ARC_TESTING_PATH, 'job_log', 'no_issues.log')

0 commit comments

Comments
 (0)