-
Notifications
You must be signed in to change notification settings - Fork 4
How to save a ParaView animation in Marenostrum IV
Let me bring here some quick notes to assist in the creation of a ParaView animation, where VTK simulation results are stored in Marenostrum IV (MN-IV). For very large and long transient simulations, there are not enough computational resources (e.g. disk space, memory,...) to download and manipulate the simulation results in our laptop. The animation must be remotely created.
This page assumes the format of the animations is a numbered series xxxx.%04d.png. They can be used directly in a LaTeX-Beamer presentation, using the animate
package, or transformed into a video (see e.g. How to create and upload a video to the Youtube channel).
I will present here a possible workflow starting from any VTK output of a transient FE problem in Marenostrum IV that can be visualized in ParaView. If you, like me, are not proficient with the Python interpreter that runs the ParaView's Python scripts, I recommend you to follow a three-step procedure:
- Establish a server-client connection for remote visualization with ParaView.
- Work with the server-client connection to configure the animation and get a processing script.
- Use the script to launch a graphical job in Marenostrum running the animation processing.
I hope that you can easily adapt these instructions to other contexts.
- Install ParaView 5.5.2 version on your computer
There is a single ParaView module in MN-IV (3rd April 2019) for version 5.5.2. For remote visualization, client and server ParaView versions must coincide. Download ParaView 5.5.2 binary files and extract them in the folder of your choice.
- Login into MN-IV with graphical interface support:
$ ssh -X [email protected]
- Load required modules:
$ module load gcc/8.1.0
$ module load paraview/5.5.2
MN-IV's ParaView has been compiled with GCC.
- Allocate and launch an interactive session from MN-IV login node:
$ salloc -p interactive --x11=all
Note that interactive sessions are jobs (i.e. charged in the budget). See also mn-iv page.
- Start a remote server in the interactive session:
/apps/PARAVIEW/5.5.2/GCC/bin/mpiexec -np 8 /apps/PARAVIEW/5.5.2/GCC/bin/pvserver --force-offscreen-rendering --server-port=44444
After some seconds, you should get a message similar to
$ Connection URL: cs://login4:44444
$ Accepting connection(s): login4:44444
- Establish a SSH tunnel between your desktop and the MN-IV login node:
Run in your desktop
$ ssh -L11111:login4:44444 -N [email protected]
- Launch ParaView 5.5.2 in your desktop, configure server connection and connect to the remote server:
-
File > Connect
prompts the window -
Choose the highlighted default connection. If not available, add it yourself.
-
Click connect. After some seconds, the server in the login node should show the message
Client connected.
A plugin manager window may also appear in your desktop ParaView. You can close it. The pipeline browser should show that you are remotely connected (via the ssh tunnel).
After establishing the connection, you can access the simulation data in the remote server (File > Open
). The server processes and renders the data, while you control the visualization from your desktop.
This is very useful to configure how you want to export the animation, but I do not think it is the best way to save the animation itself. The resources accessible in the interactive session are much lower (1 shared node?) than in the compute nodes.
Hence, I propose to use the interactive session to configure and generate a proof-of-concept script. The script can be later modified conveniently and launched to run the complete animation exporting process in the compute nodes.
Now it's time to configure how you want to export the animation (e.g. render view, titles, legends...) and generate a proof-of-concept script that reproduces the steps of the configuration process.
Configure the animation as usual. Trace all the process with Tools > Start Trace
at the beginning, right before loading the data into the pipeline browser, and Tools > Stop Trace
at the end, right after launching and completing the execution of a File > Save Animation
.
Remark: In the Save Animation Options
dialogue I recommend you to toggle the advanced properties and choose a small frame window, export only the first png
snapshots. This is enough to (1) verify that the output has been well generated and (2) get the configuration script.
After stopping the trace, a window prompts with the script contents. Save it in the login node of MN-IV.
Return to the login node. If you open a new session, remember to enable X11 forwarding, i.e. ssh -X ...
. Prepare a job script as usual and launch the job telling ParaView to execute the script you generated. The command to be executed launches pvbatch
, ParaView's python interpreter for batch processing, and it must include the slurm directive #SBATCH --x11=batch
, because it is a graphical job. The animation frames will be saved in the output folder indicated in the ParaView python script.