From 55d51c36662719ef47b1586c243d6a2bc91f6658 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 29 Dec 2015 03:31:08 +0100 Subject: [PATCH] Remove pipe files after forwarder terminates --- ocaml/.gitignore | 1 + ocaml/Qmcchem_forwarder.ml | 13 ++++++++++++- ocaml/Watchdog.ml | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ocaml/.gitignore b/ocaml/.gitignore index d6883ef..14cbb4d 100644 --- a/ocaml/.gitignore +++ b/ocaml/.gitignore @@ -9,4 +9,5 @@ Qptypes.ml generated.ninja qmcchem qptypes_generator +Property.ml diff --git a/ocaml/Qmcchem_forwarder.ml b/ocaml/Qmcchem_forwarder.ml index e886093..ba8874c 100644 --- a/ocaml/Qmcchem_forwarder.ml +++ b/ocaml/Qmcchem_forwarder.ml @@ -79,7 +79,18 @@ let run ezfio_filename dataserver = | Ok _ -> () | _ -> print_endline "Unable to remove temporary directory" ; - ZMQ.Context.terminate zmq_context + ZMQ.Context.terminate zmq_context ; + for i=port to port+4 + do + let filename = + Filename.concat Qmcchem_config.dev_shm (Printf.sprintf ":%d" i) + in + try + Unix.unlink filename + with + | _ -> () + ; + done in diff --git a/ocaml/Watchdog.ml b/ocaml/Watchdog.ml index fbdfbab..a9d2e3d 100644 --- a/ocaml/Watchdog.ml +++ b/ocaml/Watchdog.ml @@ -7,8 +7,8 @@ let _threads = ref [] ;; (** Kill the current process and all children *) let kill () = let kill pid = - Printf.printf "Killed %d\n" (Pid.to_int pid); - Signal.send_i Signal.term (`Pid pid) + Signal.send_i Signal.int (`Pid pid); + Printf.printf "Killed %d\n" (Pid.to_int pid) in List.iter ~f:kill (!_list); exit 1