Skip to content

Unsetting MALLOC_TRIM_THRESHOLD_ is sensitive to import order #8143

@crusaderky

Description

@crusaderky

import distributed respects any previous calls to dask.config.set that change a value, but not those that remove a key:

>>> import dask
>>> dask.config.set({"distributed.nanny.pre-spawn-environ": {'OMP_NUM_THREADS': 2}})
>>> dask.config.get("distributed.nanny.pre-spawn-environ")
{'OMP_NUM_THREADS': 2}
>>> import distributed
>>> dask.config.get("distributed.nanny.pre-spawn-environ")
{'OMP_NUM_THREADS': 2, 'MALLOC_TRIM_THRESHOLD_': 65536, 'MKL_NUM_THREADS': 1, 'OPENBLAS_NUM_THREADS': 1}

The problem here is that an unset MALLOC_TRIM_THRESHOLD_ has a special meaning for the glibc so it can't just simply be overridden with a different explicit value.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions