From 9f66730b212054e43cb7978f2c51ddf7ae339131 Mon Sep 17 00:00:00 2001 From: Shoubhik Maiti Date: Sun, 29 Oct 2023 11:14:59 +0000 Subject: [PATCH] pr update --- autode/neb/original.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/autode/neb/original.py b/autode/neb/original.py index 03dcb645d..e935f03aa 100644 --- a/autode/neb/original.py +++ b/autode/neb/original.py @@ -99,8 +99,13 @@ 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 = [ pool.submit(energy_gradient, images[i], method, n_cores_pp) @@ -108,12 +113,6 @@ def total_energy(flat_coords, images, method, n_cores, plot_energies): ] images[1:-1] = [res.result() for res in results] - 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()