Skip to content

Commit e65473a

Browse files
author
Akanksha Mathur
committed
Add Gpumon CLI tool for debugging
Signed-off-by: Akanksha Mathur <[email protected]>
1 parent 1d98b2c commit e65473a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

gpumon/gpumon_cli.ml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
(* Gpumon CLI *)
3+
4+
module Cmds = Gpumon_interface.RPC_API(Cmdlinergen.Gen ())
5+
6+
let version_str description =
7+
let maj,min,mic = description.Idl.Interface.version in
8+
Printf.sprintf "%d.%d.%d" maj min mic
9+
10+
let default_cmd =
11+
let doc = String.concat "" [
12+
"A CLI for the GPU monitoring API. This allows scripting of the gpumon daemon ";
13+
"for testing and debugging. This tool is not intended to be used as an ";
14+
"end user tool"] in
15+
Cmdliner.Term.(ret (const (fun _ -> `Help (`Pager, None)) $ const ())),
16+
Cmdliner.Term.info "gpumon_cli" ~version:(version_str Cmds.description) ~doc
17+
18+
let cli () =
19+
let rpc = Gpumon_client.rpc in
20+
Cmdliner.Term.eval_choice default_cmd (List.map (fun t -> t rpc) (Cmds.implementation ()))
21+
22+
let _ = cli ()

0 commit comments

Comments
 (0)