Skip to content

Commit

Permalink
Update core reduction logic test for MP
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinp0 committed Nov 27, 2023
1 parent 80a3129 commit d89426a
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions arc/job/adapters/molpro_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ def setUpClass(cls):
job_memory_gb=64,
)

cls.job_5 = MolproAdapter(execution_type='queue',
job_type='opt',
level=Level(method='CCSD(T)', basis='cc-pVQZ'),
project='test',
project_directory=os.path.join(ARC_PATH, 'arc', 'testing', 'test_MolproAdapter_2'),
species=[ARCSpecies(label='spc1', xyz=['O 0 0 1'])],
testing=True,
ess_trsh_methods=['memory','cpu', 'molpro_memory: 2800 '],
job_memory_gb=64,
)

def test_set_cpu_and_mem(self):
"""Test assigning number of cpu's and memory"""
self.job_1.cpu_cores = 48
Expand Down Expand Up @@ -165,12 +176,13 @@ def test_write_input_file(self):
self.assertEqual(content_2, job_2_expected_input_file)

def test_core_reduction_logic(self):
"""_summary_test_core_reduction_logic"""
"""Test the core reduction logic"""

# Reactive Job 3 again to trigger the condition of the core reduction logic
self.job_3.set_input_file_memory()
self.assertEqual(self.job_3.input_file_memory, 4296)
self.assertEqual(self.job_3.cpu_cores, 2)
# Job 5 again to trigger the condition of the core reduction logic
# Job 5 technically would be 3 CPUs prior to the reactive setting the input file memory.
self.job_5.set_input_file_memory()
self.assertEqual(self.job_5.input_file_memory, 4296)
self.assertEqual(self.job_5.cpu_cores, 2)

def test_set_files(self):
"""Test setting files"""
Expand Down

0 comments on commit d89426a

Please sign in to comment.