Communication with an external resource controller through a Unix domain socket letterbox using JSON messages.
The runtime sends JSON objects containing bookkeeping information and measurements for a parallel region, such as:
- capabilities (e.g. maximum number of threads),
- with-loop identifiers (region uid), and
- measurement samples (runtime, usertime, energy).
The controller replies with JSON demand messages, currently containing the desired number of threads for the next iteration of a region.
A text-based JSON protocol is used intentionally so new fields can be added by the controller without breaking backward compatibility with older runtime versions that ignore unknown keys. In addition, this enables more complicated communication patterns in the future, such as pinning strategies, or even broadcasting different implementation of the same algorithm to then dynamically find the best one.