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: MutableMapping

Dict 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 None for empty dict.

  • comm (MPI.Comm) – An MPI communicator.

  • size (int) – The total size of the shared memory in bytes. Defaults to 104857600 for 100MB.

  • root (int) – The MPI rank where the shared memory window is hosted.

Methods

clear

D.clear() -> None.

get

D.get(k[,d]) -> D[k] if k in D, else d.

incr

Atomic operator that increments and returns the resulting value.

items

D.items() -> a set-like object providing a view on D's items

keys

D.keys() -> a set-like object providing a view on D's keys

lock

Acquire the lock.

pop

D.pop(k[,d]) -> v, remove specified key and return the corresponding value.

popitem

D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty.

session_finish

session_start

setdefault

D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D

unlock

Release the lock.

update

D.update([E, ]**F) -> None.

values

D.values() -> an object providing a view on D's values

Attributes

CACHE

COUNTER

HEADER_SIZE

__call__(read_only: bool = False)[source]#

Call self as a function.

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#
lock()[source]#

Acquire the lock. Blocking operation.

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#
unlock()[source]#

Release the lock.

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#