# Catalyst old and new, necessity of MPI

**URL:** https://discourse.paraview.org/t/catalyst-old-and-new-necessity-of-mpi/9005
**Category:** In Situ Support
**Created:** [February 17, 2022, 8:53pm UTC](https://discourse.paraview.org/t/catalyst-old-and-new-necessity-of-mpi/9005 "2022-02-17T20:53:29Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![eudoxos](https://discourse.paraview.org/user_avatar/discourse.paraview.org/eudoxos/32/7738_2.png) [@eudoxos](https://discourse.paraview.org/u/eudoxos)
#### Post date: [February 17, 2022, 8:53pm UTC](https://discourse.paraview.org/t/catalyst-old-and-new-necessity-of-mpi/9005/1 "2022-02-17T20:53:29Z")

</div>

I would like to implement Catalyst support for simulation software which already can export visualization data to VTK files and would like to get oriented in the topic.

1. As I understand, passing VTK structures is now (since Paraview 3.9) considered legacy approach; is it going to be supported alongside conduit-based communication in the future? It would be much easier for me to get started just passing VTK meshes I already produce, instead of having to learn the new nomenclature and do additional data conversions. What pathway would you recommend?

2. The code is OpenMP-parallelized, not using MPI. Is it mandatory to use MPI for Catalyst? Would it be enough just to initialize the MPI runtime without actually using it?

3. I am running on Ubuntu 22.04 (pre-release) currently; for Catalyst (old-style, at least), I will need the paraview-dev package, which pulls in python3-paraview, which conflicts with python3-vtk9, thus indirectly conflicting with libvtk9-dev. Is there some way to ask CMake to look for VTK in Paraview directory?

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [February 18, 2022, 8:39am UTC](https://discourse.paraview.org/t/catalyst-old-and-new-necessity-of-mpi/9005/2 "2022-02-18T08:39:35Z")

</div>

Hello,

1. For now both version of Catalyst are usable with ParaView but the newest is not intended so support VTK meshes directly. Note that a `vtkDataObjectToConduit` exists (inside ParaView but may be ported to VTK in a near future) to help such conversion.

2. MPI is not mandatory for Catalyst

3. For a CMake project using VTK, you can specify the `vtk_DIR` at config time to point the VTK from ParaView (e.x. `<pv-install>/lib/cmake/paraview-<version>/vtk`)

---

<div class="post-metadata">

### Author: ![eudoxos](https://discourse.paraview.org/user_avatar/discourse.paraview.org/eudoxos/32/7738_2.png) [@eudoxos](https://discourse.paraview.org/u/eudoxos)
#### Post date: [February 20, 2022, 11:16am UTC](https://discourse.paraview.org/t/catalyst-old-and-new-necessity-of-mpi/9005/3 "2022-02-20T11:16:45Z")

</div>

Thank you for the reply, that got me oriented. The `vtkDataObjectToConduit` source is a good inspiration, surprisingly simple; I might switch to generating just the arrays in my code and then build either vtk arrays or conduit objects from them, as needed (exporting to file or sending to Catalyst). I also understand now the pain of linking against ParaView when using old-style Catalyst and will go the way of using the new-style Catalyst.

One more clarification to get me started. I do `add_subdirectory` on `https://gitlab.kitware.com/paraview/catalyst.git` and link my code against `catalyst::catalyst`. Then in my code I can roughly follow [catalyst\_example\_about.cxx](https://gitlab.kitware.com/paraview/catalyst/-/blob/master/examples/about/catalyst_example_about.cxx), As I understand, the basic use (simpler than the `catalyst_example_about.cxx` - I can run simulation, but if I choose so, I can run with piping data to ParaView) would be (please let me know whether I am following the logic correctly):

1. call `catalyst_initialize(...)` with an empty node, without specifying any implementation or paths; that finds (with an appropriate `LD_LIBRARY_PATH`) the no-op implementation (`libcatalyst.so` from the catalyst.git repo, providing an implementation called `stub`).
2. If I want to use visualize ParaView for a particular run, then I will specify `LD_LIBRARY_PATH=/opt/paraview/lib` so that `catalyst_initialize` finds `libcatalyst.so` in the paraview installation. That implementation is also called `stub`.

How can the code recognize whether it is talking to a functional API or the no-op implementation (both called `stub`)? And then, is there an equivalent of `RequestDataDescription` of the legacy Catalyst API, querying whether the Catalyst pipeline is ready for new data?

Thanks!

P.S. in [Catalyst for Simulation Developers](https://catalyst-in-situ.readthedocs.io/en/latest/for_simulation_developers.html), the `find_package(catalyst VERSION 2.0 REQUIRED)` should be `find_package(catalyst 2.0 REQUIRED)`.

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [February 21, 2022, 9:02am UTC](https://discourse.paraview.org/t/catalyst-old-and-new-necessity-of-mpi/9005/4 "2022-02-21T09:02:08Z")

</div>

First not that the [doc](https://catalyst-in-situ.readthedocs.io/en/latest/for_simulation_developers.html#catalyst-initialize) advise to use those environment variables instead of `LD_LIBRARY_PATH`:

- `CATALYST_IMPLEMENTATION_PATHS` to specify directories where to look
- `CATALYST_IMPLEMENTATION_NAME` to specify the impl name (like `stub` or `paraview`, not the full .so name)

If you want to use ParaView, you should use `CATALYST_IMPLEMENTATION_NAME=paraview` and not `stub`.

To check the used version, you should:

- create an empty node
- call `catalyst_about(node)`
- check for `catalyst_load/implementation` subnode. This will typically contains `stub` or `paraview`. The stub impl provides this nodes: [https://gitlab.kitware.com/paraview/catalyst/-/blob/master/src/catalyst/catalyst\_stub.cpp#L34](https://gitlab.kitware.com/paraview/catalyst/-/blob/master/src/catalyst/catalyst_stub.cpp#L34). And other implementation are encouraged to do the same.

Indeed, both `catalyst` and `paraview` repo can provide the `stub` implementation, but this is the same 🙂

And thanks for reporting the doc issue!

---

<div class="post-metadata">

### Author: ![eudoxos](https://discourse.paraview.org/user_avatar/discourse.paraview.org/eudoxos/32/7738_2.png) [@eudoxos](https://discourse.paraview.org/u/eudoxos)
#### Post date: [February 21, 2022, 7:25pm UTC](https://discourse.paraview.org/t/catalyst-old-and-new-necessity-of-mpi/9005/5 "2022-02-21T19:25:26Z")

</div>

Thanks for the reply, one more step further 🙂

`LD_LIBRARY_PATH` was just for libcatalyst.so (linked against, and not in default ld.so lookup paths); then using `CATALYST_IMPLEMENTATION_PATHS` and `CATALYST_IMPLEMENTATION_NAME` I can indeed connect to the “paraview” implementation. Good.

Now, please correct me if I am wrong: I need to set `catalyst/scripts/script*` in the node passed to `catalyst_initialize` to setup live connection to a listening Paraview instance, as detailed in [CatalystPythonScriptV2](https://gitlab.kitware.com/paraview/paraview/-/blob/release/Utilities/Doxygen/pages/CatalystPythonScriptV2.md). Is there some easier way to accomplish that for trivial cases? Or can I pass the python script as string (as opposed to filename) for short pieces I can embed in the c++ code?

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [February 22, 2022, 9:22am UTC](https://discourse.paraview.org/t/catalyst-old-and-new-necessity-of-mpi/9005/6 "2022-02-22T09:22:14Z")

</div>

Python code can only be passed as a filename, no direct code.

Note that you can setup writers directly from the conduit nodes, without python script. That is done in a `pipelines` node described in the [ParaView Blueprint documentation](https://kitware.github.io/paraview-docs/latest/cxx/ParaViewCatalystBlueprint.html)
