[Chapel Merge] draft DistributedMap and Aggregator

Branch: refs/heads/main
Revision: ee4bae6
Author: vasslitvinov
Link: draft DistributedMap and Aggregator by vasslitvinov · Pull Request #19554 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #19554 from vasslitvinov/distributed-map

draft DistributedMap and Aggregator

These draft DistributedMap and Aggregator illustrate an approach
to resolving the reference invalidation issue, following this proposal:
#12306 (comment)

The sample code in use-distributed-map.chpl computes a distributed histogram
using (a) the bulkUpdate method and (b) a forall statement that mocks
a compiler-transformed manage or sync statement in the above proposal.

The implementation is bare-bones.

DistributedMap achieves intra-locale parallelism by using multiple instances
of the standard map with parSafe=true so that they can be accessed
concurrently. Other approaches can be used, ex. the ConcurrentMap package.

The aggregator is designed to be usable with any "client" data structure
that implements the API indicated in the code using "API" comments.
Currently it aggregates only indices, for simplicity. It can be generalized
to any input such that the index can be extracted from each input element.

Discussed with @lydia-duncan

Modified Files:
A test/library/draft/DistributedMap/Aggregator.chpl

A test/library/draft/DistributedMap/Aggregator.notest
A test/library/draft/DistributedMap/DistributedMap.chpl
A test/library/draft/DistributedMap/DistributedMap.notest
A test/library/draft/DistributedMap/use-distributed-map.chpl
A test/library/draft/DistributedMap/use-distributed-map.good
A test/library/draft/DistributedMap/use-distributed-map.numlocales

Compare: https://github.com/chapel-lang/chapel/compare/fc13eac6d6e3...ee4bae675214