rdicosmo / parmap

Parmap is a minimalistic library allowing to exploit multicore architecture for OCaml programs with minimal modifications.

Home Page:http://rdicosmo.github.io/parmap/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: gross error in Parmap.array_parmapi

UnixJunkie opened this issue · comments

 #require "parmap";;
Parmap.array_parmapi ~ncores:2 ~chunksize:1 (fun i x -> (i, x)) [|0;1;2;3;4;5;6;7;8;9|];;
- : (int * int) array =
[|(0, 8); (0, 6); (0, 4); (0, 3); (0, 1); (0, 0); (0, 9); (0, 7); (0, 5);
  (0, 2)|]

i should not stay constant and equal to 0

The output should look more like this:

Parmap.parmapi ~ncores:2 ~chunksize:1 (fun i x -> (i, x)) (Parmap.L [0;1;2;3;4;5;6;7;8;9]);;
- : (int * int) list =
[(8, 8); (6, 6); (4, 4); (2, 2); (0, 0); (9, 9); (7, 7); (5, 5); (3, 3);
 (1, 1)]

I'm using parmap 1.0-rc9 from opam

the problem is caused by the ~chunksize of 1

please tell me when there is a new tag, we need to update the opam package with this bugfix

opam PR:
ocaml/opam-repository#12337
Thanks for your quick action Roberto.