~ubuntu-branches/ubuntu/trusty/ocamlnet/trusty

« back to all changes in this revision

Viewing changes to examples/rpc/matrixmult/mm_client.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-09-02 14:12:33 UTC
  • mfrom: (18.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110902141233-zbj0ygxb92u6gy4z
Tags: 3.4-1
* New upstream release
  - add a new NetcgiRequire directive to ease dependency management
    (Closes: #637147)
  - remove patches that were applied upstream:
    + Added-missing-shebang-lines-in-example-shell-scripts
    + Try-also-ocamlc-for-POSIX-threads

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(* Test client. Starts one multiplication *)
 
2
 
 
3
open Printf
 
4
 
 
5
let main() =
 
6
  let host = ref "localhost" in
 
7
  let port = ref 2021 in
 
8
  let lrows = ref 1000 in
 
9
  let rcols = ref 1000 in
 
10
  let rrows = ref 1000 in
 
11
  Arg.parse
 
12
    [ "-host", Arg.Set_string host, 
 
13
      "<host>   Contact the multiplier at this host";
 
14
 
 
15
      "-port", Arg.Set_int port, 
 
16
      "<port>   Contact the multiplier at this port";
 
17
 
 
18
      "-size", Arg.Tuple [ Arg.Set_int lrows;
 
19
                           Arg.Set_int rcols;
 
20
                           Arg.Set_int rrows
 
21
                         ],
 
22
      "<P> <Q> <R>   Size of test: Multiply a PxR with a RxQ matrix"
 
23
    ]
 
24
    (fun arg -> raise(Arg.Bad("Bad argument: " ^ arg)))
 
25
    (sprintf "usage: %s <options>" Sys.argv.(0));
 
26
 
 
27
  let multiplier =
 
28
    Mm_proto_clnt.Multiplier.V1.create_client2
 
29
      (`Socket(Rpc.Tcp,
 
30
               Rpc_client.Inet(!host,!port),
 
31
               Rpc_client.default_socket_config)) in
 
32
  Mm_proto_clnt.Multiplier.V1.test_multiply 
 
33
    multiplier
 
34
    (!lrows, !rcols, !rrows)
 
35
 
 
36
 
 
37
let () =
 
38
  Netsys_signal.init();
 
39
  main()