Parany for multicore OCaml

Hello,

There is now an implementation using multicore-OCaml in the ‘domains’ branch.

People are very welcome to give it a try and share the speedup they observe,
especially compared to fork-based parallelism.

Thanks to @nilsbecker for having motivated me.

Regards,
F.

8 Likes

If you don’t use the domains branch, then parany is using fork-based parallelism.
If you want to use the domains branch, you need to install multicore-ocaml first:

opam switch create 4.12.0+domains
eval `opam config env`

Some benchmark using 8 threads to process 100,000 molecules (runtimes are in seconds):

Chunk-size Multicore-OCaml (speedup) Fork-based // (speedup)
1 63.344 1.19 64.383 1.17
2 57.195 1.31 60.649 1.24
5 53.905 1.39 55.235 1.36
10 52.568 1.43 55.172 1.36
20 52.888 1.42 55.237 1.36
50 52.961 1.42 54.260 1.38
100 53.940 1.39 52.917 1.42
200 52.486 1.43 51.946 1.45
500 52.597 1.43 51.026 1.47

One good thing is that the multicore-OCaml program is more portable (it doesn’t need the operating system to provide the fork() system call).

I’ll try to find another benchmark; this one is probably limited by how fast I can
read things from disk.

4 Likes