Skip to content

In Situ Python Analysis

Shin-Rong Tsai edited this page Jul 8, 2023 · 4 revisions

What is in situ analysis?

In situ analysis is to analyze ongoing simulation data without outputting data to disk before conducting analysis. It enables us to explore these ongoing simulation data through accessing memory directly using Python.

Dependencies

  • Install libyt and yt_libyt: the in situ analysis library and its yt frontend.
  • Install yt: the core analysis tool.

Compilation Options

libyt has compilation options in Makefile:

  • SUPPORT_LIBYT: Use libyt for in situ analysis
  • LIBYT_USE_PATCH_GROUP: Use patch group as a unit grid. It will be a lot faster when doing analysis, but consumes more memory. Must enable SUPPORT_LIBYT.
  • LIBYT_INTERACTIVE: Activate interactive Python prompt in in situ analysis. Must enable SUPPORT_LIBYT and compile libyt in interactive mode.

Must set LIBYT_PATH in Makefile, the path should contain folder include and lib.

Runtime Parameters

libyt has input parameters:

  • YT_SCRIPT: The Python script name to be loaded. Do not include file extension .py.
  • YT_VERBOSE: Log level of libyt.
  • YT_FIG_BASENAME: Figure base name of the output from yt.

For example, Input__Parameter with these lines will read Python script inline_script.py, set log level to information only, and set the figure basename to MHD.

# YT inline analysis  
YT_SCRIPT                     inline_script # inline python script name, exclude ".py" extension  
YT_VERBOSE                    1             # log level (0=off, 1=info, 2=warning, 3=debug)
YT_FIG_BASENAME               MHD           # figure basename, this is optional.

Quick Demos

  1. Plummer

FAQs

If you happen to have error messages related to MPI remote memory access operation, something look like:

ompi_osc_ucx_win_attach: Assertion ......

Please add OMPI_MCA_osc=sm,pt2pt before mpirun, for example:

OMPI_MCA_osc=sm,pt2pt mpirun -np 4

This is something libyt will fixed in the future.

Clone this wiki locally