2018-10-16 00:27:58 +02:00
|
|
|
|
|
|
|
let () =
|
2018-10-16 19:09:00 +02:00
|
|
|
Printf.printf "Hello from rank %d of %d.\n" Parallel.rank Parallel.size;
|
|
|
|
let () = Parallel.barrier () in
|
2018-10-17 00:56:14 +02:00
|
|
|
(*
|
|
|
|
let v = Parallel.Vec.init 47 (fun i -> float_of_int i) in
|
|
|
|
*)
|
2018-10-17 11:44:28 +02:00
|
|
|
let a = Array.init 41 (fun i -> float_of_int (i+1)) |> Lacaml.D.Vec.of_array in
|
|
|
|
let b = Array.init 41 (fun i -> float_of_int (3*i+1)) |> Lacaml.D.Vec.of_array in
|
|
|
|
let v1 = Parallel.Vec.of_vec a in
|
|
|
|
let v2 = Parallel.Vec.of_vec b in
|
|
|
|
let d1 = Parallel.dot v1 v2 in
|
|
|
|
let d2 = Lacaml.D.dot a b in
|
|
|
|
(*
|
2018-10-17 10:38:07 +02:00
|
|
|
let w = Parallel.Vec.to_vec v in
|
2018-10-17 11:44:28 +02:00
|
|
|
Format.printf "%a" Parallel.Vec.pp v;
|
2018-10-17 10:38:07 +02:00
|
|
|
if Parallel.master then
|
|
|
|
Format.printf "@[%a@]@;" (Lacaml.Io.pp_lfvec ()) w;
|
2018-10-17 11:44:28 +02:00
|
|
|
*)
|
|
|
|
Printf.printf "%f %f\n" d1 d2;
|
2018-10-17 10:38:07 +02:00
|
|
|
print_newline ();
|
2018-10-16 00:27:58 +02:00
|
|
|
|