pmesh.cache module

module for caching objects

MPI Communicator is a finite resource. Plans and Procmeshs uses MPI Communicator, and there fore are finite resources too.

Using a cache for them allows us to reduce the number of usages

class pmesh.cache.Cache() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)[source]

Bases: dict

expire(*keys)[source]
get(create, *keys)[source]

create() is a function to create the object if it is not there