From a72584706abab2f7f03aaf037b2ff11ed9446066 Mon Sep 17 00:00:00 2001 From: Jintao_O Date: Mon, 14 Oct 2024 14:52:54 +0300 Subject: [PATCH] functional-test final --- arc/checks/common.py | 2 +- arc/job/adapter.py | 3 ++- arc/job/adapters/terachem.py | 2 +- arc/job/trsh.py | 4 ++-- arc/scheduler.py | 12 +++++------ arc/testing/restart/3_restart_bde/restart.yml | 21 ++++++++++++------- 6 files changed, 26 insertions(+), 18 deletions(-) diff --git a/arc/checks/common.py b/arc/checks/common.py index 4e3a8e613b..94d970c1c2 100644 --- a/arc/checks/common.py +++ b/arc/checks/common.py @@ -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: diff --git a/arc/job/adapter.py b/arc/job/adapter.py index 755c39cd37..31ac915fdf 100644 --- a/arc/job/adapter.py +++ b/arc/job/adapter.py @@ -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): @@ -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 '' diff --git a/arc/job/adapters/terachem.py b/arc/job/adapters/terachem.py index c1d477012c..f9eaed3ea4 100644 --- a/arc/job/adapters/terachem.py +++ b/arc/job/adapters/terachem.py @@ -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: diff --git a/arc/job/trsh.py b/arc/job/trsh.py index 04995c41f2..f985db6a61 100644 --- a/arc/job/trsh.py +++ b/arc/job/trsh.py @@ -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'] @@ -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.' diff --git a/arc/scheduler.py b/arc/scheduler.py index acc8984d64..3e774345f3 100644 --- a/arc/scheduler.py +++ b/arc/scheduler.py @@ -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): @@ -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. @@ -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): @@ -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] @@ -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}') diff --git a/arc/testing/restart/3_restart_bde/restart.yml b/arc/testing/restart/3_restart_bde/restart.yml index 8e60435303..df743c9d9c 100644 --- a/arc/testing/restart/3_restart_bde/restart.yml +++ b/arc/testing/restart/3_restart_bde/restart.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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