Error building with Catalyst support

All questions about installation
Forum rules
Please read the forum usage recommendations before posting.
Antech
Posts: 197
Joined: Wed Jun 10, 2015 10:02 am

Re: Error building with Catalyst support

Post by Antech »

Hello, Ivan. Thanks for your hint, it worked! I will post details later, I had hard times struggling with ParaView (and, finally, versions before 5.8 won't compile in Kubuntu-20.04 despite of many tweaks). Now Saturne-6.3.0 works with ParaView-5.8.1, but it writes "Catalyst_<N>.csv" file for every iteration in RESU/run directory, so run directory becomes flooded by these files. Is there any way to solve this issue?
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error building with Catalyst support

Post by Yvan Fournier »

Hello,

Depending on the type of output/extract you choose with ParaView (5.9 changes this again, though it is moving in a consistent and good direction), you can get csv or vtk data, or png or jpeg images for example.

I have never tried with csv, but I know with VTK, I get one file per processor. I am not fond of that, but do not know how to change it (it would probably require 2 MPI communicators in ParaView, and move data from one to the other with filters such as D3 or some more modern equivalent of the output writers do not write to single-file by themselves). It would be interesting to use some "rank merging" (such as code_saturne's "ranks step" option for MPI-IO to divide the number of files by a constant (small) factor, but that would add complexity on the code_saturne side.

With images, you do not have this issue. So the main aspect here is to choose only the type of output you need.

A nice way of working around this for data files would be to do "in transit" instead of "in situ" output, but this would add other dependencies and output structures (such as maybe ADIOS). Actually, ParaView is moving towards a Catalyst 2 based on Conduit, which might allow for additional in-situ possibilities, so I hope to start to look into that later in 2021 (after the v7 release in May).

Best regards,

Yvan
Antech
Posts: 197
Joined: Wed Jun 10, 2015 10:02 am

Re: Error building with Catalyst support

Post by Antech »

Hello, great thanks for your support. I solved "many files" issue by setting just "Catalyst" file name in ParaView Export Inspector, Advanced writer (filter) options is opened with [...] button. By default, this file name includes iteration number.

Small report about how I set up Catalyst for those who needs it.

1. ParaView Catalyst builds and interaction with Code Saturne.
It seems that only PV versions 5.8 and 5.9-RC are suitable for current Kubuntu-20 (january 2020).
With very old versions, like 5.2, that worked with Saturne 5.x branch, modern Saturne (6.x branch) cannot find lots of VTK functions etc, so it's incompatible.
PV 5.6...5.7 have OS compatibility problem in Catalyst configuration. PV 5.6 make showed some "Error 2" and I didn't even find particular error in lots of its (parallel compile) output (parallel compile output is not synced). PV 5.7 cannot decide what to do with Python versions. Although I set explicitly all Python versions/paths in CCMake and disable all 4 parameters connected with mpi4py module (checked searching CMakeCache with editor), it starts compiling mpi4py (even with clear build dir) and fails because it's not compatible with some mpi4py-related function (wrong number of arguments). May be some tweak required or environment variable or it's just a bug in PV configure. So I decided to drop these tries cause I don't see the reason to have all these old Catalystic ParaView's.
PV 5.8.1 and 5.9-RC3 compile in Catalyst mode. It may require some tricks, I cannot guarantee that I haven't forgot something. Major things for Kubuntu-20 are:
1. In CCMake, enable Catalyst mode. Don't forget to press "T" to see all params. Check for parameters that was required for older versions like 5.2, set them if found. Set specific VTK parameters needed for modern Saturne (see code section below). Configure, generate and start make. Then pray for it to complete successfuly :) If you are not a guru, it may be quite tricky to compile "catalystic" ParaView version. Here are some parameters I collected in text file to remember if needed:

Code: Select all

CMAKE_INSTALL_PREFIX                        /Programs/ParaView-5.8.1/install-catalyst
PARAVIEW_BUILD_EDITION                      CATALYST
PARAVIEW_INSTALL_DEVELOPMENT_F              ON
PARAVIEW_USE_PYTHON                         ON
PARAVIEW_USE_MPI                            ON
MPIEXEC_EXECUTABLE                          /Programs/openmpi-1.8.4/build/bin/mpiexec
MPIEXEC_MAX_NUMPROCS                        16 (Number of cores)
MPIEXEC_NUMPROC_FLAG                        -np
VTK_MPI_NUMPROCS                            16
VTK_MODULE_ENABLE_ParaView_Catalyst         YES
VTK_MODULE_ENABLE_ParaView_PythonCatalyst   YES
VTK_MODULE_ENABLE_VTK_RenderingContext2D    YES
VTK_MODULE_ENABLE_VTK_ChartsCore            YES
I attach CMakeCache.txt for PV 5.8.1 version (checked with Saturne 6.3.0). Paths like /Programs/... must be adjusted to actual paths where you build/install catalystic ParaView build. The same for Python and MPI paths. Set appropriate max number of MPI threads (to your number of cores or threads if you use multi-threading).
2. If there are different Python versions in system (that is very likely due to older programs support) set /usr/bin/python and /usr/bin/python-config to point to python3/python3-config in the same directory (I recommend to save old symlinks with "old" extension). Use Ctrl+F in Double Commander (root privileges) to easily find these files (there are lots of stuff in /usr/bin).
3. Add /usr/lib/x86_64-linux-gnu/libpython3.8.so (up-to-date Python library) to your LD_PRELOAD variable. If it's set from Saturne start script, use syntax like:

Code: Select all

export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libpython3.8.so
If you will not do it, Saturne may have "PyExc_ValueError" issue despite of python pointer set to python3. Quick googling didn't reveal how to do the same for Python library (*.so), there is no libpython.so or like pointer in /usr/lib/x86_64-linux-gnu/ so I just LD_PRELOAD actual library version. Similar trick was needed in Kubuntu-14 for Saturne 5.x branch and Python-2.7.

I noticed seldom random crashes of Saturne 5.x with Kubuntu-14 with OpenMPI version 3, while the most reliable version is 1.8.4. I'm not sure that it's important for modern Kubuntu/Saturne

Warning: Errors in ParaView crash the calculation. It was not so with older versions. Be careful!

2. Catalyst Python scripts.
Catalyst stuff is completely different in ParaView 5.8 compared with older versions (4.3, 5.2). It creates issues but may be solved. Here is how I made it to work:
1. Open your sample dataset as usual, but rename it's root tree item to Catalyst!
2. Create, for example, Slice, as usual.
3. Select Catalyst in treeview. Open View - Export Inspector, ensure that Catalyst is selected in list at the left under Data Extracts, check corresponding box to export this writer.
4. Select XMLMultiBlockDataWriter as writer type. CSV should also work, I didn't check thoroughly for now.
5. Press [...] button to open Advanced options dialog, ensure that Cell data is selected in File association and set File Pattern at the bottom to Catalyst.vtm if you don't want to retain Catalyst output file from every iteration. Other options may have to be adjusted. Press OK.
6. Export script via Catalyst => Export Catalyst Script in main menu. Name it "Catalyst.py", don't forget to name your Catalyst writer in Saturne case "Catalyst". Keep only one script in DATA directory for Saturne not to confuse what script to use, rename old ones to *.old.
7. Check that Saturne case is OK (Catalyst writer is present in output dialogs and is named "Catalyst", output is set to every N iterations and at the start of calculation, Catalyst writer is added for Fluid domain).
8. Open ParaView, Connect to Catalyst and run Saturne as usual. Catalyst output should appear at first iteration. Don't mark TrivialProducer in Catalyst tree (it crashed PV and Saturne when I tried), select, for example, Slice, as usual. If something go wrong, see "error" file in run directory (if it's empty, use single-thread run to debug as usual). If there are specific Catalyst issues, Catalyst log file appear in run directory.
Attachments
CMakeCache.txt
CMakeCache.txt for ParaView 5.8.1
(198.27 KiB) Downloaded 156 times
Antech
Posts: 197
Joined: Wed Jun 10, 2015 10:02 am

Re: Error building with Catalyst support

Post by Antech »

A small update. I tried ParaView-5.9-RC that is newest PV available (release candidat). It compiles good in Catalyst mode with the same CMakeCache.txt file with fixed paths and other minor changes (see attach if needed). They really changed Catalyst export interface in 5.9 relative to 5.8. No problems with interface itself, but it cannot produce Catalyst script. Version 5.9-RC1 creates an archive with 2 Python files that will rarely be accepted by Saturne because it takes one file. Version 5.9-RC3 cannot create Catalyst script at all (with different settings), it just says that there was an error, without detailed messages in it's console. So it seems that ParaView-5.8.1 is optimal now for Catalyst.
Attachments
CMakeCache.txt
CMakeCache for ParaView-5.9-RC3 (please don't forget to set correct paths for all depends and number of cores for MPI)
(157.21 KiB) Downloaded 166 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error building with Catalyst support

Post by Yvan Fournier »

Hello,

In theory, the latest code_saturne releases should handle the .zip files produced by PV 5.9-RC1 (not tested), and the new Python scripts produced by PV 5.9-RC2 (or a git version close to that, which I tested on a simple case). The changes are massive, but seem to be in an interesting direction.

I have not tested yet with RC3, but if if crashes outputting the script, it may be good to report this to the ParaView developers.

Best regards,

Yvan
Post Reply