diff --git a/ocaml/Qmcchem_forwarder.ml b/ocaml/Qmcchem_forwarder.ml index deaf50a..4a421f3 100644 --- a/ocaml/Qmcchem_forwarder.ml +++ b/ocaml/Qmcchem_forwarder.ml @@ -465,6 +465,13 @@ let run ezfio_filename dataserver = end; (* Wait for the qmc process to complete *) - ignore (Watchdog.join ()); - terminate () + try + ignore (Watchdog.join ()); + terminate () + with + | error -> + begin + terminate (); + raise error + end