# opam search parany
[...]
parany 14.0.0 Parallelize any computation
I switched back the runtime to fork+marshal.
As was the case before version 13.0.0.
Versions 13.* (up to 14.0.0 excluded) use ocaml5-threads to parallelize computations.
There is a branch GitHub - UnixJunkie/parany at ocaml5_threads
if anybody wants to maintain this backend.
The Parany.Parmap module has new functions for arrays:
(** The [demux] function must throw [Parany.End_of_input] once it is done. *)
exception End_of_input
(** [run ~csize:10 16 ~demux:f ~work:g ~mux:h] will run
in parallel on 16 cores the [g] function.
Inputs to function [g] are produced by function [f]
and grouped by 10 (the chunk size [csize]).
If not provided, [csize] defaults to one.
The performance-optimal [csize] depends on your computer, the functions
you are using and the granularity of your computation.
Elements which are fast to process may benefit from
a [csize] greater than one.
The demux function [f] must throw [Parany.End_of_input]
once it is done.
Outputs of function [g] are consumed by function [h].
Functions [f] and [g] are run by different unix processes.
Function [g] is run by several processes at the same time (16
in this example).
Only function [mux] is run by the same process that called [Parany.run].
This file has been truncated. show original
Regards,
F.
3 Likes
gadmm
May 23, 2023, 1:01pm
2
Can you tell us more about your reason to switch back to fork+marshal?
2 Likes
I want optimal parallel performance for the kind of workloads I encounter daily at work.