Skip to content

Commit

Permalink
Added tests for max steps and inaccurate quadrature, including parsin…
Browse files Browse the repository at this point in the history
…g test checks
  • Loading branch information
calvinp0 committed Aug 11, 2024
1 parent 8b4d096 commit 286be64
Show file tree
Hide file tree
Showing 3 changed files with 22,915 additions and 2 deletions.
75 changes: 73 additions & 2 deletions arc/job/trsh_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,25 @@ def test_determine_ess_status(self):
)
self.assertFalse(line)

path = os.path.join(self.base_path["gaussian"], "maxsteps.out")
status, keywords, error, line = trsh.determine_ess_status(
output_path=path, species_label="Zr2O4H", job_type="opt"
)
self.assertEqual(status, "errored")
self.assertEqual(keywords, ["MaxOptCycles", "GL9999", "SCF"])
self.assertEqual(error, "Maximum optimization cycles reached.")
self.assertIn("Number of steps exceeded", line)

path = os.path.join(self.base_path["gaussian"], "inaccurate_quadrature.out")
status, keywords, error, line = trsh.determine_ess_status(
output_path=path, species_label="Zr2O4H", job_type="opt"
)
self.assertEqual(status, "errored")
self.assertEqual(keywords, ["InaccurateQuadrature", "GL502"])
self.assertEqual(error, "Inaccurate quadrature in CalDSu")
self.assertIn("Inaccurate quadrature in CalDSu", line)


# QChem

path = os.path.join(self.base_path["qchem"], "H2_opt.out")
Expand Down Expand Up @@ -396,17 +415,69 @@ def test_trsh_ess_job(self):

# Gaussian: test 6
job_status = {'keywords': ['SCF', 'GL502', 'NoSymm']}
ess_trsh_methods = ['scf=(NoDIIS)', 'int=(Acc2E=14)', 'checkfile=None', 'scf=(qc)', 'NoSymm','scf=(NDamp=30)', 'guess=INDO' ]
ess_trsh_methods = ['scf=(NoDIIS)', 'int=(Acc2E=14)', 'checkfile=None', 'scf=(qc)', 'NoSymm','scf=(NDamp=30)', 'guess=INDO', 'scf=(Fermi)',
'scf=(Noincfock)', 'scf=(NoVarAcc)']
output_errors, ess_trsh_methods, remove_checkfile, level_of_theory, software, job_type, fine, trsh_keyword, \
memory, shift, cpu_cores, couldnt_trsh = trsh.trsh_ess_job(label, level_of_theory, server, job_status,
job_type, software, fine, memory_gb,
num_heavy_atoms, cpu_cores, ess_trsh_methods)
self.assertTrue(couldnt_trsh)
self.assertIn(
"Error: Could not troubleshoot opt for ethanol! Tried troubleshooting with the following methods: ['scf=(NoDIIS)', 'int=(Acc2E=14)', 'checkfile=None', 'scf=(qc)', 'NoSymm', 'scf=(NDamp=30)', 'guess=INDO']; ",
"Error: Could not troubleshoot opt for ethanol! Tried troubleshooting with the following methods: ['scf=(NoDIIS)', 'int=(Acc2E=14)', 'checkfile=None', 'scf=(qc)', 'NoSymm', 'scf=(NDamp=30)', 'guess=INDO', 'scf=(Fermi)', 'scf=(Noincfock)', 'scf=(NoVarAcc)']; ",
output_errors,
)

# Gaussian: test 7
job_status = {'keywords': ['MaxOptCycles', 'GL9999','SCF']}
ess_trsh_methods = ['int=(Acc2E=14)']
output_errors, ess_trsh_methods, remove_checkfile, level_of_theory, software, job_type, fine, trsh_keyword, \
memory, shift, cpu_cores, couldnt_trsh = trsh.trsh_ess_job(label, level_of_theory, server, job_status,
job_type, software, fine, memory_gb,
num_heavy_atoms, cpu_cores, ess_trsh_methods)
self.assertFalse(couldnt_trsh)
self.assertIn('opt=(maxcycle=200)', ess_trsh_methods)

# Gaussian: test 8 - part 1
# 'InaccurateQuadrature', 'GL502'
job_status = {'keywords': ['InaccurateQuadrature', 'GL502']}
ess_trsh_methods = ['int=(Acc2E=14)']
output_errors, ess_trsh_methods, remove_checkfile, level_of_theory, software, job_type, fine, trsh_keyword, \
memory, shift, cpu_cores, couldnt_trsh = trsh.trsh_ess_job(label, level_of_theory, server, job_status,
job_type, software, fine, memory_gb,
num_heavy_atoms, cpu_cores, ess_trsh_methods)
self.assertFalse(couldnt_trsh)
self.assertIn('int=(Acc2E=14)', ess_trsh_methods)
self.assertIn('int=grid=300590', ess_trsh_methods)

# Gaussian: test 8 - part 2
# 'InaccurateQuadrature', 'GL502'
job_status = {'keywords': ['InaccurateQuadrature', 'GL502']}
ess_trsh_methods = ['int=(Acc2E=14)', 'int=grid=300590']
output_errors, ess_trsh_methods, remove_checkfile, level_of_theory, software, job_type, fine, trsh_keyword, \
memory, shift, cpu_cores, couldnt_trsh = trsh.trsh_ess_job(label, level_of_theory, server, job_status,
job_type, software, fine, memory_gb,
num_heavy_atoms, cpu_cores, ess_trsh_methods)
self.assertFalse(couldnt_trsh)
self.assertIn('int=(Acc2E=14)', ess_trsh_methods)
self.assertIn('int=grid=300590', ess_trsh_methods)
self.assertIn('scf=(NoVarAcc)', ess_trsh_methods)

# Gaussian: test 8 - part 3
# 'InaccurateQuadrature', 'GL502'
job_status = {'keywords': ['InaccurateQuadrature', 'GL502']}
ess_trsh_methods = ['int=(Acc2E=14)', 'int=grid=300590', 'scf=(NoVarAcc)']
output_errors, ess_trsh_methods, remove_checkfile, level_of_theory, software, job_type, fine, trsh_keyword, \
memory, shift, cpu_cores, couldnt_trsh = trsh.trsh_ess_job(label, level_of_theory, server, job_status,
job_type, software, fine, memory_gb,
num_heavy_atoms, cpu_cores, ess_trsh_methods)
self.assertFalse(couldnt_trsh)
self.assertIn('int=(Acc2E=14)', ess_trsh_methods)
self.assertIn('int=grid=300590', ess_trsh_methods)
self.assertIn('scf=(NoVarAcc)', ess_trsh_methods)
self.assertIn('guess=INDO', ess_trsh_methods)



# Test Q-Chem
software = "qchem"
ess_trsh_methods = ["change_node"]
Expand Down
Loading

0 comments on commit 286be64

Please sign in to comment.