Generated catalyst script not working

I’m using ParaView 5.6.0 on MacOSX and I installed Catalyst 5.6.0 from source on a Linux machine using Spack (spack install catalyst+essentials+python3+rendering).

I have a C++ sample program that outputs a single 3d array of integers using vtkMultiPieceDataSet (for now with one piece, since I’m testing). I successfully used the Catalyst python script given in the Catalyst documentation to have my program generate an output for all the fields exposed by the program, I opened these files in ParaView on my Mac and did a simple “contour” plot of it 59|690x431. I defined the RenderView1 as Catalyst export and generated the script so that the same images would be generated directly from my program.

I’m attaching the script here: render.py (12.1 KB)

Back on the Linux workstation, when I use this script, I get Python errors:

Traceback (most recent call last):
  File "/home/mdorier/spack/opt/spack/linux-gentoo2-aarch64/gcc-9.2.0/catalyst-5.6.0-ohy6ocyp2bcutaghnvte3ckyma334jd5/lib/python3.7/site-packages/paraview/servermanager.py", line 446, in __setattr__
    setter = getattr(self.__class__, name)
AttributeError: type object 'GeometryRepresentation' has no attribute 'GaussianRadius'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mdorier/spack/opt/spack/linux-gentoo2-aarch64/gcc-9.2.0/catalyst-5.6.0-ohy6ocyp2bcutaghnvte3ckyma334jd5/lib/python3.7/site-packages/paraview/servermanager.py", line 452, in __setattr__
    _bc.setattr(self, name, value)
  File "/home/mdorier/spack/opt/spack/linux-gentoo2-aarch64/gcc-9.2.0/catalyst-5.6.0-ohy6ocyp2bcutaghnvte3ckyma334jd5/lib/python3.7/site-packages/paraview/_backwardscompatibilityhelper.py", line 261, in setattr
    raise AttributeError()
AttributeError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "render.py", line 271, in DoCoProcessing
    
  File "/home/mdorier/spack/opt/spack/linux-gentoo2-aarch64/gcc-9.2.0/catalyst-5.6.0-ohy6ocyp2bcutaghnvte3ckyma334jd5/lib/python3.7/site-packages/paraview/coprocessing.py", line 212, in UpdateProducers
    self.CreatePipeline(datadescription)
  File "render.py", line 222, in CreatePipeline
    
  File "render.py", line 34, in _CreatePipeline
    # state file generated using paraview version 5.6.0
  File "render.py", line 164, in Pipeline
    contour1Display.SetScaleArray = ['POINTS', 'Normals']
  File "/home/mdorier/spack/opt/spack/linux-gentoo2-aarch64/gcc-9.2.0/catalyst-5.6.0-ohy6ocyp2bcutaghnvte3ckyma334jd5/lib/python3.7/site-packages/paraview/servermanager.py", line 459, in __setattr__
    "to add this attribute.")
AttributeError: Attribute GaussianRadius does not exist.  This class does not allow addition of new attributes to avoid mistakes due to typos. Use add_attribute() if you really want to add this attribute.

If I comment the lines in question, I still have other lines that pose problems.

Am I missing something?

Thanks,

Matthieu

Short answer : your Catalyst version seems to miss some needed objects. I recommend to use a full pvserver instead.

Long answer:
“Catalyst” word is used for 2 things:

  • the feature of using ParaView capabilities in-situ with simulation code
  • the binaries, that are reduced version of ParaView containing only subset of ParaView features.

Several versions of Catalyst binaries exist and are called “Catalyst Editions”. They were created for performance optimizations (memory size, libs to load …) Note that you don’t need to use a Catalyst binaries to use Catalyst feature.

Using the Catalyst binaries can be complex: you have to know exactly which feature is needed in your case and which version of Catalyst contains them. There is no ‘easy’ way to find the correct Catalyst Editions.

Also note that starting with ParaView 5.7 the format of Catalyst Editions will change, due to ParaView (and VTK) internal refactoring : Catalyst Edition status in 5.7 and 5.8

I tried installing Catalyst with the +extras +essentials +python3 +rendering variants (before I didn’t have +extra) and this time I get the following error when trying to run the script:

ERROR: In /tmp/mdorier/spack-stage/catalyst-5.6.0-qgniuiucswls2x6amumen6qvdntdtn77/spack-src/Catalyst-v5.6.0/ParaViewCore/ServerImplementation/Core/vtkSIProxy.cxx, line 370
vtkSISourceProxy (0x55b36f42e0): Failed to create 'vtkPVExtractSelection'. This typically means that ParaView does not know about the request class to create an instance of if. Ensure that it has been correctly wrapped using the client-server wrappers and the wrapping has been initialized. Note class names are case-sensitive. Check for typos. Aborting for debugging purposes.

Note that when asking for the +extras variant, the installation process shows some patching errors:

Processing  /tmp/mdorier/spack-stage/catalyst-5.6.0-qgniuiucswls2x6amumen6qvdntdtn77/spack-src/Catalyst/Editions/Essentials
Processing  /tmp/mdorier/spack-stage/catalyst-5.6.0-qgniuiucswls2x6amumen6qvdntdtn77/spack-src/Catalyst/Editions/Extras
patching file ParaViewCore/ClientServerCore/Core/CMakeLists.txt
Reversed (or previously applied) patch detected!  Assume -R? [n] y
Hunk #1 succeeded at 106 with fuzz 1.
patching file ParaViewCore/ClientServerCore/Core/CMakeLists.txt
Reversed (or previously applied) patch detected!  Assume -R? [n] y
patching file ParaViewCore/ClientServerCore/Core/module.cmake
Reversed (or previously applied) patch detected!  Assume -R? [n] y
Hunk #1 succeeded at 19 with fuzz 2 (offset 1 line).

If I say no when asked to assume -R, spack fails to install (patching fails). If I say yes, spack proceeds, but I think that this happens because the catalyze.py script applies the same patches twice and saying yes reverses the patches the second time they are applied.

I will try to manually build Catalyst, instead of using spack, to see if that changes anything. In the mean time, if you have any suggestions…

Update on my earlier post: I did a quick and dirty patch to the catalyze.py file to fix the double-patching problem I reported earlier, which allowed me to install with the +extras variant in spack. So right now my build of Catalyst includes all the editions, yet my rendering script still fails, with exactly the same error as in my first post.

@nicolas.vuaille by “I recommend to use a full pvserver instead” you mean compiling ParaView from source?

Yes, I mean using a built ParaView. I’m not familiar with spack, maybe it can do it for you ? Note that you can disable the Qt part, as you don’t need the GUI.

Concerning the patches: It is not the same patch applied many times but several patches modifying the same file. Each variant of Catalyst Edition brings its own patches. In basic edition, vtkPVExtractSelection is disable, so a patch removes it from CMakeLists. When you add +extras , a second patch is applied to re-enable it.

I know, it looks complicated, but it will change soon. And that’s why I recommend to use ParaView with good cmake options (typically disable Qt, and maybe some others) instead of Catalyst Edition until you really need it.

Thanks, I’ll try with ParaView then.
I’m curious though what is are the Catalyst editions for, if ParaView has to be built anyway?

Catalyst Edition are an advanced mode to use Catalyst, for performances purpose.
Each feature of a Catalyst Edition is available through ParaView. You never prefer a Catalyst Edition over ParaView for its feature but only for performances.

No, it does not have to. Catalyst Editions are replacement for ParaView. However, when you are learning/testing/configuring Catalyst features, I recommend to use a ParaView as it is more flexible (full-featured) and easier to use.

Details:
Catalyst Editions are subsets of ParaView in term of source code. The generation of a Catalyst Edition is done through a script that copy paste some specific files (classes, CMakeLists … ) of ParaView to recreate another c++ project, smaller than ParaView. Some patches are also applied to remove unwanted dependencies. The resulting binaries are more optimized than the ParaView binaries (in term of size and number of linked libraries).