

Multicore OCaml: May 2020 update
source link: https://discuss.ocaml.org/t/multicore-ocaml-may-2020-update/5898
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Multicore OCaml: May 2020
Welcome to the May 2020 update from the Multicore OCaml team! As withprevious updates, many thanks to@shakthimaan and@kayceesrk for help assembling this month’s roundup.
A major milestone in May 2020 has been the completion of rebasing of Multicore OCaml all the way from 4.06 to 4.10! The Parallel Minor GC variant that performs stop-the-world parallel minor collection is the default branch for the compiler, which means that compatibility with C bindings is now much simpler than with the older minor GC design.
I’ve received many questions asking if this means that multicore OCaml will “just work” with the opam ecosystem now. Not quite yet: we estimate that we are now one PR away from this working, which requires that the existing Threads
module is backported to multicore OCaml to support the older (non-parallel-in-the-runtime but concurrent) uses of threading that existing OCaml supports. This effort was begun a year ago by@jhw in #240 and now rebased and being reviewed by@engil in #342 . Once that is merged and tested by us on a bunch of packages and bulk builds, we should be good to start using Multicore OCaml with opam. Stay tuned for more on that next month!
The ongoing and completed tasks for the Multicore OCaml are listed first, which are then followed by improvements to the Sandmark benchmarking project. Finally, the status of the contributions to upstream OCaml are mentioned for your reference. This month has also seen a meeting of the core OCaml runtime developers to assign post-rebasing tasks (such as also porting statmemprof, how to handle non-x86 architectures, Windows support, etc) to ensure a more complete view of the upstreaming tasks ahead. The task list is long, but steadily decreasing in length.
As to how to contribute currently, there is an incredibly exciting seam of work that has now started on the appropriate programming abstractions to support parallel algorithms in OCaml. Seethis thread for more on that, and also on the Domainslib repository for more low-level examples of traditional parallel algorithms. In a month or so, we expect that the multicore switch will also be more suitable for use with opam, but don’t let that stop you from porting your favourite parallel benchmark to Domainslib today.
Multicore OCaml
Ongoing
-
ocaml-multicore/ocaml-multicore#339
Proposal for domain-local storage
A new proposal for implementing a domain-local storage in Multicore
OCaml has been created.
-
Task library slowdown if the number of domains is greater than 8
This is an ongoing investigation on why there is a slowdown with
domainslib
version 0.2 for the Game of Life benchmark when thenumber of domains is greater than eight.
-
ocaml-multicore/ocaml-multicore#340
Fix Atomic.exchange in concurrent_minor_gc
An implementation is provided for
Atomic.exchange
usingAtomic.get
andAtomic.compare_and_set
to obtain the correctsemantics to handle assertion failure in interp.c.
-
ocaml-multicore/ocaml-multicore#338
Introduce Lazy.try_force and Lazy.try_force_val
The
Lazy.try_force
andLazy.try_force_val
functions areimplemented for concurrent lazy abstractions to handle the RacyLazy
exception.
-
ocaml-multicore/ocaml-multicore#333
Random module functions slowdown on multiple cores
There is an observed slowdown for the
Random
module on multiplecores, and the issue is being analysed in detail.
-
ocaml-multicore/ocaml-multicore#343
Fix extcall noalloc DWARF
The patch provides a fix for the emitted DWARF information for
extcall noalloc
. This PR is currently under review.
Completed
-
ocaml-multicore/ocaml-multicore#337
Update opam file to 4.10.0+multicore
The rebasing of Multicore OCaml to 4.11 branch
(
parallel_minor_gc_4_11
) point is now complete! Thefile for 4.10.0+multicore has been made the default in the
multicore-opam repository.
-
ocaml-multicore/ocaml-multicore#335
Add byte_domain_state.tbl to install files
A patch to install
byte_domain_state.tbl
andcaml/*.h
files hasnow been included in the runtime/Makefile which is required for
parallel_minor_gc_4_10 branch.
-
The Multicore OCaml major GC implementation verification using the
SPIN model checker is available at the following GitHub repository
Benchmarking
Ongoing
-
Task API Port: LU-Decomposition, Floyd Warshall, Mandelbrot, N-body
Porting of the following programs - LU-Decomposition, Floyd
Warshall, Mandelbrot and N-body to use the Task API.
-
Make benchmark wrapper user configurable
The ability to dynamically specify the input commands and their
respective arguments to the benchmark scripts is currently being
evaluated.
-
Promote dune > 2.0
Sandmark works with dune 1.11.4 and we need to support dune greater
than 2.0 moving forward. The upgrade path with the necessary package
builds is being tested.
Completed
-
Added sequential-interactive.ipynb
An interactive notebook to run and analyse sequential benchmarks has
been included. Given an artifacts directory with the benchmark
files, the notebook prompts you in the GUI to select different
commit and compiler variants for analysis. A sample screenshot of
the UI is shown below:
The PR adds error handling, user input validation and the project
README has also been updated.
-
Add parallel initialisation and parallel copy to LU decomposition benchmark
The parallel initialisation is now added to LU decomposition
numerical benchmark
(benchmarks/multicore-numerical/LU_decomposition_multicore.ml).
-
Use --format=columns with pip3 list in Makefile
A fix for the “DEPRECATION: The default format will switch to
columns in the future” warning when using
pip3 list
has now beenadded to the Makefile with the use of the
--format=columns
option. -
Use sudo for parallel benchmark builds
The Makefile has been updated with the right combination ofsudo
and OPAM environment variables so that we can now run parallel
benchmarks in Sandmark. The sudo command is required exclusively for
using the
chrt
command. We can now perform nightly builds for bothserial and parallel benchmarks!
-
Refactored README and added JupyterHub info
The Sandmark README file has now been updated to include information
on configuration, usage of JupyterHub, benchmarking and a quick
start guide!
OCaml
Ongoing
-
Add manual page for the instrumented runtime
A draft manual for the instrumented runtime eventlog tracing has
been created. Please feel free to review the document and share your
valuable feedback.
-
Support building executables against OCaml 4.11 instrumented runtime
OCaml 4.11.0 has built-in support for the instrumented runtime, and
it will be useful to have dune generate instrumented targets.
Completed
-
Eventlog tracing system
The Eventlog tracing proposal for the OCaml runtime that uses the
Binary Trace Format (CTF) is now merged with upstream OCaml
(4.11.0).
-
[RFC] Dynamic check for naked pointers
An RFC for adding the ability to dynamically identify naked pointers
in the 4.10.0 compiler.
-
Reimplement Unix.create_process and related functions without Unix.fork
The use of process creation functions in the Unix module is not
suitable for Multicore OCaml, for both behaviour and efficiency. The
patch provides an implementation that uses
posix_spawn
. -
Add a macro for out-of-heap block header
This PR adds a macro definition to construct a out-of-heap block
header in runtime/caml/mlvalues.h. The objective is to use the
header for out of heap objects.
As always, we would like to thank all the OCaml developers and users for their continued support and contribution to the project. Stay safe out there.
Acronyms
- API: Application Programming Interface
- CTF: Common Trace Format
- DWARF: Debugging With Attributed Record Formats
- GC: Garbage Collector
- GUI: Graphical User Interface
- LU: Lower-Upper
- OPAM: OCaml Package Manager
- PIP: Pip Installs Python
- PR: Pull Request
- RFC: Request for Comments
- UI: User Interface
Recommend
-
65
比较广义的分类型的话,总共有两种Concurrency Control Protocol Two Phase Locking(悲观) 假设事务会冲突,提前加上锁。会有死锁的可能 Timestamp Ordering(乐观) 假设事务冲突比...
-
33
Welcome to the February 2020 news update from the Multicore OCaml team, spread across the UK, India, France and Switzerland! This follows on fromlast month’s update, and has been put together by@shakthimaan and@kayceesrk....
-
19
Multicore OCaml: March 2020 Welcome to the March 2020 news update from the Multicore OCaml team! This update has been assembled with@shakthimaan and@kayceesrk, as with theFebruary andJanuary ones. Ou...
-
29
Parallel programming in Multicore OCaml This tutorial will help you get started with writing parallel programs in Multicore OCaml. All the code examples along with their corresponding dune file are available i...
-
14
Welcome to the July 2020 Multicore OCaml report! This update, along with theprevious updates, has been compiled by@shakthimaan,@kayceesrk and myself. There are a number of advances both in upstream OCaml as well as our m...
-
6
Multicore OCaml: March 2021 We've updated this site, please refresh, or you may experience unexpected behaviour. ...
-
11
OCaml 5 Will Include Multicore Support Oct 11, 2021 2 m...
-
6
Copy link Contributor kayceesrk comme...
-
2
Yawar Amin ...
-
9
effects-examples/algorithmic_differentiation.ml at master · ocaml-multicore/effects-examples · GitHub
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK