deephyper.evaluator.storage.MPIWinMutableMapping#
- class deephyper.evaluator.storage.MPIWinMutableMapping(default_value: dict = None, comm: mpi4py.MPI.Comm = mpi4py.MPI.COMM_WORLD, size: int = 104857600, root: int = 0)[source]#
Bases:
MutableMappingDict like object shared between MPI processes using one-sided communication.
- Parameters:
default_value (dict) – The default value of the mutable mapping at initialization. Defaults to
Nonefor empty dict.comm (MPI.Comm) – An MPI communicator.
size (int) – The total size of the shared memory in bytes. Defaults to
104857600for 100MB.root (int) – The MPI rank where the shared memory window is hosted.
Methods
D.clear() -> None.
D.get(k[,d]) -> D[k] if k in D, else d.
Atomic operator that increments and returns the resulting value.
D.items() -> a set-like object providing a view on D's items
D.keys() -> a set-like object providing a view on D's keys
Acquire the lock.
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty.
session_finishsession_startD.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
Release the lock.
D.update([E, ]**F) -> None.
D.values() -> an object providing a view on D's values
Attributes
CACHECOUNTERHEADER_SIZE- clear() None. Remove all items from D.#
- get(k[, d]) D[k] if k in D, else d. d defaults to None.#
- incr(key: Hashable, amount=1)[source]#
Atomic operator that increments and returns the resulting value.
- items() a set-like object providing a view on D's items#
- keys() a set-like object providing a view on D's keys#
- pop(k[, d]) v, remove specified key and return the corresponding value.#
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair#
as a 2-tuple; but raise KeyError if D is empty.
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D#
- update([E, ]**F) None. Update D from mapping/iterable E and F.#
If E present and has a .keys() method, does: for k in E.keys(): D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values#