[Mesa-users] cache files

Rob Farmer r.j.farmer at uva.nl
Thu Dec 6 10:18:07 EST 2018


Hi,
We create the folder as a safe place to store cache files when we run the
code. Once the files have been written they are moved into the
$MESA_DIR/data folder for longer term storage.

Imagine your running two mesa's at once on your machine (or many mesa's on
a cluster). Each once starts and tries to load a cache file. At first these
files don't exist so mesa computes them and saves them to disk. Subsequent
mesa runs will see the cache file already written and read that file. But
what happens if a mesa run tries to read a cache file before a different
mesa run had finished writing it to file? Very bad things happen.

So instead each mesa run writes the cache file to a its local work
directory (and inside .mesa_temp_cache), then uses mv to move the file to
its final location. mv is an atomic operation when moving files on the same
filesystem (we have extra handling for when things are on different
filesystems). This way every mesa run either sees no cache file, so writes
its own, or sees an existing file that is fully written, so reads that. It
never sees a partially written file which would be bad.

Rob

ps You should never need to run mesa as root. that is a bad idea.


On Thu, 6 Dec 2018 at 15:49, sheyda najafi via Mesa-users <
mesa-users at lists.mesastar.org> wrote:

> Dear MESA users
>
> I am running (test_suite/1M_pre_ms_to_wd) in version (mesa-r9793)
> remotely as a root.
> by running MESA, a directory named (.mesa_temp_cache) is created in
> 1M_pre_ms_to wd package automatically with cache files (eosDT_cache,
> isonization_cache, kap_cache, rates_cache) which remain empty during
> the run.
> I run mesa as a root so i think there is no need to add new address
> for cache files in my inlist (&star_job namelist) as
>
>          !     eosDT_cache_dir = '/Users/bpaxton/mesa_caches/eosDT_cache'
>          !     eosPT_cache_dir = '/Users/bpaxton/mesa_caches/eosPT_cache'
>          !     eosDE_cache_dir = '/Users/bpaxton/mesa_caches/eosDE_cache'
>          !     ionization_cache_dir =
> '/Users/bpaxton/mesa_caches/ionization_cache'
>          !     kap_cache_dir = '/Users/bpaxton/mesa_caches/kap_cache'
>          !     rates_cache_dir = '/Users/bpaxton/mesa_caches/rates_cache'
>
> why does MESA create (.mesa_temp_cache) directory  with the files
> remaining empty during the run? Does it mean that MESA can not use
> cache files?
>
> thank you very much.
>
> Sheyda
> _______________________________________________
> mesa-users at lists.mesastar.org
> https://lists.mesastar.org/mailman/listinfo/mesa-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20181206/b8970d39/attachment.html>


More information about the Mesa-users mailing list