graflo.hq.bulk.partition¶
Rounds of edge cells that share no endpoint vertex (mix and batch).
The fold hashes each edge's source and target keys into n buckets, which
puts every edge of a run in one cell (source bucket, target bucket). Cells
whose buckets differ touch disjoint vertices, so their edges can be created in
parallel without two writers waiting on one node's lock. A round is a list of
lanes, each a few cells one writer takes in order; the lanes of a round run in
parallel and rounds run one after another.
When the source and target types are the same, a vertex's bucket is the same in either role, so a cell touches both of its buckets: a lane then holds the two cells of one bucket pair and a round's pairs are a matching.
Attributes¶
Cell = tuple[int, int]
module-attribute
¶
Lane = tuple[Cell, ...]
module-attribute
¶
Functions:¶
rounds(n, *, same_type)
¶
Every cell of the n by n grid, once, in rounds of disjoint lanes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
Buckets per endpoint. |
required |
same_type
|
bool
|
Source and target are one vertex type. |
required |