Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ocaml-parmap for openSUSE:Factory 
checked in at 2021-04-29 01:37:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ocaml-parmap (Old)
 and      /work/SRC/openSUSE:Factory/.ocaml-parmap.new.12324 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ocaml-parmap"

Thu Apr 29 01:37:39 2021 rev:9 rq:888344 version:20210423.2800b78

Changes:
--------
--- /work/SRC/openSUSE:Factory/ocaml-parmap/ocaml-parmap.changes        
2020-03-09 14:13:35.406514745 +0100
+++ /work/SRC/openSUSE:Factory/.ocaml-parmap.new.12324/ocaml-parmap.changes     
2021-04-29 01:38:29.086585614 +0200
@@ -1,0 +2,7 @@
+Sun Apr 25 22:22:22 UTC 2021 - [email protected]
+
+- Update to version 20210423.2800b78
+  avoid corruption on 32bit architectures
+  add support for returning results in the right order
+
+-------------------------------------------------------------------

Old:
----
  ocaml-parmap-20200124.526acc4.tar.xz

New:
----
  ocaml-parmap-20210423.2800b78.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ocaml-parmap.spec ++++++
--- /var/tmp/diff_new_pack.I3poOT/_old  2021-04-29 01:38:29.498586198 +0200
+++ /var/tmp/diff_new_pack.I3poOT/_new  2021-04-29 01:38:29.502586203 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ocaml-parmap
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,17 +17,17 @@
 
 
 Name:           ocaml-parmap
-Version:        20200124.526acc4
+Version:        20210423.2800b78
 Release:        0
 %{?ocaml_preserve_bytecode}
 Summary:        Multicore architecture exploitation for OCaml programs with 
minimal modifications
 License:        LGPL-2.0-only
 Group:          Development/Languages/OCaml
-URL:            http://rdicosmo.github.io/parmap/
-Source:         %{name}-%{version}.tar.xz
+URL:            https://opam.ocaml.org/packages/parmap
+Source0:        %{name}-%{version}.tar.xz
 BuildRequires:  ocaml
 BuildRequires:  ocaml-dune
-BuildRequires:  ocaml-rpm-macros >= 20200220
+BuildRequires:  ocaml-rpm-macros >= 20210409
 BuildRequires:  ocamlfind(bigarray)
 BuildRequires:  ocamlfind(dune.configurator)
 BuildRequires:  ocamlfind(graphics)
@@ -57,6 +57,10 @@
 %autosetup -p1
 
 %build
+sed -i~ '
+s@10000000@1000000@
+' tests/simplescale.ml
+diff -u "$_"~ "$_" && exit 1
 dune_release_pkgs='parmap'
 %ocaml_dune_setup
 %ocaml_dune_build
@@ -66,11 +70,7 @@
 %ocaml_create_file_list
 
 %check
-test -x "$(type -P ocamlc.opt)" || exit 0
 OCAML_DUNE_RUNTEST_ARGS="-j 1"
-%if "%{_lib}" == "lib"
-dune_test_tolerate_fail='dune_test_tolerate_fail Array.make'
-%endif
 export nData=$((1000 * 10))
 export nProcs=2
 %ocaml_dune_test

++++++ _service ++++++
--- /var/tmp/diff_new_pack.I3poOT/_old  2021-04-29 01:38:29.546586266 +0200
+++ /var/tmp/diff_new_pack.I3poOT/_new  2021-04-29 01:38:29.550586272 +0200
@@ -1,8 +1,9 @@
 <services>
   <service name="tar_scm" mode="disabled">
     <param name="filename">ocaml-parmap</param>
-    <param name="revision">526acc4d2dd0f8949dfd53fa1ff015307c970899</param>
+    <param name="revision">2800b78e9e10ffffafc3cbb0ffaed646ab71cc6a</param>
     <param name="scm">git</param>
+    <param name="submodules">disable</param>
     <param name="url">https://github.com/rdicosmo/parmap.git</param>
     <param name="versionformat">%cd.%h</param>
   </service>

++++++ ocaml-parmap-20200124.526acc4.tar.xz -> 
ocaml-parmap-20210423.2800b78.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-parmap-20200124.526acc4/CHANGES 
new/ocaml-parmap-20210423.2800b78/CHANGES
--- old/ocaml-parmap-20200124.526acc4/CHANGES   2020-01-24 15:22:21.000000000 
+0100
+++ new/ocaml-parmap-20210423.2800b78/CHANGES   2021-04-23 12:12:28.000000000 
+0200
@@ -1,3 +1,10 @@
+2021/01/09 (RDC)
+        Major enhancement: add support for returning results in the right 
order from
+        the calls to parmap/parmapi/array_parmap/array_parmapi even when the
+       chunksize parameter is used. This can be accomplished using the 
keeporder
+       parameter.
+       Documentation, tests and functions parameters updated accordingly.
+
 2020/01/23 (RDC)
        Integrated major rewriting of the build system, moving to dune;
        dropped compatibility with pre-4.02 OCaml versions.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-parmap-20200124.526acc4/README.md 
new/ocaml-parmap-20210423.2800b78/README.md
--- old/ocaml-parmap-20200124.526acc4/README.md 2020-01-24 15:22:21.000000000 
+0100
+++ new/ocaml-parmap-20210423.2800b78/README.md 2021-04-23 12:12:28.000000000 
+0200
@@ -65,16 +65,28 @@
 If the number of chunks is equal to the number of cores, it is easy to preserve
 the order of the elements of the sequence passed to the map/fold operations, so
 the result will be a list with the same order as if the sequential function 
would
-be applied to the input. This is what the `parmap`, `parmafold` and `parfold` 
functions
+be applied to the input. This is what the `parmap`, `parmapfold` and `parfold` 
functions
 do when the chunksize argument is not used.
 
 If the user specifies a chunksize that is different from the number of cores,
-there is no general way to preserve the ordering, so the result of calling
-`Parmap.parmap f l` are not necessarily in the same order as `List.map f l`.
-
-In general, using little chunksize helps in balancing the load among the 
workers,
-and provides better speed, at the price of losing the ordering: there is a
-tradeoff, and it is up to the user to choose the solution that better suits 
him/her.
+the current implementation for `parmap`, `parmapi`, `array_parmap` and
+`array_parmapi` by default does not guarantee the preservation of the order
+of the results. If the `keeporder` parameter is set to true, an alternative
+implementation is used, that tags the chunks and reorders them at the end, so 
the result of
+calling `Parmap.parmap f l` is the same as `List.map f l`. Depending on the
+nature of your workload (in particular, number of chunks and size of the 
results),
+this may be way more efficient than implementing a sorting mechanism yourself, 
but
+may also end up using up to twice the space and time of the default 
implementation:
+there is a tradeoff, and it is up to the user to choose the solution that 
better suits him/her.
+
+No reordering logic is implemented for `parmapfold`, `parfold` and their
+variants, as performing these operations in parallel only make sense if the
+order is irrelevant.
+
+In general, using little chunksize helps in balancing the load among the
+workers, and provides better speed, but incurs a little overhead for tagging 
and
+reordering the chunks: there is a tradeoff, and it is up to the user to choose
+the solution that better suits him/her.
 
 ## Fast map on arrays and on float arrays
 
@@ -103,7 +115,7 @@
         - : float = 0.0501301288604736328
     ```
 
- 2. create a shared memory area ,
+ 2. create a shared memory area,
 
  3. possibly copy the result array to the shared memory area,
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-parmap-20200124.526acc4/config/discover.ml 
new/ocaml-parmap-20210423.2800b78/config/discover.ml
--- old/ocaml-parmap-20200124.526acc4/config/discover.ml        2020-01-24 
15:22:21.000000000 +0100
+++ new/ocaml-parmap-20210423.2800b78/config/discover.ml        2021-04-23 
12:12:28.000000000 +0200
@@ -27,7 +27,6 @@
     let ml_file = "parmap_compat.ml" in
     let pre_406 = [ "let map_file = Bigarray.Genarray.map_file" ] in
     let ml_code = match C.ocaml_config_var_exn c "version" with
-      | "4.02.3" -> pre_406
       | "4.03.0" -> pre_406
       | "4.04.0" -> pre_406
       | "4.04.1" -> pre_406
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-parmap-20200124.526acc4/dune-project 
new/ocaml-parmap-20210423.2800b78/dune-project
--- old/ocaml-parmap-20200124.526acc4/dune-project      2020-01-24 
15:22:21.000000000 +0100
+++ new/ocaml-parmap-20210423.2800b78/dune-project      2021-04-23 
12:12:28.000000000 +0200
@@ -27,4 +27,4 @@
   base-bigarray
   base-unix
   (ocaml
-   (>= 4.02.3))))
+   (>= 4.03.0))))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-parmap-20200124.526acc4/parmap.opam 
new/ocaml-parmap-20210423.2800b78/parmap.opam
--- old/ocaml-parmap-20200124.526acc4/parmap.opam       2020-01-24 
15:22:21.000000000 +0100
+++ new/ocaml-parmap-20210423.2800b78/parmap.opam       2021-04-23 
12:12:28.000000000 +0200
@@ -26,5 +26,5 @@
   "dune-configurator"
   "base-bigarray"
   "base-unix"
-  "ocaml" {>= "4.02.3"}
+  "ocaml" {>= "4.03.0"}
 ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-parmap-20200124.526acc4/src/bytearray.ml 
new/ocaml-parmap-20210423.2800b78/src/bytearray.ml
--- old/ocaml-parmap-20200124.526acc4/src/bytearray.ml  2020-01-24 
15:22:21.000000000 +0100
+++ new/ocaml-parmap-20210423.2800b78/src/bytearray.ml  2021-04-23 
12:12:28.000000000 +0200
@@ -113,7 +113,7 @@
   = "ml_blit_bigarray_to_floatarray" [@@noalloc]
 
 let to_floatarray a l =
-  let fa = Obj.obj (Obj.new_block Obj.double_array_tag l) in
+  let fa = Array.create_float l in
   unsafe_blit_to_floatarray a 0 fa 0 l;
   fa
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-parmap-20200124.526acc4/src/bytearray_stubs.c 
new/ocaml-parmap-20210423.2800b78/src/bytearray_stubs.c
--- old/ocaml-parmap-20200124.526acc4/src/bytearray_stubs.c     2020-01-24 
15:22:21.000000000 +0100
+++ new/ocaml-parmap-20210423.2800b78/src/bytearray_stubs.c     2021-04-23 
12:12:28.000000000 +0200
@@ -37,7 +37,7 @@
 CAMLprim value ml_blit_string_to_bigarray
 (value s, value i, value a, value j, value l)
 {
-  char *src = String_val(s) + Int_val(i);
+  const char *src = String_val(s) + Int_val(i);
   char *dest = Array_data(Bigarray_val(a), j);
   memcpy(dest, src, Long_val(l));
   return Val_unit;
@@ -47,7 +47,7 @@
 (value a, value i, value s, value j, value l)
 {
   char *src = Array_data(Bigarray_val(a), i);
-  char *dest = String_val(s) + Long_val(j);
+  char *dest = &Byte(String_val(s), Long_val(j));
   memcpy(dest, src, Long_val(l));
   return Val_unit;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-parmap-20200124.526acc4/src/parmap.ml 
new/ocaml-parmap-20210423.2800b78/src/parmap.ml
--- old/ocaml-parmap-20200124.526acc4/src/parmap.ml     2020-01-24 
15:22:21.000000000 +0100
+++ new/ocaml-parmap-20210423.2800b78/src/parmap.ml     2021-04-23 
12:12:28.000000000 +0200
@@ -524,34 +524,6 @@
     (concat:'c->'c->'c) : 'c=
   parmapifold ~init ~finalize ?ncores ?chunksize (fun _ x -> f x) s op opid 
concat
 
-(* the parallel map function *)
-
-let parmapi
-    ?(init = fun _ -> ())
-    ?(finalize = fun () -> ())
-    ?(ncores= !default_ncores)
-    ?chunksize
-    (f:int ->'a -> 'b)
-    (s:'a sequence) : 'b list=
-  (* enforce array to speed up access to the list elements *)
-  let al = match s with A al -> al | L l  -> Array.of_list l in
-  let compute al lo hi previous exc_handler =
-    (* iterate in reverse order, to accumulate in the right order,
-       and add to acc *)
-    let f' j =
-      try let idx = lo+j in f idx (Array.unsafe_get al idx)
-      with e -> exc_handler e j in
-    let rec aux acc =
-      function
-         0 ->  (f' 0)::acc
-       | n ->  aux ((f' n)::acc) (n-1)
-    in aux previous (hi-lo)
-  in
-  mapper init finalize ncores ~chunksize compute [] al  (fun r -> 
Utils.concat_tr r)
-
-let parmap ?init ?finalize ?ncores ?chunksize (f:'a -> 'b) (s:'a sequence) : 
'b list=
-    parmapi ?init ?finalize ?ncores ?chunksize (fun _ x -> f x) s
-
 (* the parallel fold function *)
 
 let parfold
@@ -565,7 +537,7 @@
     (concat:'b->'b->'b) : 'b=
     parmapfold ~init ~finalize ~ncores ?chunksize (fun x -> x) s op opid concat
 
-(* the parallel map function, on arrays *)
+(* the parallel map function *)
 
 let mapi_range lo hi (f:int -> 'a -> 'b) a =
   let l = hi-lo in
@@ -578,23 +550,95 @@
     r
   end
 
+
+(* the parallel map function, on arrays *)
+
 let array_parmapi
     ?(init = fun _ -> ())
     ?(finalize = fun () -> ())
     ?(ncores= !default_ncores)
     ?chunksize
+    ?(keeporder=false)
     (f:int -> 'a -> 'b)
     (al:'a array) : 'b array=
-  let compute a lo hi previous exc_handler =
+  (* compute, collect and opid definitions for reordering after load balancing 
*)
+  let compute_sorted a lo hi previous exc_handler =
+    try
+      (lo,mapi_range lo hi f a)::previous
+    with e -> exc_handler e lo
+  and collect_sorted (r:(int * 'b array) list list) =
+    let fragments = List.flatten r in
+    let ordered=List.map snd (List.stable_sort (fun (n,_) (m,_) -> n-m) 
fragments) in
+    Array.concat ordered
+  and opid_sorted = [(0,[||])]
+  (* compute, collect and opid definitions without reordering *)
+  and compute a lo hi previous exc_handler =
     try
       Array.concat [(mapi_range lo hi f a);previous]
     with e -> exc_handler e lo
-  in
-  mapper init finalize ncores ~chunksize compute [||] al  (fun r -> 
Array.concat r)
+  and collect r = Array.concat r
+  and opid = [||] in
+  let ln = Array.length al in
+  match keeporder, chunksize with
+  | _ , None ->
+      (* no need of load balancing *)
+      mapper init finalize ncores ~chunksize compute opid al collect
+  | _ , Some v when ncores >= ln/v ->
+      (* no need of load balancing if more cores than tasks *)
+      mapper init finalize ncores ~chunksize compute opid al collect
+  | false , Some _ ->
+      (* load balancing without reordering *)
+      mapper init finalize ncores ~chunksize compute opid al collect
+  | true , Some _ ->
+      (* load balancing with reordering *)
+      mapper init finalize ncores ~chunksize compute_sorted opid_sorted al 
collect_sorted
+
+let array_parmap ?init ?finalize ?ncores ?chunksize ?keeporder (f:'a -> 'b) 
(al:'a array) : 'b array=
+  array_parmapi ?init ?finalize ?ncores ?chunksize ?keeporder (fun _ x -> f x) 
al
+
+let parmapi
+    ?(init = fun _ -> ())
+    ?(finalize = fun () -> ())
+    ?(ncores= !default_ncores)
+    ?chunksize
+    ?(keeporder=false)
+    (f:int ->'a -> 'b)
+    (s:'a sequence) : 'b list=
+  (* enforce array to speed up access to the list elements *)
+  let al = match s with A al -> al | L l  -> Array.of_list l in
+  (* compute, collect and opid definitions without reordering *)
+  let compute al lo hi previous exc_handler =
+    (* iterate in reverse order, to accumulate in the right order,
+       and add to acc *)
+    let f' j =
+      try let idx = lo+j in f idx (Array.unsafe_get al idx)
+      with e -> exc_handler e j in
+    let rec aux acc =
+      function
+         0 ->  (f' 0)::acc
+       | n ->  aux ((f' n)::acc) (n-1)
+    in aux previous (hi-lo)
+  and collect r = Utils.concat_tr r
+  and opid = [] in
+  let ln = Array.length al in
+  match keeporder, chunksize with
+    _ , None ->
+      (* no need of load balancing *)
+      mapper init finalize ncores ~chunksize compute opid al collect
+  | _ , Some v when ncores >= ln/v ->
+      (* no need of load balancing if more cores than tasks *)
+      mapper init finalize ncores ~chunksize compute opid al collect
+  | false , Some _ ->
+      (* load balancing without reordering *)
+      mapper init finalize ncores ~chunksize compute opid al collect
+  | true , Some _ ->
+      (* load balancing with reordering *)
+      Array.to_list (array_parmapi ~init ~finalize ~ncores ?chunksize 
~keeporder f al)
 
-let array_parmap ?init ?finalize ?ncores ?chunksize (f:'a -> 'b) (al:'a array) 
: 'b array=
-  array_parmapi ?init ?finalize ?ncores ?chunksize (fun _ x -> f x) al
+let parmap ?init ?finalize ?ncores ?chunksize ?keeporder (f:'a -> 'b) (s:'a 
sequence) : 'b list=
+    parmapi ?init ?finalize ?ncores ?chunksize ?keeporder (fun _ x -> f x) s
 
+    
 (* This code is highly optimised for operations on float arrays:
 
    - knowing in advance the size of the result allows to
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-parmap-20200124.526acc4/src/parmap.mli 
new/ocaml-parmap-20210423.2800b78/src/parmap.mli
--- old/ocaml-parmap-20200124.526acc4/src/parmap.mli    2020-01-24 
15:22:21.000000000 +0100
+++ new/ocaml-parmap-20210423.2800b78/src/parmap.mli    2021-04-23 
12:12:28.000000000 +0200
@@ -105,13 +105,13 @@
       function is only correct if [op] and [concat] are associative and 
commutative.
       If the optional [chunksize] parameter is specified,
       the processes compute the result in an on-demand fashion
-      on blocks of size [chunksize].
+      on blocks of size [chunksize]. 
       [parfold ~ncores:n op (A a) b concat] similarly computes 
[Array.fold_right op a b].
       *)
 
 (** {3 Parallel map} *)
 
-val parmap : ?init:(int -> unit) -> ?finalize:(unit -> unit) -> ?ncores:int -> 
?chunksize:int -> ('a -> 'b) -> 'a sequence -> 'b list
+val parmap : ?init:(int -> unit) -> ?finalize:(unit -> unit) -> ?ncores:int -> 
?chunksize:int -> ?keeporder:bool-> ('a -> 'b) -> 'a sequence -> 'b list
   (** [parmap  ~ncores:n f (L l) ] computes [List.map f l]
       by forking [n] processes on a multicore machine.
       [parmap  ~ncores:n f (A a) ] computes [Array.map f a]
@@ -119,8 +119,8 @@
       If the optional [chunksize] parameter is specified,
       the processes compute the result in an on-demand fashion
       on blocks of size [chunksize]; this provides automatic
-      load balancing for unbalanced computations, but the order
-      of the result is no longer guaranteed to be preserved. *)
+      load balancing for unbalanced computations, preserving
+      the order of the results if [keeporder] is set to true. *)
 
 (** {3 Parallel iteration} *)
 
@@ -142,7 +142,7 @@
 
 (** {3 Parallel map, indexed} *)
 
-val parmapi : ?init:(int -> unit) -> ?finalize:(unit -> unit) -> ?ncores:int 
-> ?chunksize:int -> (int -> 'a -> 'b) -> 'a sequence -> 'b list
+val parmapi : ?init:(int -> unit) -> ?finalize:(unit -> unit) -> ?ncores:int 
-> ?chunksize:int -> ?keeporder:bool -> (int -> 'a -> 'b) -> 'a sequence -> 'b 
list
   (** Like parmap, but the map function gets as an extra argument
       the index of the mapped element *)
 
@@ -154,18 +154,18 @@
 
 (** {3 Parallel map on arrays} *)
 
-val array_parmap : ?init:(int -> unit) -> ?finalize:(unit -> unit) -> 
?ncores:int -> ?chunksize:int -> ('a -> 'b) -> 'a array -> 'b array
+val array_parmap : ?init:(int -> unit) -> ?finalize:(unit -> unit) -> 
?ncores:int -> ?chunksize:int -> ?keeporder:bool -> ('a -> 'b) -> 'a array -> 
'b array
   (** [array_parmap  ~ncores:n f a ] computes [Array.map f a]
       by forking [n] processes on a multicore machine.
       If the optional [chunksize] parameter is specified,
       the processes compute the result in an on-demand fashion
       on blochs of size [chunksize]; this provides automatic
-      load balancing for unbalanced computations, but the order
-      of the result is no longer guaranteed to be preserved. *)
+      load balancing for unbalanced computations, preserving
+      the order of the results if [keeporder] is set to true. *)
 
 (** {3 Parallel map on arrays, indexed} *)
 
-val array_parmapi : ?init:(int -> unit) -> ?finalize:(unit -> unit) -> 
?ncores:int -> ?chunksize:int -> (int -> 'a -> 'b) -> 'a array -> 'b array
+val array_parmapi : ?init:(int -> unit) -> ?finalize:(unit -> unit) -> 
?ncores:int -> ?chunksize:int -> ?keeporder:bool -> (int -> 'a -> 'b) -> 'a 
array -> 'b array
   (** Like array_parmap, but the map function gets as an extra argument
       the index of the mapped element *)
 
@@ -189,7 +189,7 @@
       optional [chunksize] parameter is specified, the processes compute the
       result in an on-demand fashion on blochs of size [chunksize]; this
       provides automatic load balancing for unbalanced computations, *and* the
-      order of the result is still guaranteed to be preserved.
+      order of the result is guaranteed to be preserved.
 
       In case you already have at hand an array where to store the result, you
       can squeeze out some more cpu cycles by passing it as optional parameter
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-parmap-20200124.526acc4/src/setcore_stubs.c 
new/ocaml-parmap-20210423.2800b78/src/setcore_stubs.c
--- old/ocaml-parmap-20200124.526acc4/src/setcore_stubs.c       2020-01-24 
15:22:21.000000000 +0100
+++ new/ocaml-parmap-20210423.2800b78/src/setcore_stubs.c       2021-04-23 
12:12:28.000000000 +0200
@@ -29,6 +29,8 @@
 #endif
   int retcode;
   int finished=0;
+  if (numcores <= 1) // only one core in the system, no need to attempt pinning
+    return Val_unit;
   while (finished==0)
     {
 #if HAVE_DECL_SCHED_SETAFFINITY
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-parmap-20200124.526acc4/tests/simplescale.ml 
new/ocaml-parmap-20210423.2800b78/tests/simplescale.ml
--- old/ocaml-parmap-20200124.526acc4/tests/simplescale.ml      2020-01-24 
15:22:21.000000000 +0100
+++ new/ocaml-parmap-20210423.2800b78/tests/simplescale.ml      2021-04-23 
12:12:28.000000000 +0200
@@ -72,26 +72,38 @@
 
 scale_test compute (L (initsegm 20000)) 2 1 10;;
 
-Printf.printf "*** Computations on integer lists (chunksize=100)\n%!";
+Printf.printf "*** Computations on integer lists (chunksize=100, 
keeporder=false)\n%!";
 
 scale_test ~chunksize:100 ~inorder:false compute (L (initsegm 20000)) 2 1 10;;
 
+Printf.printf "*** Computations on integer lists (chunksize=100, 
keeporder=true)\n%!";
+
+scale_test ~chunksize:100 ~keeporder:true compute (L (initsegm 20000)) 2 1 10;;
+
 Printf.printf "*** Computations on integer arrays\n%!";
 
 scale_test compute (A (Array.init 20000 (fun n -> n+1))) 2 1 10;;
 
-Printf.printf "*** Computations on integer arrays (chunksize-100)\n%!";
+Printf.printf "*** Computations on integer arrays (chunksize=100, 
keeporder=false)\n%!";
 
 scale_test ~chunksize:100 ~inorder:false compute (A (Array.init 20000 (fun n 
-> n+1))) 2 1 10;;
 
+Printf.printf "*** Computations on integer arrays (chunksize=100, 
keeporder=true)\n%!";
+
+scale_test ~chunksize:100 ~keeporder:true compute (A (Array.init 20000 (fun n 
-> n+1))) 2 1 10;;
+
 Printf.printf "*** Computations on lists of floats\n%!";
 
 scale_test fcompute (L (List.map float_of_int (initsegm 20000))) 2 1 10;;
 
-Printf.printf "*** Computations on lists of floats (chunksize=100)\n%!";
+Printf.printf "*** Computations on lists of floats (chunksize=100, 
keeporder=false)\n%!";
 
 scale_test  ~chunksize:100 ~inorder:false fcompute (L (List.map float_of_int 
(initsegm 20000))) 2 1 10;;
 
+Printf.printf "*** Computations on lists of floats (chunksize=100, 
keeporder=true)\n%!";
+
+scale_test  ~chunksize:100 ~keeporder:true fcompute (L (List.map float_of_int 
(initsegm 20000))) 2 1 10;;
+
 Printf.printf "*** Computations on arrays of floats\n%!";
 
 scale_test fcompute (A (Array.init 20000 (fun n -> float_of_int (n+1)))) 2 1 
10;;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/ocaml-parmap-20200124.526acc4/tests/simplescale_array.ml 
new/ocaml-parmap-20210423.2800b78/tests/simplescale_array.ml
--- old/ocaml-parmap-20200124.526acc4/tests/simplescale_array.ml        
2020-01-24 15:22:21.000000000 +0100
+++ new/ocaml-parmap-20210423.2800b78/tests/simplescale_array.ml        
2021-04-23 12:12:28.000000000 +0200
@@ -30,10 +30,12 @@
 ;;
 
 array_scale_test fcompute (Array.init 20000 (fun i -> float_of_int i)) 2 1 10;;
+array_scale_test ~chunksize:100 ~inorder:false fcompute (Array.init 20000 (fun 
i -> float_of_int i)) 2 1 10;;
+array_scale_test ~chunksize:100 ~keeporder:true fcompute (Array.init 20000 
(fun i -> float_of_int i)) 2 1 10;;
 
 array_float_scale_test fcompute (Array.init 20000 (fun i -> float_of_int i)) 2 
1 10;;
 
 scale_test ~chunksize:100 ~inorder:false compute (A (Array.init 20000 (fun i 
-> i))) 2 1 10;;
+scale_test ~chunksize:100 ~keeporder:true compute (A (Array.init 20000 (fun i 
-> i))) 2 1 10;;
 
 scale_test compute (A (Array.init 20000 (fun i -> i))) 2 1 10;;
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-parmap-20200124.526acc4/tests/utils.ml 
new/ocaml-parmap-20210423.2800b78/tests/utils.ml
--- old/ocaml-parmap-20200124.526acc4/tests/utils.ml    2020-01-24 
15:22:21.000000000 +0100
+++ new/ocaml-parmap-20210423.2800b78/tests/utils.ml    2021-04-23 
12:12:28.000000000 +0200
@@ -12,7 +12,7 @@
 
 open Parmap
 
-let scale_test ?(init=(fun _ -> ())) ?(inorder=true) ?(step=1) ?chunksize 
compute sequence iter nprocmin nprocmax =
+let scale_test ?(init=(fun _ -> ())) ?(inorder=true) ?(step=1) ?chunksize 
?(keeporder=false) compute sequence iter nprocmin nprocmax =
   Printf.eprintf "Testing scalability with %d iterations on %d to %d cores, 
step %d\n%!" iter nprocmin nprocmax step;
   let rseq,tseq =  
     let d=Unix.gettimeofday() in
@@ -26,14 +26,14 @@
     let tot=ref 0.0 in
     for j=1 to iter do
       let d=Unix.gettimeofday() in
-      let rpar=parmap ~init ~ncores:i ?chunksize compute sequence in
+      let rpar=parmap ~init ~ncores:i ?chunksize ~keeporder compute sequence in
       tot:=!tot+.(Unix.gettimeofday()-.d);
       if rseq<>rpar then 
        begin
          if (List.sort compare rseq) <> (List.sort compare rpar) then 
            Printf.eprintf "Parmap failure: result mismatch!\n%!"
          else
-           if inorder then Printf.eprintf "Parmap failure: result order was 
expected to be preserved, and is not.\n%!"
+           if inorder || keeporder then Printf.eprintf "Parmap failure: result 
order was expected to be preserved, and is not.\n%!"
            else Printf.eprintf "Parmap warning: result order is not preserved 
(it was not expected to be).\n%!"
        end
     done;
@@ -43,7 +43,7 @@
   rseq
 ;;
 
-let array_scale_test ?(init= (fun _ -> ())) ?(inorder=true) ?(step=1) 
?chunksize compute a iter nprocmin nprocmax =
+let array_scale_test ?(init= (fun _ -> ())) ?(inorder=true) ?(step=1) 
?chunksize ?(keeporder=false) compute a iter nprocmin nprocmax =
   Printf.eprintf "Testing scalability with %d iterations on %d to %d cores, 
step %d\n" iter nprocmin nprocmax step;
   let rseq,tseq =  
     let d=Unix.gettimeofday() in
@@ -56,14 +56,14 @@
     let tot=ref 0.0 in
     for j=1 to iter do
       let d=Unix.gettimeofday() in
-      let rpar=array_parmap ~init ~ncores:i compute a in
+      let rpar=array_parmap ~init ~ncores:i ?chunksize ~keeporder compute a in
       tot:=!tot+.(Unix.gettimeofday()-.d);
       if rseq<>rpar then 
        begin
          if (Array.sort compare rseq) <> (Array.sort compare rpar) then 
            Printf.eprintf "Parmap failure: result mismatch!\n"
          else
-           if inorder then Printf.eprintf "Parmap failure: result order was 
expected to be preserved, and is not.\n"
+           if inorder || keeporder then Printf.eprintf "Parmap failure: result 
order was expected to be preserved, and is not.\n"
            else Printf.eprintf "Parmap warning: result order is not preserved 
(it was not expected to be).\n"
        end
     done;

Reply via email to