rdicosmo / parmap

Parmap is a minimalistic library allowing to exploit multicore architecture for OCaml programs with minimal modifications.
http://rdicosmo.github.io/parmap/
Other
94 stars 20 forks source link

bug: gross error in Parmap.array_parmapi #74

Closed UnixJunkie closed 6 years ago

UnixJunkie commented 6 years ago
 #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)|]
UnixJunkie commented 6 years ago

i should not stay constant and equal to 0

UnixJunkie commented 6 years ago

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)]
UnixJunkie commented 6 years ago

I'm using parmap 1.0-rc9 from opam

UnixJunkie commented 6 years ago

the problem is caused by the ~chunksize of 1

UnixJunkie commented 6 years ago

fix here: https://github.com/rdicosmo/parmap/pull/75

UnixJunkie commented 6 years ago

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

rdicosmo commented 6 years ago

Release done, and a big thanks.

-- Roberto

Le mar. 10 juil. 2018 à 11:09, UnixJunkie notifications@github.com a écrit :

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rdicosmo/parmap/issues/74#issuecomment-403754298, or mute the thread https://github.com/notifications/unsubscribe-auth/AAp-v6O-ip9M6winyPMdumHH6Mi2qzf3ks5uFG79gaJpZM4VI_Gy .

UnixJunkie commented 6 years ago

opam PR: https://github.com/ocaml/opam-repository/pull/12337 Thanks for your quick action Roberto.