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

get

incr

Atomic operator that increments and returns the resulting value.

items

keys

lock

Acquire the lock.

pop

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem

as a 2-tuple; but raise KeyError if D is empty.

session_finish

session_start

setdefault

unlock

Release the lock.

update

If E present and has a .keys() method, does: for k in E: 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

Attributes

CACHE

COUNTER

HEADER_SIZE

__call__(ready_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: 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#