Update doc for qp_run

This commit is contained in:
Anthony Scemama 2019-01-13 14:57:53 +01:00
parent 54a5e30c1d
commit 2ad39fae6a
3 changed files with 39 additions and 16 deletions

10
TODO
View File

@ -50,11 +50,17 @@ Refaire les benchmarks
# Documentation de qpsh
# Documentation de /etc
# Extrapolation qui prend aussi en compe la variance
# Parler dans le papier de rPT2
# Toto
Environment variables dans qp_run (prefix,etc)
Si un provider est un programme, generer une page a lui tout seul avec le man
Options obligatoires dans Command_line.ml
Documentation des commandes a updater
# Completion foireuse:
qp create_ezfio_from_xyz -b 6-31g ./<Tab>
qp create_ezfio_from_xyz -b <Tab>
# Verifier la doc des commandes avec les options - et --

View File

@ -14,17 +14,27 @@ Usage
.. code:: bash
qp_run [-slave] [-help] <PROGRAM> <EZFIO_DIRECTORY>
qp_run [-h|--help] [-p <string>|--prefix=<string>] [-s|--slave] [--]
PROGRAM EZFIO_DIR
``PROGRAM`` is the name of the |QP| program to be run, and ``EZFIO_DIR`` is
the name of the |EZFIO| directory containing the data.
.. option:: -help
.. option:: -h, --help
Displays the list of available |qp| programs.
.. option:: -slave
.. option:: -p <string>, --prefix=<string>
This option needs to be set when ``PROGRAM`` is a slave program, to accelerate
Prefix before running the program. This option is used to run programs like
like gdb or valgrind.
.. option:: -s, --slave
This option needs to be set to run a slave job for ``PROGRAM``, to accelerate
another running instance of the |qp|.
@ -33,6 +43,8 @@ Example
.. code:: bash
qp_run FCI h2o.ezfio
qp_run fci h2o.ezfio &
srun qp_run --slave fci h2o.ezfio
wait

View File

@ -2,7 +2,6 @@ open Qputils
(* Environment variables :
QP_PREFIX=gdb : to run gdb (or valgrind, or whatever)
QP_TASK_DEBUG=1 : debug task server
*)
@ -14,7 +13,7 @@ let print_list () =
let () =
Random.self_init ()
let run slave exe ezfio_file =
let run slave ?prefix exe ezfio_file =
(** Check availability of the ports *)
let port_number =
@ -113,8 +112,9 @@ let run slave exe ezfio_file =
(** Run executable *)
let prefix =
try (Sys.getenv "QP_PREFIX")^" " with
| Not_found -> ""
match prefix with
| Some x -> x^" "
| None -> ""
and exe =
match (List.find (fun (x,_) -> x = exe) executables) with
| (_,exe) -> exe^" "
@ -147,11 +147,12 @@ let () =
|> String.concat "\n"
) |> Command_line.set_header_doc;
[ (
's', "slave", "Required to run slave tasks in distributed environments",
[ ( 's', "slave", "Required to run slave tasks in distributed environments",
Command_line.Without_arg);
Command_line.anonymous "<EXECUTABLE>" "Name of the QP program to be run";
Command_line.anonymous "<EZFIO_FILE>" "EZFIO directory";
( 'p', "prefix", "<string> Prefix before running the program, like gdb or valgrind",
Command_line.With_arg );
Command_line.anonymous "PROGRAM" "Name of the QP program to be run";
Command_line.anonymous "EZFIO_DIR" "EZFIO directory";
]
|> Command_line.set_specs ;
@ -166,9 +167,13 @@ let () =
| _ -> true
in
let prefix =
Command_line.get "prefix"
in
(* Run the program *)
match Command_line.anon_args () with
| exe :: ezfio_file :: [] -> run slave exe ezfio_file
| exe :: ezfio_file :: [] -> run slave ?prefix exe ezfio_file
| _ -> (Command_line.help () ; failwith "Inconsistent command line")