mindspore.dataset.config.set_enable_shared_mem

mindspore.dataset.config.set_enable_shared_mem(enable)

Set whether to use shared memory for interprocess communication when data processing multiprocessing is turned on.

Using shared memory can speed up the efficiency of data transfer between processes.

Shared memory is used by default.

Note

Windows and MacOS systems are not supported yet.

Parameters

enable (bool) – Whether to use shared memory for interprocess communication.

Raises

TypeError – If enable is not of type bool.

Examples

>>> # Enable shared memory feature to improve the performance of Python multiprocessing.
>>> import mindspore.dataset as ds
>>> ds.config.set_enable_shared_mem(True)