memory_full_cache module¶
Caching module to store all the entries in memory.
- class gemseo.caches.memory_full_cache.MemoryFullCache(tolerance=0.0, name=None, is_memory_shared=True)[source]
Bases:
AbstractFullCache
Cache using memory to cache all the data.
- Parameters:
Warning
If
is_memory_shared
isFalse
and multiple disciplines point to the same cache or the process is multi-processed, there may be duplicate computations because the cache will not be shared among the processes. This class relies on some multiprocessing features, it is therefore necessary to protect its execution with anif __name__ == '__main__':
statement when working on Windows.- clear()[source]
Clear the cache.
- Return type:
None
- property copy: MemoryFullCache
Copy the current cache.
- Returns:
A copy of the current cache.
- lock: RLockType
The lock used for both multithreading and multiprocessing.
Ensure safe multiprocessing and multithreading concurrent access to the cache.
- lock_hashes: RLockType
The lock used for both multithreading and multiprocessing.
Ensure safe multiprocessing and multithreading concurrent access to the cache.
- name: str
The name of the cache.
- tolerance: float
The tolerance below which two input arrays are considered equal.