10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-22 04:14:07 +01:00

Fixed gaspi_command

This commit is contained in:
Anthony Scemama 2017-07-22 13:15:09 +02:00
parent fe76bd313a
commit b4b1d23f64
2 changed files with 10 additions and 10 deletions

6
bin/qp_gaspi_run Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
QP_ROOT=$( cd $(dirname "${BASH_SOURCE}")/.. ; pwd -P )
source $HOME/.bashrc
source $QP_ROOT/quantum_package.rc
exec $QP_ROOT/ocaml/qp_run $@

View File

@ -15,7 +15,7 @@ let print_list () =
let () =
Random.self_init ()
let run slave gaspi_command exe ezfio_file =
let run slave exe ezfio_file =
(** Check availability of the ports *)
@ -115,17 +115,13 @@ let run slave gaspi_command exe ezfio_file =
match Sys.getenv "QP_PREFIX" with
| Some x -> x^" "
| None -> ""
and gaspi_command =
match gaspi_command with
| Some gaspi_run -> gaspi_run^" "
| None -> ""
and exe =
match (List.find ~f:(fun (x,_) -> x = exe) executables) with
| Some (_,x) -> x^" "
| None -> assert false
in
let exit_code =
match (Sys.command (prefix^gaspi_command^exe^ezfio_file)) with
match (Sys.command (prefix^exe^ezfio_file)) with
| 0 -> 0
| i -> (Printf.printf "Program exited with code %d.\n%!" i; i)
in
@ -146,8 +142,6 @@ let spec =
empty
+> flag "slave" no_arg
~doc:(" Needed for slave tasks")
+> flag "gaspi_run" (optional string)
~doc:(" mpi launcher with its options")
+> anon ("executable" %: string)
+> anon ("ezfio_file" %: string)
;;
@ -165,8 +159,8 @@ Executes a Quantum Package binary file among these:\n\n"
)
)
spec
(fun slave gaspi_command exe ezfio_file () ->
run slave gaspi_command exe ezfio_file
(fun slave exe ezfio_file () ->
run slave exe ezfio_file
)
|> Command.run ~version: Git.sha1 ~build_info: Git.message