diff --git a/ocaml/Qmcchem_config.ml b/ocaml/Qmcchem_config.ml index d9f302d..3a82387 100644 --- a/ocaml/Qmcchem_config.ml +++ b/ocaml/Qmcchem_config.ml @@ -83,7 +83,7 @@ let hostname = lazy ( try Unix.gethostname () with - | _ -> "localhost" + | _ -> "127.0.0.1" ) diff --git a/ocaml/Qmcchem_dataserver.ml b/ocaml/Qmcchem_dataserver.ml index 3067996..73cc34e 100644 --- a/ocaml/Qmcchem_dataserver.ml +++ b/ocaml/Qmcchem_dataserver.ml @@ -100,7 +100,7 @@ let run ?(daemon=true) ezfio_filename = ZMQ.Socket.bind socket address; accu with - | _ -> false; + | _ -> false in ZMQ.Socket.close socket; result diff --git a/ocaml/Qmcchem_run.ml b/ocaml/Qmcchem_run.ml index 7a1a465..368695c 100644 --- a/ocaml/Qmcchem_run.ml +++ b/ocaml/Qmcchem_run.ml @@ -12,13 +12,16 @@ let full_run ?(start_dataserver=true) ezfio_filename = (* Create the node file *) - let server_file = - Filename.concat ezfio_filename "nodefile" - in - Out_channel.with_file server_file ~f:(fun out_channel -> - Launcher.create_nodefile () - |> Out_channel.output_string out_channel - ) ; + (* + let () = + let server_file = + Filename.concat ezfio_filename "nodefile" + in + Out_channel.with_file server_file ~f:(fun out_channel -> + Launcher.create_nodefile () + |> Out_channel.output_string out_channel + ) + *) (* Get the configuration of executables *) @@ -32,7 +35,7 @@ let full_run ?(start_dataserver=true) ezfio_filename = if (start_dataserver) then begin (* Reset socket address in EZFIO *) - Ezfio.set_simulation_http_server "tcp://localhost:65534"; + Ezfio.set_simulation_http_server "tcp://127.0.0.1:65534"; (* Start the data server *) @@ -64,7 +67,7 @@ let full_run ?(start_dataserver=true) ezfio_filename = ZMQ.Socket.send socket (Message.(to_string Test)); ZMQ.Socket.recv socket ) with - | Unix.Unix_error _ -> + | Unix.Unix_error (_,_,_) -> begin ZMQ.Socket.set_linger_period socket 1 ; ZMQ.Socket.close socket;