Пример #1
0
    def default_cache_sizes():
        """
        Cache sizes for standard sessions for medium production and analysis.

        """

        return {
            'trajectories': WeakLRUCache(10000),
            'snapshots': WeakLRUCache(10000),
            'statics': WeakLRUCache(10000),
            'kinetics': WeakLRUCache(10000),
            'samples': WeakLRUCache(25000),
            'samplesets': WeakLRUCache(10000),
            'cvs': True,
            'pathmovers': True,
            'shootingpointselectors': True,
            'engines': True,
            'pathsimulators': True,
            'volumes': True,
            'ensembles': True,
            'movechanges': WeakLRUCache(10000),
            'transitions': True,
            'networks': True,
            'interfacesets': True,
            'schemes': True,
            'msouters': True,
            'details': WeakLRUCache(1000),
            'steps': WeakLRUCache(1000),
            'topologies': True
        }
Пример #2
0
    def analysis_cache_sizes():
        """
        Cache Sizes for analysis sessions

        Analysis caching is very large to allow fast processing

        """
        return {
            'trajectories': WeakLRUCache(500000),
            'snapshots': WeakLRUCache(100000),
            'statics': WeakLRUCache(10000),
            'kinetics': WeakLRUCache(1000),
            'samples': WeakLRUCache(1000000),
            'samplesets': WeakLRUCache(100000),
            'cvs': True,
            'pathmovers': True,
            'shootingpointselectors': True,
            'engines': True,
            'pathsimulators': True,
            'volumes': True,
            'ensembles': True,
            'movechanges': WeakLRUCache(250000),
            'transitions': True,
            'networks': True,
            'interfacesets': True,
            'schemes': True,
            'msouters': True,
            'details': WeakLRUCache(50000),
            'steps': WeakLRUCache(50000),
            'topologies': True
        }
Пример #3
0
    def __init__(self,
                 name,
                 cv_store_cache=False,
                 cv_time_reversible=False,
                 cv_requires_lists=False,
                 cv_wrap_numpy_array=False,
                 cv_scalarize_numpy_singletons=False):
        if (type(name) is not str
                and type(name) is not unicode) or len(name) == 0:
            raise ValueError('name must be a non-empty string')

        StorableNamedObject.__init__(self)

        self.name = name

        self.store_cache = cv_store_cache
        self.time_reversible = cv_time_reversible
        self.requires_lists = cv_requires_lists
        self.wrap_numpy_array = cv_wrap_numpy_array
        self.scalarize_numpy_singletons = cv_scalarize_numpy_singletons

        self._single_dict = cd.ExpandSingle()
        self._cache_dict = cd.ReversibleCacheChainDict(
            WeakLRUCache(1000, weak_type='key'), reversible=cv_time_reversible)

        self._func_dict = cd.Function(self._eval, self.requires_lists,
                                      self.scalarize_numpy_singletons)

        post = self._func_dict + self._cache_dict + self._single_dict

        if cv_wrap_numpy_array:
            post = post + cd.MergeNumpy()

        super(CollectiveVariable, self).__init__(post=post)
Пример #4
0
    def production_cache_sizes():
        """
        Cache Sizes for production runs

        Production. No loading assumed, only last 1000 steps and a few other
        objects for error testing

        """
        return {
            'trajectories': WeakLRUCache(1000),
            'snapshots': WeakLRUCache(10000),
            'statics': WeakLRUCache(1000),
            'kinetics': WeakLRUCache(1000),
            'samples': WeakLRUCache(10000),
            'samplesets': False,
            'cvs': False,
            'pathmovers': False,
            'shootingpointselectors': False,
            'engines': False,
            'pathsimulators': False,
            'volumes': False,
            'ensembles': False,
            'movechanges': False,
            'transitions': False,
            'networks': False,
            'interfacesets': False,
            'schemes': True,
            'msouters': False,
            'details': False,
            'steps': WeakLRUCache(10),
            'topologies': True
        }
Пример #5
0
    def lowmemory_cache_sizes():
        """
        Cache sizes for very low memory

        This uses even less caching than production runs.
        Mostly used for debugging.
        """

        return {
            'trajectories': WeakLRUCache(1000),
            'snapshots': WeakLRUCache(1000),
            'statics': WeakLRUCache(10),
            'kinetics': WeakLRUCache(10),
            'samples': WeakLRUCache(25),
            'samplesets': False,
            'cvs': True,
            'pathmovers': True,
            'shootingpointselectors': True,
            'engines': True,
            'pathsimulators': True,
            'volumes': True,
            'ensembles': True,
            'movechanges': False,
            'transitions': True,
            'networks': True,
            'interfacesets': True,
            'schemes': True,
            'msouters': True,
            'details': False,
            'steps': WeakLRUCache(10),
            'topologies': True
        }
Пример #6
0
def netcdfplus_init(store):
    static_store = StaticContainerStore()
    static_store.set_caching(WeakLRUCache(10000))

    name = store.prefix + 'statics'

    static_store.set_dimension_prefix_store(store)

    store.storage.create_store(name, static_store, False)

    store.create_variable(
        'statics',
        'lazyobj.' + name,
        description="the snapshot index (0..n_configuration-1) of "
        "snapshot '{idx}'.")
Пример #7
0
def netcdfplus_init(store):
    kinetic_store = KineticContainerStore()
    kinetic_store.set_caching(WeakLRUCache(10000))

    name = store.prefix + 'kinetics'

    # tell the KineticContainerStore to base its dimensions on names
    # prefixed with the store name to make sure each snapshot store has
    # its own kinetics store
    kinetic_store.set_dimension_prefix_store(store)

    store.storage.create_store(name, kinetic_store, False)
    store.create_variable(
        'kinetics',
        'lazyobj.' + name,
        description="the snapshot index (0..n_momentum-1) 'frame' of "
        "snapshot '{idx}'.")

    store.create_variable(
        'is_reversed',
        'bool',
        description="the indicator if momenta should be flipped.")
Пример #8
0
    def memtest_cache_sizes():
        """
        Cache Sizes for memtest debugging sessions

        Memtest will cache everything weak to measure if there is some object
        left in memory that should have been disposed of.

        """
        return {
            'trajectories': WeakLRUCache(10),
            'snapshots': WeakLRUCache(10),
            'statics': WeakLRUCache(10),
            'kinetics': WeakLRUCache(10),
            'samples': WeakLRUCache(10),
            'samplesets': WeakLRUCache(10),
            'cvs': WeakLRUCache(10),
            'pathmovers': WeakLRUCache(10),
            'shootingpointselectors': WeakLRUCache(10),
            'engines': WeakLRUCache(10),
            'pathsimulators': WeakLRUCache(10),
            'volumes': WeakLRUCache(10),
            'ensembles': WeakLRUCache(10),
            'movechanges': WeakLRUCache(10),
            'transitions': WeakLRUCache(10),
            'networks': WeakLRUCache(10),
            'interfacesets': WeakLRUCache(10),
            'schemes': WeakLRUCache(10),
            'msouters': WeakLRUCache(10),
            'details': WeakLRUCache(10),
            'steps': WeakLRUCache(10),
            'topologies': WeakLRUCache(10)
        }