Skip to content

Commit

Permalink
functional-test final
Browse files Browse the repository at this point in the history
  • Loading branch information
JintaoWu98 committed Oct 16, 2024
1 parent 7812f66 commit a725847
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
2 changes: 1 addition & 1 deletion arc/checks/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_i_from_job_name(job_name: str) -> Optional[int]:
"""
i = None
if 'conf_opt' in job_name:
i = int(job_name[8:])
i = int(job_name[9:])
elif 'conf_sp' in job_name:
i = int(job_name[7:])
elif 'tsg' in job_name:
Expand Down
3 changes: 2 additions & 1 deletion arc/job/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ def _set_job_number(self):
job_num = 0
self.job_num = job_num
# 2. Set other related attributes job_name and job_server_name.
self.job_server_name = self.job_server_name or 'a' + str(self.job_num)
if self.conformer is not None and self.job_name is None:
self.job_name = f'{self.job_type}_{self.conformer}_{self.job_server_name}'
elif self.tsg is not None and (self.job_name is None or 'tsg_a' in self.job_name):
Expand Down Expand Up @@ -1095,7 +1096,7 @@ def _log_job_execution(self):
local = 'local '
else:
server = f' on {self.server}'
if 'conformer' in self.job_name or 'tsg' in self.job_name:
if 'conf_opt' in self.job_name or 'tsg' in self.job_name:
job_server_name = f' ({self.job_server_name})'
execution_type = {'incore': 'incore job', 'queue': 'queue job', 'pipe': 'job array (pipe)'}[self.execution_type]
pivots = f' for pivots {[[tor[1] + 1, tor[2] + 1] for tor in self.torsions]}' if self.torsions is not None else ''
Expand Down
2 changes: 1 addition & 1 deletion arc/job/adapters/terachem.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def write_input_file(self) -> None:
input_dict['dispersion'] = 'no'

# Job type specific options
if self.job_type in ['conformer', 'opt', 'scan']:
if self.job_type in ['conf_opt', 'opt', 'scan']:
input_dict['job_type_1'] = 'minimize\n' \
'new_minimizer yes'
if self.fine:
Expand Down
4 changes: 2 additions & 2 deletions arc/job/trsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def determine_ess_status(output_path: str,
done = True
# If this is an opt job, we must also check that the max num of cycles hasn't been reached,
# so don't break yet.
if 'opt' not in job_type and 'conformer' not in job_type and 'ts' not in job_type:
if 'opt' not in job_type and 'conf_opt' not in job_type and 'ts' not in job_type:
break
elif 'SCF failed' in line:
keywords = ['SCF']
Expand All @@ -245,7 +245,7 @@ def determine_ess_status(output_path: str,
elif 'Invalid charge/multiplicity combination' in line:
raise SpeciesError(f'The multiplicity and charge combination for species '
f'{species_label} are wrong.')
if 'opt' in job_type or 'conformer' in job_type or 'ts' in job_type:
if 'opt' in job_type or 'conf_opt' in job_type or 'ts' in job_type:
if 'MAXIMUM OPTIMIZATION CYCLES REACHED' in line:
keywords = ['MaxOptCycles']
error = 'Maximum optimization cycles reached.'
Expand Down
12 changes: 6 additions & 6 deletions arc/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def schedule_jobs(self):
continue
job_list = self.running_jobs[label]
for job_name in job_list:
if 'conformer' in job_name:
if 'conf_opt' in job_name:
i = get_i_from_job_name(job_name)
job = self.job_dict[label]['conf_opt'][i]
if not (job.job_id in self.server_job_ids and job.job_id not in self.completed_incore_jobs):
Expand All @@ -562,7 +562,7 @@ def schedule_jobs(self):
# Just terminated a conformer job.
# Are there additional conformer jobs currently running for this species?
for spec_jobs in job_list:
if 'conformer' in spec_jobs and spec_jobs != job_name:
if 'conf_opt' in spec_jobs and spec_jobs != job_name:
break
else:
# All conformer jobs terminated.
Expand Down Expand Up @@ -599,7 +599,7 @@ def schedule_jobs(self):
self.run_conformer_jobs(labels=[label])
self.timer = False
break
elif 'opt' in job_name:
elif 'opt' in job_name and 'conf_opt' not in job_name:
# val is 'opt1', 'opt2', etc., or 'optfreq1', optfreq2', etc.
job = self.job_dict[label]['opt'][job_name]
if not (job.job_id in self.server_job_ids and job.job_id not in self.completed_incore_jobs):
Expand Down Expand Up @@ -3133,7 +3133,7 @@ def get_completed_incore_jobs(self):
if i is None:
job_type = '_'.join(job_name.split('_')[:-1]) # Consider job types such as 'directed_scan'.
job = self.job_dict[label][job_type][job_name]
elif 'conformer' in job_name:
elif 'conf_opt' in job_name:
job = self.job_dict[label]['conf_opt'][i]
elif 'tsg' in job_name:
job = self.job_dict[label]['tsg'][i]
Expand Down Expand Up @@ -3660,9 +3660,9 @@ def save_restart_dict(self):
self.restart_dict['running_jobs'][spc.label] = \
[self.job_dict[spc.label][job_name.rsplit('_', 1)[0]][job_name].as_dict()
for job_name in self.running_jobs[spc.label]
if 'conformer' not in job_name and 'tsg' not in job_name] \
if 'conf_opt' not in job_name and 'tsg' not in job_name] \
+ [self.job_dict[spc.label]['conf_opt'][get_i_from_job_name(job_name)].as_dict()
for job_name in self.running_jobs[spc.label] if 'conformer' in job_name] \
for job_name in self.running_jobs[spc.label] if 'conf_opt' in job_name] \
+ [self.job_dict[spc.label]['tsg'][get_i_from_job_name(job_name)].as_dict()
for job_name in self.running_jobs[spc.label] if 'tsg' in job_name]
logger.debug(f'Dumping restart dictionary:\n{self.restart_dict}')
Expand Down
21 changes: 14 additions & 7 deletions arc/testing/restart/3_restart_bde/restart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ irc_level:
job_memory: 14
job_types:
bde: true
conformers: true
conf_opt: true
conf_sp: false
fine: true
freq: true
irc: true
Expand Down Expand Up @@ -78,7 +79,8 @@ output:
job_types:
bde: true
composite: false
conformers: false
conf_opt: false
conf_sp: false
fine: false
freq: false
irc: true
Expand All @@ -105,7 +107,8 @@ output:
job_types:
bde: true
composite: false
conformers: true
conf_opt: true
conf_sp: false
fine: true
freq: true
irc: true
Expand All @@ -131,7 +134,8 @@ output:
job_types:
bde: true
composite: false
conformers: true
conf_opt: true
conf_sp: false
fine: true
freq: true
irc: true
Expand All @@ -156,7 +160,8 @@ output:
job_types:
bde: true
composite: false
conformers: true
conf_opt: true
conf_sp: false
fine: true
freq: true
irc: true
Expand All @@ -181,7 +186,8 @@ output:
job_types:
bde: true
composite: false
conformers: true
conf_opt: true
conf_sp: false
fine: true
freq: true
irc: true
Expand All @@ -206,7 +212,8 @@ output:
job_types:
bde: true
composite: false
conformers: true
conf_opt: true
conf_sp: false
fine: true
freq: true
irc: true
Expand Down

0 comments on commit a725847

Please sign in to comment.