Using Python to Create Complicated Animation

I’ve been using the full GUI to visualize some transient CDF studies I’ve been doing. In order to streamline things a bit, I’ve started experimenting with using pvpython to create the animation for me. However, I’m running into trouble getting pvpython to recreate the results I see with the GUI.

The python script I’ve created works relatively well when it is run as a macro in the GUI. However, when I run the same macro from the command line with pvpython, it fails to create an animation. The various views do appear during the course of running the script, but when the script attempts to create the animation, I get a fault. Here is the specific error:

[xcb] Unknown sequence number while appending request
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
pvpython: ../../src/xcb_io.c:161: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.
Aborted (core dumped)

The animation requires recalculation of the streamlines at each time step (there can be up to 1000 time steps). I’m also using PlotOverTime to create the plot of relevant metrics in the CFD over all the time steps.

I’m running paraview 5.4 on an Ubuntu 16 machine. The machine only has 16 GB of RAM, so maybe that is something. The scripts (if I can get them working) will eventually be uploaded to some instances on AWS (also Ubuntu 16 with 16 GB of RAM) and be part of an automated pipeline.

Here is a screen shot of the animation produced by the script run in the GUI.

Does the segfault happen on first timestep or after several? Are you creating and destroying views each timestep in your script? It may be worthwhile to change it not do the same. Another thing to try, use pvbatch --use-offscreen-rendering <script> instead of pvpython.

Utkarsh,

Thank you so much. Using pvbatch with --use-offscreen-rendering enabled worked correctly.

-Geoff