ocaml-multicore/domainslib

parallel_scan rejects arrays not larger than pool size

nilsbecker opened this issue · 3 comments

utop # #require "domainslib";;
utop # open Domainslib;;
utop # let p = Task.setup_pool 4;;
val p : Task.pool = <abstr>
utop # Task.parallel_scan p (+) [|1;2;3;4|];;
Exception: Invalid_argument "index out of bounds".

@Sudha247 any thoughts on this one? It may be easiest to perform a sequential scan if the size is less than the pool size.

Thanks for the report @nilsbecker. I agree with performing a sequential scan in this case. I have attempted to fix this in #39, it does something similar.

Fixed by #60.