PropertyMaps

Usage

use PropertyMaps;
proc UninitializedPropertyMap(type propertyType, mapper: ?t = new DefaultMapper())

Uninitialized property map (does not initialize nor privatize).

record PropertyMap
type propertyType
type mapperType
proc init(type propertyType, mapper: ?mapperType = new DefaultMapper())

Create an empty property map.

Arguments:
  • propertyType – Type of properties.
  • mapper – Determines which locale to hash to.
proc init(other: ?propertyTypePropertyMap?mapperType)

Create a shallow-copy of the property map. The resulting map refers to the same internals as the original.

Arguments:other – Other property map.
proc clone(other: ?propertyTypePropertyMap?mapperType)

Performs a deep-copy of a property map.

Arguments:other – Other property map.
proc isInitialized
proc _value
proc destroy()
class PropertyMapImpl
type propertyType
var mapper
var lock: Lock
proc init(type propertyType, mapper: ?t = new DefaultMapper())
proc init(other: PropertyMapImpl(?propertyType))
proc append(other: this.type, param overwrite = true, param acquireLock = true)

Appends the other property map’s properties. If a property already exists, it will overwrite the current value if ‘overwrite’ policy is set.

Arguments:
  • other – Other property map to append.
  • overwrite – Whether or not to overwrite when a duplicate is found.
proc create(property: propertyType, param aggregated = false, param acquireLock = true)
proc flushLocal(param acquireLock = true)
proc flushGlobal(param acquireLock = true)
proc setProperty(property: propertyType, id: int, param aggregated = false, param acquireLock = true)
proc _flushGetAggregatorBuffer(buf: nilable Buffer, loc: locale, param acquireLock = true)
proc getPropertyAsync(property: propertyType, param acquireLock = true): unmanaged PropertyHandle
proc getProperty(property: propertyType, param acquireLock = true): int
proc numProperties(): int
proc numPropertiesGlobal(): int
iter localProperties(): (propertyType, int)

Obtains local property keys and values (serial).

iter localProperties(): (propertyType, int)
iter these(): (propertyType, int)
iter these(param tag: iterKind): (propertyType, int)

Obtains global property keys and values (parallel).

class PropertyHandle

Represents an asynchronous result that will be computed once the aggregation buffer for it gets flushed. Can be thought of as a way to ‘prefetch’ data.

Note

Cannot be used as shared due to bug where assigning a tuple involving a ‘shared’ object will result in the compiler stripping the lifetime of the object and throwing a compiler error. It is not known to me whether or not this would result in dangerous deallocations or memory leakage.

var retVal: int
var ready: atomicbool
proc init()
proc init(val: int)
proc get(): int
proc set(val: int)
proc isReady()