Skip to content
Snippets Groups Projects
Commit 7c0716ad authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'update_doc_logger' into 'master'

Update documentation logger

See merge request !1259
parents a781c1d3 5338075b
No related branches found
No related tags found
1 merge request!1259Update documentation logger
...@@ -2,15 +2,16 @@ Logger Output ...@@ -2,15 +2,16 @@ Logger Output
============= =============
The logger is a particle based output (e.g. snapshot) that takes into account the large difference of timescale. The logger is a particle based output (e.g. snapshot) that takes into account the large difference of timescale.
If you have any question, a slack channel is available for it in SWIFT's slack. If you have any questions, a slack channel is available for it in SWIFT's slack.
To run it, you will need to use the configuration option ``--enable-logger``. To run it, you will need to use the configuration option ``--enable-logger`` and the run time argument ``--logger``.
Currently the logger is implemented only for Gadget2 and the default gravity / stars, but can be easily extended to the other schemes by adding the logger structure to the particles (see ``src/hydro/Gadget2/hydro_part.h``). Currently the logger is implemented only for GEAR, Gadget2 and the default modules, but can be easily extended to the other schemes by adding the logger structure to the particles and implementing the IO functions (see ``src/hydro/Gadget2/hydro_part.h``, ``src/hydro/Gadget2/hydro_logger.c`` and ``src/hydro/Gadget2/hydro_logger.h``).
The main parameters of the logger are ``Logger:delta_step`` and ``Logger:index_mem_frac`` that define the time accuracy of the logger and the number of index files. The main parameters of the logger are ``Logger:delta_step`` and ``Logger:index_mem_frac`` that define the time accuracy of the logger and the number of index files.
The first parameter defines the number of active steps that a particle is doing before writing and the second defines the total storage size of the index files as function of the dump file. The first parameter defines the number of active steps that a particle is doing before writing and the second defines the total storage size of the index files as a fraction of the dump file.
Unfortunately, the API is not really developed yet. Therefore if you wish to dump another field, you will need to trick the logger by replacing a field in the ``logger_log_part`` function. For reading, the python wrapper is available through the configuration option ``--with-python``.
I recommend running the SedovBlast_3D with the logger and then using the example ``logger/examples/reader_example.py``.
This file is kept up to date with the most recent changes and includes a call to all the existing functions.
If you need some extra information, a doc string is provided for the class ``logger.Reader`` and all its methods.
For reading, the python wrapper is available through the configuration option ``--with-python``. Once compiled, you will be able to use the file ``logger/examples/reader_example.py``. If you wish to obtain a snapshot from the logger, a script is available in ``logger/examples/create_snapshot.py``.
The first argument is the basename of the index file and the second one is the time requested.
During the first reading, the library is manipulating the dump file and therefore it should not be killed and may take a bit more time than usual.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment