ocaml-multicore / domainslib

Parallel Programming over Domains
ISC License
171 stars 30 forks source link

parallel_scan rejects arrays not larger than pool size #38

Closed nilsbecker closed 2 years ago

nilsbecker commented 3 years ago
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".
kayceesrk commented 3 years ago

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

Sudha247 commented 3 years ago

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.

Sudha247 commented 2 years ago

Fixed by #60.