lenskit.parallel.serialize#

Serialization utilities for parallel processing.

Functions

shm_deserialize(data)

Deserialize SHM-pickled data.

shm_serialize(obj[, manager])

Serialize an object for processing in a subclass with shared memory when feasible (including CUDA).

Classes

SHMData(pickle, buffers)

Serialized data (with shared memory handles).

SHMPickler(file[, protocol, manager, ...])

class lenskit.parallel.serialize.SHMData(pickle, buffers)#

Bases: NamedTuple

Serialized data (with shared memory handles).

Parameters:
pickle: bytes#

Alias for field number 0

buffers: list[tuple[SharedMemory | None, int]]#

Alias for field number 1

class lenskit.parallel.serialize.SHMPickler(file, protocol=5, manager=None, *, fix_imports=False)#

Bases: Pickler

Parameters:
lenskit.parallel.serialize.shm_serialize(obj, manager=None)#

Serialize an object for processing in a subclass with shared memory when feasible (including CUDA).

Parameters:
Return type:

SHMData

lenskit.parallel.serialize.shm_deserialize(data)#

Deserialize SHM-pickled data.

Parameters:

data (SHMData)

Return type:

Any