From 2ffd82436d1208ae97220f82b5fc4dbcc56430ef Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 17 Oct 2018 10:15:02 +0200 Subject: [PATCH] Update configure --- Parallel/Parallel.ml | 15 ++++++--------- configure | 2 ++ run_parallel.ml | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Parallel/Parallel.ml b/Parallel/Parallel.ml index 4c05437..f3d4f13 100644 --- a/Parallel/Parallel.ml +++ b/Parallel/Parallel.ml @@ -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 diff --git a/configure b/configure index 72c415b..dbdfbe5 100755 --- a/configure +++ b/configure @@ -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 diff --git a/run_parallel.ml b/run_parallel.ml index 70c427d..c475045 100644 --- a/run_parallel.ml +++ b/run_parallel.ml @@ -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;