Skip to content

Commit b38742a

Browse files
authored
Added a feature that allows not to trsh rotors (#786)
1D rotor scans for large systems fail too often. In some applications we'd like to compute rotors, but if they fail that means that more sophisticated methods should be applied. Currently ARC tries to troubleshoot the rotor runs, taking too long, and not always succeeding. This PR keeps the above default behavior, but adds an option to avoid trshing rotor runs
2 parents 155f5af + c9d88af commit b38742a

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

arc/main.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ class ARC(object):
152152
format (``True``, default) or classical two-parameter Arrhenius equation format
153153
(``False``).
154154
trsh_ess_jobs (bool, optional): Whether to attempt troubleshooting failed ESS jobs. Default is ``True``.
155+
trsh_rotors (bool, optional): Whether to attempt troubleshooting failed rotor scan jobs. Default is ``True``.
155156
output (dict, optional): Output dictionary with status and final QM file paths for all species.
156157
Only used for restarting.
157158
output_multi_spc (dict, optional): Output dictionary with status and final QM file paths for the multi species.
@@ -227,6 +228,7 @@ class ARC(object):
227228
three_params (bool): Compute rate coefficients using the modified three-parameter Arrhenius equation
228229
format (``True``) or classical two-parameter Arrhenius equation format (``False``).
229230
trsh_ess_jobs (bool): Whether to attempt troubleshooting failed ESS jobs. Default is ``True``.
231+
trsh_rotors (bool): Whether to attempt troubleshooting failed rotor scan jobs. Default is ``True``.
230232
ts_adapters (list): Entries represent different TS adapters.
231233
report_e_elect (bool): Whether to report electronic energy.
232234
skip_nmd (bool): Whether to skip normal mode displacement check.
@@ -279,6 +281,7 @@ def __init__(self,
279281
thermo_adapter: str = 'Arkane',
280282
three_params: bool = True,
281283
trsh_ess_jobs: bool = True,
284+
trsh_rotors: bool = True,
282285
ts_adapters: List[str] = None,
283286
ts_guess_level: Optional[Union[str, dict, Level]] = None,
284287
verbose=logging.INFO,
@@ -317,6 +320,7 @@ def __init__(self,
317320
self.compute_rates = compute_rates
318321
self.three_params = three_params
319322
self.trsh_ess_jobs = trsh_ess_jobs
323+
self.trsh_rotors = trsh_rotors
320324
self.compute_transport = compute_transport
321325
self.thermo_adapter = StatmechEnum(thermo_adapter.lower()).value
322326
self.kinetics_adapter = StatmechEnum(kinetics_adapter.lower()).value
@@ -440,6 +444,10 @@ def __init__(self,
440444
logger.info('\n')
441445
logger.warning('Not troubleshooting ESS jobs!')
442446
logger.info('\n')
447+
elif not self.trsh_rotors:
448+
logger.info('\n')
449+
logger.warning('Not troubleshooting rotor scan jobs!')
450+
logger.info('\n')
443451

444452
self.scheduler = None
445453
self.restart_dict = self.as_dict()
@@ -544,6 +552,8 @@ def as_dict(self) -> dict:
544552
restart_dict['three_params'] = self.three_params
545553
if not self.trsh_ess_jobs:
546554
restart_dict['trsh_ess_jobs'] = self.trsh_ess_jobs
555+
if not self.trsh_rotors:
556+
restart_dict['trsh_rotors'] = self.trsh_rotors
547557
if self.ts_guess_level is not None and str(self.ts_guess_level).split()[0] != default_levels_of_theory['ts_guesses']:
548558
restart_dict['ts_guess_level'] = self.ts_guess_level.as_dict() \
549559
if not isinstance(self.ts_guess_level, (dict, str)) else self.ts_guess_level
@@ -617,6 +627,7 @@ def execute(self) -> dict:
617627
e_confs=self.e_confs,
618628
dont_gen_confs=self.dont_gen_confs,
619629
trsh_ess_jobs=self.trsh_ess_jobs,
630+
trsh_rotors=self.trsh_rotors,
620631
fine_only=self.fine_only,
621632
ts_adapters=self.ts_adapters,
622633
report_e_elect=self.report_e_elect,

arc/scheduler.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ class Scheduler(object):
162162
kinetics_adapter (str, optional): The statmech software to use for kinetic rate coefficient calculations.
163163
freq_scale_factor (float, optional): The harmonic frequencies scaling factor.
164164
trsh_ess_jobs (bool, optional): Whether to attempt troubleshooting failed ESS jobs. Default is ``True``.
165+
trsh_rotors (bool, optional): Whether to attempt troubleshooting failed rotor scan jobs. Default is ``True``.
165166
ts_adapters (list, optional): Entries represent different TS adapters.
166167
report_e_elect (bool, optional): Whether to report electronic energy. Default is ``False``.
167168
skip_nmd (bool, optional): Whether to skip normal mode displacement check. Default is ``False``.
@@ -219,6 +220,7 @@ class Scheduler(object):
219220
kinetics_adapter (str): The statmech software to use for kinetic rate coefficient calculations.
220221
freq_scale_factor (float): The harmonic frequencies scaling factor.
221222
trsh_ess_jobs (bool): Whether to attempt troubleshooting failed ESS jobs. Default is ``True``.
223+
trsh_rotors (bool): Whether to attempt troubleshooting failed rotor scan jobs. Default is ``True``.
222224
ts_adapters (list): Entries represent different TS adapters.
223225
report_e_elect (bool): Whether to report electronic energy.
224226
skip_nmd (bool): Whether to skip normal mode displacement check.
@@ -253,6 +255,7 @@ def __init__(self,
253255
e_confs: Optional[float] = 5,
254256
fine_only: Optional[bool] = False,
255257
trsh_ess_jobs: Optional[bool] = True,
258+
trsh_rotors: Optional[bool] = True,
256259
kinetics_adapter: str = 'arkane',
257260
freq_scale_factor: float = 1.0,
258261
ts_adapters: List[str] = None,
@@ -284,6 +287,7 @@ def __init__(self,
284287
self.job_types = job_types if job_types is not None else default_job_types
285288
self.fine_only = fine_only
286289
self.trsh_ess_jobs = trsh_ess_jobs
290+
self.trsh_rotors = trsh_rotors
287291
self.kinetics_adapter = kinetics_adapter
288292
self.freq_scale_factor = freq_scale_factor
289293
self.ts_adapters = ts_adapters if ts_adapters is not None else default_ts_adapters
@@ -2888,7 +2892,7 @@ def check_scan_job(self,
28882892

28892893
if len(list(actions.keys())) \
28902894
and 'pivTS' not in self.species_dict[label].rotors_dict[job.rotor_index]['invalidation_reason'] \
2891-
and self.trsh_ess_jobs:
2895+
and self.trsh_ess_jobs and self.trsh_rotors:
28922896
# The rotor scan is problematic (and does not block a TS reaction zone), troubleshooting is required.
28932897
logger.info(f'Trying to troubleshoot rotor '
28942898
f'{self.species_dict[label].rotors_dict[job.rotor_index]["pivots"]} '
@@ -3219,9 +3223,9 @@ def troubleshoot_scan_job(self,
32193223
- ``True`` if the troubleshooting is valid.
32203224
- The actions are applied in the troubleshooting.
32213225
"""
3222-
if not self.trsh_ess_jobs:
3226+
if not self.trsh_ess_jobs or not self.trsh_rotors:
32233227
logger.warning(f'Not troubleshooting failed scan job {job.job_name}. To enable troubleshooting, '
3224-
f'set the "trsh_ess_jobs" to "True".')
3228+
f'set the "trsh_ess_jobs" and the "trsh_rotors" arguments to "True".')
32253229
return False, dict()
32263230

32273231
label = job.species_label
@@ -3413,7 +3417,7 @@ def troubleshoot_ess(self,
34133417
level_of_theory (Level, dict, str): The level of theory to use.
34143418
conformer (int, optional): The conformer index.
34153419
"""
3416-
if not self.trsh_ess_jobs:
3420+
if not self.trsh_ess_jobs or not self.trsh_rotors and job.job_type == 'scan':
34173421
logger.warning(f'Not troubleshooting failed {label} job {job.job_name}. '
34183422
f'To enable troubleshooting, set the "trsh_ess_jobs" argument to "True".')
34193423
return None

0 commit comments

Comments
 (0)