diff options
Diffstat (limited to 'Docs/source/visualization')
-rw-r--r-- | Docs/source/visualization/plot_parallel.rst | 63 | ||||
-rw-r--r-- | Docs/source/visualization/visualization.rst | 1 | ||||
-rw-r--r-- | Docs/source/visualization/yt.rst | 8 |
3 files changed, 72 insertions, 0 deletions
diff --git a/Docs/source/visualization/plot_parallel.rst b/Docs/source/visualization/plot_parallel.rst new file mode 100644 index 000000000..75f8559e1 --- /dev/null +++ b/Docs/source/visualization/plot_parallel.rst @@ -0,0 +1,63 @@ +Out-of-the-box plotting script +============================== + +A ready-to-use python script for plotting simulation results is available at +:download:`plot_parallel.py<../../../Tools/plot_parallel.py>`. Feel free to +use it out-of-the-box or to modify it to suit your needs. + +Dependencies +------------ + +Most of its dependencies are standard Python packages, that come with a default +Anaconda installation or can be installed with ``pip`` or ``conda``: +`os, matplotlib, sys, argparse, matplotlib, scipy`. + +Additional dependencies are ``yt >= 3.5`` ( or ``yt >= 3.6`` if you are using +rigid injection, see section :doc:`yt` on how to install ``yt``), and ``mpi4py``. + +Run serial +---------- + +Executing the script with + +:: + + python plot_parallel.py + +will loop through plotfiles named ``plt?????`` (e.g., ``plt00000``, ``plt00100`` etc.) +and save one image per plotfile. For a 2D simulation, a 2D colormap of the Ez +field is plotted by default, with 1/20 of particles of each species (with different colors). +For a 3D simulation, a 2D colormap of the central slices in `y` is plotted, and particles +are handled the same way. + +The script reads command-line options (which field and particle species, rendering with +`yt` or `matplotlib`, etc.). For the full list of options, run + +:: + + python plot_parallel.py --help + +In particular, option ``--plot_Ey_max_evolution`` shows you how to plot the evolution of +a scalar quantity over time (by default, the max of the Ey field). Feel free to modify it +to plot the evolution of other quantities. + +Run parallel +------------ + +To execute the script in parallel, you can run for instance + +:: + + mpirun -np 4 python plot_parallel.py --parallel + +In this case, MPI ranks will share the plotfiles to process as evenly as possible. +Note that each plotfile is still processed in serial. When option +``--plot_Ey_max_evolution`` is on, the scalar quantity is gathered to rank 0, and +rank 0 plots the image. + +If all dependencies are satisfied, the script can be used on Summit or Cori. For +instance, the following batch script illustrates how to submit a post-processing +batch job on Cori haswell with some options: + +.. literalinclude:: ../../../Tools/cori_postproc_script.sh + :language: bash
\ No newline at end of file diff --git a/Docs/source/visualization/visualization.rst b/Docs/source/visualization/visualization.rst index 1ddd8218f..76acd1bb6 100644 --- a/Docs/source/visualization/visualization.rst +++ b/Docs/source/visualization/visualization.rst @@ -21,6 +21,7 @@ This section describes some of the tools available to visualize the data: picviewer openpmdviewer advanced + plot_parallel In addition, WarpX also has In-Situ Visualization capabilities (i.e. diff --git a/Docs/source/visualization/yt.rst b/Docs/source/visualization/yt.rst index cfc859ffa..7c52f81f8 100644 --- a/Docs/source/visualization/yt.rst +++ b/Docs/source/visualization/yt.rst @@ -20,6 +20,14 @@ or with the `Anaconda distribution <https://anaconda.org/>`__ of python (recomme conda install -c conda-forge yt +The latest version of `yt` can be required for advanced options (e.g., rigid +injection for particles). To built `yt` directly from source, you can use + +:: + + pip install git+https://github.com/yt-project/yt.git + + Visualizing the data -------------------- |