From 65c86706addb32533cc89545737c9092d6c1b8c7 Mon Sep 17 00:00:00 2001 From: Michele Ceriotti Date: Mon, 21 Oct 2024 19:58:58 +0200 Subject: [PATCH] Clean up before exiting plumed --- ipi/engine/forcefields.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ipi/engine/forcefields.py b/ipi/engine/forcefields.py index 827d92b6a..0b994d1b4 100644 --- a/ipi/engine/forcefields.py +++ b/ipi/engine/forcefields.py @@ -741,6 +741,12 @@ def __init__( self.masses = dstrip(myatoms.m) self.lastq = np.zeros(3 * self.natoms) self.system_force = None # reference to physical force calculator + softexit.register_function(self.softexit) + + def softexit(self): + """Takes care of cleaning up upon softexit""" + + self.plumed.finalize() def evaluate(self, r): """A wrapper function to call the PLUMED evaluation routines