You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently using the Domainslib library in my OCaml project, and I wanted to use a parallel map function. However, I could not find such a function in the library.
Does a parallel map exist in this library? If not, which implementation would you suggest instead (for example, Parany's)?
The text was updated successfully, but these errors were encountered:
tjazerzen
changed the title
Does a parallel map function exist in Domainslib?
Question: Does a parallel map function exist in Domainslib?
Jul 25, 2023
One can do a naive version of parallel_map with a parallel_for.
letparallel_mapfarrpool=let len =Array.length arr inlet res =Array.make len (f arr.(0)) inDomainslib.Task.parallel_for pool ~start:0~finish:(len -1)
~body:(funi -> res.(i) <- (f arr.(i)));
res
Parany supports parallel map indeed. Although, the latest release of Parany doesn't use shared memory parallelism, but uses Unix fork to spawn new processes. This may work for certain type of jobs, but if you want to use OCaml 5 features in your project I'd suggest going with one of the above two options.
Hello
Domainslib
maintainers,I'm currently using the
Domainslib
library in my OCaml project, and I wanted to use aparallel map
function. However, I could not find such a function in the library.Does a parallel map exist in this library? If not, which implementation would you suggest instead (for example, Parany's)?
The text was updated successfully, but these errors were encountered: