Previous Next

Caching

Computational intense tasks like parsing the database XML-file and applying the 'Cascade' PAH emission model support caching. Caching provides a significantly speed-up on subsequent use. By default, the 'IDL_TMP'-directory is used to store the cache. However, this means that upon system reboot the cache will be cleared. To avoid this, set either or both of the system and IDL AMESPAHCACHEDIR environment variables to a directory for storing the cache.

IDL:
DEFSYSV,'!AMESPAHCACHEDIR',"/path/to/cache"
Bash:
export AMESPAHCACHEDIR='/path/to/cache'

NB On some systems these variables are case-sensitive.

The cache can be managed by the static 'Cache'-method of the 'AmesPAHdbIDLSuite' class. Simply invoking it lists the hash of each cached item and its size.

AmesPAHdbIDLSuite->Cache

The 'Clear'-keyword can be used to clear the cache.

AmesPAHdbIDLSuite->Cache,/Clear

To clear a specific cached item its hash can be provided.

AmesPAHdbIDLSuite->Cache,'6EA3188984B19E595142DE68BC40EA52',/Clear

The 'CLEARED'-column indicates whether a cached-item has been cleared.


=========================================================
CACHE DIR: /Users/boersma/.pahdb_cache/
---------------------------------------------------------
HASH                             SIZE           CLEARED
---------------------------------------------------------
180EEF46                            0.61 MiB    0
3B4BAE59DF0F6F2DD348D626843AE37F   42.27 MiB    0
55AE8746                            0.61 MiB    0
6EA3188984B19E595142DE68BC40EA52  130.52 MiB    1
6EA3188984B19E595142DE68BC40EA52  409.44 MiB    1
80223684                           97.36 MiB    0
98025537                            0.61 MiB    0
DAF16FAD                            0.61 MiB    0
=========================================================