Check if pipeline update is required in Catalyst V2

We are trying to port our Catalyst adaptor from V1 to V2. In V1 we were able to check if a pipeline update is required via something like:

    dataDescription->SetTimeData(currentTimeDimensional, timeStep);

    bool updateRequired = processor->RequestDataDescription(dataDescription) != 0;

This is rather important to us since we prepare data to pass to Catalyst. This operation is expensive and should not be done unless really needed.

We can’t find anything equivalent in the new V2 API. Does it not yet exist or did we miss it somewhere?

@nicolas.vuaille @Francois_Mazen

Hello @cmorsbach

Indeed, this feature is not available in Catalyst 2, you must always call the C method catalyst_execute and the control is delegated to the python script:

  • the trigger parameters of the extractors and the catalyst option object change the frequency of the write to the disk.
  • You can always fine tune the execution of your pipeline with the python methods def catalyst_execute:.

In addition, using conduit node set_external method for zero copy makes the data wrapping process quite small, so the previous overhead of creating VTK structures should be removed.

Do not hesitate to ask for more help.

Best,

Thanks for the quick reply, @Francois_Mazen!

I agree, that it would be very desirable to pass everything with zero copy. However, for us this would require a complete support of VtkLagrangeHexahedron elements. I couldn’t find those in Mesh Blueprint — Conduit 0.8.4 documentation.

So, for now, we have to rely on rather expensive interpolation operations from our high order hexahedral grid onto a finer standard hexahedral grid. And this we can’t afford to do every time step.

Are there plans to extend the API in this direction or would this be a feature against the philosophy behind it?

P.S. Thanks for all the great work on Paraview and Catalyst in the recent years! We’ve been using it quite intensively.

Indeed, Catalyst 2 dataset features are limited by conduit capabilities and advanced cell types are not yet supported. Conduit project is very active and open to contribution, so you may request such addition at their github repo, or push it yourself if you have developer skills and time.

Hi @cmorsbach ,

Please note also that catalyst scripts handled a GlobalTrigger in the Options object, that behave like the Trigger from the extractors.
The method “catalyst_execute” is not called if the trigger is not respected.

This can be timestep based:

# ------------------------------------------------------------------------------
# Catalyst options
from paraview import catalyst
options = catalyst.Options()
options.GlobalTrigger = 'TimeStep'

# init the 'TimeStep' selected for 'GlobalTrigger'
options.GlobalTrigger.UseStartTimeStep = 1
options.GlobalTrigger.StartTimeStep = 1
options.GlobalTrigger.UseEndTimeStep = 1
options.GlobalTrigger.EndTimeStep = 5
options.GlobalTrigger.Frequency = 2

Or custom python code:

# Catalyst options
from paraview import catalyst
options = catalyst.Options()

# init the 'Python' selected for 'GlobalTrigger'
options.GlobalTrigger = 'Python'
options.GlobalTrigger.Script = """\
def is_activated(controller):
    from os.path import basename
    from paraview import print_info
    from paraview.catalyst import get_script_filename
    timestep = controller.GetTimeStep()
    time = controller.GetTime()
    if timestep < 2:
        # start from timestep 2
        return False
    if (timestep - 2) % 7 != 0:
        # frequency 7
        return False
    print_info("'%s' activated for timestep %d." % (basename(get_script_filename()), timestep))
    return True
"""