Skip to content

Refactor DistArray.from_localarrays() #337

@kwmsmith

Description

@kwmsmith

Currently DistArray.from_localarrays() takes a key and a context and does a round-trip communication to get the dim_data information. In nearly all circumstances, this extra round-trip is unnecessary.

DistArray.from_localarrays() should be refactored to take a key, a context, and an optional dim_data (default None). If dim_data is provided, then the call to _make_mdmap_from_local_dimdata should be skipped (https://github.com/enthought/distarray/blob/master/distarray/client.py#L119), and Distribution.from_dim_data should be called directly.

Where possible, the places where DistArray.from_localarrays() is called should be refactored to get the key and the dim_data from the LocalArrays on the engines and call from_localarrays() with the dim_data sequence. See the _create_local, _from_dim_data, load_dnpy, load_npy, load_hdf5, and from_function methods in the Context class.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions