mirror of
https://github.com/LCPQ/quantum_package
synced 2024-08-24 21:41:46 +02:00
Repaired qp_run
This commit is contained in:
parent
28ad08a48d
commit
555fba503e
@ -20,27 +20,6 @@ let run exe ezfio_file =
|
||||
Printf.printf "===============\nQuantum Package\n===============\n\n";
|
||||
Printf.printf "Date : %s\n\n%!" (Time.to_string time_start);
|
||||
|
||||
let output_dir = ezfio_file^"/output" in
|
||||
if (Sys.file_exists_exn output_dir) then
|
||||
begin
|
||||
Sys.ls_dir output_dir
|
||||
|> List.iter ~f:(fun x -> Sys.remove (output_dir^"/"^x));
|
||||
Unix.rmdir output_dir
|
||||
end;
|
||||
|
||||
let fifo_name = ezfio_file^"/.fifo" in
|
||||
if (Sys.file_exists_exn fifo_name) then
|
||||
Sys.remove fifo_name;
|
||||
Unix.mkfifo ~perm:0o664 fifo_name;
|
||||
|
||||
let pid =
|
||||
In_channel.with_file fifo_name ~f:(fun in_channel ->
|
||||
In_channel.input_all in_channel |> String.strip )
|
||||
|> Int.of_string
|
||||
|> Pid.of_int
|
||||
in
|
||||
Sys.remove fifo_name;
|
||||
|
||||
let exe =
|
||||
match (List.find ~f:(fun (x,_) -> x = exe) executables) with
|
||||
| None -> assert false
|
||||
@ -51,13 +30,6 @@ let run exe ezfio_file =
|
||||
| i -> Printf.printf "Program exited with code %d.\n%!" i;
|
||||
;
|
||||
|
||||
Signal.send_exn (Signal.of_system_int 2) (`Pid pid);
|
||||
|
||||
|
||||
|
||||
(* Run the executable in the foreground
|
||||
* ==================================== *)
|
||||
|
||||
let duration = Time.diff (Time.now()) time_start
|
||||
|> Core.Span.to_string in
|
||||
Printf.printf "Wall time : %s\n\n" duration;
|
||||
|
Loading…
Reference in New Issue
Block a user