Skip to content

Commit

Permalink
Added trsh_test for maxcycle increases
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinp0 committed Aug 7, 2024
1 parent 0538532 commit 37e3ca3
Show file tree
Hide file tree
Showing 2 changed files with 11,680 additions and 3 deletions.
28 changes: 25 additions & 3 deletions arc/job/trsh_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ 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)


# QChem

path = os.path.join(self.base_path["qchem"], "H2_opt.out")
Expand Down Expand Up @@ -381,7 +391,7 @@ def test_trsh_ess_job(self):
num_heavy_atoms, cpu_cores, ess_trsh_methods)

self.assertTrue(remove_checkfile)
self.assertIn('scf=(qc)', ess_trsh_methods)
self.assertIn('scf=(maxcycle=512)', ess_trsh_methods)
self.assertFalse(couldnt_trsh)

# Gaussian: test 5
Expand All @@ -396,17 +406,29 @@ 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=(maxcycle=512)' ]
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=(maxcycle=512)']; ",
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)
self.assertIn('scf=(maxcycle=512)', ess_trsh_methods)


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

0 comments on commit 37e3ca3

Please sign in to comment.