File: mm_client.ml

package info (click to toggle)
ocamlnet 4.1.9-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 54,040 kB
  • sloc: ml: 151,939; ansic: 11,071; sh: 2,003; makefile: 1,310
file content (39 lines) | stat: -rw-r--r-- 991 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(* Test client. Starts one multiplication *)

open Printf

let main() =
  let host = ref "localhost" in
  let port = ref 2021 in
  let lrows = ref 1000 in
  let rcols = ref 1000 in
  let rrows = ref 1000 in
  Arg.parse
    [ "-host", Arg.Set_string host, 
      "<host>   Contact the multiplier at this host";

      "-port", Arg.Set_int port, 
      "<port>   Contact the multiplier at this port";

      "-size", Arg.Tuple [ Arg.Set_int lrows;
			   Arg.Set_int rcols;
			   Arg.Set_int rrows
			 ],
      "<P> <Q> <R>   Size of test: Multiply a PxR with a RxQ matrix"
    ]
    (fun arg -> raise(Arg.Bad("Bad argument: " ^ arg)))
    (sprintf "usage: %s <options>" Sys.argv.(0));

  let multiplier =
    Mm_proto_clnt.Multiplier.V1.create_client2
      (`Socket(Rpc.Tcp,
	       Rpc_client.Inet(!host,!port),
	       Rpc_client.default_socket_config)) in
  Mm_proto_clnt.Multiplier.V1.test_multiply 
    multiplier
    (!lrows, !rcols, !rrows)


let () =
  Netsys_signal.init();
  main()