BucketMap

Usage

use BucketMap;
config const BucketMapInitialBucketSize = 8

A map intended to be used for computing equivalence classes. We create a fixed number of buckets per locale and use modulus division to determine where the objects are sent to. The more buckets, the higher the potential for concurrency. Each bucket is a resizing vector with its own lock; this can be seen as a way to dynamically redistribute data based on the hash.

record BucketMap
type keyType
type valueType
var pid: int
proc init(type keyType, type valueType, numBucketsPerLocale = 1024)
class Bucket
type keyType
type valueType
var lock: Lock
var keySlots: owned Vector(keyType)
var valueSlots: owned Vector(valueType)
proc init(type keyType, type valueType)
class Buckets
type keyType
type valueType
const numBucketsPerLocale: int
var bucketsDom = {0..#numLocales*numBucketsPerLocale} dmapped Cyclic(startIdx = 0)
var buckets: [bucketsDom] unmanaged keyTypeBucketvalueType
proc init(type keyType, type valueType, numBucketsPerLocale)
class BucketMapImpl
type keyType
type valueType
var pid: int
var buckets: unmanaged keyTypeBucketsvalueType
var bucketsRef = _newArray(buckets.buckets._value)
proc init(type keyType, type valueType, numBucketsPerLocale: int)
proc init(other: unmanaged ?keyTypeBucket?valueType, privatizedData)
proc dsiPrivatize(privatizedData)
proc dsiGetPrivatizeData()
proc getPrivatizedInstance()