# Spatio-temporal parallelism 5.11

**URL:** https://discourse.paraview.org/t/spatio-temporal-parallelism-5-11/12656
**Category:** ParaView Support
**Created:** [August 7, 2023, 8:54am UTC](https://discourse.paraview.org/t/spatio-temporal-parallelism-5-11/12656 "2023-08-07T08:54:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![luismhy](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/53a042/32.png) [@luismhy](https://discourse.paraview.org/u/luismhy)
#### Post date: [August 7, 2023, 8:54am UTC](https://discourse.paraview.org/t/spatio-temporal-parallelism-5-11/12656/1 "2023-08-07T08:54:15Z")

</div>

Hello everyone.

I would to ask about the “_spatio-temporal parallelism_” discussed in these two posts:

[https://www.kitware.com/spatio-temporal-parallelism-with-paraview/](https://www.kitware.com/spatio-temporal-parallelism-with-paraview/)

[https://www.kitware.com/paraview-spatio-temporal-parallelism-revised/](https://www.kitware.com/paraview-spatio-temporal-parallelism-revised/)

First of all, I explain my case. I am working in a project in which I have a big amount of heavy timesteps. Normally, Paraview process all these timesteps sequentially, taking around one minute for timestep. The result is that it takes approximately 8 or 10 hours to get all the render images I need for making animations later. The bottleneck here is only to read the timestep, since once it has been read, all the filters and and images exportation are done quickly. As I have numerous cases, the complete postprocessing can take several days and I started to think in a way to optimize this process. As each timestep is independent itself, I searched for a way to process the timesteps in a parallel way. I count on a cluster with 128 cores and 512 Gb of memory, so I thought I could reduce the postprocessing time.

By searching on the web, I found the two posts I have attached at the beginning. Basically, they do exactly what I want. It seems that a group created a plugin in 2013 that allows to do this, and later in 2018 (the second post), the plugin was integrated as part of the Paraview GUI.

I have successfully proofed the process with Paraview 5.7, which is the one where the plugin was implemented, and it works perfectly. For doing this, it is necessary to create your pipeline, specifying the necessary images exports and click on the option “_Export temporal script_” of the “_Catalyst_” submenu. Later, this script is executed with “_pvbatch”_. My first question is:

- How can I do this in Paraview 5.11? I assume that the process should be similar but using the new way to create exports (“Extractors”) and saving the catalyst state, but the temporal option has disappeared from the GUI (or I cannot see it), so the state will not have this information. I have seen that the script used for this plugin in 5.7 (“_spatiotemporalparallelism.py_”) remains unmodified in the _bin_ folder in 5.11, so it should exist a way to use it.
- By assuming that the process could be translated to Paraview 5.11, I have a second problem. As I have said, in 5.7 it works, but not directly with my project. In the process you have to specify the base name of each timestep file as it is designed to read each timestep in a separated file. However, my simulation data is generated in ANSYS Fluent and it is exported in Ensight Gold format, so I have only one file (the _.case_) with the information of all timesteps which must be read. Perhaps I have to create a different _.case_ for each timestep?

Any help would be appreciated. Thanks in advance.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 17, 2023, 8:59am UTC](https://discourse.paraview.org/t/spatio-temporal-parallelism-5-11/12656/2 "2023-08-17T08:59:43Z")

</div>

Hi @luismhy

The “Export Temporal Script” from 2018 is indeed gone but the feature itself is still present in the python logic and can be used.  
[https://gitlab.kitware.com/paraview/paraview/-/blob/master/Wrapping/Python/paraview/spatiotemporalparallelism.py](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Wrapping/Python/paraview/spatiotemporalparallelism.py)

TBH, this logic is only a helper and creating a python script that performs simple temporal parallelism should be fairly simple.

The idea is just to distribute the timesteps accros ranks and update the pipeline as many times as needed, while using `--symmetric` option.

I did not try it though, so if you try and have feedbacks I would be interested!

FYI @cory.quammen @nicolas.vuaille @jfausty @Dave_DeMarle @Andy_Bauer

---

<div class="post-metadata">

### Author: ![luismhy](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/53a042/32.png) [@luismhy](https://discourse.paraview.org/u/luismhy)
#### Post date: [August 22, 2023, 11:24am UTC](https://discourse.paraview.org/t/spatio-temporal-parallelism-5-11/12656/3 "2023-08-22T11:24:53Z")

</div>

Hi @[mwestphal](https://discourse.paraview.org/u/mwestphal)

Many thanks for the answer.

You are right, with the temporal script exported in Paraview 5.7, I have successfully done the temporal parallelization for a transient simulation in 5.11, using the format _.pvti_.

However, as commented in my original question, my goal is to do the same with Ensight Gold Cases from FLUENT, and this script is not working for this kind of files. Therefore, I think the best option is to create a simple script to do the parallelization, as you have commented.

I am not an expert in creating scripts for paraview, so any help would be appreciated. Basically, what I have doing right now is try to replicate the temporal parallelization with the same _.pvti_ simulation previously mentioned (because it is clear that this is possible). If this works, I will continue with the Ensight Gold files.

I have done something like this:

“”””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””

_from mpi4py import MPI_

\*from paraview.simple import \*\*

_from paraview import catalyst_

_from paraview.simple import SaveExtractsUsingCatalystOptions_

_if **name** == “ **main** ”:_

_comm = MPI.COMM\_WORLD_

_rank = comm.Get\_rank()_

_size = comm.Get\_size()_

_total\_timesteps = 720_

_timesteps\_per\_process = total\_timesteps // size_

_# Calculate timesteps assigned to this process_

_start\_timestep = rank \* timesteps\_per\_process_

_end\_timestep = start\_timestep + timesteps\_per\_process - 1_

_for timestep in range(start\_timestep, end\_timestep + 1):_

_# Generate string with the timestep (6 digits)_

_timestep\_str = f"{timestep:06d}"_

_# Generate filename to read_

_filename\_timestep = f"filename\_{timestep\_str}.pvti"_

_filename\_path=f"path\_to\_the cwd\filename\_{timestep\_str}.pvti"_

_output\_image=f"image{timestep\_str}.png"_

_._

_._

_._

_[PARAVIEW PIPELINE]_

“”””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””

So, I have created a simple paraview catalyst state reading the first timestep of the _.pvti_ simulation and doing some slice and creating a view to extract an image. This pipeline is inserted in a for loop which is parallelized with MPI, as can be seen in the portion of code. Each iteration will read the correspondent timestep according to the distribution done (and will create an image file with the name of the timestep).

It is very simple, and I do not know if this is the correct way to proceed. When I execute this script with _mpiexec_ and 1 processor it works. But if I use more than 1 processor, the parallelization does not work (symmetric option is enabled). For example, when I used the temporal script exported with the logic _spatiotemporalparalellism.py_ using 10 cores, 10 images were generated at a time, later 10 more…etc. With my approach, the 10 processes are launched but the images are generated 1 by 1, and I do not know the reason.

Many thanks in advance.
