Update configure

This commit is contained in:
Anthony Scemama 2018-10-17 10:15:02 +02:00
parent e6c597deeb
commit 2ffd82436d
3 changed files with 9 additions and 10 deletions

View File

@ -66,6 +66,7 @@ module Vec = struct
let make0 n =
make n 0.
let init n f =
let result = create n in
{ result with data =
@ -76,22 +77,18 @@ module Vec = struct
let of_array a =
let la = Array.length a in
let length_a = Array.length a in
let a =
let n = la mod size in
let n = length_a mod size in
if n > 0 then
Array.concat [ a ; Array.make (size-n) 0. ]
else
a
in
let result = create la in
let () = Mpi.barrier Mpi.comm_world in
Printf.printf "%d\n%!" rank;
let result = create length_a in
let a_local = Array.make ((Array.length a)/size) 0. in
Printf.printf "%d\n%!" (Array.length a_local);
let () = Mpi.scatter_float_array a a_local 0 Mpi.comm_world in
{ result with data =
Lacaml.D.Vec.of_array a_local
}
{ result with data = Lacaml.D.Vec.of_array a_local }
end

2
configure vendored
View File

@ -12,6 +12,7 @@ share='$(prefix)/share'
man='$(prefix)/man'
etc='$(prefix)/etc'
ocamlcflags='"-g -warn-error A"'
ocamllflags='"-g -warn-error A"'
ocamloptflags='"opt -O3 -nodynlink -remove-unused-arguments -rounds 16 -inline 100 -inline-max-unroll 100"'
ocamldocflags='-docflags "-g ltxhtml.cma -sort -css-style $(PWD)/style.css -colorize-code"'
@ -93,6 +94,7 @@ man=$man
etc=$etc
ocamlcflags=$ocamlcflags
ocamllflags=$ocamllflags
ocamloptflags=$ocamloptflags
ocamldocflags=$ocamldocflags

View File

@ -5,7 +5,7 @@ let () =
(*
let v = Parallel.Vec.init 47 (fun i -> float_of_int i) in
*)
let a = Array.init 6 (fun i -> float_of_int (i+1)) in
let a = Array.init 47 (fun i -> float_of_int (i+1)) in
let v = Parallel.Vec.of_array a in
Format.printf "%a" Parallel.Vec.pp v;