Skip to content

Commit

Permalink
Merge pull request #217 from leeping/pre1.1_tests_working
Browse files Browse the repository at this point in the history
All tests pass for v1.1 release
  • Loading branch information
leeping authored Jan 24, 2025
2 parents ea7b172 + b1a11bf commit b29b198
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
6 changes: 4 additions & 2 deletions geometric/nifty.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,10 +830,12 @@ def createWorkQueue(wq_port, debug=True, name=package):
if debug:
work_queue.set_debug_flag('all')
WORK_QUEUE = work_queue.WorkQueue(port=wq_port)
WORK_QUEUE.specify_name(name)
# LPW 2025-01-23 Commenting out the following line because it makes deleting the WQ no longer work.
# WORK_QUEUE.specify_name(name)
# QYD: prefer the worker that is fastest in previous tasks
# another choice is first-come-first serve: WORK_QUEUE_SCHEDULE_FCFS
WORK_QUEUE.specify_algorithm(work_queue.WORK_QUEUE_SCHEDULE_TIME)
# LPW 2025-01-23 Commenting out the following line because it makes deleting the WQ no longer work.
# WORK_QUEUE.specify_algorithm(work_queue.WORK_QUEUE_SCHEDULE_TIME)
# QYD: We don't want to specify the following extremely long keepalive times
# because they will prevent checking "dead" workers, causing the program to wait forever
#WORK_QUEUE.specify_keepalive_timeout(8640000)
Expand Down
2 changes: 1 addition & 1 deletion geometric/tests/test_hessian.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_ase_work_queue_hessian(self, localizer):

shutil.copy2(os.path.join(datad, 'water1_coords_gfn2-xtb.xyz'), os.path.join(os.getcwd(), "start.xyz"))

geometric.nifty.createWorkQueue(9192, debug=False)
geometric.nifty.createWorkQueue(9191, debug=False)
wq = geometric.nifty.getWorkQueue()

molecule, engine = geometric.prepare.get_molecule_engine(engine="ase", input="start.xyz", ase_class="xtb.ase.calculator.XTB", ase_kwargs='{"method":"GFN2-xTB", "accuracy":0.001}')
Expand Down
4 changes: 2 additions & 2 deletions geometric/tests/test_neb.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def test_qchem_work_queue_neb(self, localizer, molecule_engine_hcn):
M, engine=engine, tmpdir=tempfile.mkdtemp(), params=params, plain=0
)

geometric.nifty.createWorkQueue(9192, debug=False)
geometric.nifty.createWorkQueue(9191, debug=False)
wq = geometric.nifty.getWorkQueue()
worker_program = geometric.nifty.which('work_queue_worker')
# Assume 4 threads are available
Expand Down Expand Up @@ -296,7 +296,7 @@ def test_terachem_work_queue_neb(self, localizer, molecule_engine_hcn):
M, engine=engine, tmpdir=tempfile.mkdtemp(), params=params, plain=0
)

geometric.nifty.createWorkQueue(9193, debug=False)
geometric.nifty.createWorkQueue(9191, debug=False)
wq = geometric.nifty.getWorkQueue()
worker_program = geometric.nifty.which('work_queue_worker')
# Assume 4 threads are available
Expand Down
16 changes: 8 additions & 8 deletions geometric/tests/test_terachem.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ def test_terachem_qmmm_openmm(self, localizer, workqueue):
else:
result = engine.calc_new(coords, 'run.tmp')['gradient']
# Compare result
refgrad = np.array([[-0.0146181655, 0.0413077637, -0.0000000018],
[-0.0035848878, -0.0059011543, -0.0092284233],
[-0.0035848900, -0.0059011520, 0.0092284240],
[ 0.0116421807, -0.0005882161, -0.0000000007],
[ 0.0082058550, -0.0232158055, 0.0000000018],
[-0.0016073291, -0.0027339830, 0.0043185120],
[-0.0016073291, -0.0027339829, -0.0043185120],
[ 0.0051545658, -0.0002334698, -0.0000000000]]).flatten()
refgrad = np.array([[-0.0087843182, 0.0248112145, 0.0000000045],
[-0.0035052067, -0.0062861883, -0.0093217504],
[-0.0035052036, -0.0062861880, 0.0093217464],
[ 0.0118851362, -0.0009251753, 0.0000000006],
[ 0.0071183928, -0.0200906153, -0.0000000012],
[-0.0007386155, 0.0029989473, -0.0004150336],
[-0.0007386155, 0.0029989474, 0.0004150337],
[-0.0017315695, 0.0027790577, -0.0000000000]]).flatten()
np.testing.assert_almost_equal(result, refgrad, decimal=6)

def test_edit_tcin(localizer):
Expand Down

0 comments on commit b29b198

Please sign in to comment.