Skip to content

Commit

Permalink
pr update
Browse files Browse the repository at this point in the history
  • Loading branch information
shoubhikraj committed Oct 29, 2023
1 parent d51389b commit 9f66730
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions autode/neb/original.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,20 @@ def total_energy(flat_coords, images, method, n_cores, plot_energies):
f"{n_cores} total cores and {n_cores_pp} per process"
)

# Run an energy + gradient evaluation in parallel across all images
if isinstance(method, Method):
# Run an energy + gradient evaluation across all images (parallel for EST)
if isinstance(method, IDPP):
images[1:-1] = [
energy_gradient(images[i], method, n_cores_pp)
for i in range(1, len(images) - 1)
]
else:
with ProcessPool(max_workers=n_cores) as pool:
results = [

Check warning on line 110 in autode/neb/original.py

View check run for this annotation

Codecov / codecov/patch

autode/neb/original.py#L109-L110

Added lines #L109 - L110 were not covered by tests
pool.submit(energy_gradient, images[i], method, n_cores_pp)
for i in range(1, len(images) - 1)
]

images[1:-1] = [res.result() for res in results]

Check warning on line 115 in autode/neb/original.py

View check run for this annotation

Codecov / codecov/patch

autode/neb/original.py#L115

Added line #L115 was not covered by tests
else:
# turn off parallelisation for IDPP
images[1:-1] = [
energy_gradient(images[i], method, n_cores_pp)
for i in range(1, len(images) - 1)
]

images.increment()

Expand Down

0 comments on commit 9f66730

Please sign in to comment.