Unexpected plot shown by ParaView Catalyst on using Rectilinear Conduit blueprint

@Andy_Bauer @utkarsh.ayachit @mwestphal @Francois_Mazen @nicolas.vuaille @cory.quammen
I’m using Paraview Catalyst for In Situ visualization and I want to pass Rectilinear grid to it. However, a sample rectilinear grid that I created with Conduit (just to test and check the code) doesn’t seem to produce the intended result as far as the ParaView rendered plots are concerned. For this test, I ran the code on two processors and divided the domain into two blocks in the x direction. I ran into the unexpected surprises. The Conduit node generates right output when I tested it on Ascent. I’m attaching the rendered image and the relevant sections of the code.

/*   setup conduit for catalyst   */
  conduit_node* catalyst_exec_params = conduit_node_create();
  conduit_node_set_path_int64(catalyst_exec_params, "catalyst/state/timestep", cycle);
  conduit_node_set_path_float64(catalyst_exec_params, "catalyst/state/time", time);
  
  //create mesh
  conduit_node_set_path_char8_str(catalyst_exec_params, "catalyst/channels/grid/type", "mesh");
  conduit_node* mesh = conduit_node_create();
  
  // add coordsets
  conduit_node_set_path_char8_str(mesh, "coordsets/coords/type", "rectilinear");

// add topologies
  conduit_node_set_path_char8_str(mesh, "topologies/mesh/type", "rectilinear");
  conduit_node_set_path_char8_str(mesh, "topologies/mesh/coordset", "coords");

  // add density (cell-field)
  conduit_node_set_path_char8_str(mesh, "fields/density/association", "element");
  conduit_node_set_path_char8_str(mesh, "fields/density/topology", "mesh");
  conduit_node_set_path_char8_str(mesh, "fields/density/volume_dependent", "false");

// put in the data
if (prank==0){
    double zval[] = {0., 1.};
    double xval[] = {0.,0.25,0.5};
    double yval[] = {0.,0.5,1.};
    double vals[] = {0.,0.05,0.5,1.0};
    conduit_node_set_path_external_float64_ptr(mesh, "coordsets/coords/values/x", xval, 3);
    conduit_node_set_path_external_float64_ptr(mesh, "coordsets/coords/values/y", yval, 3);
    conduit_node_set_path_external_float64_ptr(mesh, "coordsets/coords/values/z", zval, 2);
    conduit_node_set_path_external_float64_ptr(mesh, "fields/density/values", vals, 4);
  }
  else{
    double zval[] = {0., 1.};
    double xval[] = {0.5,0.75,1.0};
    double yval[] = {0.,0.5,1.};
    double vals[] = {0.1,0.2,2.,3.};
    conduit_node_set_path_external_float64_ptr(mesh, "coordsets/coords/values/x", xval, 3);
    conduit_node_set_path_external_float64_ptr(mesh, "coordsets/coords/values/y", yval, 3);
    conduit_node_set_path_external_float64_ptr(mesh, "coordsets/coords/values/z", zval, 2);
    conduit_node_set_path_external_float64_ptr(mesh, "fields/density/values", vals, 4);
  }
  
  // add the mesh info (conduit mesh) to catalyst_exec_params
  conduit_node_set_path_external_node(catalyst_exec_params, "catalyst/channels/grid/data", mesh);

One more thing I observed is that although my data is 2D, I had to pass a dummy z data to Catalyst through Conduit otherwise the code crashes with the following error.

vtkConduitArrayUtilities invalid node of type 'empty'

This only happens for rectilinear mesh blueprint. Omitting the z-direction in uniform mesh blueprint however is fine and the code works without any issue.

I used the debugging and info to get the following. This most likely seems to be something weird going on when Conduit rectilinear mesh blueprint is processed by ParaView Catalyst to generate the rendered images.

// print for debugging purposes, if needed
conduit_node_print(catalyst_exec_params);

// print information with details about memory allocation
conduit_node* info = conduit_node_create();
conduit_node_info(catalyst_exec_params, info);
conduit_node_print(info);
conduit_node_destroy(info);

Proc 0:

catalyst: 
  state: 
    timestep: 0
    time: 0.0
  channels: 
    grid: 
      type: "mesh"
      data: 
        coordsets: 
          coords: 
            type: "rectilinear"
            values: 
              x: [0.0, 0.25, 0.5]
              y: [0.0, 1.0, 1.5]
              z: [0.0, 0.0]
        topologies: 
          mesh: 
            type: "rectilinear"
            coordset: "coords"
        fields: 
          density: 
            association: "element"
            topology: "mesh"
            volume_dependent: "false"
            values: [0.0, 0.05, 0.5, 1.0]


mem_spaces: 
  0x55c6974884e0: 
    path: "catalyst/state/timestep"
    type: "allocated"
    bytes: 8
    allocator_id: 0
  0x55c697525e80: 
    path: "catalyst/state/time"
    type: "allocated"
    bytes: 8
    allocator_id: 0
  0x55c697541ef0: 
    path: "catalyst/channels/grid/type"
    type: "allocated"
    bytes: 5
    allocator_id: 0
  0x55c697488a00: 
    path: "catalyst/channels/grid/data/coordsets/coords/type"
    type: "external"
  ... ( skipped 6 children )
  0x55c6974a2c70: 
    path: "catalyst/channels/grid/data/fields/density/topology"
    type: "external"
  0x55c6974a2dd0: 
    path: "catalyst/channels/grid/data/fields/density/volume_dependent"
    type: "external"
  0x7ffc5118ba30: 
    path: "catalyst/channels/grid/data/fields/density/values"
    type: "external"
total_bytes_allocated: 21
total_bytes_mmaped: 0
total_bytes_compact: 167
total_strided_bytes: 167

Proc 1:

catalyst: 
  state: 
    timestep: 0
    time: 0.0
  channels: 
    grid: 
      type: "mesh"
      data: 
        coordsets: 
          coords: 
            type: "rectilinear"
            values: 
              x: [0.5, 0.75, 1.0]
              y: [0.0, 1.0, 1.5]
              z: [0.0, 0.0]
        topologies: 
          mesh: 
            type: "rectilinear"
            coordset: "coords"
        fields: 
          density: 
            association: "element"
            topology: "mesh"
            volume_dependent: "false"
            values: [0.1, 0.2, 2.0, 3.0]


mem_spaces: 
  0x555980ac0c40: 
    path: "catalyst/state/timestep"
    type: "allocated"
    bytes: 8
    allocator_id: 0
  0x555980ad9db0: 
    path: "catalyst/state/time"
    type: "allocated"
    bytes: 8
    allocator_id: 0
  0x555980ad9d70: 
    path: "catalyst/channels/grid/type"
    type: "allocated"
    bytes: 5
    allocator_id: 0
  0x555980ad9cb0: 
    path: "catalyst/channels/grid/data/coordsets/coords/type"
    type: "external"
  ... ( skipped 6 children )
  0x555980ac1a90: 
    path: "catalyst/channels/grid/data/fields/density/topology"
    type: "external"
  0x555980ac1ab0: 
    path: "catalyst/channels/grid/data/fields/density/volume_dependent"
    type: "external"
  0x7fff567bec20: 
    path: "catalyst/channels/grid/data/fields/density/values"
    type: "external"
total_bytes_allocated: 21
total_bytes_mmaped: 0
total_bytes_compact: 167
total_strided_bytes: 167

After further testing, I found out that the Catalyst generated rendering is independent of whatever y values I pass to using Conduit rectilinear mesh blueprint. This happens only when multiple processors are involved. The way Catalyst is functioning is that it is treating the y direction to be same as the x direction irrespective of what y values are passed.

your analysis is correct. Here is the source code with the typographic errors:
https://gitlab.kitware.com/vtk/vtk/-/blob/2726f5f712c22c3ae4018a7e2fdeda5b1a745c46/IO/CatalystConduit/vtkConduitSource.cxx#L270-271

1 Like

Good catch! I’ve just write a simple test to reproduce the issue: https://gitlab.kitware.com/francois.mazen/vtk/-/commit/2135ab4963a80140a66d6475093e3330f2e8e473

I’ll open a VTK issue and push a fix.

I have submitted an issue already:
Issue with Rectilinear grid Conduit blueprint processing by Catalyst (#18580) · Issues · VTK / VTK · GitLab (kitware.com)

François fixed it here: https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9301

1 Like

@cory.quammen Are we going to see this update in the next release of paraview pre-compiled binaries? Because for now I think I need to recompile Paraview myself on my system, ain’t I?

Yes, it should be included.

1 Like